ChimeraTK / project-template

Template for new projects. Can also be used to update cmake scripts in existing projects by merging the changes. This repository intentionally does not have a README.md (which would create conflicts in the projects using this template). For documentation, please follow this link:
https://github.com/ChimeraTK/project-template/blob/master/HowTo_project-template.md
GNU Lesser General Public License v3.0
1 stars 3 forks source link

Introduced cmake module registerTests: #4

Closed vargheseg closed 5 years ago

vargheseg commented 5 years ago

usage:

register_tests(SOURCES
                 ${list_of_source_files}
                 "test_src.cc"
                 ${concatenated_string_of_source_files}
               NAMESPACE
                 "test_namespace"
               LINK_LIBRARIES
                 ${list_of_targets}
               INCLUDE_DIRECTORIES
                 ${list_of_include_directories}
               COMPILE_OPTIONS
                 ${list_of_compile_options})

Function registers tests defined as a list of souce files. Test defined by file source_name.cc in the SOURCES list is registered under the name test_namespace.source_name

Provided list of dependent targets and include directories are used for test executables as PRIVATE dependencies during compilation.

Function implicitly adds a dependency on the boost unit test framework to each generated test executable.