gvsig-raster / org.gvsig.raster.ermapper / tags / org.gvsig.raster.ermapper-2.2.74 / org.gvsig.raster.ermapper.jni / CMakeLists.txt @ 22649
History | View | Annotate | Download (1.68 KB)
1 | 2449 | nbrodin | project(jecw) |
---|---|---|---|
2 | |||
3 | set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE) |
||
4 | |||
5 | IF(WIN32) |
||
6 | CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR) |
||
7 | ELSE(WIN32) |
||
8 | IF(APPLE) |
||
9 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) |
||
10 | ELSE(APPLE) |
||
11 | CMAKE_MINIMUM_REQUIRED(VERSION 2.4.4 FATAL_ERROR) |
||
12 | ENDIF(APPLE) |
||
13 | ENDIF(WIN32) |
||
14 | |||
15 | if(COMMAND cmake_policy) |
||
16 | # Works around warnings libraries linked against that don't |
||
17 | # have absolute paths (e.g. -lpthreads) |
||
18 | cmake_policy(SET CMP0003 NEW) |
||
19 | |||
20 | # Works around warnings about escaped quotes in ADD_DEFINITIONS |
||
21 | # statements. |
||
22 | cmake_policy(SET CMP0005 NEW) |
||
23 | |||
24 | # cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names |
||
25 | # quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below." |
||
26 | if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0) |
||
27 | cmake_policy(SET CMP0008 OLD) |
||
28 | endif() |
||
29 | endif() |
||
30 | |||
31 | SET(JECW_VERSION_MAJOR "2") |
||
32 | SET(JECW_VERSION_MINOR "0") |
||
33 | SET(JECW_VERSION_PATCH "0") |
||
34 | |||
35 | SET(VERSION "${JECW_VERSION_MAJOR}.${JECW_VERSION_MINOR}.${JECW_VERSION_PATCH}") |
||
36 | |||
37 | SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}") |
||
38 | |||
39 | IF(UNIX OR APPLE) |
||
40 | SET(CMAKE_C_FLAGS "-DLINUX -DPOSIX") |
||
41 | ENDIF() |
||
42 | |||
43 | FIND_PACKAGE(DepMan REQUIRED) |
||
44 | INCLUDE(GeneralMacros) |
||
45 | |||
46 | CONFIGURE_DEFAULTS() |
||
47 | |||
48 | IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
||
49 | SET(CMAKE_INSTALL_PREFIX |
||
50 | ${DEPMAN_PATH} CACHE PATH "depman path install prefix" FORCE |
||
51 | ) |
||
52 | ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
||
53 | |||
54 | FIND_PACKAGE(JNI REQUIRED) |
||
55 | FIND_PACKAGE(ECW REQUIRED) |
||
56 | |||
57 | ADD_SUBDIRECTORY(src/main/native) |
||
58 | |||
59 | CONFIGURE_END() |