CMakeLists.txt 2.02 KB
Newer Older
1 2 3 4 5 6 7 8 9
#
# 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)
10
SET(designer_launcher_directory ${Slicer_BINARY_DIR})
11 12 13 14 15 16 17 18 19 20 21
# --------------------------------------------------------------

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
    CONFIGURE_FILE(
      ${CMAKE_CURRENT_SOURCE_DIR}/Designer.py.in
26
      ${CMAKE_CURRENT_BINARY_DIR}/Designer.py
27
      )
28 29 30
    FILE(COPY ${CMAKE_CURRENT_BINARY_DIR}/Designer.py
      DESTINATION ${designer_launcher_directory}
      FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ)
31
    MESSAGE(STATUS "Configuring Qt Designer launcher: "${designer_launcher})
32 33 34 35
  ENDFOREACH(config)
  
ELSE(CMAKE_CONFIGURATION_TYPES)

36
  SET(LIBRARY_OUTPUT_DIRECTORY ${output_directory})
37 38 39
  SET(designer_launcher "${designer_launcher_directory}/Designer.py")
  CONFIGURE_FILE(
    ${CMAKE_CURRENT_SOURCE_DIR}/Designer.py.in
40
    ${CMAKE_CURRENT_BINARY_DIR}/Designer.py
41
    )
42 43 44
  FILE(COPY ${CMAKE_CURRENT_BINARY_DIR}/Designer.py
    DESTINATION ${designer_launcher_directory}
    FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ )
45
  MESSAGE(STATUS "Configuring Qt Designer launcher: "${designer_launcher})
46 47
  
ENDIF(CMAKE_CONFIGURATION_TYPES)