# HG changeset patch # User Sebastien Jodogne # Date 1393602909 -3600 # Node ID 8c29c1056d45bd2b125b50c4fa50672e2c1164d3 # Parent 29982cfc5009e1e9626375a11a40d0f9ad219298 automatic search of the dicom dictionaries in CMake diff -r 29982cfc5009 -r 8c29c1056d45 CMakeLists.txt --- a/CMakeLists.txt Thu Feb 27 09:45:15 2014 +0100 +++ b/CMakeLists.txt Fri Feb 28 16:55:09 2014 +0100 @@ -15,7 +15,7 @@ SET(STANDALONE_BUILD ON CACHE BOOL "Standalone build (all the resources are embedded, necessary for releases)") SET(ENABLE_SSL ON CACHE BOOL "Include support for SSL") SET(BUILD_CLIENT_LIBRARY ON CACHE BOOL "Build the client library") -SET(DCMTK_DICTIONARY_DIR "/usr/share/dcmtk" CACHE PATH "Directory containing the DCMTK dictionaries \"dicom.dic\" and \"private.dic\" (only when using system version of DCMTK)") +SET(DCMTK_DICTIONARY_DIR "" CACHE PATH "Directory containing the DCMTK dictionaries \"dicom.dic\" and \"private.dic\" (only when using system version of DCMTK)") SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages") SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests") diff -r 29982cfc5009 -r 8c29c1056d45 LinuxCompilation.txt --- a/LinuxCompilation.txt Thu Feb 27 09:45:15 2014 +0100 +++ b/LinuxCompilation.txt Fri Feb 28 16:55:09 2014 +0100 @@ -89,7 +89,6 @@ -DUSE_SYSTEM_GOOGLE_LOG=OFF \ -DUSE_SYSTEM_MONGOOSE=OFF \ -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \ - -DDCMTK_DICTIONARY_DIR:PATH=/usr/share/dcmtk \ ~/Orthanc @@ -105,7 +104,6 @@ # cmake -DALLOW_DOWNLOADS=ON \ -DUSE_SYSTEM_MONGOOSE=OFF \ -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \ - -DDCMTK_DICTIONARY_DIR:PATH=/usr/share/libdcmtk2 \ ~/Orthanc Note: Have also a look at the official package: @@ -159,7 +157,6 @@ -DALLOW_DOWNLOADS=ON \ -DUSE_SYSTEM_MONGOOSE=OFF \ -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \ - -DDCMTK_DICTIONARY_DIR:PATH=/usr/share/libdcmtk2 \ ~/Orthanc diff -r 29982cfc5009 -r 8c29c1056d45 Resources/CMake/DcmtkConfiguration.cmake --- a/Resources/CMake/DcmtkConfiguration.cmake Thu Feb 27 09:45:15 2014 +0100 +++ b/Resources/CMake/DcmtkConfiguration.cmake Fri Feb 28 16:55:09 2014 +0100 @@ -1,4 +1,17 @@ -add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}") +# Lookup for DICOM dictionaries, if none is specified by the user +if (DCMTK_DICTIONARY_DIR STREQUAL "") + find_path(DCMTK_DICTIONARY_DIR_AUTO dicom.dic + /usr/share/dcmtk + /usr/share/libdcmtk2 + ) + + message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}") + add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}") +else() + add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}") +endif() + + if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK) SET(DCMTK_VERSION_NUMBER 360)