Add booleanmatrix and simplicialcomplex
[libstick.git] / CMakeLists.txt
index c9d4fb2c57c6cf2f15d89778abf207871fab339a..b5116d9d93515228cef3292c1dec55f45db5b5fe 100644 (file)
@@ -1,30 +1,42 @@
 cmake_minimum_required (VERSION 2.6)
-project (stick) 
+project (libstick)
 
 
 if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
-       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi")
+       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -ansi -pedantic")
+       # I would like to use -pedantic, but VTK devs are not sufficiently
+       # pedantic
+       set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror")
        set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed" )
 endif()
 
-set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG")
+set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG")
 if(CMAKE_BUILD_TYPE STREQUAL "Release")
-       # CMAKE_C_FLAGS_RELEASE is appended, but we need to prepend -O2 to take
+       # CMAKE_CXX_FLAGS_RELEASE is appended, but we need to prepend -O2 to take
        # effect
-       set(CMAKE_C_FLAGS "-O2 ${CMAKE_C_FLAGS}")
+       set(CMAKE_CXX_FLAGS "-O2 ${CMAKE_CXX_FLAGS}")
 endif()
 
 set(PACKAGE_STRING stick)
 set(PACKAGE_BUGREPORT stefan.huber@ist.ac.at)
 set(PACKAGE_VERSION 0.1)
 
-if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
-       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99")
-       # I would like to use -pedantic, but VTK devs are not sufficiently
-       # pedantic
-       set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror")
-endif()
+option(WITH_UNITTESTS "Enable unit tests" "OFF")
 
 add_subdirectory(include)
 add_subdirectory(lib)
 add_subdirectory(src)
+
+if(WITH_UNITTESTS)
+       add_subdirectory(tests)
+endif()
+
+
+########### Add uninstall target ###############
+configure_file(
+    "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
+    "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
+    IMMEDIATE @ONLY)
+
+add_custom_target(uninstall
+    COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)