Browse Source

Made documentation and building a shared version of the library optional.

Ioannis Koutras 13 years ago
parent
commit
306175e290
3 changed files with 15 additions and 6 deletions
  1. 3 1
      CMakeLists.txt
  2. 4 1
      DefineOptions.cmake
  3. 8 4
      src/CMakeLists.txt

+ 3 - 1
CMakeLists.txt

@@ -23,5 +23,7 @@ if (WITH_EXAMPLES)
   add_subdirectory(examples)
 endif (WITH_EXAMPLES)
 
-add_subdirectory(doc)
+if (WITH_DOC)
+  add_subdirectory(doc)
+endif (WITH_DOC)
 

+ 4 - 1
DefineOptions.cmake

@@ -1,7 +1,10 @@
 option(HAVE_LOCKS "Build with POSIX locking mechanisms" ON)
 option(WITH_EXAMPLES "Build with examples" OFF)
 option(WITH_MEMORY_SPACE_AWARENESS "Build with memory space awareness" OFF)
-option(WITH_STATIC_LIB "Build with a static library" OFF)
+option(WITH_STATIC_LIB "Build a static library" OFF)
+option(WITH_SHARED_LIB "Build a shared library" OFF)
+option(WITH_DOC "Build with documentation" OFF)
+
 set(NUM_HEAPS '0')
 
 option(P2012 "Build for P2012 runtime" OFF)

+ 8 - 4
src/CMakeLists.txt

@@ -14,10 +14,12 @@ set(DMMLIB_PRIVATE_INCLUDE_DIRS
 	${CMAKE_BINARY_DIR}
 )
 
-set(DMMLIB_SHARED_LIBRARY
-  dmm_shared
-  CACHE INTERNAL "dmmlib shared library"
+if (WITH_SHARED_LIB)
+  set(DMMLIB_SHARED_LIBRARY
+    dmm_shared
+    CACHE INTERNAL "dmmlib shared library"
 )
+endif (WITH_SHARED_LIB)
 
 if (WITH_STATIC_LIB)
   set(DMMLIB_STATIC_LIBRARY
@@ -50,7 +52,9 @@ include_directories(
   ${DMMLIB_PRIVATE_INCLUDE_DIRS}
 )
 
-add_library(${DMMLIB_SHARED_LIBRARY} SHARED ${dmmlib_SRCS})
+if (WITH_SHARED_LIB)
+  add_library(${DMMLIB_SHARED_LIBRARY} SHARED ${dmmlib_SRCS})
+endif (WITH_SHARED_LIB)
 
 if (WITH_STATIC_LIB)
   add_library(${DMMLIB_STATIC_LIBRARY} STATIC ${dmmlib_SRCS})