Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
CMake macros

The CMake macros used to configure this project. More...

+ Collaboration diagram for CMake macros:

Modules

 camitk
 The CMake macros especially defined to configure CMake projects using CamiTK.
 

Functions

void export_headers ()
 export_headers is a macro that install header files at build and install time
 
void gather_headers_and_sources ()
 macro gather_headers_and_sources find all headers, sources, including the qt ui, moc and resources and create two variables from it: ${Name}_HEADERS ${Name}_SOURCES, and define all needed commands for qt if BaseDirectory is specified, the glob recurse starts in directory DIR
 
void get_directory_name ()
 macro get_directory_name set the variable VariableName to the name of the last directory of FullPathDirectory set the variable VariableName_CMAKE to be the same but in uppercase
 
void get_git_info ()
 macro get_git_info get the last value of commit count.
 
void get_subdirectories ()
 macro get_subdirectories get the names of all the subdirectories that contains a CMakeLists.txt in case insensitive alphabetical order
 
void get_subdirectoryfiles ()
 macro get_subdirectoryfiles get the names of all the files (and not directories) contained in a defined directory in case insensitive alphabetical order
 

Detailed Description

The CMake macros used to configure this project.

These macros are CamiTK projects specific (the ones in the camitk subfolders), others are CMake macros that you can use in any CMake projects.

Function Documentation

◆ export_headers()

void export_headers ( )

export_headers is a macro that install header files at build and install time

Duplicate headers installation:

  • one is used at compiled time and puts everything in ${CMAKE_BINARY_DIR}/include/${CAMITK_SHORT_VERSION_STRING}/${GroupName}/${ComponentName}/${SubdirName}
  • the other one is used at installation time and puts everything in ${CMAKE_INSTALL_PREFIX}/include/${CAMITK_SHORT_VERSION_STRING}/${GroupName}/${ComponentName}/${SubdirName}

Usage:

export_headers(HeaderFile1.h HeaderFile2.h ...
COMPONENT ComponentName
[GROUP GroupName]
[SUBDIRECTORY SubdirName]
)
void export_headers()
export_headers is a macro that install header files at build and install time
Definition ExportHeaders.h:40
Parameters
HeaderFileX.h(required) A list of header files to install
COMPONENTname of the component to use. This is also the include subdirectory name used for copying the file
GROUP(optional) the name of the group this install should be using group will be prepend to the component name.
SUBDIRECTORY(optional) subdirectory to use in ${CAMITK_INCLUDE_DIR}/include/${ComponentName}

Example invocation:

#--------------
# installation
#--------------
export_headers(${MYPROJECT_HEADERS}
COMPONENT ${MYPROJECT_NAME}
)

◆ gather_headers_and_sources()

void gather_headers_and_sources ( )

macro gather_headers_and_sources find all headers, sources, including the qt ui, moc and resources and create two variables from it: ${Name}_HEADERS ${Name}_SOURCES, and define all needed commands for qt if BaseDirectory is specified, the glob recurse starts in directory DIR

Usage:

gather_headers_and_sources(Name [BaseDirectory])
void gather_headers_and_sources()
macro gather_headers_and_sources find all headers, sources, including the qt ui, moc and resources an...
Definition GatherHeadersAndSources.h:15
Parameters
Name(required) the prefix of the resulting variables ${Name}_HEADERS ${Name}_SOURCES
BaseDirectory(optional) do not start gathering from current subdirectory but from the given directory

◆ get_directory_name()

void get_directory_name ( )

macro get_directory_name set the variable VariableName to the name of the last directory of FullPathDirectory set the variable VariableName_CMAKE to be the same but in uppercase

Usage:

directory_name(FullPathDirectory VariableName)
Parameters
FullPathDirectory(required) the full path directory (input)
VariableName(required) the resulting variable name containing the base name all in uppercase

◆ get_git_info()

void get_git_info ( )

macro get_git_info get the last value of commit count.

Set CAMITK_GIT_COMMIT_COUNT variable with the last number of commits

Usage:

get_git_info(PATH_TO_SOURCE_DIR)
void get_git_info()
macro get_git_info get the last value of commit count.
Definition GetGitInfo.h:14
Parameters
PATH_TO_SOURCE_DIR(required) input source directory path

◆ get_subdirectories()

void get_subdirectories ( )

macro get_subdirectories get the names of all the subdirectories that contains a CMakeLists.txt in case insensitive alphabetical order

Note
This macro sorts the directory alphabetically without considering the case (case insensitive sort) This sort is needed to always get the subdirectories in the same order, on all plateforms (Linux, Windows,...) thanks to the insensitive sort.

Usage:

void get_subdirectories()
macro get_subdirectories get the names of all the subdirectories that contains a CMakeLists....
Definition GetSubdirectories.h:19
Parameters
Name(required) the name of the resulting variable containing all the subdirectories names sorted alphabetically (case insensitive)

◆ get_subdirectoryfiles()

void get_subdirectoryfiles ( )

macro get_subdirectoryfiles get the names of all the files (and not directories) contained in a defined directory in case insensitive alphabetical order

Note
This macro sorts the filename alphabetically without considering the case (case insensitive sort) This sort is needed to always get the filenames in the same order, on all plateforms (Linux, Windows,...) thanks to the insensitive sort.

Usage:

get_subdirectoryfiles(Path Filenames)
void get_subdirectoryfiles()
macro get_subdirectoryfiles get the names of all the files (and not directories) contained in a defin...
Definition GetSubdirectoryFiles.h:20
Parameters
Path(required) input directory path
Name(required) the name of the resulting variable containing all the file names of the given directory sorted alphabetically (case insensitive)