summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChristoph Lipka <clipka@jp.adit-jv.com>2016-10-12 14:28:56 +0900
committerChristoph Lipka <clipka@jp.adit-jv.com>2016-10-24 13:39:56 +0900
commit5ed21aebff7220288565cbda1d6830310de2d535 (patch)
treeeadf201c3e9e986387515b19d4e70164b461b094 /CMakeLists.txt
parent206397282c3adbdcbc6a163d6692588d214e62ed (diff)
downloadDLT-daemon-5ed21aebff7220288565cbda1d6830310de2d535.tar.gz
CMake: Add option to build unit test binaries
Adds a configuration option for building gtest framework and unittests. Default setting: OFF Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index da3afaf..4028a50 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,6 +68,7 @@ option(WITH_DLT_EXAMPLES "Set to ON to build src/examples binaries"
option(WITH_DLT_SYSTEM "Set to ON to build src/system binaries" ON)
option(WITH_DLT_DBUS "Set to ON to build src/dbus binaries" ON)
option(WITH_DLT_TESTS "Set to ON to build src/test binaries" ON)
+option(WITH_DLT_UNIT_TESTS "Set to ON to build gtest framework and tests/binaries" OFF)
set( DLT_USER "genivi" CACHE STRING
"Set user for process not run as root")
@@ -112,6 +113,10 @@ if(WITH_DLTTEST)
add_definitions( -DDLT_TEST_ENABLE)
endif(WITH_DLTTEST)
+if (WITH_DLT_UNIT_TESTS)
+ add_definitions(-DDLT_UNIT_TESTS)
+endif(WITH_DLT_UNIT_TESTS)
+
if(WITH_DLT_SHM_ENABLE)
add_definitions( -DDLT_SHM_ENABLE)
endif(WITH_DLT_SHM_ENABLE)
@@ -193,8 +198,10 @@ add_subdirectory( doc )
add_subdirectory( src )
add_subdirectory( include )
add_subdirectory( testscripts )
-add_subdirectory( gtest-1.7.0 )
-add_subdirectory( tests )
+if (WITH_DLT_UNIT_TESTS)
+ add_subdirectory( gtest-1.7.0 )
+ add_subdirectory( tests )
+endif(WITH_DLT_UNIT_TESTS)
message( STATUS )
message( STATUS "-------------------------------------------------------------------------------" )
@@ -211,6 +218,7 @@ message( STATUS "WITH_DLT_EXAMPLES = ${WITH_DLT_EXAMPLES}")
message( STATUS "WITH_DLT_SYSTEM = ${WITH_DLT_SYSTEM}")
message( STATUS "WITH_DLT_DBUS = ${WITH_DLT_DBUS}")
message( STATUS "WITH_DLT_TESTS = ${WITH_DLT_TESTS}")
+message( STATUS "WITH_DLT_UNIT_TESTS = ${WITH_DLT_UNIT_TESTS}" )
message( STATUS "WITH_DLT_SHM_ENABLE = ${WITH_DLT_SHM_ENABLE}" )
message( STATUS "WITH_DLTTEST = ${WITH_DLTTEST}" )
message( STATUS "WITH_DLT_CXX11_EXT = ${WITH_DLT_CXX11_EXT}" )