# CMake Modules Collection of usefull CMake modules. # Collection ## cmake_tests Add a `tests` target to automatically build and run all tests. **Usage:** Add a new test with name `fuu` that depends on target `bar`. ```cmake Add_CMake_Test ( NAME fuu TARGET bar [ GROUP baz ] [ COMMAND /bin/sh do_something ] ) ``` **Parameters** | Parameter | Description | | --- | --- | | `NAME ` | Name of the test. | | `TARGET ` | Taget the test depends on. | | `GROUP ` | Add the test to the passed group. | | `COMMAND ` | Command to execute for testing. If no command is passed the passed target is executed. | ## find_local_modules Helper function to include a local module into the cmake environment. **Usage:** ```cmake FindLocalModule ( ) ``` **Parameters** | Parameter | Description | | --- | --- | | `` | Name of the module to add to cmake environment. | | `` | Path to the local module. | ## pedantic Helper functions to add pedantic flags to the compiler. **Pedantic_Apply_Flags:** Add pedantic flags to `CMAKE_C_FLAGS` and `CMAKE_CXX_FLAGS`. ```cmake Pedantic_Apply_Flags ( [ C ] [ CXX ] [ ALL ] [ IGNORE ] [ IGNORE_C ] [ IGNORE_CXX ] [ ADDITIONAL ] [ ADDITIONAL_C ] [ ADDITIONAL_CXX ] ) ``` **Parameters:** | Parameter | Description | | --- | --- | | `C ` | Only add flags to the C compiler. | | `CXX ` | Only add flags to the C++ compiler. | | `ALL ` | Add flags to all compilers. | | `IGNORE ` | List of compiler flags to ignore. | | `IGNORE_C ` | List of C compiler flags to ignore. | | `IGNORE_CXX ` | List of C++ compiler flags to ignore. | | `ADDITIONAL ` | List of additional compiler flags to ignore. | | `ADDITIONAL_C ` | List of additional C compiler flags to ignore. | | `ADDITIONAL_CXX ` | List of additional C++ compiler flags to ignore. | **Pedantic_Apply_Flags_Target:** Add pedantic flags for compilers to the given target. ```cmake Pedantic_Apply_Flags_Target ( [ C ] [ CXX ] [ ALL ] [ IGNORE ] [ IGNORE_C ] [ IGNORE_CXX ] [ ADDITIONAL ] [ ADDITIONAL_C ] [ ADDITIONAL_CXX ] [ VISIBILITY ] ) ``` **Parameters:** | Parameter | Description | | --- | --- | | `` | Target to add flags to. | | `C ` | Only add flags to the C compiler. | | `CXX ` | Only add flags to the C++ compiler. | | `ALL ` | Add flags to all compilers. | | `IGNORE ` | List of compiler flags to ignore. | | `IGNORE_C ` | List of C compiler flags to ignore. | | `IGNORE_CXX ` | List of C++ compiler flags to ignore. | | `ADDITIONAL ` | List of additional compiler flags to ignore. | | `ADDITIONAL_C ` | List of additional C compiler flags to ignore. | | `ADDITIONAL_CXX ` | List of additional C++ compiler flags to ignore. | | `VISIBILITY ` | Visibility to use to add flags to the target. | **Pedantic_Test_Flags:** Check if the passed flags are supported by the compiler. ```cmake Pedantic_Test_Flags ( ) ``` **Parameters:** + `` Compiler to use for checking the flags + `` Name of the variable to store valid flags into. + `` Flags to check. ## strip_symbols Strip thedebug symbols from the passed target. **Usage:** ```cmake Strip_Symbols ( ) ``` **Parameters** | Parameter | Description | | --- | --- | | `` | Target to strip symbols from. | | `` | Variable to store the path of the striped symbols to. | # Third Party + [sanitizers-cmake](https://github.com/arsenm/sanitizers-cmake) + Collection to add sanitizer support to cmake. + Is merged into this project. + Files: + asan-wrapper + FindASan.cmake + FindMSan.cmake + FindSanitizers.cmake + FindTSan.cmake + FindUBSan.cmake + sanitize-helpers.cmake + [cotire](https://github.com/sakra/cotire) + Collection to speed up the build process. + Is merged into this project. + Files: + cotire.cmake