CMakeLists.txt 1.65 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
# Configure Qt Designer launcher (Designer.py.in) allowing to:
# - update the environment variable QT_PLUGIN_PATH with Slicer QT Plugin path
# - update PATH with Slicer libraries
# - start the designer
#

# --------------------------------------------------------------
SET(designer_launcher_project_name SlicerQT)
SET(designer_launcher_directory ${Slicer3_BINARY_DIR})
# --------------------------------------------------------------

GET_TARGET_PROPERTY(output_directory ${designer_launcher_project_name} LIBRARY_OUTPUT_DIRECTORY)
#MESSAGE(STATUS CMAKE_CONFIGURATION_TYPES:${CMAKE_CONFIGURATION_TYPES})
#MESSAGE(STATUS CMAKE_BUILD_TYPE:${CMAKE_BUILD_TYPE})
#MESSAGE(STATUS output_directory:${output_directory})

IF(CMAKE_CONFIGURATION_TYPES)
  # Loop through all Configuration types
  # For further details, see http://www.cmake.org/cmake/help/cmake-2-8-docs.html#variable:CMAKE_CONFIGURATION_TYPES
  FOREACH(config ${CMAKE_CONFIGURATION_TYPES})
22
    SET(LIBRARY_OUTPUT_DIRECTORY ${output_directory}/${config})
23
    SET(designer_launcher "${designer_launcher_directory}/Designer-${config}.py")
24
25
26
27
28
    CONFIGURE_FILE(
      ${CMAKE_CURRENT_SOURCE_DIR}/Designer.py.in
      ${designer_launcher}
      IMMEDIATE
      )
29
30
31
32
33
    MESSAGE(STATUS "Configuring Designer launcher: "${designer_launcher})
  ENDFOREACH(config)
  
ELSE(CMAKE_CONFIGURATION_TYPES)

34
  SET(LIBRARY_OUTPUT_DIRECTORY ${output_directory})
35
36
37
38
39
40
41
42
43
  SET(designer_launcher "${designer_launcher_directory}/Designer.py")
  CONFIGURE_FILE(
    ${CMAKE_CURRENT_SOURCE_DIR}/Designer.py.in
    ${designer_launcher}
    IMMEDIATE
    )
  MESSAGE(STATUS "Configuring Designer launcher: "${designer_launcher})
  
ENDIF(CMAKE_CONFIGURATION_TYPES)