diff --git a/CMakeLists.txt b/CMakeLists.txt index e3642cf..c48c27c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,12 @@ set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O1" ) # Include headers from inc include_directories ( ${CMAKE_SOURCE_DIR}/inc ) +set ( COMPILE_TESTS OFF CACHE COMPILE_TESTS "Compile test_executable" ) + # Add the test subdirectory -add_subdirectory ( ${CMAKE_SOURCE_DIR}/tests ) +if ( COMPILE_TESTS ) + add_subdirectory ( ${CMAKE_SOURCE_DIR}/tests ) +endif ( COMPILE_TESTS ) file ( GLOB_RECURSE EVENTSYSTEM_HEADERS ${CMAKE_SOURCE_DIR}/inc *.(h|hpp) ) install ( FILES ${EVENTSYSTEM_HEADERS} DESTINATION include ) diff --git a/cmake.sh b/cmake.sh index 3e270a4..f78e083 100755 --- a/cmake.sh +++ b/cmake.sh @@ -5,10 +5,10 @@ set -e case $1 in "setup") - cmake -H. -Bbuild + cmake -H. -Bbuild -DCOMPILE_TESTS=ON ;; "debug") - cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug + cmake -H. -Bbuild -DCOMPILE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug ;; "clean") echo "removing build/, libeventsystem.a and test_executable"