summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-01-27 12:12:32 +0000
committerJose Fonseca <jfonseca@vmware.com>2016-01-27 12:33:08 +0000
commite11395e9a4afddfc68b40facb1007dd303ee24f6 (patch)
treeb06a6957a5453b238f834aac37f1e6b9001628db /CMakeLists.txt
parent7be9f4204c989fcfd2e78fdc8b42428b981a7928 (diff)
libbacktrace: Always build and run btest.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 11 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f67405e6..200cc24f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -353,6 +353,17 @@ endif ()
# which subdirectory they are declared
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+enable_testing ()
+if (CMAKE_CROSSCOMPILING)
+ add_custom_target (check)
+elseif (DEFINED CMAKE_BUILD_TYPE)
+ # Single configuration
+ add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
+else ()
+ # Multiple configuration
+ add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND} -C "$<CONFIG>" --output-on-failure)
+endif ()
+
##############################################################################
# Installation directories
@@ -468,17 +479,6 @@ add_library (gtest ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gtest/src/gtest-all.cc
set_property (TARGET gtest APPEND PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gtest)
target_link_libraries (gtest ${CMAKE_THREAD_LIBS_INIT})
-enable_testing ()
-if (CMAKE_CROSSCOMPILING)
- add_custom_target (check)
-elseif (DEFINED CMAKE_BUILD_TYPE)
- # Single configuration
- add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
-else ()
- # Multiple configuration
- add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND} -C "$<CONFIG>" --output-on-failure)
-endif ()
-
# Convenience macro for adding unit tests
macro (add_gtest)
add_executable (${ARGV})