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,6 +17,8 @@ endif(NOT HAVEGIT)
17 17
 #   message(STATUS "Mercurial (hg) was not found.")
18 18
 # endif(NOT HAVEHG)
19 19
 
20
+option(BUILD_SHARED_LIBS OFF)
21
+
20 22
 ###################
21 23
 # External Projects
22 24
 ###################
@@ -44,7 +46,7 @@ ExternalProject_Add(YAML-CPP
44 46
 	UPDATE_COMMAND ""
45 47
 	PATCH_COMMAND ""
46 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 51
 add_compile_options(-DHAVE_YAMLCPP) 
50 52
 
@@ -57,7 +59,8 @@ if ( TINYXML_SUPPORT )
57 59
 		UPDATE_COMMAND ""
58 60
 		PATCH_COMMAND ""
59 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 65
 	add_compile_options(-DTINYXMLSUPPORT) 
63 66
 endif()
@@ -94,6 +97,8 @@ endif()
94 97
 # Lemma Configuration
95 98
 #####################
96 99
 
100
+
101
+
97 102
 ####################
98 103
 # Add the c++11 flag 
99 104
 # TODO add compiler specific instructions

+ 9
- 1
LemmaCore/CMakeLists.txt View File

@@ -2,7 +2,15 @@ include_directories(${CMAKE_INSTALL_PREFIX}/include)
2 2
 
3 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 14
 set_target_properties(lemmacore PROPERTIES 
7 15
 	VERSION ${LEMMA_VERSION_MAJOR}
8 16
 	SOVERSION ${LEMMA_VERSION})

Loading…
Cancel
Save