# HG changeset patch # User Sebastien Jodogne # Date 1349366421 -7200 # Node ID 5af0a4345d06cdb45eb9cd5af2f9b7db53dfb3be # Parent 2bc922bcfd2dfc93a319f86e5acaf7a66b955ee0 disabling of unit tests diff -r 2bc922bcfd2d -r 5af0a4345d06 CMakeLists.txt --- a/CMakeLists.txt Thu Oct 04 15:09:40 2012 +0200 +++ b/CMakeLists.txt Thu Oct 04 18:00:21 2012 +0200 @@ -9,6 +9,7 @@ SET(STATIC_BUILD ON CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") SET(STANDALONE_BUILD OFF CACHE BOOL "Standalone build (necessary for cross-compilation or binary releases)") SET(ENABLE_SSL ON CACHE BOOL "Include support for SSL") +SET(BUILD_UNIT_TESTS ON CACHE BOOL "Build the unit tests") SET(DEBIAN_HARDENING OFF CACHE BOOL "Use Debian hardening flags") if (${CMAKE_CROSSCOMPILING}) @@ -42,7 +43,6 @@ include(${CMAKE_SOURCE_DIR}/Resources/CMake/BoostConfiguration.cmake) include(${CMAKE_SOURCE_DIR}/Resources/CMake/DcmtkConfiguration.cmake) -include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleTestConfiguration.cmake) include(${CMAKE_SOURCE_DIR}/Resources/CMake/MongooseConfiguration.cmake) include(${CMAKE_SOURCE_DIR}/Resources/CMake/ZlibConfiguration.cmake) include(${CMAKE_SOURCE_DIR}/Resources/CMake/SQLiteConfiguration.cmake) @@ -208,17 +208,22 @@ OrthancServer/main.cpp ) -add_executable(UnitTests - ${GTEST_SOURCES} - UnitTests/main.cpp - UnitTests/SQLite.cpp - UnitTests/SQLiteChromium.cpp - UnitTests/Versions.cpp - UnitTests/Zip.cpp - ) +TARGET_LINK_LIBRARIES(Orthanc ServerLibrary CoreLibrary) + -TARGET_LINK_LIBRARIES(Orthanc ServerLibrary CoreLibrary) -TARGET_LINK_LIBRARIES(UnitTests ServerLibrary CoreLibrary) +if (BUILD_UNIT_TESTS) + include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleTestConfiguration.cmake) + add_executable(UnitTests + ${GTEST_SOURCES} + UnitTests/main.cpp + UnitTests/SQLite.cpp + UnitTests/SQLiteChromium.cpp + UnitTests/Versions.cpp + UnitTests/Zip.cpp + ) + TARGET_LINK_LIBRARIES(UnitTests ServerLibrary CoreLibrary) +endif() + find_package(Doxygen) if (DOXYGEN_FOUND)