diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cae08d..8fa30b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,8 @@ find_package(everest-cmake 0.1 REQUIRED ) # options +option(${PROJECT_NAME}_BUILD_TESTING "Build unit tests, used if included as dependency" OFF) +option(BUILD_TESTING "Build unit tests, used if standalone project" OFF) option(EVSE_SECURITY_INSTALL "Install the library (shared data might be installed anyway)" ${EVC_MAIN_PROJECT}) # dependencies @@ -53,7 +55,7 @@ if (EVSE_SECURITY_INSTALL) ) endif() -if((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR ${PROJECT_NAME}_BUILD_TESTING) AND BUILD_TESTING) +if((${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME} OR ${PROJECT_NAME}_BUILD_TESTING) AND BUILD_TESTING) include(CTest) add_subdirectory(tests) set(CMAKE_BUILD_TYPE Debug)