summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2016-06-09 09:03:26 +0000
committerAlexander Valavanis <valavanisalex@gmail.com>2016-06-09 09:03:26 +0000
commitc8fb84faf249ce3f7d7bc8837fd47c16813f09d3 (patch)
tree132337fd009abe18ab38a866cf409919d2255cf0 /CMakeLists.txt
parentRename test->testfiles folder to avoid naming conflict (diff)
downloadinkscape-c8fb84faf249ce3f7d7bc8837fd47c16813f09d3.tar.gz
inkscape-c8fb84faf249ce3f7d7bc8837fd47c16813f09d3.zip
Fix testing dependencies
(bzr r14967.1.2)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt35
1 files changed, 17 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f3d1aac0..9d7b15dfe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,18 +70,6 @@ set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" )
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" )
# -----------------------------------------------------------------------------
-# Test Harness
-# -----------------------------------------------------------------------------
-set(GMOCK_DIR "${CMAKE_SOURCE_DIR}/gtest/gmock-1.7.0"
- CACHE PATH "The path to the GoogleMock test framework.")
-
-if(EXISTS "${GMOCK_DIR}" AND IS_DIRECTORY "${GMOCK_DIR}")
- set(GMOCK_PRESENT ON)
-else()
- message("No gmock/gtest found! Perhaps you wish to run 'bash download-gtest.sh' to download it.")
-endif()
-
-# -----------------------------------------------------------------------------
# Options
# -----------------------------------------------------------------------------
option(WITH_DBUS "Compile with support for DBus interface" OFF)
@@ -90,7 +78,6 @@ option(WITH_GNOME_VFS "Compile with support for Gnome VFS" ON)
option(WITH_SVG2 "Compile with support for new SVG2 features" ON)
option(WITH_LPETOOL "Compile with LPE Tool and experimental LPEs enabled" ON)
#option(WITH_INKJAR "Enable support for openoffice files (SVG jars)" ON)
-option(WITH_GTEST "Compile with Google Test support" ${GMOCK_PRESENT})
option(WITH_OPENMP "Compile with OpenMP support" ON)
option(WITH_PROFILING "Turn on profiling" OFF) # Set to true if compiler/linker should enable profiling
@@ -104,6 +91,19 @@ option(WITH_LIBWPG "Compile with support of libwpg for WordPerfect Graphics" ON)
option(WITH_NLS "Compile with Native Language Support (using gettext)" ON)
option(WITH_GTK3_EXPERIMENTAL "Enable compilation with GTK+3 (EXPERIMENTAL!)" OFF)
+# -----------------------------------------------------------------------------
+# Test Harness
+# -----------------------------------------------------------------------------
+set(GMOCK_DIR "${CMAKE_SOURCE_DIR}/gtest/gmock-1.7.0"
+ CACHE PATH "The path to the GoogleMock test framework.")
+
+if(EXISTS "${GMOCK_DIR}" AND IS_DIRECTORY "${GMOCK_DIR}")
+ set(GMOCK_PRESENT ON)
+else()
+ set(GMOCK_PRESENT OFF)
+ message("No gmock/gtest found! Perhaps you wish to run 'bash download-gtest.sh' to download it.")
+endif()
+
include(CMakeScripts/ConfigPaths.cmake) # Installation Paths
include(CMakeScripts/DefineDependsandFlags.cmake) # Includes, Compiler Flags, and Link Libraries
include(CMakeScripts/HelperMacros.cmake) # Misc Utility Macros
@@ -210,12 +210,11 @@ add_custom_target(clean-all
)
#-----------------------------------------------------------------------------
-
-#add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
-
-if(WITH_GTEST)
+if(GMOCK_PRESENT)
+ set(CMAKE_CTEST_COMMAND ctest -V)
enable_testing()
- add_subdirectory(testfiles EXCLUDE_FROM_ALL)
+ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
+ add_subdirectory(testfiles)
endif()
# Canonicalize the flags to speed up recompilation using ccache/etc.