diff --git a/CMakeLists.txt b/CMakeLists.txt index 05eda647..b51f83ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,6 @@ option(BuildTests "Build the unit tests" ON) # define project variables set(JSON_TARGET_NAME ${PROJECT_NAME}) -set(JSON_UNITTEST_TARGET_NAME "json_unit") set(JSON_PACKAGE_NAME ${JSON_TARGET_NAME}) set(JSON_TARGETS_FILENAME "${JSON_PACKAGE_NAME}Targets.cmake") set(JSON_CONFIG_FILENAME "${JSON_PACKAGE_NAME}Config.cmake") @@ -23,17 +22,17 @@ target_include_directories(${JSON_TARGET_NAME} INTERFACE # create and configure the unit test target if (BuildTests) - add_executable(${JSON_UNITTEST_TARGET_NAME} + add_executable(json_unit "test/catch.hpp" "test/unit.cpp" ) - set_target_properties(${JSON_UNITTEST_TARGET_NAME} PROPERTIES + set_target_properties(json_unit PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON COMPILE_DEFINITIONS "$<$:_SCL_SECURE_NO_WARNINGS>" COMPILE_OPTIONS "$<$:/EHsc;$<$:/Od>>") - target_include_directories(${JSON_UNITTEST_TARGET_NAME} PRIVATE "test") - target_link_libraries(${JSON_UNITTEST_TARGET_NAME} ${JSON_TARGET_NAME}) + target_include_directories(json_unit PRIVATE "test") + target_link_libraries(json_unit ${JSON_TARGET_NAME}) endif() # generate a config and config version file for the package