|
@@ -1,10 +1,12 @@
|
1
|
1
|
cmake_minimum_required (VERSION 2.8.12)
|
2
|
2
|
|
|
3
|
+# Mac OSX RPATH is weird
|
|
4
|
+# enable @rpath in the install name for any shared library being built
|
|
5
|
+# note: it is planned that a future version of CMake will enable this by default
|
3
|
6
|
if(POLICY CMP0015)
|
4
|
7
|
cmake_policy(SET CMP0015 NEW)
|
5
|
8
|
endif()
|
6
|
|
-
|
7
|
|
-
|
|
9
|
+set(CMAKE_MACOSX_RPATH 1)
|
8
|
10
|
|
9
|
11
|
project (Lemma CXX)
|
10
|
12
|
|
|
@@ -24,6 +26,11 @@ endif(NOT HAVEGIT)
|
24
|
26
|
# endif(NOT HAVEHG)
|
25
|
27
|
|
26
|
28
|
option(BUILD_SHARED_LIBS OFF)
|
|
29
|
+if(BUILD_SHARED_LIBS)
|
|
30
|
+ set(LABEL_SUFFIX "shared")
|
|
31
|
+else()
|
|
32
|
+ set(LABEL_SUFFIX "static")
|
|
33
|
+endif()
|
27
|
34
|
|
28
|
35
|
###################
|
29
|
36
|
# External Projects
|
|
@@ -66,7 +73,7 @@ if ( TINYXML_SUPPORT )
|
66
|
73
|
PATCH_COMMAND ""
|
67
|
74
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/tinyxml2
|
68
|
75
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON
|
69
|
|
-#-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
|
|
76
|
+ #-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
|
70
|
77
|
)
|
71
|
78
|
add_compile_options(-DTINYXMLSUPPORT)
|
72
|
79
|
endif()
|
|
@@ -103,8 +110,6 @@ endif()
|
103
|
110
|
# Lemma Configuration
|
104
|
111
|
#####################
|
105
|
112
|
|
106
|
|
-
|
107
|
|
-
|
108
|
113
|
####################
|
109
|
114
|
# Add the c++11 flag
|
110
|
115
|
# TODO add compiler specific instructions
|
|
@@ -112,11 +117,11 @@ include(CheckCXXCompilerFlag)
|
112
|
117
|
CHECK_CXX_COMPILER_FLAG(-std=c++11 COMPILER_SUPPORTS_CXX11)
|
113
|
118
|
CHECK_CXX_COMPILER_FLAG(-std=c++0x COMPILER_SUPPORTS_CXX0X)
|
114
|
119
|
if(COMPILER_SUPPORTS_CXX11)
|
115
|
|
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
120
|
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
116
|
121
|
elseif(COMPILER_SUPPORTS_CXX0X)
|
117
|
|
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
|
122
|
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
118
|
123
|
else()
|
119
|
|
- message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
|
|
124
|
+ message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
|
120
|
125
|
endif()
|
121
|
126
|
|
122
|
127
|
set(LEMMA_VERSION_MAJOR "0")
|
|
@@ -125,8 +130,8 @@ set(LEMMA_VERSION_PATCH "1")
|
125
|
130
|
set(LEMMA_VERSION "${LEMMA_VERSION_MAJOR}.${LEMMA_VERSION_MINOR}.${LEMMA_VERSION_PATCH}")
|
126
|
131
|
|
127
|
132
|
configure_file (
|
128
|
|
- "${PROJECT_SOURCE_DIR}/include/LemmaConfig.h.in"
|
129
|
|
- "${PROJECT_BINARY_DIR}/include/LemmaConfig.h"
|
|
133
|
+ "${PROJECT_SOURCE_DIR}/include/LemmaConfig.h.in"
|
|
134
|
+ "${PROJECT_BINARY_DIR}/include/LemmaConfig.h"
|
130
|
135
|
)
|
131
|
136
|
include_directories("${PROJECT_BINARY_DIR}/include")
|
132
|
137
|
|