source: branches/maven/projects/jar2lib/src/main/resources/jace/Prerequisites.cmake @ 6806

Revision 6806, 3.3 KB checked in by curtis, 9 years ago (diff)

Initial version of Jar2Lib implementation.

  • Property svn:eol-style set to native
RevLine 
[5692]1#
[6806]2# Prerequisites.cmake
[5692]3#
4
5# CMake build file for cross-platform location of prerequisite libraries,
6# including Boost Thread and Java's jni.h.
7
8### search for prerequisite libraries ###
9
10message(STATUS "")
11
12#message("-- Java Runtime:")
13#find_package(Java REQUIRED)
14#message("java          : ${JAVA_RUNTIME}")
15#message("javac         : ${JAVA_COMPILE}")
16#message("jar           : ${JAVA_ARCHIVE}")
17#message("")
18
19message(STATUS "-- Java Native Interface:")
20find_package(JNI REQUIRED)
21message(STATUS "jawt lib      : ${JAVA_AWT_LIBRARY}")
22message(STATUS "jvm lib       : ${JAVA_JVM_LIBRARY}")
23message(STATUS "jni.h         : ${JAVA_INCLUDE_PATH}")
24message(STATUS "jni_md.h      : ${JAVA_INCLUDE_PATH2}")
25message(STATUS "jawt.h        : ${JAVA_AWT_INCLUDE_PATH}")
26message(STATUS "")
27
28# HACK - CMake on Windows refuses to find the thread library unless BOOST_ROOT
29#        is set, even though it can locate the Boost directory tree.
30#        So we first look for base Boost, then set BOOST_ROOT and look again
31#        for Boost Thread specifically.
32
33message(STATUS "-- Boost:")
[6738]34set(Boost_USE_STATIC_LIBS ON)
[5692]35set(Boost_USE_MULTITHREADED ON)
36set(Boost_ADDITIONAL_VERSIONS "1.37" "1.37.0" "1.37.1" "1.38" "1.38.0" "1.38.1"
37  "1.39" "1.39.0" "1.39.1" "1.40" "1.40.0" "1.40.1" "1.41" "1.41.0" "1.41.1"
[6739]38  "1.42" "1.42.0" "1.42.1" "1.43" "1.43.0" "1.43.1" "1.44" "1.44.0" "1.44.1"
39  "1.45" "1.45.0" "1.45.1" "1.46" "1.46.0" "1.46.1" "1.47" "1.47.0" "1.47.1"
40  "1.48" "1.48.0" "1.48.1" "1.49" "1.49.0" "1.49.1" "1.50" "1.50.0" "1.50.1")
[5692]41#set(Boost_FIND_QUIETLY ON)
42find_package(Boost)
43if(IS_DIRECTORY "${Boost_INCLUDE_DIR}")
44  message(STATUS "boost headers : ${Boost_INCLUDE_DIR}")
45else(IS_DIRECTORY "${Boost_INCLUDE_DIR}")
46  if(UNIX)
47    message(FATAL_ERROR "Cannot build without Boost Thread library. Please install libboost-thread-dev package or visit www.boost.org.")
48  else(UNIX)
49    message(FATAL_ERROR "Cannot build without Boost Thread library. Please install Boost from www.boost.org.")
50  endif(UNIX)
51endif(IS_DIRECTORY "${Boost_INCLUDE_DIR}")
52#set(Boost_FIND_QUIETLY OFF)
53if(WIN32)
54  set(BOOST_ROOT ${Boost_INCLUDE_DIR})
55endif(WIN32)
56find_package(Boost COMPONENTS thread REQUIRED)
57
58# HACK - Make linking to Boost work on Windows systems.
59string(REGEX REPLACE "/[^/]*$" ""
60  Boost_STRIPPED_LIB_DIR "${Boost_THREAD_LIBRARY_DEBUG}")
61
62if(EXISTS "${Boost_THREAD_LIBRARY_DEBUG}")
63  message(STATUS "boost lib dir : ${Boost_STRIPPED_LIB_DIR}")
64  message(STATUS "thread lib    : ${Boost_THREAD_LIBRARY_DEBUG}")
65else(EXISTS "${Boost_THREAD_LIBRARY_DEBUG}")
66  message(FATAL_ERROR "Cannot build without Boost Thread library. Please install libboost-thread-dev package or visit www.boost.org.")
67endif(EXISTS "${Boost_THREAD_LIBRARY_DEBUG}")
68message(STATUS "")
69
70# HACK - Make linking to Boost work on Windows systems.
71if(WIN32)
72  link_directories(${Boost_STRIPPED_LIB_DIR})
73endif(WIN32)
[6643]74
75message(STATUS "-- Jace:")
76set(JACE_DIR NOTFOUND CACHE PATH
77  "The path to toplevel directory of your Jace checkout")
78if(IS_DIRECTORY "${JACE_DIR}")
79  message(STATUS "jace root     : ${JACE_DIR}")
80else(IS_DIRECTORY "${JACE_DIR}")
81  message(FATAL_ERROR "Cannot build without Jace. Please set JACE_DIR.")
82endif(IS_DIRECTORY "${JACE_DIR}")
83
84set(JACE_CPP_DIR "${JACE_DIR}/source/c++")
85# For Jace r46 and later, use instead (& see build.properties):
86#set(JACE_CPP_DIR "${JACE_DIR}/core/cpp")
Note: See TracBrowser for help on using the repository browser.