33 "NEEDS_CEPDEFAULT_APPLICATIONDESCRIPTIONCONTACTNAMELICENSE" # possible lists
34 "ENABLED" # possible options
39 if(NOT DEFINED ${CEP_DIR_NAME}_CMAKE_NAME)
40 set(CEP_NAME ${CEP_DIR_NAME})
42 set(CEP_NAME ${${CEP_DIR_NAME}_CMAKE_NAME})
44 string(TOUPPER ${CEP_NAME} CEP_NAME_CMAKE)
46 #
if it is the first cmake run, create the
internal variable with a correct initial value (
false is
default)
47 if(NOT CEP_${CEP_NAME_CMAKE}_INTERNAL)
48 # add option to enable/disable
this CEP
49 if(${CEP_DIR_NAME}_CMAKE_ENABLED)
50 set(CEP_${CEP_NAME_CMAKE}_ENABLED TRUE)
52 set(CEP_${CEP_NAME_CMAKE}_ENABLED FALSE)
54 set(CEP_${CEP_NAME_CMAKE} ${CEP_${CEP_NAME_CMAKE}_ENABLED} CACHE BOOL
"Build CEP ${CEP_NAME}")
55 set(CEP_${CEP_NAME_CMAKE}_INTERNAL TRUE CACHE INTERNAL
"Is variable CAMITK_CEP_${CEP_NAME_CMAKE} already created?")
58 if(CEP_${CEP_NAME_CMAKE})
59 message(STATUS
"Building CEP ${CEP_NAME}")
63 if(NOT DEFINED ${CEP_DIR_NAME}_CMAKE_CONTACT)
64 message(FATAL_ERROR
"In camitk_extension_project(...) for CEP \"${CEP_NAME}\": CONTACT argument is mandatory\n Should give the email address of the person(s) to contact for more information about the CEP \"${CEP_NAME}\"")
67 if(NOT DEFINED ${CEP_DIR_NAME}_CMAKE_LICENSE)
68 set(${CEP_NAME}_LICENSE
"LGPL-v3")
70 set(${CEP_NAME}_LICENSE ${${CEP_DIR_NAME}_CMAKE_LICENSE})
74 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
76 # init cep sub project
79 # packaging macro must be called before parsing extensions CMakeList files.
81 CONTACT ${${CEP_DIR_NAME}_CMAKE_CONTACT}
82 DESCRIPTION ${${CEP_DIR_NAME}_CMAKE_DESCRIPTION}
83 LICENSE ${${CEP_NAME}_LICENSE}
93 # CEP packaging (only works if this is a stand-alone CEP
96 # For Microsoft Visual C++, sets the default application for the "ALL_BUILD" project
97 # (i.e. launches imp when we you click on "Debug" or "Start Without Debugging" button on Visual)
98 # In addition, but not the least, sets the environment to the debug dll directory for VTK (and ITK)
99 # to solve the dll incompatibility between debug and relase version of QVTK.dll and ITKCommon.dll
100 # is there a specifi application to run by default
101 if(${CEP_NAME_CMAKE}_CMAKE_DEFAULT_APPLICATION)
102 set(CEP_DEFAULT_APPLICATION ${${CEP_NAME_CMAKE}_CMAKE_DEFAULT_APPLICATION})
104 set(CEP_DEFAULT_APPLICATION
"camitk-imp")
107 # if this is a single CEP, provides the installation facilities
108 # otherwise, just add include(CamiTKInstall) to get the installation facilities
109 if (NOT CAMITK_EXTENSION_PROJECT_SET)
110 #-- camitk_global_install == install in CAMITK_DIR
111 if (CAMITK_SDK_BUILD)
112 # if the SDK is currently being build => install in CMAKE_INSTALL_PREFIX
113 add_custom_target(${CEP_NAME}_global_install
114 # Second cmake to install
115 COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target install --config ${CMAKE_CFG_INTDIR}
116 COMMENT
"Global Installation in ${CMAKE_INSTALL_PREFIX}"
120 # this is called from a normal CEP build => install in CAMITK_DIR
121 add_custom_target(${CEP_NAME}_global_install
122 # First cmake to redefine install prefix
123 COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${CAMITK_DIR} ${CMAKE_BINARY_DIR}
124 # Second cmake to install
125 COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target install --config ${CMAKE_CFG_INTDIR}
126 COMMENT
"Global Installation in ${CAMITK_DIR}"
130 # camitk_local_install == install in User Config directory
131 add_custom_target(${CEP_NAME}_local_install
132 # First cmake to redefine install prefix
133 COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${CAMITK_USER_DIR} ${CMAKE_BINARY_DIR}
134 COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target install --config ${CMAKE_CFG_INTDIR}
135 COMMENT
"Local Installation in ${CAMITK_USER_DIR}"
camitk_sub_project_init()
MACRO camitk_sub_project_init initializes the xml_subprojects variable to gather CamiTK subprojects...
Definition: CamiTKSubProjectInit.h:10
camitk_cep_packaging()
CamiTK cep packaging allows you to build a package from a CEP If README and COPYRIGHT files exists at...
Definition: CamiTKCEPPackaging.h:28
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_sub_project_validate()
macro camitk_sub_project_validate validates the xml_subprojects variable by ending its xml tag i...
Definition: CamiTKSubProjectValidate.h:15
parse_arguments()
macro parse_arguments is a fork from CMakeMacroParseArguments see http://www.cmake.org/Wiki/CMakeMacroParseArguments for more information
Definition: ParseArguments.h:13
set(CAMITK_TEST_COMMAND_FILE ${CAMITK_TEST_OUTPUT_DIR}/command) set(CAMITK_TEST_COMMAND_RESULT_FILE $
This CMake file run a command and put the output in a given file.
Definition: CamiTKTestPassFile.h:11
camitk_extension_project()
macro add_cep creates an optional (disabled by default) CEP (CamiTK Extension Project) subdirectory t...
Definition: CamiTKExtensionProject.h:28
camitk_add_subdirectory()
camitk_add_subdirectory is a utility macro that add a source subdirectory only if: ...
Definition: CamiTKAddSubDirectory.h:19