Commit 5922a4d0 authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED rationalized CMake target names

All the CMake targets created by CamiTK now starts with `camitk` and words are separated
using `-` (dash) instead of `_` (underscore).
For instance `sdk_local_install` became `camitk-sdk-local-install`
All CEP CMake general targets now start with `cep-nameOfCep`.
parent a48a828c
......@@ -73,7 +73,7 @@ set(PYSIDE_INCLUDE_ALL_DIR_SHIBOKEN
# information in order to convert it into a CPython extension
# Shiboken parses the typesystem.xml files to detect which C++ classes to expose to Python
# For each of them, it create a CPython C++ decorated class in the build directory
add_custom_target( sdk_wrap_to_python
add_custom_target( camitk-sdk-wrap-to-python
# OUTPUT ${lib_python_SRC}
COMMAND ${CMAKE_COMMAND} -E echo "Cleaning C++ classes generated from previous wrapping."
COMMAND ${CMAKE_COMMAND} -E remove_directory camitk_sdk
......@@ -100,7 +100,7 @@ file(GLOB_RECURSE CAMITK_SDK_LIBRARIES ${CMAKE_BINARY_DIR}/*.so)
# This CMake target aims at compiling the C++ Python-wrapped classes of CamiTK and link them against
# the original CamiTK SDK libraries.
# WARNING Do not manually run this target, it requires another configure step wich is run by the sdk_package_to_python
# WARNING Do not manually run this target, it requires another configure step wich is run by the camitk-sdk-package-to-python
# CMake target.
if(NOT SDK_WRAPPED_CLASSES STREQUAL "") # only create camitk_sdk target if camitk sdk has been wrapped
set(PROJECT_NAME camitk_sdk) # the name of the camitk sdk package once compiled
......@@ -130,14 +130,14 @@ endif()
# Create the Python package of CamiTK SDK
# This package is compiled from the generated C++ classes of the sdk_wrap_to_python target
# This package is compiled from the generated C++ classes of the camitk-sdk-wrap-to-python target
# and link against the CamiTK SDK libraries.
# Build the custom sdk_package_to_python target in order to compile the wrapped C++ classes and link against
# Build the custom camitk-sdk-package-to-python target in order to compile the wrapped C++ classes and link against
# CamiTK SDK dynamic libraries.
add_custom_target( sdk_package_to_python
add_custom_target( camitk-sdk-package-to-python
COMMAND ${CMAKE_COMMAND} -E echo "Creating Python package of CamiTK SDK."
COMMAND ${CMAKE_COMMAND} ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target camitk_sdk
COMMAND ${CMAKE_COMMAND} -E echo "CamiTK SDK Python package created."
)
add_dependencies(sdk_package_to_python sdk_wrap_to_python) # need to wrapp before creating the package
add_dependencies(camitk-sdk-package-to-python camitk-sdk-wrap-to-python) # need to wrapp before creating the package
......@@ -26,25 +26,25 @@ endif()
# include global install of SDK
# This is a SDK build => global install is done in CMAKE_INSTALL_PREFIX
add_custom_target(sdk_global_install
add_custom_target(camitk-sdk-global-install
COMMAND ${CMAKE_COMMAND} -E echo "Global Installation in ${CMAKE_INSTALL_PREFIX}"
# First remove the WIN32 system runtime libraries dependencies
COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS:STRING=" " ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E echo "Configuration for ${CMAKE_INSTALL_PREFIX} done."
# Second cmake to install
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target install --config ${CMAKE_CFG_INTDIR}
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target sdk_copy_camitkdirtxt --config ${CMAKE_CFG_INTDIR}
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target camitk-sdk-copy-camitkdirtxt --config ${CMAKE_CFG_INTDIR}
COMMAND ${CMAKE_COMMAND} -E echo "File installation done."
COMMAND ${CMAKE_COMMAND} -E echo "Global installation in ${CMAKE_INSTALL_PREFIX} done."
COMMENT "Global installation"
)
# The definition of SDK_TOP_LEVEL_SOURCE_DIR and SDK_TOP_LEVEL_BINARY_DIR are
# are needed to store the current source dir to pass as an argument to the ConfigureCamiTKDirTxt.cmake script in sdk_copy_camitkdirtxt
# are needed to store the current source dir to pass as an argument to the ConfigureCamiTKDirTxt.cmake script in camitk-sdk-copy-camitkdirtxt
set(SDK_TOP_LEVEL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(SDK_TOP_LEVEL_BINARY_DIR ${CMAKE_BINARY_DIR})
# specific top-level target that prepare and copy the CamiTKDir.txt file in ${CAMITK_USER_DIR}
add_custom_target(sdk_copy_camitkdirtxt
add_custom_target(camitk-sdk-copy-camitkdirtxt
# prepare the CamiTKConfig.cmake for installation
COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DCAMITK_USER_DIR=${CAMITK_USER_DIR}
......@@ -60,23 +60,23 @@ add_custom_target(sdk_copy_camitkdirtxt
COMMAND ${CMAKE_COMMAND} -E echo "CamiTKDir.txt [${CMAKE_INSTALL_PREFIX}] copied in ${CAMITK_USER_DIR}"
)
# camitk_local_install == install in User Config directory
add_custom_target(sdk_local_install
# camitk-sdk-local-install == install in User Config directory
add_custom_target(camitk-sdk-local-install
COMMAND ${CMAKE_COMMAND} -E echo "Local Installation in ${CAMITK_USER_DIR}"
# First cmake to redefine install prefix
COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CAMITK_USER_DIR} ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E echo "Configuration for ${CMAKE_INSTALL_PREFIX} done."
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target install --config ${CMAKE_CFG_INTDIR}
COMMAND ${CMAKE_COMMAND} -E echo "File installation done."
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target sdk_copy_camitkdirtxt --config ${CMAKE_CFG_INTDIR}
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target camitk-sdk-copy-camitkdirtxt --config ${CMAKE_CFG_INTDIR}
COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E echo "Local Installation in ${CAMITK_USER_DIR} done."
COMMENT "Local installation"
)
# camitk_update_translate == configure all the .qrc files for the different extensions of the SDK.
# camitk-sdk-update-translate == configure all the .qrc files for the different extensions of the SDK.
# .qrc files consider up to date .ts resources files for translation
add_custom_target(sdk_updatetranslate
add_custom_target(camitk-sdk-update-translate
COMMAND ${CMAKE_COMMAND} -E echo "Updating translation for CamiTK SDK"
COMMAND ${CMAKE_COMMAND} -DCAMITK_TRANSLATE=TRUE ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -DCAMITK_TRANSLATE=FALSE ${CMAKE_BINARY_DIR}
......@@ -85,7 +85,7 @@ add_custom_target(sdk_updatetranslate
# make sure a copy of the CamiTKDir.txt file is written to ${CAMITK_USER_DIR}
# even if the user is just invoking the "install" target (from the IDE or command line)
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target sdk_copy_camitkdirtxt)")
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target camitk-sdk-copy-camitkdirtxt)")
# include CamiTK auto-documentation generation
include(CamiTKApiDoc)
......
# CMake script to configure CamiTKDir.txt at installation time (executed by top-level target "sdk_copy_camitkdirtxt", see CMakeLists.txt)
# CMake script to configure CamiTKDir.txt at installation time (executed by top-level target "camitk-sdk-copy-camitkdirtxt", see CMakeLists.txt)
message(STATUS "Updating CamiTKDir.txt in User Config Directory [${CAMITK_USER_DIR}] to [${CMAKE_INSTALL_PREFIX}]")
configure_file(${SDK_TOP_LEVEL_SOURCE_DIR}/CamiTKDir.txt.in ${SDK_TOP_LEVEL_BINARY_DIR}/CamiTKDir.txt @ONLY)
\ No newline at end of file
......@@ -207,7 +207,7 @@ while (${CTEST_ELAPSED_TIME} LESS ${CONTINUOUS_BUILD_DURATION})
ctest_submit(PARTS Coverage)
# Install locally this build version of CamiTK
set(CTEST_BUILD_TARGET sdk_local_install)
set(CTEST_BUILD_TARGET camitk-sdk-local-install)
ctest_build()
ctest_submit(PARTS Install)
......
......@@ -170,6 +170,11 @@ foreach(subproject ${CAMITK_SUBPROJECTS})
ctest_submit(PARTS Build)
endforeach()
# build the api-doc
set(CTEST_BUILD_TARGET camitk-api-doc)
ctest_build()
# TODO zip it and download it on the website every so often (as `develop api-doc`)
# now that everything is build, run all the tests
foreach(subproject ${CAMITK_SUBPROJECTS})
# Run tests
......@@ -195,7 +200,7 @@ ctest_coverage()
ctest_submit(PARTS Coverage)
# Install locally this build version of CamiTK
set(CTEST_BUILD_TARGET sdk_local_install)
set(CTEST_BUILD_TARGET camitk-sdk-local-install)
ctest_build()
ctest_submit(PARTS Install)
......
......@@ -149,13 +149,13 @@ ctest_submit(PARTS Build)
set_property(GLOBAL PROPERTY SubProject package-source)
set_property(GLOBAL PROPERTY Label package-source)
# Package CamiTK and send the report.
set(CTEST_BUILD_TARGET camitk_package_source)
set(CTEST_BUILD_TARGET camitk-package-source)
ctest_build()
ctest_submit(PARTS Build)
# Api documentation (doxygen)
set_property(GLOBAL PROPERTY SubProject apidoc)
set_property(GLOBAL PROPERTY Label apidoc)
set_property(GLOBAL PROPERTY SubProject camitk-api-doc)
set_property(GLOBAL PROPERTY Label camitk-api-doc)
# Build the documentation and send the report
set(CTEST_BUILD_TARGET apidoc)
set(CTEST_BUILD_TARGET camitk-api-doc)
ctest_build()
ctest_submit(PARTS Build)
......@@ -25,12 +25,12 @@ if(APIDOC_SDK)
set(DOXYGEN_LANGUAGE "English" CACHE STRING "Language used by doxygen")
mark_as_advanced(DOXYGEN_LANGUAGE)
# define where to put the apidoc at build time
# define where to put the camitk-api-doc at build time
set(CAMITK_APIDOC_DIR ${CMAKE_BINARY_DIR}/share/${CAMITK_SHORT_VERSION_STRING}/apidoc)
set(DOXYGEN_OUTPUT_DIR ${CAMITK_APIDOC_DIR})
message(STATUS "Generating build target 'apidoc' for CamiTK SDK documentation in ${CAMITK_APIDOC_DIR}")
message(STATUS "Generating build target 'camitk-api-doc' for CamiTK SDK documentation in ${CAMITK_APIDOC_DIR}")
# which directories to use
set(DOXYGEN_SUBDIRS)
......@@ -77,7 +77,7 @@ if(APIDOC_SDK)
# Configure CamiTKVersion.h.in to generate index.html page for API documentation
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libraries/core/CamiTKVersion.h.in ${CMAKE_CURRENT_BINARY_DIR}/core/CamiTKVersion.h @ONLY)
add_custom_target(apidoc
add_custom_target(camitk-api-doc
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMENT "Generating CamiTK SDK API documentation using Doxygen"
VERBATIM
......@@ -92,7 +92,7 @@ if(APIDOC_SDK)
# doc installation
install(DIRECTORY ${CAMITK_APIDOC_DIR}
DESTINATION share/${CAMITK_SHORT_VERSION_STRING}
COMPONENT apidoc
COMPONENT camitk-api-doc
)
else()
message(WARNING "Doxygen not found - CamiTK SDK API documentation and reference manual will not be created")
......
......@@ -265,7 +265,7 @@ macro(camitk_application)
if(PYTHONLIBS_FOUND)
message(STATUS "Python found (needed by ${APPLICATION_NAME})")
include_directories(${PYTHON_INCLUDE_DIRS})
# PYTHON_LIRARIES is automatically and correctly set by find_package
# PYTHON_LIBRARIES is automatically and correctly set by find_package
else()
message(FATAL_ERROR "Python (2.7 or above) is required by ${APPLICATION_NAME} : please add your python installation dir to your PATH environment variable")
endif()
......
......@@ -128,10 +128,10 @@ macro(camitk_extension_project)
# if this is a single CEP, provides the installation facilities
# otherwise, just add include(CamiTKInstall) to get the installation facilities
if (NOT CAMITK_EXTENSION_PROJECT_SET)
#-- camitk_global_install == install in CAMITK_DIR
#-- camitk-global-install == install in CAMITK_DIR
if (CAMITK_COMMUNITY_EDITION_BUILD)
# if the SDK is currently being build => install in CMAKE_INSTALL_PREFIX
add_custom_target(${SIMPLIFIED_CEP_NAME}_global_install
add_custom_target(cep-${SIMPLIFIED_CEP_NAME}-global-install
# Second cmake to install
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target install --config ${CMAKE_CFG_INTDIR}
COMMENT "Global Installation in ${CMAKE_INSTALL_PREFIX}"
......@@ -139,7 +139,7 @@ macro(camitk_extension_project)
else()
# this is called from a normal CEP build => install in CAMITK_DIR
add_custom_target(${SIMPLIFIED_CEP_NAME}_global_install
add_custom_target(cep-${SIMPLIFIED_CEP_NAME}-global-install
# First cmake to redefine install prefix
COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${CAMITK_DIR} ${CMAKE_BINARY_DIR}
# Second cmake to install
......@@ -148,8 +148,8 @@ macro(camitk_extension_project)
)
endif()
# camitk_local_install == install in User Config directory
add_custom_target(${SIMPLIFIED_CEP_NAME}_local_install
# camitk-local-install == install in User Config directory
add_custom_target(cep-${SIMPLIFIED_CEP_NAME}-local-install
# First cmake to redefine install prefix
COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${CAMITK_USER_DIR} ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target install --config ${CMAKE_CFG_INTDIR}
......@@ -157,9 +157,9 @@ macro(camitk_extension_project)
)
endif()
# Add an update_translate targete to configure all the .qrc files for the different extensions of this CEP on demand.
# Add an update-translate targete to configure all the .qrc files for the different extensions of this CEP on demand.
# .qrc files consider up to date .ts resources files for translation
add_custom_target(${SIMPLIFIED_CEP_NAME}_updatetranslate
add_custom_target(cep-${SIMPLIFIED_CEP_NAME}-update-translate
COMMAND ${CMAKE_COMMAND} -E echo "Updating translation for ${CEP_NAME}"
COMMAND ${CMAKE_COMMAND} -DCAMITK_TRANSLATE=TRUE ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -DCAMITK_TRANSLATE=FALSE ${CMAKE_BINARY_DIR}
......
......@@ -48,7 +48,7 @@ macro(camitk_sub_project_validate)
# Add packaging source, packaging and api_doc target (COMMENTED > let's be frank, those are not compiled anymore on VMs)
# set(CAMITK_XML_PROJECT_DESCRIPTION ${CAMITK_XML_PROJECT_DESCRIPTION} "\n <SubProject name=\"package-source\">\n </SubProject>")
# set(CAMITK_XML_PROJECT_DESCRIPTION ${CAMITK_XML_PROJECT_DESCRIPTION} "\n <SubProject name=\"package\">\n </SubProject>")
# set(CAMITK_XML_PROJECT_DESCRIPTION ${CAMITK_XML_PROJECT_DESCRIPTION} "\n <SubProject name=\"apidoc\">\n </SubProject>")
# set(CAMITK_XML_PROJECT_DESCRIPTION ${CAMITK_XML_PROJECT_DESCRIPTION} "\n <SubProject name=\"camitk-api-doc\">\n </SubProject>")
else() # Other external CEP
set(CAMITK_XML_PROJECT_DESCRIPTION ${CAMITK_XML_PROJECT_DESCRIPTION} ${xml_subproject_components})
set(CAMITK_XML_PROJECT_DESCRIPTION ${CAMITK_XML_PROJECT_DESCRIPTION} ${xml_subproject_actions})
......
......@@ -413,7 +413,7 @@ set(CEP_PACKAGE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPA
# simply target name so that the custom target name does not contains any space
string(REGEX REPLACE " " "" SIMPLIFIED_PROJECT_NAME ${PROJECT_NAME})
add_custom_target(camitk_extension_${SIMPLIFIED_PROJECT_NAME}_package
add_custom_target(cep-${SIMPLIFIED_PROJECT_NAME}-package
# configure for packaging
COMMAND ${CMAKE_COMMAND} -DPACKAGING_NSIS:BOOL=ON ${CMAKE_BINARY_DIR}
# build first
......
......@@ -2,23 +2,23 @@
#!
#! ==================== Source Tar ball ====================
#!
#! To make a source tar ball, use the custom target "camitk_package_source"
#! - make camitk_package_source
#! To make a source tar ball, use the custom target "camitk-package-source"
#! - make camitk-package-source
#! (it generates the correct CamiTKVersion.h)
#! WARNING it is VERY important to use "make camitk_package_source" and NOT just "make package_source"
#! WARNING it is VERY important to use "make camitk-package-source" and NOT just "make package_source"
#!
#! ==================== Windows User Package ====================
#!
#! To make an installer (setup.exe) for the user package:
#! - configure cmake with -DPACKAGING_NSIS:BOOL=TRUE (on windows AND unix)
#! - use the custom target camitk_package, e.g "make camitk_package"
#! - use the custom target camitk-package, e.g "make camitk-package"
#!
#! On Windows platforms
#! CMake configure command (from the build directory) :
#! cmake -DCMAKE_GENERATOR="Visual Studio 12 Win64" -DPACKAGING_NSIS=TRUE -DCEP_IMAGING=TRUE -DCEP_MODELING=TRUE -DAPPLICATION_CEPGENERATOR=FALSE -DAPPLICATION_TESTACTIONS=FALSE -DAPPLICATION_TESTCOMPONENTS=FALSE -DAPPLICATION_WIZARD=FALSE ../src
#! Launch the camitkopensource.sln visual studio solution file.
#! Build all in Release (do it again if some .h files missing errors occured)
#! Build camitk_package target.
#! Build camitk-package target.
#!
#! On windows for the NSIS packager, to generate different components that can be opt out at install time, see
#! http://www.itk.org/Wiki/CMake:Component_Install_With_CPack
......@@ -114,7 +114,7 @@ if (PACKAGING_NSIS AND UNIX AND NOT WIN32)
#! Note : even if not packaging for Unix with NSIS, the CMake variable
#! PACKAGING_NSIS is used here to indicate we are packaging (i.e. building
#! the camitk_package target).
#! the camitk-package target).
message(STATUS "Packaging CamiTK for UNIX systems")
#! Try to find architecture
......@@ -241,7 +241,7 @@ if(WIN32 AND MSVC AND PACKAGING_NSIS)
# message(STATUS "==========***************************================ QT5_PLATFORM_FILE = ${QT5_PLATFORM_FILE}")
if(NOT QT5_PLATFORM_FILE)
message(WARNING "Cannot find qwindows.dll: running target 'camitk_package' will result in a buggy NSIS user package")
message(WARNING "Cannot find qwindows.dll: running target 'camitk-package' will result in a buggy NSIS user package")
else()
# Instead of putting the same value twice into different variable it would be a good idea to use this mecanism
# to fill all libraries variables below (as seen in CamiTK meeting)
......@@ -539,7 +539,7 @@ cpack_add_component_group(CEP_MODELING
#! create specific target for package source
#! When packaging, copy the CamiTKPackageVersion.h file to the source directory
#! Don't forget to remove it immediatly after packaging.
add_custom_target(camitk_package_source
add_custom_target(camitk-package-source
COMMAND ${CMAKE_COMMAND}
-E copy ${CMAKE_CURRENT_BINARY_DIR}/CamiTKPackageVersion.h
${CMAKE_CURRENT_SOURCE_DIR}/sdk/libraries/core/CamiTKVersion.h
......@@ -553,7 +553,7 @@ add_custom_target(camitk_package_source
#! This target create the installer / linux package.
#! On windows, you have configured with PACKAGING_NSIS=TRUE => all project names have their "-" replaced by "_" character
#! NSIS doesn't support "-" character.
add_custom_target(camitk_NSIS_Windows_package
add_custom_target(camitk-NSIS-Windows-package
COMMAND ${CMAKE_COMMAND}
-E copy ${CMAKE_CURRENT_BINARY_DIR}/sdk/libraries/core/CamiTKVersion.h
${CMAKE_CURRENT_BINARY_DIR}/sdk/libraries/core/CamiTKVersion.h-backup
......
......@@ -36,7 +36,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "3.3" OR ${CMAKE_VERSION} VERSION_EQUAL "3.3
set(CAMITK_CMAKE_MACRO_PATH ${SDK_TOP_LEVEL_SOURCE_DIR}/cmake/modules/macros/camitk/test)
endif()
add_custom_target(iwyu
add_custom_target(camitk-iwyu
COMMAND ${CMAKE_COMMAND} -E echo "Running include-what-you-use. Results can be found in ${IWYU_OUTPUT}"
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR} --target clean
COMMAND ${CMAKE_COMMAND} "-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=${IWYU_EXECUTABLE}" ${CMAKE_SOURCE_DIR}
......
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