-
Notifications
You must be signed in to change notification settings - Fork 30
/
CMakeLists.txt
115 lines (89 loc) · 5 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
cmake_minimum_required(VERSION 2.6)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
Project(InteractiveImageGraphCutSegmentation)
# We need to compile with c++11 functionality since it is
# used by the Helpers subsubmodule.
if(UNIX)
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++0x") # gcc < 4.7
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++11") # gcc >= 4.7
endif(UNIX)
# Turn off warnings seen in VS2010 in ITK code.
if(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_SCL_SECURE_NO_WARNINGS")
endif(WIN32)
FIND_PACKAGE(Qt4 REQUIRED)
INCLUDE(${QT_USE_FILE})
set(InteractiveImageGraphCutSegmentation_libraries ${InteractiveImageGraphCutSegmentation_libraries} ${QT_LIBRARIES})
QT4_WRAP_UI(GraphCutSegmentationUISrcs GraphCutSegmentationWidget.ui)
QT4_WRAP_CPP(GraphCutSegmentationMOCSrcs GraphCutSegmentationWidget.h)
# Allow Qt to find it's MOCed files
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
# VTK
FIND_PACKAGE(VTK REQUIRED)
INCLUDE( ${USE_VTK_FILE} )
if( "${VTK_MAJOR_VERSION}" LESS 6 )
MESSAGE(FATAL_ERROR "You must build this code with VTK >= 6.0!")
endif( "${VTK_MAJOR_VERSION}" LESS 6 )
set(InteractiveImageGraphCutSegmentation_libraries ${InteractiveImageGraphCutSegmentation_libraries} ${VTK_LIBRARIES})
# ITK
FIND_PACKAGE(ITK REQUIRED)
INCLUDE( ${USE_ITK_FILE} )
if( "${ITK_VERSION_MAJOR}" LESS 4 )
MESSAGE(FATAL_ERROR "You must build this code with ITK >= 4.0!")
endif( "${ITK_VERSION_MAJOR}" LESS 4 )
set(InteractiveImageGraphCutSegmentation_libraries ${InteractiveImageGraphCutSegmentation_libraries} ${ITK_LIBRARIES})
# Submodules
# ITKVTKHelpers
get_property(FoundITKVTKHelpers GLOBAL PROPERTY ITKVTKHelpersIncludeDirs SET)
if(NOT FoundITKVTKHelpers)
add_subdirectory(ITKVTKHelpers)
endif()
get_property(ITKVTKHelpersIncludeDirs GLOBAL PROPERTY ITKVTKHelpersIncludeDirs)
set(InteractiveImageGraphCutSegmentation_include_dirs ${InteractiveImageGraphCutSegmentation_include_dirs} ${ITKVTKHelpersIncludeDirs})
get_property(ITKVTKHelpersLibs GLOBAL PROPERTY ITKVTKHelpersLibs)
set(InteractiveImageGraphCutSegmentation_libraries ${InteractiveImageGraphCutSegmentation_libraries} ${ITKVTKHelpersLibs})
# ScribbleInteractorStyle
get_property(FoundScribbleInteractorStyle GLOBAL PROPERTY ScribbleInteractorStyleIncludeDirs SET)
if(NOT FoundScribbleInteractorStyle)
add_subdirectory(ScribbleInteractorStyle)
endif()
get_property(ScribbleInteractorStyleIncludeDirs GLOBAL PROPERTY ScribbleInteractorStyleIncludeDirs)
set(InteractiveImageGraphCutSegmentation_include_dirs ${InteractiveImageGraphCutSegmentation_include_dirs} ${ScribbleInteractorStyleIncludeDirs})
get_property(ScribbleInteractorStyleLibs GLOBAL PROPERTY ScribbleInteractorStyleLibs)
set(InteractiveImageGraphCutSegmentation_libraries ${InteractiveImageGraphCutSegmentation_libraries} ${ScribbleInteractorStyleLibs})
# VTKHelpers
get_property(FoundVTKHelpers GLOBAL PROPERTY VTKHelpersIncludeDirs SET)
if(NOT FoundVTKHelpers)
add_subdirectory(VTKHelpers)
endif()
get_property(VTKHelpersIncludeDirs GLOBAL PROPERTY VTKHelpersIncludeDirs)
set(InteractiveImageGraphCutSegmentation_include_dirs ${InteractiveImageGraphCutSegmentation_include_dirs} ${VTKHelpersIncludeDirs})
get_property(VTKHelpersLibs GLOBAL PROPERTY VTKHelpersLibs)
set(InteractiveImageGraphCutSegmentation_libraries ${InteractiveImageGraphCutSegmentation_libraries} ${VTKHelpersLibs})
# ITKVTKCamera
get_property(FoundITKVTKCamera GLOBAL PROPERTY ITKVTKCameraIncludeDirs SET)
if(NOT FoundITKVTKCamera)
add_subdirectory(ITKVTKCamera)
endif()
get_property(ITKVTKCameraIncludeDirs GLOBAL PROPERTY ITKVTKCameraIncludeDirs)
set(InteractiveImageGraphCutSegmentation_include_dirs ${InteractiveImageGraphCutSegmentation_include_dirs} ${ITKVTKCameraIncludeDirs})
get_property(ITKVTKCameraLibs GLOBAL PROPERTY ITKVTKCameraLibs)
set(InteractiveImageGraphCutSegmentation_libraries ${InteractiveImageGraphCutSegmentation_libraries} ${ITKVTKCameraLibs})
# ImageGraphCutSegmentation
get_property(FoundImageGraphCutSegmentation GLOBAL PROPERTY ImageGraphCutSegmentationIncludeDirs SET)
if(NOT FoundImageGraphCutSegmentation)
add_subdirectory(ImageGraphCutSegmentation)
endif()
get_property(ImageGraphCutSegmentationIncludeDirs GLOBAL PROPERTY ImageGraphCutSegmentationIncludeDirs)
set(InteractiveImageGraphCutSegmentation_include_dirs ${InteractiveImageGraphCutSegmentation_include_dirs} ${ImageGraphCutSegmentationIncludeDirs})
get_property(ImageGraphCutSegmentationLibs GLOBAL PROPERTY ImageGraphCutSegmentationLibs)
set(InteractiveImageGraphCutSegmentation_libraries ${InteractiveImageGraphCutSegmentation_libraries} ${ImageGraphCutSegmentationLibs})
# Give the compiler all of the required include directories
include_directories(${InteractiveImageGraphCutSegmentation_include_dirs})
# Build the executable
ADD_EXECUTABLE(InteractiveImageGraphCutSegmentation
InteractiveGraphCutSegmentation.cpp GraphCutSegmentationWidget.cpp
${GraphCutSegmentationMOCSrcs} ${GraphCutSegmentationUISrcs})
TARGET_LINK_LIBRARIES(InteractiveImageGraphCutSegmentation
${InteractiveImageGraphCutSegmentation_libraries}
)