forked from IGSIO/OpenIGTLinkIO
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
68 lines (53 loc) · 1.85 KB
/
CMakeLists.txt
File metadata and controls
68 lines (53 loc) · 1.85 KB
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
cmake_minimum_required(VERSION 2.8.12.2)
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW) # CMake 3.0.0
endif()
###########################################################
project(OpenIGTLinkIO)
###########################################################
set(BUILD_SHARED_LIBS ON CACHE BOOL "build shared or static libs")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
# Choose version of Qt
set( IGTLIO_QT_VERSION "5" CACHE STRING "Expected Qt version")
mark_as_advanced( IGTLIO_QT_VERSION )
set_property(CACHE IGTLIO_QT_VERSION PROPERTY STRINGS 4 5)
if(NOT (IGTLIO_QT_VERSION VERSION_EQUAL "4" OR IGTLIO_QT_VERSION VERSION_EQUAL "5"))
message(FATAL_ERROR "Expected value for IGTLIO_QT_VERSION is either '4' or '5'")
endif()
set (OpenIGTLinkIO_TARGETS igtlioLogic igtlioDevices igtlioConverter ${OpenIGTLinkIO_TARGETS})
set (OpenIGTLinkIO_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
Logic
Converter
Devices
${OpenIGTLinkIO_INCLUDE_DIRS}
)
add_subdirectory(Converter)
add_subdirectory(Devices)
add_subdirectory(Logic)
option(IGTLIO_USE_GUI "Build IGTLIO with an user interface" ON)
if (${IGTLIO_USE_GUI})
add_subdirectory(GUI)
set (OpenIGTLinkIO_TARGETS igtlioGUI ${OpenIGTLinkIO_TARGETS})
endif()
option(IGTLIO_USE_EXAMPLES "Build IGTLIO examples" ON)
if (${IGTLIO_USE_EXAMPLES})
add_subdirectory(Examples)
endif ()
# TODO use the namespace feature for all libs
export(TARGETS ${OpenIGTLinkIO_TARGETS}
FILE "${CMAKE_CURRENT_BINARY_DIR}/OpenIGTLinkIOTargets.cmake"
)
set (OpenIGTLinkIO_LIBRARIES ${OpenIGTLinkIO_TARGETS})
set (OpenIGTLinkIO_LIBRARY_DIRS
${CMAKE_CURRENT_BINARY_DIR}
)
configure_file(OpenIGTLinkIOConfig.cmake.in
OpenIGTLinkIOConfig.cmake
)
include(CTest)
if (BUILD_TESTING)
add_subdirectory(Testing)
endif()