-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
executable file
·90 lines (66 loc) · 2.37 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
cmake_minimum_required(VERSION 3.13)
project(skeltools VERSION 1.0
DESCRIPTION "Skeletonization Tools"
LANGUAGES CXX)
message(STATUS "Found CMAKE-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}")
message(STATUS "----------------Running CMake---------------------------------")
cmake_host_system_information(RESULT HOSTNAME QUERY HOSTNAME)
message(STATUS "Invoking CMAKE on : ${HOSTNAME} running: ${CMAKE_HOST_SYSTEM}")
set(ITK_DIR $ENV{HOME}/opt/itk/lib/cmake/ITK-5.3)
message(STATUS "ITK Directory ${ITK_DIR}")
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
set(CMAKE_CONFIGURATION_TYPES Debug Release)
# Set a default build type if none was specified
set(default_build_type "Release")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(default_build_type "Debug")
endif()
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
endif()
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
set(CMAKE_CXX_STANDARD 17)
set(DEBUG_CXX_FLAGS "-ggdb;-O1;-Wall;-Wextra;-march=native;-fPIC")
set(RELEASE_CXX_FLAGS "-O3;-Wall;-march=native;-fPIC;-ffast-math")
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# Sources
set(SOURCES
src/itkCommandLineArgumentParser.cxx
src/topology.cpp
src/experiment.cpp
src/homotopic.cpp
src/medial.cpp
src/skeletonize.cpp
)
set(HEADERS
include/itkCommandLineArgumentParser.h
include/topology.h
include/itkHomotopicThinningImageFilter.h
include/experiment.h
include/homotopic.h
include/util.h
include/flux.h
include/medial.h
include/itkSpokeFieldToAverageOutwardFluxImageFilter.h
include/skeletonize.h
)
add_library(skel SHARED)
target_compile_options(skel PUBLIC "$<$<CONFIG:Debug>:${DEBUG_CXX_FLAGS}>")
target_compile_options(skel PUBLIC "$<$<CONFIG:Release>:${RELEASE_CXX_FLAGS}>")
target_compile_definitions(skel PUBLIC "$<$<CONFIG:Debug>:DEBUG_BUILD>")
target_include_directories(skel PUBLIC include)
target_sources(skel PRIVATE ${SOURCES}
PUBLIC ${HEADERS})
set_target_properties(skel PROPERTIES
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
add_executable(skeltool main.cpp)
target_link_libraries(skeltool skel ${ITK_LIBRARIES})
# Tests
#enable_testing()
#add_subdirectory(tests)
add_subdirectory("examples")