source: branches/maven/projects/jar2lib/src/main/resources/jace/CMakeLists.txt @ 6806

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

Initial version of Jar2Lib implementation.

  • Property svn:eol-style set to native
Line 
1#
2# CMakeLists.txt
3#
4
5# CMake build file for Jace C++ code.
6
7cmake_minimum_required(VERSION 2.8)
8
9project(jace)
10
11include(Prerequisites.cmake)
12
13### build Jace C++ library ###
14
15#message(STATUS "-- Jace:")
16#set(JACE_DIR NOTFOUND CACHE PATH
17#  "The path to toplevel directory of your Jace checkout")
18#if(IS_DIRECTORY "${JACE_DIR}")
19#  message(STATUS "jace root     : ${JACE_DIR}")
20#else(IS_DIRECTORY "${JACE_DIR}")
21#  message(FATAL_ERROR "Cannot build without Jace. Please set JACE_DIR.")
22#endif(IS_DIRECTORY "${JACE_DIR}")
23
24include_directories("${JACE_CPP_DIR}/include"
25  "${JAVA_INCLUDE_PATH}" "${JAVA_INCLUDE_PATH2}"
26  "${Boost_INCLUDE_DIR}")
27
28file(GLOB_RECURSE JACE_SRC "${JACE_CPP_DIR}/source/*.cpp")
29#message("jace source   : ${JACE_SRC}")
30message(STATUS "")
31
32add_library(jace SHARED ${JACE_SRC})
33
34# NB: Mac OS X 10.4 and earlier requires .jnilib extension rather than
35#     .dylib when loading native code with System.loadLibrary(String).
36if(APPLE)
37  set_target_properties(jace PROPERTIES SUFFIX ".jnilib")
38endif(APPLE)
39
40# HACK - Make linking to Boost work on Windows systems.
41if(WIN32)
42  target_link_libraries(jace "${JAVA_JVM_LIBRARY}")
43else(WIN32)
44  target_link_libraries(jace
45    "${JAVA_JVM_LIBRARY}" ${Boost_THREAD_LIBRARY_DEBUG})
46endif(WIN32)
47
48if(CMAKE_COMPILER_IS_GNUCXX)
49  set_target_properties(jace PROPERTIES COMPILE_FLAGS "-fpermissive")
50else(CMAKE_COMPILER_IS_GNUCXX)
51  set_target_properties(jace PROPERTIES DEFINE_SYMBOL JACE_EXPORTS)
52endif(CMAKE_COMPILER_IS_GNUCXX)
Note: See TracBrowser for help on using the repository browser.