summaryrefslogtreecommitdiff
path: root/science/orthanc/files/patch-CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'science/orthanc/files/patch-CMakeLists.txt')
-rw-r--r--science/orthanc/files/patch-CMakeLists.txt61
1 files changed, 61 insertions, 0 deletions
diff --git a/science/orthanc/files/patch-CMakeLists.txt b/science/orthanc/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..c5ccbf40e9f1
--- /dev/null
+++ b/science/orthanc/files/patch-CMakeLists.txt
@@ -0,0 +1,61 @@
+--- CMakeLists.txt.orig 2015-02-12 13:47:38 UTC
++++ CMakeLists.txt
+@@ -20,6 +20,7 @@ SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allo
+ SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests")
+ SET(ENABLE_JPEG ON CACHE BOOL "Enable JPEG decompression")
+ SET(ENABLE_JPEG_LOSSLESS ON CACHE BOOL "Enable JPEG-LS (Lossless) decompression")
++SET(BUILD_UNIT_TESTS ON CACHE BOOL "Build UnitTests binary")
+
+ # Advanced parameters to fine-tune linking against system libraries
+ SET(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp")
+@@ -359,22 +360,24 @@ install(
+ ## Build the unit tests
+ #####################################################################
+
+-if (UNIT_TESTS_WITH_HTTP_CONNEXIONS)
+- add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1)
+-else()
+- add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0)
+-endif()
+-
+-add_definitions(-DORTHANC_BUILD_UNIT_TESTS=1)
+-include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleTestConfiguration.cmake)
+-add_executable(UnitTests
+- ${GTEST_SOURCES}
+- ${ORTHANC_UNIT_TESTS_SOURCES}
+- )
+-target_link_libraries(UnitTests ServerLibrary CoreLibrary ${STATIC_LUA} ${STATIC_GOOGLE_LOG})
+-
+-if (${OPENSSL_SOURCES_LENGTH} GREATER 0)
+- target_link_libraries(UnitTests OpenSSL)
++if (BUILD_UNIT_TESTS)
++ if (UNIT_TESTS_WITH_HTTP_CONNEXIONS)
++ add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1)
++ else()
++ add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0)
++ endif()
++
++ add_definitions(-DORTHANC_BUILD_UNIT_TESTS=1)
++ include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleTestConfiguration.cmake)
++ add_executable(UnitTests
++ ${GTEST_SOURCES}
++ ${ORTHANC_UNIT_TESTS_SOURCES}
++ )
++ target_link_libraries(UnitTests ServerLibrary CoreLibrary ${STATIC_LUA} ${STATIC_GOOGLE_LOG})
++
++ if (${OPENSSL_SOURCES_LENGTH} GREATER 0)
++ target_link_libraries(UnitTests OpenSSL)
++ endif()
+ endif()
+
+
+@@ -443,7 +446,8 @@ if (BUILD_CLIENT_LIBRARY)
+ )
+ endif()
+
+- elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
++ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR
++ ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
+ # TODO
+ target_link_libraries(OrthancClient pthread)
+