activates CTest and adds Cmocka as a dependency

This commit is contained in:
2026-07-29 18:46:27 +03:00
parent 92115c0dd4
commit 5b42ea6a73
4 changed files with 23 additions and 13 deletions
-13
View File
@@ -1,13 +0,0 @@
project("My Awesome Tested Project" C)
cmake_minimum_required(VERSION 3.0) # Let's tell it a bit about our environment
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) # We declare a variable to select what to build
set (TARGET_GROUP production CACHE STRING "What Should I Build?") # Modules that exist in both our release and our unit tests, are added now
add_subdirectory(src) if(TARGET_GROUP STREQUAL release) # If we had any files that ONLY were compiled into our release, for example startup code,
# it's really handy to put it here.
elseif(TARGET_GROUP STREQUAL test) # Our tests need to let CTest know we're running tests
include(CTest) # It also needs to understand we have code in source and test directories
add_subdirectory(unity)
add_subdirectory(test)
else()
message(FATAL_ERROR "I don't know the TARGET_GROUP you gave me!")
endif()