source: trunk/projects/jar2lib/src/main/resources/project-files/jace/Prerequisites.cmake @ 7729

Revision 7729, 3.1 KB checked in by curtis, 8 years ago (diff)

Add Boost versions up to 1.60.

  • Property svn:eol-style set to native
Line 
1#
2# Prerequisites.cmake
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:")
34set(Boost_USE_STATIC_LIBS ON)
35set(Boost_USE_MULTITHREADED ON)
36set(Boost_ADDITIONAL_VERSIONS
37  "1.37" "1.37.0" "1.37.1" "1.38" "1.38.0" "1.38.1" "1.39" "1.39.0" "1.39.1"
38  "1.40" "1.40.0" "1.40.1" "1.41" "1.41.0" "1.41.1" "1.42" "1.42.0" "1.42.1"
39  "1.43" "1.43.0" "1.43.1" "1.44" "1.44.0" "1.44.1" "1.45" "1.45.0" "1.45.1"
40  "1.46" "1.46.0" "1.46.1" "1.47" "1.47.0" "1.47.1" "1.48" "1.48.0" "1.48.1"
41  "1.49" "1.49.0" "1.49.1" "1.50" "1.50.0" "1.50.1" "1.51" "1.51.0" "1.51.1"
42  "1.52" "1.52.0" "1.52.1" "1.53" "1.53.0" "1.53.1" "1.54" "1.54.0" "1.54.1"
43  "1.55" "1.55.0" "1.55.1" "1.56" "1.56.0" "1.56.1" "1.57" "1.57.0" "1.57.1"
44  "1.58" "1.58.0" "1.58.1" "1.59" "1.59.0" "1.59.1" "1.60" "1.60.0" "1.60.1")
45#set(Boost_FIND_QUIETLY ON)
46find_package(Boost)
47if(IS_DIRECTORY "${Boost_INCLUDE_DIR}")
48  message(STATUS "boost headers : ${Boost_INCLUDE_DIR}")
49else(IS_DIRECTORY "${Boost_INCLUDE_DIR}")
50  if(UNIX)
51    message(FATAL_ERROR "Cannot build without Boost Thread library. Please install libboost-thread-dev package or visit www.boost.org.")
52  else(UNIX)
53    message(FATAL_ERROR "Cannot build without Boost Thread library. Please install Boost from www.boost.org.")
54  endif(UNIX)
55endif(IS_DIRECTORY "${Boost_INCLUDE_DIR}")
56#set(Boost_FIND_QUIETLY OFF)
57if(WIN32)
58  set(BOOST_ROOT ${Boost_INCLUDE_DIR})
59endif(WIN32)
60find_package(Boost COMPONENTS thread REQUIRED)
61
62# HACK - Make linking to Boost work on Windows systems.
63string(REGEX REPLACE "/[^/]*$" ""
64  Boost_STRIPPED_LIB_DIR "${Boost_THREAD_LIBRARY_DEBUG}")
65
66if(EXISTS "${Boost_THREAD_LIBRARY_DEBUG}")
67  message(STATUS "boost lib dir : ${Boost_STRIPPED_LIB_DIR}")
68  message(STATUS "thread lib    : ${Boost_THREAD_LIBRARY_DEBUG}")
69else(EXISTS "${Boost_THREAD_LIBRARY_DEBUG}")
70  message(FATAL_ERROR "Cannot build without Boost Thread library. Please install libboost-thread-dev package or visit www.boost.org.")
71endif(EXISTS "${Boost_THREAD_LIBRARY_DEBUG}")
72message(STATUS "")
73
74# HACK - Make linking to Boost work on Windows systems.
75if(WIN32)
76  link_directories(${Boost_STRIPPED_LIB_DIR})
77endif(WIN32)
Note: See TracBrowser for help on using the repository browser.