43 "COMPONENTSUBDIRECTORYGROUP" # possible lists
44 "" # no possible options
48 # special
case for components:
remove prefix
for the destination directory
49 string(REGEX REPLACE
"^component-|^component_|^action-|^action_|^library_|^library-" "" EXPORT_HEADER_DESTINATION ${EXPORT_HEADER_COMPONENT})
51 # define
where to install files
52 set(EXPORT_HEADER_INCLUDE_DIR ${CMAKE_BINARY_DIR}/
include/${CAMITK_SHORT_VERSION_STRING})
53 set(EXPORT_HEADER_INSTALL_ROOT ${CMAKE_INSTALL_PREFIX})
56 if(EXPORT_HEADER_GROUP)
58 if (NOT EXISTS ${EXPORT_HEADER_INCLUDE_DIR}/${EXPORT_HEADER_GROUP})
59 add_custom_command(TARGET ${EXPORT_HEADER_COMPONENT}
61 COMMAND ${CMAKE_COMMAND} -E make_directory ${EXPORT_HEADER_INCLUDE_DIR}/${EXPORT_HEADER_GROUP}
62 COMMENT
"Creating build-time group include dir ${EXPORT_HEADER_INCLUDE_DIR}/${EXPORT_HEADER_GROUP}"
66 set(EXPORT_HEADER_DESTINATION ${EXPORT_HEADER_GROUP}/${EXPORT_HEADER_DESTINATION})
69 # check that the directory exists otherwise create it
70 if (NOT EXISTS ${EXPORT_HEADER_INCLUDE_DIR}/${EXPORT_HEADER_DESTINATION})
71 add_custom_command(TARGET ${EXPORT_HEADER_COMPONENT}
73 COMMAND ${CMAKE_COMMAND} -E make_directory ${EXPORT_HEADER_INCLUDE_DIR}/${EXPORT_HEADER_DESTINATION}
74 COMMENT
"Creating build-time include dir ${EXPORT_HEADER_INCLUDE_DIR}/${EXPORT_HEADER_DESTINATION}"
79 # check the SUBDIRECTORY parameter
80 if(EXPORT_HEADER_SUBDIRECTORY)
81 set(EXPORT_HEADER_DESTINATION ${EXPORT_HEADER_DESTINATION}/${EXPORT_HEADER_SUBDIRECTORY})
82 # create subdirectory
if it does not exists
83 if (NOT EXISTS ${EXPORT_HEADER_INCLUDE_DIR}/${EXPORT_HEADER_DESTINATION})
84 add_custom_command(TARGET ${EXPORT_HEADER_COMPONENT}
86 COMMAND ${CMAKE_COMMAND} -E make_directory ${EXPORT_HEADER_INCLUDE_DIR}/${EXPORT_HEADER_DESTINATION}
87 COMMENT
"Creating build-time include subdir ${EXPORT_HEADER_INCLUDE_DIR}/${EXPORT_HEADER_DESTINATION}"
94 # at build time, copy the files to build directory include files when the target is built
95 foreach(HEADER ${EXPORT_HEADER_DEFAULT_ARGS})
96 # check
if file name is relative or not
97 set(FILE_TO_COPY ${HEADER})
99 # copy after build, only
if there was a change
100 add_custom_command(TARGET ${EXPORT_HEADER_COMPONENT}
102 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FILE_TO_COPY} ${EXPORT_HEADER_INCLUDE_DIR}/${EXPORT_HEADER_DESTINATION}/
103 COMMENT
"Installing build-time header ${HEADER}"
104 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
109 # during installation, copy the files to install directory
110 install(FILES ${EXPORT_HEADER_DEFAULT_ARGS}
111 # DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${CAMITK_SHORT_VERSION_STRING}/${EXPORT_HEADER_DESTINATION}/
112 DESTINATION
include/${CAMITK_SHORT_VERSION_STRING}/${EXPORT_HEADER_DESTINATION}/
OpenCVConfig cmake include("${OpenCV_DIR}/OpenCVConfig.cmake") set(CVLIB_SUFFIX"$
Definition: FindOpenCV.cmake:71
config endif() if(EXISTS"$
Definition: FindCamiTK.cmake:76
set(CAMITK_TEST_PLATEFORM ${Plateform}) set(CAMITK_SVN_SUBDIR $
Definition: CamiTKTestBuildMacros.cmake:15
export_headers()
export_headers is a macro that install header files at build and install time
Definition: ExportHeaders.h:40
COMPONENT
Definition: CamiTKSubProjectAdd.cmake:19
CamiTK CamiTKDir txt file(STRINGS"${FIND_CAMITK_USER_BASE_DIR}/CamiTK/CamiTKDir.txt"FIND_CAMITK_USER_DIR_LAST_INSTALL) endif() find_program(CAMITK_CONFIG_EXECUTABLE NAMES camitk-config-debug camitk-config PATH_SUFFIXES"bin"PATHS"$
Definition: FindCamiTK.cmake:80
EXTENSION_NAME parse_arguments(${EXTENSION_NAME_CMAKE}#prefix"NEEDS_TOOL;NEEDS_CEP_LIBRARIES;NEEDS_COMPONENT_EXTENSION;NEEDS_ACTION_EXTENSION;INCLUDE_DIRECTORIES;EXTERNAL_LIBRARIES;HEADERS_TO_INSTALL;DEFINES;CXX_FLAGS;EXTERNAL_SOURCES;TARGET_NAME;CEP_NAME;DESCRIPTION;TEST_APPLICATION"#possible lists"NEEDS_QT_MODULES;ACTION_EXTENSION;COMPONENT_EXTENSION;DISABLED;NEEDS_XERCESC;NEEDS_ITK;NEEDS_LIBXML2;NEEDS_XSD;NEEDS_QTXML;NEEDS_OPENCV;NEEDS_IGSTK;INSTALL_ALL_HEADERS;NEEDS_GDCM;"#possible options ${ARGN}) if($
Definition: CamiTKExtension.cmake:82