############################################################################# # one executable for each unit test file ############################################################################# file(GLOB files unit-*.cpp) set(GUCC_TEST_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set(GUCC_TOP_DIR "${CMAKE_SOURCE_DIR}") foreach(file ${files}) get_filename_component(file_basename ${file} NAME_WE) string(REGEX REPLACE "unit-([^$]+)" "test-\\1" testcase ${file_basename}) add_executable(${testcase} ${file}) target_compile_options(${testcase} PRIVATE $<$>:-Wno-deprecated;-Wno-float-equal> $<$:-Wno-deprecated-declarations> ) add_definitions(-DGUCC_TEST_DIR="${GUCC_TEST_DIR}") add_definitions(-DGUCC_TOP_DIR="${GUCC_TOP_DIR}") target_link_libraries(${testcase} PRIVATE project_warnings project_options gucc::gucc) endforeach()