Browse Source

Static library option.

enhancement_3
Trevor Irons 8 years ago
parent
commit
4b4d658264
2 changed files with 16 additions and 3 deletions
  1. 7
    2
      CMakeLists.txt
  2. 9
    1
      LemmaCore/CMakeLists.txt

+ 7
- 2
CMakeLists.txt View File

17
 #   message(STATUS "Mercurial (hg) was not found.")
17
 #   message(STATUS "Mercurial (hg) was not found.")
18
 # endif(NOT HAVEHG)
18
 # endif(NOT HAVEHG)
19
 
19
 
20
+option(BUILD_SHARED_LIBS OFF)
21
+
20
 ###################
22
 ###################
21
 # External Projects
23
 # External Projects
22
 ###################
24
 ###################
44
 	UPDATE_COMMAND ""
46
 	UPDATE_COMMAND ""
45
 	PATCH_COMMAND ""
47
 	PATCH_COMMAND ""
46
     PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/yaml-cpp
48
     PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/yaml-cpp
47
-    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DBUILD_SHARED_LIBS=ON
49
+    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DBUILD_SHARED_LIBS=ON -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
48
 )
50
 )
49
 add_compile_options(-DHAVE_YAMLCPP) 
51
 add_compile_options(-DHAVE_YAMLCPP) 
50
 
52
 
57
 		UPDATE_COMMAND ""
59
 		UPDATE_COMMAND ""
58
 		PATCH_COMMAND ""
60
 		PATCH_COMMAND ""
59
     	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/tinyxml2
61
     	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/tinyxml2
60
-    	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
62
+    	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON 
63
+#-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
61
 	)
64
 	)
62
 	add_compile_options(-DTINYXMLSUPPORT) 
65
 	add_compile_options(-DTINYXMLSUPPORT) 
63
 endif()
66
 endif()
94
 # Lemma Configuration
97
 # Lemma Configuration
95
 #####################
98
 #####################
96
 
99
 
100
+
101
+
97
 ####################
102
 ####################
98
 # Add the c++11 flag 
103
 # Add the c++11 flag 
99
 # TODO add compiler specific instructions
104
 # TODO add compiler specific instructions

+ 9
- 1
LemmaCore/CMakeLists.txt View File

2
 
2
 
3
 add_subdirectory("src")
3
 add_subdirectory("src")
4
 
4
 
5
-add_library( lemmacore SHARED ${SOURCE} )  
5
+#option (SHARED_LEMMA_LIB off)
6
+#
7
+#if (SHARED_LEMMA_LIB)
8
+#	add_library( lemmacore SHARED ${SOURCE} )  
9
+#else()
10
+#	add_library( lemmacore STATIC ${SOURCE} )  
11
+#endif()
12
+add_library( lemmacore ${SOURCE} )  
13
+
6
 set_target_properties(lemmacore PROPERTIES 
14
 set_target_properties(lemmacore PROPERTIES 
7
 	VERSION ${LEMMA_VERSION_MAJOR}
15
 	VERSION ${LEMMA_VERSION_MAJOR}
8
 	SOVERSION ${LEMMA_VERSION})
16
 	SOVERSION ${LEMMA_VERSION})

Loading…
Cancel
Save