From e1a81f22a71600876163b84116415afe2416b771 Mon Sep 17 00:00:00 2001 From: ryanmrichard Date: Fri, 1 Sep 2017 13:39:59 -0500 Subject: [PATCH] Allows tests to be skipped --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2653d45b..99efdbd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,11 @@ include (FindPkgConfig) include(CheckCXXSourceCompiles) # build type -set(CMAKE_BUILD_TYPE Debug) +if( NOT DEFINED CMAKE_BUILD_TYPE ) + set(CMAKE_BUILD_TYPE Debug) +endif( NOT DEFINED CMAKE_BUILD_TYPE ) + +option( BUILD_TESTS "If true Sprout's tests will be built" TRUE) set(CMAKE_CXX_FLAGS_DEBUG "-W -Wall -Wextra -Wno-unused-parameter -Werror -std=c++0x -O0 -g") @@ -22,6 +26,7 @@ if( NOT DEFINED CMAKE_VERBOSE_MAKEFILE ) set(CMAKE_VERBOSE_MAKEFILE OFF) endif( NOT DEFINED CMAKE_VERBOSE_MAKEFILE ) + if( NOT DEFINED Boost_USE_MULTITHREADED ) set(Boost_USE_MULTITHREADED ON) endif( NOT DEFINED Boost_USE_MULTITHREADED ) @@ -35,5 +40,8 @@ pkg_check_modules(OpenCV opencv) INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIRS} ) link_directories( ${Boost_LIBRARY_DIRS} ) -subdirs( sprout libs tools cmake ) +subdirs( sprout tools cmake ) +if( ${BUILD_TESTS} ) + subdirs(libs) +endif( ${BUILD_TESTS} )