Notes for CMakeLists for UnitTest
If a separate CMakeLists.txt for UnitTest should be generate
- bake dependency "gmock" needs to be filtered
EXCLUDE_BAKE_DEPENDENCIES = [gmock]
This has the consequence, that the gmock pathes will be removed. "make" will do not have problems if gmock is filtered, otherwise linker errors will be occur.
Additionally
EXCLUDE_BAKE_INCLUDES = [gmock]
is needed.
Example:
template_UnitTest.txt |
CMakeLists.txt |
...
target_link_libraries(gtest_${targetName}
gtest_${targetName}_sut
gtest_esr_all_$OPTION(BAKE_DEPENDENCIES)_sut
${testFrameworkTarget}
)
|
...
target_link_libraries(gtest_${targetName}
gtest_${targetName}_sut
gtest_esr_all_logger_sut
${testFrameworkTarget}
)
|