cmake_minimum_required (VERSION 3.10) project (CppLogger) option(BUILD_TESTS "Build unit tests with Catch2" OFF) set(HEADER_FILES Logger.hpp Singleton_DCLP.hpp ArgParser.hpp) add_executable(cpplogger main.cpp ${HEADER_FILES}) set_target_properties(cpplogger PROPERTIES COMPILE_FLAGS "-ggdb") if (BUILD_TESTS) set(CATCH_HEADER_FILE Catch2/single_include/catch2/catch.hpp) add_executable(cpplogger_test cpp_logger_test.cpp ${HEADER_FILES} ${CATCH_HEADER_FILE}) target_include_directories(cpplogger_test PRIVATE . Catch2/single_include) set_target_properties(cpplogger_test PROPERTIES COMPILE_FLAGS "-ggdb") endif()