Chris Schick commented on issue #50 at cmocka / cmocka

Chris Schick
2023-01-24T03:49:55Z

I am also trying to resolve cmocka as a dependency with FetchContent. My issue is that my project tries to build the cmocka tests as well as my own. I believe the testing and example section from lines 58 to 65 in the project-level CMakeLists.txt should be wrapped in something like:

if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(AddCMockaTest)
# etc..
endif()

This way we don't build the CMocka tests and examples when consuming through FetchContent.