Mercurial > hg > orthanc
view OrthancFramework/UnitTestsSources/CMakeLists.txt @ 4126:aad700c38719
merge
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 07 Jul 2020 20:27:50 +0200 |
parents | 9286649df279 |
children | 304842a0d152 |
line wrap: on
line source
## ## This file is meant to be used only by ../SharedLibrary/CMakeLists.txt ## cmake_minimum_required(VERSION 2.8) project(UnitTestsProject) set(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages") set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") set(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests") set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)") set(USE_CXX11 OFF CACHE BOOL "Whether to enable compiler support for C++11") if (UNIT_TESTS_WITH_HTTP_CONNEXIONS) add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1) else() add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0) endif() if (NOT ORTHANC_FRAMEWORK_STATIC) set(ENABLE_DCMTK ON) set(ENABLE_LUA ON) set(ENABLE_PUGIXML ON) set(ENABLE_SQLITE ON) set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test") else() set(USE_SYSTEM_GOOGLE_TEST OFF CACHE INTERNAL "") endif() set(ENABLE_GOOGLE_TEST ON) include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DownloadOrthancFramework.cmake) include(${CMAKE_SOURCE_DIR}/../Resources/CMake/GoogleTestConfiguration.cmake) if (USE_CXX11) if (CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif() endif() add_definitions( -DORTHANC_UNIT_TESTS_LINK_FRAMEWORK=1 -DORTHANC_BUILD_UNIT_TESTS=1 # For "HierarchicalZipWriter" tests ) add_executable(UnitTests ${CMAKE_SOURCE_DIR}/SharedLibraryUnitTests.cpp ${CMAKE_SOURCE_DIR}/DicomMapTests.cpp ${CMAKE_SOURCE_DIR}/FileStorageTests.cpp ${CMAKE_SOURCE_DIR}/FrameworkTests.cpp ${CMAKE_SOURCE_DIR}/FromDcmtkTests.cpp ${CMAKE_SOURCE_DIR}/ImageProcessingTests.cpp ${CMAKE_SOURCE_DIR}/ImageTests.cpp ${CMAKE_SOURCE_DIR}/JobsTests.cpp ${CMAKE_SOURCE_DIR}/JpegLosslessTests.cpp ${CMAKE_SOURCE_DIR}/LoggingTests.cpp ${CMAKE_SOURCE_DIR}/LuaTests.cpp ${CMAKE_SOURCE_DIR}/MemoryCacheTests.cpp ${CMAKE_SOURCE_DIR}/RestApiTests.cpp ${CMAKE_SOURCE_DIR}/SQLiteChromiumTests.cpp ${CMAKE_SOURCE_DIR}/SQLiteTests.cpp ${CMAKE_SOURCE_DIR}/StreamTests.cpp ${CMAKE_SOURCE_DIR}/ToolboxTests.cpp ${CMAKE_SOURCE_DIR}/ZipTests.cpp ${AUTOGENERATED_SOURCES} ${GOOGLE_TEST_SOURCES} ) target_link_libraries(UnitTests ${ORTHANC_FRAMEWORK_LIBRARIES}) install(TARGETS UnitTests DESTINATION ${ORTHANC_FRAMEWORK_LIBDIR} )