-
Notifications
You must be signed in to change notification settings - Fork 458
/
UseSlicer.cmake.in
77 lines (65 loc) · 3.52 KB
/
UseSlicer.cmake.in
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
#
# This file sets up the include directories, link directories and compiler
# settings for a project to use Slicer. Such projects could provide new
# Slicer modules built against a Slicer build tree or a Slicer installation.
#
# --------------------------------------------------------------------------
# Prerequisites
# --------------------------------------------------------------------------
# Include projects
foreach(proj ${Slicer_EXTERNAL_PROJECTS})
include(${${proj}_USE_FILE})
endforeach()
# Set PythonQt 'DIR' variable so that find_package(PythonQt) works as expected.
set(PYTHONQT_INSTALL_DIR ${CTK_PYTHONQT_INSTALL_DIR})
# --------------------------------------------------------------------------
# Platform check
# --------------------------------------------------------------------------
include(SlicerBlockPlatformCheck)
#-----------------------------------------------------------------------------
# Set {ITK,VTK}_REQUIRED_{C,CXX}_FLAGS variables
#-----------------------------------------------------------------------------
include(vtkDetermineCompilerFlags)
include(ITKPlatformSpecificChecks)
#-----------------------------------------------------------------------------
# Set Slicer_{C,CXX}_REQUIRED_FLAGS variables
#-----------------------------------------------------------------------------
include(SlicerBlockCXXRequiredFlags)
#-----------------------------------------------------------------------------
# Set CMAKE_{C,CXX}_FLAGS variables
#-----------------------------------------------------------------------------
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT} ${Slicer_REQUIRED_C_FLAGS} ${ITK_REQUIRED_C_FLAGS} ${VTK_REQUIRED_C_FLAGS} ${ADDITIONAL_C_FLAGS}" CACHE STRING "CMake C Flags" FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} ${Slicer_REQUIRED_CXX_FLAGS} ${ITK_REQUIRED_CXX_FLAGS} ${VTK_REQUIRED_CXX_FLAGS} ${ADDITIONAL_CXX_FLAGS}" CACHE STRING "CMake CXX Flags" FORCE)
#-----------------------------------------------------------------------------
# Static or Shared library
#------------------------------------------------------------------------------
if(NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS ${Slicer_BUILD_SHARED})
endif()
#-----------------------------------------------------------------------------
# Include directories - See SlicerMacroBuildQtModule
#------------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# CMake Function(s) and Macro(s)
#-----------------------------------------------------------------------------
include(CMakeParseArguments)
include(ctkMacroCompilePythonScript)
include(ctkMacroWrapPythonQt)
include(SlicerMacroParseArguments)
include(SlicerMacroBuildModuleQtLibrary)
include(SlicerMacroBuildModuleVTKLibrary)
#include(SlicerMacroPythonWrapModuleVTKLibrary)
include(SlicerMacroBuildModuleLogic)
include(SlicerMacroBuildModuleMRML)
include(SlicerMacroBuildModuleWidgets)
include(SlicerMacroBuildQtModule)
#-----------------------------------------------------------------------------
# Set a default build type if none was specified
#-----------------------------------------------------------------------------
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()