diff options
author | Lars Pensjö <lars.pensjo@gmail.com> | 2013-02-27 07:10:03 +0100 |
---|---|---|
committer | Lars Pensjö <lars.pensjo@gmail.com> | 2013-02-27 07:10:03 +0100 |
commit | 584812b6054a95f4346bbadcbbb54b5e72c2d746 (patch) | |
tree | 0ced8139e078f16b1e2be41f8fdf3e49c499fe53 | |
parent | 6bb2ed010c3892b3c290e76df0d37583448cc6c7 (diff) |
Update cmake conf for testing.
Suppress error from signed comparison in gtest.h (-Wno-error=sign-compare).
Suppress error from unused variables (-Wno-error=unused-but-set-variable).
Add cmake flag BUILD_TESTING to the cached variables.
When building for testing, the include path to GTest shall be added.
-rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index be77681..c4547c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,7 @@ set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) find_package(Boost 1.48.0 REQUIRED COMPONENTS signals) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Werror -Wall -Wextra -Wno-unused-parameter -Wno-error=unused-variable -std=c++11") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Werror -Wall -Wextra -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=sign-compare -std=c++11") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") @@ -67,9 +67,11 @@ include_directories( ${GTest_INCLUDE_DIR} ) +set(BUILD_TESTING false CACHE BOOL "Enable building of tests") if (BUILD_TESTING) enable_testing() find_package(GTest REQUIRED) + include_directories(${GTEST_INCLUDE_DIRS}) create_test(entity_test entityx/Entity_test.cc) create_test(component_test entityx/Components_test.cc) create_test(event_test entityx/Event_test.cc) |