comparison Resources/CMake/DatabasesPluginConfiguration.cmake @ 372:b5e2c1e48828 db-protobuf

created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 28 Mar 2023 11:40:07 +0200
parents 16aac0287485
children be7de633695c
comparison
equal deleted inserted replaced
371:c1fe28de1bf6 372:b5e2c1e48828
21 21
22 include(${CMAKE_CURRENT_LIST_DIR}/DatabasesFrameworkConfiguration.cmake) 22 include(${CMAKE_CURRENT_LIST_DIR}/DatabasesFrameworkConfiguration.cmake)
23 include(${CMAKE_CURRENT_LIST_DIR}/../Orthanc/CMake/AutoGeneratedCode.cmake) 23 include(${CMAKE_CURRENT_LIST_DIR}/../Orthanc/CMake/AutoGeneratedCode.cmake)
24 include(${CMAKE_CURRENT_LIST_DIR}/../Orthanc/Plugins/OrthancPluginsExports.cmake) 24 include(${CMAKE_CURRENT_LIST_DIR}/../Orthanc/Plugins/OrthancPluginsExports.cmake)
25 25
26
27 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK) 26 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK)
28 if (ORTHANC_SDK_VERSION STREQUAL "0.9.5") 27 if (ORTHANC_SDK_VERSION STREQUAL "0.9.5")
29 include_directories(${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-0.9.5) 28 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-0.9.5)
30 elseif (ORTHANC_SDK_VERSION STREQUAL "1.4.0") 29 elseif (ORTHANC_SDK_VERSION STREQUAL "1.4.0")
31 include_directories(${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.4.0) 30 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.4.0)
32 elseif (ORTHANC_SDK_VERSION STREQUAL "1.5.2") 31 elseif (ORTHANC_SDK_VERSION STREQUAL "1.5.2")
33 include_directories(${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.5.2) 32 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.5.2)
34 elseif (ORTHANC_SDK_VERSION STREQUAL "1.5.4") 33 elseif (ORTHANC_SDK_VERSION STREQUAL "1.5.4")
35 include_directories(${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.5.4) 34 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.5.4)
36 elseif (ORTHANC_SDK_VERSION STREQUAL "1.9.2") 35 elseif (ORTHANC_SDK_VERSION STREQUAL "1.9.2")
37 include_directories(${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.9.2) 36 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.9.2)
37 elseif (ORTHANC_SDK_VERSION STREQUAL "1.12.0")
38 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.12.0)
38 elseif (ORTHANC_SDK_VERSION STREQUAL "framework") 39 elseif (ORTHANC_SDK_VERSION STREQUAL "framework")
39 set(tmp ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include/) 40 set(tmp ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include/)
40 message(${tmp}) 41 message(${tmp})
41 if (NOT EXISTS ${tmp}/orthanc/OrthancCDatabasePlugin.h) 42 if (NOT EXISTS ${tmp}/orthanc/OrthancCDatabasePlugin.h)
42 message(FATAL_ERROR "Your copy of the Orthanc framework doesn't contain the Orthanc plugin SDK") 43 message(FATAL_ERROR "Your copy of the Orthanc framework doesn't contain the Orthanc plugin SDK")
43 endif() 44 endif()
44 include_directories(${tmp}) 45 set(ORTHANC_SDK_ROOT ${tmp})
45 else() 46 else()
46 message(FATAL_ERROR "Unsupported version of the Orthanc plugin SDK: ${ORTHANC_SDK_VERSION}") 47 message(FATAL_ERROR "Unsupported version of the Orthanc plugin SDK: ${ORTHANC_SDK_VERSION}")
47 endif() 48 endif()
48 else () 49 else ()
49 CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCDatabasePlugin.h HAVE_ORTHANC_H) 50 find_path(ORTHANC_SDK_ROOT orthanc/OrthancCDatabasePlugin.h
51 /usr/include
52 /usr/local/include
53 )
54
55 if (NOT ORTHANC_SDK_ROOT)
56 message(FATAL_ERROR "Please install the headers of the Orthanc plugins SDK")
57 endif()
58
59 check_include_file(${ORTHANC_SDK_ROOT}/orthanc/OrthancCDatabasePlugin.h HAVE_ORTHANC_H)
50 if (NOT HAVE_ORTHANC_H) 60 if (NOT HAVE_ORTHANC_H)
51 message(FATAL_ERROR "Please install the headers of the Orthanc plugins SDK") 61 message(FATAL_ERROR "Please install the headers of the Orthanc plugins SDK")
52 endif() 62 endif()
53 endif() 63 endif()
64
65 include_directories(${ORTHANC_SDK_ROOT})
54 66
55 67
56 if (NOT DEFINED ORTHANC_OPTIMAL_VERSION_MAJOR) 68 if (NOT DEFINED ORTHANC_OPTIMAL_VERSION_MAJOR)
57 message(FATAL_ERROR "ORTHANC_OPTIMAL_VERSION_MAJOR is not defined") 69 message(FATAL_ERROR "ORTHANC_OPTIMAL_VERSION_MAJOR is not defined")
58 endif() 70 endif()