Commit 9cde3626 authored by jcfr's avatar jcfr

COMP: Slicer Libs target are exported into SlicerTargets.cmake

Note also that of the library are build as standalone package, the associated
targets will be exported into <PROJECT_NAME>Targets.cmake

git-svn-id: http://svn.slicer.org/Slicer4/trunk@16486 3bd1e089-480b-0410-8dfb-8563597acbee
parent a5925346
......@@ -211,16 +211,20 @@ ENDIF()
#-----------------------------------------------------------------------------
# Superbuild script
#-----------------------------------------------------------------------------
IF(Slicer_SUPERBUILD)
INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild.cmake")
RETURN()
ENDIF()
#-----------------------------------------------------------------------------
# Output directories.
# Clear SlicerTargets.cmake
#------------------------------------------------------------------------------
FILE(WRITE "${Slicer_BINARY_DIR}/SlicerTargets.cmake"
"# Generated by CMake, do not edit!")
#-----------------------------------------------------------------------------
# Output directories.
#------------------------------------------------------------------------------
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Slicer_BINARY_DIR}/bin)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Slicer_BINARY_DIR}/bin)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Slicer_BINARY_DIR}/lib)
......
......@@ -104,5 +104,6 @@ FOREACH(dir ${dirs})
SET(${dir}_INSTALL_BIN_DIR ${Slicer_INSTALL_LIB_DIR})
SET(${dir}_INSTALL_LIB_DIR ${Slicer_INSTALL_LIB_DIR})
SET(${dir}_INSTALL_NO_DEVELOPMENT ${Slicer_INSTALL_NO_DEVELOPMENT})
SET(${dir}_EXPORT_FILE ${Slicer_BINARY_DIR}/SlicerTargets.cmake)
ADD_SUBDIRECTORY(${dir})
ENDFOREACH()
......@@ -52,6 +52,14 @@ IF(Slicer_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES ${Slicer_LIBRARY_PROPERTIES})
ENDIF()
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
# --------------------------------------------------------------------------
......
......@@ -90,6 +90,14 @@ IF(Slicer_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES ${Slicer_LIBRARY_PROPERTIES})
ENDIF()
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
# --------------------------------------------------------------------------
......
......@@ -130,6 +130,14 @@ IF(Slicer_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES ${Slicer_LIBRARY_PROPERTIES})
ENDIF()
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
# --------------------------------------------------------------------------
......
......@@ -78,6 +78,14 @@ add_library(${lib_name} ${srcs})
set(libs ${ITK_LIBRARIES})
target_link_libraries(${lib_name} ${libs})
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
# --------------------------------------------------------------------------
......
......@@ -238,6 +238,14 @@ IF(Slicer_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES ${Slicer_LIBRARY_PROPERTIES})
ENDIF()
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
# --------------------------------------------------------------------------
......
......@@ -79,6 +79,14 @@ IF(Slicer_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES ${Slicer_LIBRARY_PROPERTIES})
ENDIF()
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
# --------------------------------------------------------------------------
......
......@@ -147,6 +147,14 @@ IF(Slicer_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES ${Slicer_LIBRARY_PROPERTIES})
ENDIF()
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
# --------------------------------------------------------------------------
......
......@@ -82,6 +82,14 @@ IF(Slicer_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES ${Slicer_LIBRARY_PROPERTIES})
ENDIF()
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
# --------------------------------------------------------------------------
......
......@@ -95,6 +95,14 @@ IF(Slicer_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES ${Slicer_LIBRARY_PROPERTIES})
ENDIF()
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
# --------------------------------------------------------------------------
......
......@@ -102,6 +102,14 @@ IF(Slicer_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES ${Slicer_LIBRARY_PROPERTIES})
ENDIF()
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
# --------------------------------------------------------------------------
......
......@@ -22,6 +22,12 @@ IF(DEFINED SlicerExecutionModel_INSTALL_NO_DEVELOPMENT)
SET(tclap_INSTALL_NO_DEVELOPMENT ${SlicerExecutionModel_INSTALL_NO_DEVELOPMENT})
ENDIF()
IF(DEFINED SlicerExecutionModel_EXPORT_FILE)
SET(GenerateCLP_EXPORT_FILE ${SlicerExecutionModel_EXPORT_FILE})
SET(ModuleDescriptionParser_EXPORT_FILE ${SlicerExecutionModel_EXPORT_FILE})
#SET(tclap_EXPORT_FILE ${SlicerExecutionModel_EXPORT_FILE})
ENDIF()
# --------------------------------------------------------------------------
# SETIFEMPTY
......
......@@ -51,12 +51,13 @@ include_directories(
# --------------------------------------------------------------------------
# Build executable
# --------------------------------------------------------------------------
set(executable_name GenerateCLP)
set(GENERATECLP_SOURCE
GenerateCLP.cxx
)
add_executable(GenerateCLP ${GENERATECLP_SOURCE})
add_executable(${executable_name} ${GENERATECLP_SOURCE})
target_link_libraries(GenerateCLP
target_link_libraries(${executable_name}
# Appearently windows does not like static libs mixed with shared libs ModuleDescriptionParser-static
# A different solution will have to be investigated for makeing GenerateCLP work without
# shared libs.
......@@ -66,6 +67,14 @@ target_link_libraries(GenerateCLP
include(GenerateGenerateCLPConfig.cmake)
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${executable_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install executable
# --------------------------------------------------------------------------
......
......@@ -170,6 +170,13 @@ if(Slicer_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES ${Slicer_LIBRARY_PROPERTIES})
endif()
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
......
......@@ -315,6 +315,14 @@ IF(qMRMLWidgets_WRAP_PYTHON)
ENDIF()
ENDIF()
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
# --------------------------------------------------------------------------
......
......@@ -124,6 +124,14 @@ IF(Slicer_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES ${Slicer_LIBRARY_PROPERTIES})
ENDIF()
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
# --------------------------------------------------------------------------
......
......@@ -124,6 +124,14 @@ IF(Slicer_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES ${Slicer_LIBRARY_PROPERTIES})
ENDIF()
# --------------------------------------------------------------------------
# Export target
# --------------------------------------------------------------------------
IF(NOT DEFINED ${PROJECT_NAME}_EXPORT_FILE)
SET(${PROJECT_NAME}_EXPORT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
ENDIF()
EXPORT(TARGETS ${lib_name} APPEND FILE ${${PROJECT_NAME}_EXPORT_FILE})
# --------------------------------------------------------------------------
# Install library
# --------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment