Mercurial > hg > orthanc
changeset 287:471df5fecb1e
simplification to cmake for dcmtk
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 14 Dec 2012 10:46:00 +0100 |
parents | 727a6d766dde |
children | 40d3bf6cc8d9 |
files | INSTALL Resources/CMake/DcmtkConfiguration.cmake |
diffstat | 2 files changed, 24 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/INSTALL Thu Dec 13 14:52:57 2012 +0100 +++ b/INSTALL Fri Dec 14 10:46:00 2012 +0100 @@ -67,6 +67,15 @@ # cmake -DSTATIC_BUILD=OFF -DCMAKE_BUILD_TYPE=DEBUG ~/Orthanc # make + +Debian/Ubuntu specific: Because of a packaging error for "libdcmtk", +you have to add the "wrap" and "oflog" libraries at the configuration +time: + +# cd ~/OrthancBuild +# cmake "-DDCMTK_LIBRARIES=wrap;oflog" -DSTATIC_BUILD=OFF -DCMAKE_BUILD_TYPE=DEBUG ~/Orthanc +# make + Cross-Compilation for Windows under Linux
--- a/Resources/CMake/DcmtkConfiguration.cmake Thu Dec 13 14:52:57 2012 +0100 +++ b/Resources/CMake/DcmtkConfiguration.cmake Fri Dec 14 10:46:00 2012 +0100 @@ -71,14 +71,14 @@ set(DCMTK_BUNDLES_LOG4CPLUS 1) else() - #include(FindDCMTK) - set(DCMTK_DIR /usr/include/dcmtk) - set(DCMTK_INCLUDE_DIR ${DCMTK_DIR}) - - #message(${DCMTK_LIBRARIES}) + # The following line allows to manually add libraries at the + # command-line, which is necessary for Ubuntu/Debian packages + set(tmp "${DCMTK_LIBRARIES}") + include(FindDCMTK) + list(APPEND DCMTK_LIBRARIES "${tmp}") include_directories(${DCMTK_INCLUDE_DIR}) - link_libraries(dcmdata dcmnet wrap ofstd) + link_libraries(${DCMTK_LIBRARIES}) add_definitions( -DHAVE_CONFIG_H=1 @@ -93,17 +93,17 @@ endif() # Autodetection of the version of DCMTK - file(STRINGS "${DCMTK_CONFIGURATION_FILE}" DCMTK_VERSION_NUMBER1 REGEX ".*PACKAGE_VERSION .*") - string(REGEX REPLACE ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$" "\\1\\2\\3" DCMTK_VERSION_NUMBER ${DCMTK_VERSION_NUMBER1}) + file(STRINGS + "${DCMTK_CONFIGURATION_FILE}" + DCMTK_VERSION_NUMBER1 REGEX + ".*PACKAGE_VERSION .*") - IF (EXISTS "${DCMTK_DIR}/oflog") - set(DCMTK_BUNDLES_LOG4CPLUS 1) - link_libraries(oflog) - else() - set(DCMTK_BUNDLES_LOG4CPLUS 0) - endif() + string(REGEX REPLACE + ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$" + "\\1\\2\\3" + DCMTK_VERSION_NUMBER + ${DCMTK_VERSION_NUMBER1}) endif() add_definitions(-DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER}) message("DCMTK version: ${DCMTK_VERSION_NUMBER}") -message("Does DCMTK includes its own copy of Log4Cplus: ${DCMTK_BUNDLES_LOG4CPLUS}")