initial commit
[libstick.git] / CMakeLists.txt
1 cmake_minimum_required (VERSION 2.6)
2 project (stick)
3
4
5 if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
6 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi")
7 set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed" )
8 endif()
9
10 set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG")
11 if(CMAKE_BUILD_TYPE STREQUAL "Release")
12 # CMAKE_C_FLAGS_RELEASE is appended, but we need to prepend -O2 to take
13 # effect
14 set(CMAKE_C_FLAGS "-O2 ${CMAKE_C_FLAGS}")
15 endif()
16
17 set(PACKAGE_STRING stick)
18 set(PACKAGE_BUGREPORT stefan.huber@ist.ac.at)
19 set(PACKAGE_VERSION 0.1)
20
21 if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
22 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99")
23 # I would like to use -pedantic, but VTK devs are not sufficiently
24 # pedantic
25 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror")
26 endif()
27
28 add_subdirectory(include)
29 add_subdirectory(lib)
30 add_subdirectory(src)