No Description

bergmann 165bf7c770 * Added FindGTest with patch GMock targets 7 months ago
cmake 165bf7c770 * Added FindGTest with patch GMock targets 7 months ago
README.md 7a576e37cf Merge remote-tracking branch 'sanitizers/master' 8 months ago

README.md

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.

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.

find_local_modules

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.

pedantic

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>`

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_symbols

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.

Third Party

  • 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
    • Collection to speed up the build process.
    • Is merged into this project.
    • Files:
    • cotire.cmake