Bergmann89 f1ff5b9d65 | 2 years ago | |
---|---|---|
cmake | 2 years ago | |
README.md | 4 years ago |
Collection of usefull CMake modules.
Add a tests
target to automatically build and run all tests.
Usage:
Add a new test with name fuu
that depends on target bar
.
Add_CMake_Test ( NAME fuu
TARGET bar
[ GROUP baz ]
[ COMMAND /bin/sh do_something ] )
Parameters
Parameter | Description |
---|---|
NAME <name> |
Name of the test. |
TARGET <target> |
Taget the test depends on. |
GROUP <group> |
Add the test to the passed group. |
COMMAND <args..> |
Command to execute for testing. If no command is passed the passed target is executed. |
Helper function to include a local module into the cmake environment.
Usage:
FindLocalModule ( <module-name> <local-path> )
Parameters
Parameter | Description |
---|---|
<module-name> |
Name of the module to add to cmake environment. |
<local-path> |
Path to the local module. |
Helper functions to add pedantic flags to the compiler.
Pedantic_Apply_Flags:
Add pedantic flags to CMAKE_C_FLAGS
and CMAKE_CXX_FLAGS
.
Pedantic_Apply_Flags ( [ C ]
[ CXX ]
[ ALL ]
[ IGNORE <flags..> ]
[ IGNORE_C <flags..> ]
[ IGNORE_CXX <flags..> ]
[ ADDITIONAL <flags..> ]
[ ADDITIONAL_C <flags..> ]
[ ADDITIONAL_CXX <flags..> ] )
Parameters:
Parameter | Description |
---|---|
C <flags..> |
Only add flags to the C compiler. |
CXX <flags..> |
Only add flags to the C++ compiler. |
ALL <flags..> |
Add flags to all compilers. |
IGNORE <flags..> |
List of compiler flags to ignore. |
IGNORE_C <flags..> |
List of C compiler flags to ignore. |
IGNORE_CXX <flags..> |
List of C++ compiler flags to ignore. |
ADDITIONAL <flags..> |
List of additional compiler flags to ignore. |
ADDITIONAL_C <flags..> |
List of additional C compiler flags to ignore. |
ADDITIONAL_CXX <flags..> |
List of additional C++ compiler flags to ignore. |
Pedantic_Apply_Flags_Target:
Add pedantic flags for compilers to the given target.
Pedantic_Apply_Flags_Target ( <target>
[ C ]
[ CXX ]
[ ALL ]
[ IGNORE <flags..> ]
[ IGNORE_C <flags..> ]
[ IGNORE_CXX <flags..> ]
[ ADDITIONAL <flags..> ]
[ ADDITIONAL_C <flags..> ]
[ ADDITIONAL_CXX <flags..> ]
[ VISIBILITY <PRIVATE|PUBLIC> ] )
Parameters:
Parameter | Description |
---|---|
<target> |
Target to add flags to. |
C <flags..> |
Only add flags to the C compiler. |
CXX <flags..> |
Only add flags to the C++ compiler. |
ALL <flags..> |
Add flags to all compilers. |
IGNORE <flags..> |
List of compiler flags to ignore. |
IGNORE_C <flags..> |
List of C compiler flags to ignore. |
IGNORE_CXX <flags..> |
List of C++ compiler flags to ignore. |
ADDITIONAL <flags..> |
List of additional compiler flags to ignore. |
ADDITIONAL_C <flags..> |
List of additional C compiler flags to ignore. |
ADDITIONAL_CXX <flags..> |
List of additional C++ compiler flags to ignore. |
VISIBILITY <PRIVATE|PUBLIC> |
Visibility to use to add flags to the target. |
Pedantic_Test_Flags:
Check if the passed flags are supported by the compiler.
Pedantic_Test_Flags ( <C|CXX> <out-var> <flags..> )
Parameters:
<C|CXX>
Compiler to use for checking the flags<out-var>
Name of the variable to store valid flags into.<flags..>
Flags to check.Strip thedebug symbols from the passed target.
Usage:
Strip_Symbols ( <target> <output> )
Parameters
Parameter | Description |
---|---|
<target> |
Target to strip symbols from. |
<output> |
Variable to store the path of the striped symbols to. |