68 #########################################################################
72 # * Use
a macro to create the CMAKE variables according to the #
73 # provided options as input. #
75 #########################################################################
79 set(options SHARED STATIC NEEDS_CAMITKCORE NEEDS_ITK NEEDS_LIBXML2 NEEDS_XERCESC NEEDS_XSD NEEDS_QT PUBLIC)
80 set(oneValueArgs LIBNAME CEP_NAME DESCRIPTION)
81 set(multiValueArgs SOURCES NEEDS_CEP_LIBRARIES EXTERNAL_LIBRARIES INCLUDE_DIRECTORIES DEFINES LINK_DIRECTORIES HEADERS_TO_INSTALL EXTRA_TRANSLATE_LANGUAGE CXX_FLAGS)
82 cmake_parse_arguments(${DEFAULT_LIBRARY_NAME_CMAKE}
"${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
85 #########################################################################
87 # Consider moc sources files #
89 # *
if you use Q_OBJECT in your classes #
91 #########################################################################
92 file(GLOB_RECURSE MOC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/moc_*.cxx)
93 set(${DEFAULT_LIBRARY_NAME_CMAKE}_SOURCES ${${DEFAULT_LIBRARY_NAME_CMAKE}_SOURCES} ${MOC_SRCS})
96 #########################################################################
98 # CREATE CMAKE VARIABLES #
100 # * Create required and useful
CMake variables
for the macro #
102 #########################################################################
105 # The target name is composed of the following: library-name
106 # * library is the suffix
107 # * name is deduced from the input folder containing the calling CMakeLists.txt file of the extension.
108 #
"-" is replaced by
"_" if configuring
for packaging with NSIS, the program to create
a Windows installer.
110 if (
"${${DEFAULT_LIBRARY_NAME_CMAKE}_LIBNAME}" STREQUAL
"")
111 set(LIBRARY_TARGET_NAME library_${DEFAULT_LIBRARY_NAME})
113 set(LIBRARY_TARGET_NAME library_${${DEFAULT_LIBRARY_NAME_CMAKE}_LIBNAME})
116 if (
"${${DEFAULT_LIBRARY_NAME_CMAKE}_LIBNAME}" STREQUAL
"")
117 set(LIBRARY_TARGET_NAME library-${DEFAULT_LIBRARY_NAME})
119 set(LIBRARY_TARGET_NAME library-${${DEFAULT_LIBRARY_NAME_CMAKE}_LIBNAME})
125 ######################################################################### 127 # INCLUDE DIRECTORIES # 129 # * Include library directories where to look for header files # 130 # * Include also additional user provided directories # 131 # * These directories are used for compilation step # 133 ######################################################################### 136 include_directories(${CAMITK_INCLUDE_DIRECTORIES})
137 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
138 include_directories(${CMAKE_CURRENT_BINARY_DIR})
140 # USER PROVIDED ADDITIONAL DIRECTORIEs
141 include_directories(${${DEFAULT_LIBRARY_NAME_CMAKE}_INCLUDE_DIRECTORIES})
145 #########################################################################
149 # * On Windows, Visual Studio, group .moc and .ui files #
150 # in subdirectories #
152 #########################################################################
154 source_group(
"Source Files\\Moc Files" "moc_*")
155 source_group(
"Source Files\\CLI Files" "CommandLineOptions.*")
156 source_group(
"Header Files\\UI Files" "ui_*.h")
157 source_group(
"Source Files\\Resources Files" "qrc_*")
158 source_group(
"Source Files\\Resources Files" "*.qrc")
159 source_group(
"UI Files" "*.ui")
164 ######################################################################### 166 # ADDITIONAL KNOWN LIBRARY DEPENDENCIES # 168 # * Look for specific library needed # 169 # * Specific libraries are specified as option with the # 170 # NEEDS_LIBRARY syntax (see macro syntax for more options) # 171 # * Backward compatibility : Warn user if using old NEEDS_TOOL syntax # 173 ######################################################################### 176 set(ITK_LIBRARIES
"")
177 if(${DEFAULT_LIBRARY_NAME_CMAKE}_NEEDS_ITK)
178 find_package(ITK REQUIRED)
181 set(ITK_VERSION ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}) #ITK_VERSION is not always
set 182 set(CAMITK_ITK_VERSION ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR})
183 message(STATUS
"${${DEFAULT_LIBRARY_NAME_CMAKE}_TARGET_NAME}: Found ITK version ${ITK_VERSION}")
185 if ((${ITK_VERSION} VERSION_GREATER
"4") AND (${ITK_VERSION} VERSION_LESS
"5")) # ITK 4.9 on Windows, maybe
a lesser version
for Linux.
187 set(ITK_DIR ${ITK_DIR}/../..)
188 # Construct list of ITK libraries
for linking = CAMITK_ITK_LIBRARIES
189 foreach(ITK_LIBRARY ${ITK_LIBRARIES})
190 string(SUBSTRING ${ITK_LIBRARY} 0 3 ${ITK_LIBRARY}_PREFIX)
191 # Some libraries have not the expected
'itk' prefix. Add it then
192 if((NOT ${${ITK_LIBRARY}_PREFIX} STREQUAL
"itk") AND (NOT ${${ITK_LIBRARY}_PREFIX} STREQUAL
"ITK"))
193 set(ITK_LIBRARY
itk${ITK_LIBRARY})
195 list(APPEND CAMITK_ITK_LIBRARIES debug ${ITK_DIR}/${ITK_LIBRARY}-${CAMITK_ITK_VERSION}${CAMITK_DEBUG_POSTFIX}.lib
196 optimized ${ITK_DIR}/${ITK_LIBRARY}-${CAMITK_ITK_VERSION}.lib
200 set(CAMITK_ITK_LIBRARIES ${ITK_LIBRARIES})
202 message(WARNING
"CamiTKExtension.cmake: ITK LIBRARY NOT SET FOR APPLE")
205 message(FATAL_ERROR
"Wrong version of ITK : ${ITK_VERSION}. Required is at least 4.x to 4.9")
208 message(FATAL_ERROR
"ITK not found but required for ${${DEFAULT_LIBRARY_NAME_CMAKE}_TARGET_NAME}")
213 set(LIBXML2_LIBRARY
"")
214 if(${DEFAULT_LIBRARY_NAME_CMAKE}_NEEDS_LIBXML2)
215 # LibXml2 is required
218 add_definitions(${LIBXML2_DEFINITIONS})
219 include_directories(${LIBXML2_INCLUDE_DIR})
220 set(LIBXML2_LIBRARY ${LIBXML2_LIBRARIES})
222 # most probably win32 or crosscompiling 223 message(WARNING
"${LIBRARY_TARGET_NAME}: libxml2 required")
228 set(XERCESC_LIBRARIES)
229 if(${DEFAULT_LIBRARY_NAME_CMAKE}_NEEDS_XERCESC)
230 # XercesC is required
231 find_package(XercesC REQUIRED)
233 include_directories(${XERCESC_INCLUDE_DIR})
234 set(XERCESC_LIBRARIES ${XERCESC_LIBRARY})
236 # most probably win32 or crosscompiling 237 message(FATAL_ERROR
"${DEFAULT_LIBRARY_NAME}: xerces-c required. Please provide Xerces-C path.")
242 if(${DEFAULT_LIBRARY_NAME_CMAKE}_NEEDS_XSD)
243 # XercesC is required
244 find_package(XercesC REQUIRED)
246 include_directories(${XERCESC_INCLUDE_DIR})
247 set(XERCESC_LIBRARIES ${XERCESC_LIBRARY})
248 find_package(XSD REQUIRED)
249 include_directories(${XSD_INCLUDE_DIR})
251 # most probably win32 or crosscompiling 252 message(FATAL_ERROR
"${LIBRARY_TARGET_NAME}: xerces-c required because of XSD cxx, please set XERCESC_INCLUDE_DIR")
257 if(${DEFAULT_LIBRARY_NAME_CMAKE}_NEEDS_QT)
258 # Instruct
CMake to run moc automatically when needed.
259 set(CMAKE_AUTOMOC ON)
261 set(QT_COMPONENTS Core Gui Xml XmlPatterns Widgets Help UiTools OpenGL OpenGLExtensions Test)
262 find_package(Qt5 COMPONENTS ${QT_COMPONENTS} REQUIRED)
264 # cmake_policy(SET CMP0020 NEW) # policy for Qt core linking to qtmain.lib 265 message(STATUS
"${LIBRARY_TARGET_NAME}: found Qt ${Qt5_VERSION}.")
266 set(QT_INCLUDE_DIRS ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5XmlPatterns_INCLUDE_DIRS} ${Qt5Declarative_INCLUDE_DIRS} ${Qt5Help_INCLUDE_DIRS} ${Qt5UiTools_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} ${Qt5OpenGLExtensions_INCLUDE_DIRS})
267 include_directories(${QT_INCLUDE_DIRS})
269 message(SEND_ERROR
"${LIBRARY_TARGET_NAME}: Failed to find Qt 5.x. This is needed by ${LIBRARY_TARGET_NAME}.")
273 # EXTERNAL DEPENDENCIES 274 set(LINKER_EXTERNAL_LIBRARIES)
275 if(${DEFAULT_LIBRARY_NAME_CMAKE}_EXTERNAL_LIBRARIES)
276 foreach(EXTERNAL_LIBRARY ${${DEFAULT_LIBRARY_NAME_CMAKE}_EXTERNAL_LIBRARIES})
278 set(LINKER_EXTERNAL_LIBRARIES ${LINKER_EXTERNAL_LIBRARIES}
279 debug ${EXTERNAL_LIBRARY}${CAMITK_DEBUG_POSTFIX}.lib
280 optimized ${EXTERNAL_LIBRARY}.lib
282 message(STATUS
"LINKER_EXTERNAL_LIBRARIES = ${LINKER_EXTERNAL_LIBRARIES}")
284 set(LINKER_EXTERNAL_LIBRARIES ${LINKER_EXTERNAL_LIBRARIES} ${EXTERNAL_LIBRARY})
291 ######################################################################### 295 # * Link directories are used to indicate the compiler where # 296 # to look for folder containing libraries to link with. # 297 # * Additional link directories provided by the user # 299 ######################################################################### 300 # CAMITK BASIC LIB DIRECTORIES 301 link_directories(${CAMITK_LINK_DIRECTORIES})
303 # ADDITIONAL LINK DIRECTORIES
304 if (NOT
"${${DEFAULT_LIBRARY_NAME_CMAKE}_LINK_DIRECTORIES}" STREQUAL
"")
305 link_directories(${${DEFAULT_LIBRARY_NAME_CMAKE}_LINK_DIRECTORIES})
310 ######################################################################### 312 # TARGET COMPILATION DEFINITION # 314 # * Additional sources files to consider at compilation (.cpp) # 315 # * CMake project target definition depending on library type # 318 ######################################################################### 319 # CMAKE TARGET DEFINITION DEPENDENDING ON THE LIBRARY TYPE (SHARED or STATIC) 320 if (${DEFAULT_LIBRARY_NAME_CMAKE}_SHARED) # shared library
321 message(STATUS
"Building shared library: ${LIBRARY_TARGET_NAME}")
322 add_library(${LIBRARY_TARGET_NAME} SHARED ${${DEFAULT_LIBRARY_NAME_CMAKE}_SOURCES})
323 # prepare the library specific info (SONAME...)
324 set(${LIBRARY_TARGET_NAME}_LIBRARY_PROPERTIES ${${LIBRARY_TARGET_NAME}_LIBRARY_PROPERTIES}
325 VERSION
"${CAMITK_VERSION_MAJOR}.${CAMITK_VERSION_MINOR}.${CAMITK_VERSION_PATCH}" 326 SOVERSION
"${CAMITK_VERSION_MAJOR}" 329 set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES ${${LIBRARY_TARGET_NAME}_LIBRARY_PROPERTIES} LINK_INTERFACE_LIBRARIES
"")
330 elseif (${DEFAULT_LIBRARY_NAME_CMAKE}_STATIC) #
static library
331 message(STATUS
"Building static library: ${LIBRARY_TARGET_NAME}")
332 add_library(${LIBRARY_TARGET_NAME} STATIC ${${DEFAULT_LIBRARY_NAME_CMAKE}_SOURCES})
334 message(FATAL_ERROR
"In adding static library ${LIBRARY_TARGET_NAME}.\n Please specify the library type: SHARED or STATIC")
339 ######################################################################### 341 # QT LINKING LIBRARIES # 343 # * Set linking modules for the Qt5 libraries # 345 ######################################################################### 346 if(${DEFAULT_LIBRARY_NAME_CMAKE}_NEEDS_QT)
347 qt5_use_modules(${LIBRARY_TARGET_NAME} ${QT_COMPONENTS})
351 ######################################################################### 353 # CAMITK CORE LIBRARIES # 355 # * If a library build on top of CamiTKCore add required dependencies # 357 ######################################################################### 358 # Check if camitk core is needed 359 if (${DEFAULT_LIBRARY_NAME_CMAKE}_NEEDS_CAMITKCORE)
360 set(CAMITK_LIBRARIES_DEPENDENCIES ${CAMITK_CORE_LIBRARIES} ${CAMITK_LIBRARIES})
364 ######################################################################### 366 # CAMITK LIBRARIES DEPENDENCIES # 368 # * Add in this section library dependencies to other camitk libraies # 369 # to keep a correct build order (NEEDS_CEP_LIBRARIES). # 371 ######################################################################### 373 # CEP LIBRARIES DEPENDENCIES 375 set(LIBRARIES_DEPENDENCY_LIST
"") #use
for generating the project.xml file
376 if(${DEFAULT_LIBRARY_NAME_CMAKE}_NEEDS_CEP_LIBRARIES)
377 foreach(CEP_LIBRARY_NEEDED ${${DEFAULT_LIBRARY_NAME_CMAKE}_NEEDS_CEP_LIBRARIES})
378 #
include directories from build,
camitk (local or global install).
379 include_directories(${CAMITK_BUILD_INCLUDE_DIR}/libraries/${CEP_LIBRARY_NEEDED})
380 include_directories(${CAMITK_INCLUDE_DIR}/libraries/${CEP_LIBRARY_NEEDED})
383 list(APPEND CEP_LIBRARIES debug ${CEP_LIBRARY_NEEDED}${CAMITK_DEBUG_POSTFIX}.lib
384 optimized ${CEP_LIBRARY_NEEDED}
387 list(APPEND CEP_LIBRARIES ${CEP_LIBRARY_NEEDED})
389 # CMake / CDash dependencies 391 add_dependencies(${LIBRARY_TARGET_NAME} library_${CEP_LIBRARY_NEEDED})
392 # add the dependency to the library automoc target
393 set_property(TARGET ${LIBRARY_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS library_${CEP_LIBRARY_NEEDED})
395 add_dependencies(${LIBRARY_TARGET_NAME} library-${CEP_LIBRARY_NEEDED})
396 list(APPEND library-${CEP_LIBRARY_NEEDED})
397 # add the dependency to the library automoc target
398 set_property(TARGET ${LIBRARY_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS library-${CEP_LIBRARY_NEEDED})
405 ######################################################################### 409 # * Linking is the last stage of compilation # 410 # * Indicate what libraries to use for linking the target # 412 ######################################################################### 414 target_link_libraries(${LIBRARY_TARGET_NAME} ${CAMITK_LIBRARIES_DEPENDENCIES} ${CEP_LIBRARIES} ${LINKER_EXTERNAL_LIBRARIES} ${LIBXML2_LIBRARY} ${CAMITK_ITK_LIBRARIES} ${XERCESC_LIBRARIES})
418 #########################################################################
422 # * Define the output directory (location and name)
# 423 # * Define the output name of the library # 424 # * Add ${CAMITK_DEBUG_POSTFIX} suffix to Debug MSVC built libraries # 426 ######################################################################### 428 # OUTPUT DIRECTORY LOCATION and NAME depending on the type of the library (PUBLIC or PRIVATE) 429 # DEBGUG POSTFIX FOR MSVC 430 if (${DEFAULT_LIBRARY_NAME_CMAKE}_PUBLIC) # Public library => build in the bin folder
432 # With Visual Studio, public libraries are built in build\bin directory, else it's in build\lib 433 set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CAMITK_BUILD_BIN_DIR}
434 LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_BIN_DIR}
435 LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_BIN_DIR}
437 set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CAMITK_BUILD_BIN_DIR}
438 RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_BIN_DIR}
439 RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_BIN_DIR}
441 set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CAMITK_BUILD_BIN_DIR}
442 ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_BIN_DIR}
443 ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_BIN_DIR}
445 set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES DEBUG_POSTFIX ${CAMITK_DEBUG_POSTFIX})
447 # for xcode generation, the <CONFIG> postfix should also be used, but "a la" UNIX (lib in /lib etc...) 448 # no need to check the generator with if(CMAKE_GENERATOR STREQUAL Xcode), as the <CONFIG> postfix should 449 # not affect the other unix generators 450 set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CAMITK_BUILD_PUBLIC_LIB_DIR}
451 LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_PUBLIC_LIB_DIR}
452 LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_PUBLIC_LIB_DIR}
454 set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CAMITK_BUILD_PUBLIC_LIB_DIR}
455 RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_PUBLIC_LIB_DIR}
456 RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_PUBLIC_LIB_DIR}
458 set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CAMITK_BUILD_PUBLIC_LIB_DIR}
459 ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_PUBLIC_LIB_DIR}
460 ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_PUBLIC_LIB_DIR}
463 else() # Private library => build in lib folder
465 set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES DEBUG_POSTFIX ${CAMITK_DEBUG_POSTFIX})
467 set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CAMITK_BUILD_PRIVATE_LIB_DIR}
468 LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_PRIVATE_LIB_DIR}
469 LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_PRIVATE_LIB_DIR}
471 set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CAMITK_BUILD_PRIVATE_LIB_DIR}
472 RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_PRIVATE_LIB_DIR}
473 RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_PRIVATE_LIB_DIR}
475 set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CAMITK_BUILD_PRIVATE_LIB_DIR}
476 ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_PRIVATE_LIB_DIR}
477 ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_PRIVATE_LIB_DIR}
481 # OUTUPUT LIBRARY NAME (without the prefix "library-"). 482 string(REGEX REPLACE
"^library_|^library-" "" LIBRARY_NAME
"${LIBRARY_TARGET_NAME}")
483 set_target_properties(${LIBRARY_TARGET_NAME}
484 PROPERTIES OUTPUT_NAME ${LIBRARY_NAME}
489 #########################################################################
493 # * Flags are options to give to the compiler #
494 # * Add user input flags #
495 # * Add platform specific flags #
497 #########################################################################
499 # USER INPUT COMPILER FLAG
500 if(${DEFAULT_LIBRARY_NAME_CMAKE}_DEFINES)
501 foreach (FLAG ${${DEFAULT_LIBRARY_NAME_CMAKE}_DEFINES})
502 add_definitions(-D${FLAG})
506 # USER INPUT CUSTOM COMPILER FLAG 507 if(${DEFAULT_LIBRARY_NAME_CMAKE}_CXX_FLAGS)
508 foreach (FLAG ${${DEFAULT_LIBRARY_NAME_CMAKE}_CXX_FLAGS})
509 set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${FLAG}")
513 # PLATFORM SPECIFIC COMPILER FLAG 514 # 64bits and other platform with relocation needs -fPIC 516 check_cxx_accepts_flag(-fPIC FPIC_FLAG_ACCEPTED)
517 # no need to add -fPIC on mingw, otherwise it generates a warning: -fPIC ignored for target (all code is position independent) [enabled by default] 518 # msvc is also accepting the flag, but then produce warning D9002 : ignoring unknown option '-fPIC' cl 519 if(FPIC_FLAG_ACCEPTED AND NOT WIN32)
520 set_property(TARGET ${LIBRARY_TARGET_NAME} APPEND PROPERTY COMPILE_FLAGS -fPIC)
525 ######################################################################### 529 # * When installing the project, header files (.h) and test data are # 530 # copied into an installation folder to determine. # 531 # * Indicate in this section, where to install your project and which # 532 # files to copy into that folder (during local/global installation) # 534 ######################################################################### 536 # FOLDER INSTALLATION 537 # Indicate where to install the library, dependending on its property (public / private) 538 if (${DEFAULT_LIBRARY_NAME_CMAKE}_PUBLIC) #
public library
540 # public library -> install in bin folder 541 install(TARGETS ${LIBRARY_TARGET_NAME}
542 RUNTIME DESTINATION bin
543 LIBRARY DESTINATION lib
544 ARCHIVE DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}
545 COMPONENT ${LIBRARY_NAME_INSTALL}
548 # other public libraries -> install in lib folder 549 install(TARGETS ${LIBRARY_TARGET_NAME}
550 RUNTIME DESTINATION lib
551 LIBRARY DESTINATION lib
552 ARCHIVE DESTINATION lib
553 COMPONENT ${LIBRARY_NAME_INSTALL}
557 # private library -> install in lib/camitk-version folder 558 install(TARGETS ${LIBRARY_TARGET_NAME}
559 RUNTIME DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}
560 LIBRARY DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}
561 ARCHIVE DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}
562 COMPONENT ${LIBRARY_NAME_INSTALL}
566 # HEADER FILES (.h) INSTALLATION 567 if(${DEFAULT_LIBRARY_NAME_CMAKE}_HEADERS_TO_INSTALL)
568 # If headers information provided
for installation => install them
569 export_headers(${${DEFAULT_LIBRARY_NAME_CMAKE}_HEADERS_TO_INSTALL} COMPONENT ${LIBRARY_TARGET_NAME} GROUP libraries)
571 # By default, install all headers and keep include directories structure 577 ######################################################################### 579 # CDASH SUBPROJECT DESCRIPTION # 581 # * Update the XML descriton of the subprojects dependencies # 584 ######################################################################### 585 # CDASH XML SUBPROJECTS DESCRIPTION UPDATE 586 if(LIBRARY_TARGET_NAME STREQUAL
"library-qtpropertybrowser")
587 # library-qtpropertybrowser is a corelib as library-camitkcore depends on it 595 ##################################################################################### 599 # * CAMITK_TRANSLATIONS contains the list of language to translate # 602 # * Create the translate.pro file which contains 4 sections: # 603 # - HEADERS: list of .h/.hpp files to look for tr("") QString # 604 # - SOURCES: list of .cpp files to look for tr("") QString # 605 # - FORMS: list of .ui files to look for tr("") QString # 606 # - TRANSLATIONS: list of .ts files which use CAMITK_TRANSLATIONS # 607 # to define each .ts file # 609 # * Execute lupdate program to update the .ts files with new QString # 612 # * Execute lrelease program to create .qm files (binary equivalent of # 615 # * Create translate.qrc which contains the list of .qm files. # 616 # * Create the flags.qrc file which contains the list of .png flags # 619 ##################################################################################### 621 if(${DEFAULT_LIBRARY_NAME_CMAKE}_EXTRA_TRANSLATE_LANGUAGE)
622 camitk_translate(EXTRA_LANGUAGE ${${DEFAULT_LIBRARY_NAME_CMAKE}_EXTRA_TRANSLATE_LANGUAGE})
630 ######################################################################### 632 # PACKAGING CATEGORIZATION # 634 # * On Windows, when building a package (win32 installer), the # 635 # install shield wizard proposes you to select which component # 637 # * Each component to install has a short description following its # 638 # name to understand its role. # 639 # * This section deals with the categorization and the description # 640 # of the component in this installer. # 642 ######################################################################### 644 # WINDOWS INSTALLER CATEGORIZATION 645 if(${DEFAULT_LIBRARY_NAME_CMAKE}_CEP_NAME) # This input variable describes the category
646 if (${DEFAULT_LIBRARY_NAME_CMAKE}_CEP_NAME MATCHES
"SDK")
647 # The
default SDK extensions are categorized as
"required" and are not
"unselectable" by the user at installation time
648 cpack_add_component(${LIBRARY_TARGET_NAME}
649 DISPLAY_NAME ${LIBRARY_TARGET_NAME}
650 DESCRIPTION ${${DEFAULT_LIBRARY_NAME_CMAKE}_DESCRIPTION}
656 # Extension is selectable for installation in the wizard of the installer 657 cpack_add_component(${LIBRARY_TARGET_NAME}
658 DISPLAY_NAME ${LIBRARY_TARGET_NAME}
659 DESCRIPTION ${${DEFAULT_LIBRARY_NAME_CMAKE}_DESCRIPTION}
660 GROUP ${${DEFAULT_LIBRARY_NAME_CMAKE}_CEP_NAME}
664 # Extension if not categorized for packaging presentation 665 cpack_add_component(${LIBRARY_TARGET_NAME}
666 DISPLAY_NAME ${LIBRARY_TARGET_NAME}
667 DESCRIPTION ${${DEFAULT_LIBRARY_NAME_CMAKE}_DESCRIPTION}
A pseudo-namespace used to group CMake macros and functions.
Definition: itkImageToVTKImageFilter.h:39
get_directory_name()
macro get_directory_name set the variable VariableName to the name of the last directory of FullPathD...
Definition: GetDirectoryName.h:14
camitk_translate()
macro camitk_translate allows to perform the translation of any project (action, component, application and libraries) in several languages.
Definition: CamiTKTranslate.h:16
Definition: Action.cpp:36
cmake modules macros camitk test endif() add_custom_target(camitk-ce-iwyu COMMAND $
Definition: CamiTKIncludeWhatYouUse.h:37
export_headers()
export_headers is a macro that install header files at build and install time
Definition: ExportHeaders.h:40
camitk_install_all_headers()
camitk_install_all_headers is a macro that install all header files of a project at build and install...
Definition: CamiTKInstallAllHeaders.h:42
camitk_library()
macro camitk_library simplifies the declaration of a library inside CamiTK and is to be used for all ...
Definition: CamiTKLibrary.h:66
camitk_register_subproject()
macro camitk_register_subproject adds a subproject definition for the CDash report ...
Definition: CamiTKAddSubProject.h:45
if(${CMAKE_VERSION} VERSION_GREATER "3.3" OR ${CMAKE_VERSION} VERSION_EQUAL "3.3") option(CAMITK_INCLUDE_WHAT_YOU_USE "Enable the header analysis on you code
static void include(QRect &r, const QRect &rect)
Definition: canvas_typed/qtcanvas.cpp:98