forked from ilastik/ilastiktools
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
executable file
·58 lines (49 loc) · 2.15 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#----------------------------------------------------
# default build-type (release)
# (the next lines must be called bevore project(ilastiktools))
#----------------------------------------------------
IF(DEFINED CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
ELSE()
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
ENDIF()
#----------------------------------------------------
# ilastiktools
#----------------------------------------------------
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
project(ilastiktools)
set (ILASTIKTOOLS_VERSION_MAJOR 0)
set (ILASTIKTOOLS_VERSION_MINOR 2)
set (ILASTIKTOOLS_VERSION_PATCH 1)
#--------------------------------------------------------
# enable_testing
#--------------------------------------------------------
enable_testing()
#--------------------------------------------------------
# global headers
#--------------------------------------------------------
file(GLOB_RECURSE headers include/*.hxx)
file(GLOB_RECURSE headers ${CMAKE_INSTALL_PREFIX}/include/*.hxx)
include_directories(include)
FIND_PACKAGE(VIGRA REQUIRED)
include_directories(${VIGRA_INCLUDE_DIR})
FIND_PACKAGE(Threads REQUIRED) # includes pthread
#--------------------------------------------------------
# OpenMP
#--------------------------------------------------------
option (WITH_OPENMP "use openmp" ON)
if(WITH_OPENMP)
FIND_PACKAGE(OpenMP REQUIRED)
message(STATUS "build with OpenMP")
add_definitions(-DWITH_OPENMP)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
else()
message(STATUS "build without openMP -> multithreaded options disabled")
endif(WITH_OPENMP)
#--------------------------------------------------------
# source directory
#--------------------------------------------------------
add_subdirectory(ext/pybind11)
add_subdirectory(src)