UseSlicer.cmake.in 3.18 KB
Newer Older
1
2
#
# This file sets up the include directories, link directories and compiler
3
4
# settings for a project to use Slicer.  Such projects could provide new
# Slicer modules built against a Slicer build tree or a Slicer installation.
5
6
#

7
8
9
# --------------------------------------------------------------------------
# Prerequisites
# --------------------------------------------------------------------------
10

11
# Include projects
12
13
14
FOREACH(proj ${Slicer_EXTERNAL_PROJECTS})
  INCLUDE(${${proj}_USE_FILE})
ENDFOREACH()
15
16
17
18
19
20
21
22
  
# --------------------------------------------------------------------------
# Qt
# --------------------------------------------------------------------------
# Note: This block should be added after VTK and CTK are found.
#       Indeed, it will check if both VTK_QT_QMAKE_EXECUTABLE and CTK_QT_QMAKE_EXECUTABLE 
#       are valid.
INCLUDE(SlicerBlockFindQtAndCheckVersion)
23

24
25
26
27
# --------------------------------------------------------------------------
# Platform check
# --------------------------------------------------------------------------
INCLUDE(SlicerBlockPlatformCheck)
28

29
30
31
32
33
#-----------------------------------------------------------------------------
# Set {ITK,VTK}_REQUIRED_{C,CXX}_FLAGS variables
#-----------------------------------------------------------------------------
INCLUDE(vtkDetermineCompilerFlags)
INCLUDE(ITKPlatformSpecificChecks)
34

35
36
37
38
#-----------------------------------------------------------------------------
# Set Slicer_{C,CXX}_REQUIRED_FLAGS variables
#-----------------------------------------------------------------------------
INCLUDE(SlicerBlockCXXRequiredFlags)
barre's avatar
barre committed
39

40
41
42
43
44
#-----------------------------------------------------------------------------
# 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)
45

46
47
48
#-----------------------------------------------------------------------------
# Link directories
#------------------------------------------------------------------------------
49
if(NOT DEFINED BUILD_SHARED_LIBS)
50
  set(BUILD_SHARED_LIBS ${Slicer_BUILD_SHARED})
51
endif()
52

53
link_directories(
54
55
  ${Slicer_Libs_LIBRARY_DIRS}
  ${Slicer_Base_LIBRARY_DIRS}
56
  ${Slicer_ModuleLogic_LIBRARY_DIRS}
57
58
  )

59
60
61
62
63
64
65
66
67
#-----------------------------------------------------------------------------
# Include directories - See SlicerMacroBuildQtModule
#------------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# CMake Function(s) and Macro(s)
#-----------------------------------------------------------------------------
include(CMakeParseArguments)
#include(ctkMacroCompilePythonScript)
68
include(SlicerMacroParseArguments)
69
70
include(SlicerMacroBuildModuleLibrary)
#include(SlicerMacroPythonWrapModuleLibrary)
71
include(SlicerMacroBuildModuleLogic)
72
include(SlicerMacroBuildModuleMRML)
73
74
include(SlicerMacroBuildQtModule)