changeset 150:1058c115aed1

patch for archlinux
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 16 Oct 2012 15:30:19 +0200
parents b15ac5bd19f3
children 11e48e70c039
files Resources/CMake/DcmtkConfiguration.cmake
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/DcmtkConfiguration.cmake	Mon Oct 15 13:11:30 2012 +0200
+++ b/Resources/CMake/DcmtkConfiguration.cmake	Tue Oct 16 15:30:19 2012 +0200
@@ -72,16 +72,18 @@
     -DHAVE_CONFIG_H=1
     )
 
-  if (NOT EXISTS "${DCMTK_DIR}/config/cfunix.h")
+  if (EXISTS "${DCMTK_DIR}/config/cfunix.h")
+    set(DCMTK_CONFIGURATION_FILE "${DCMTK_DIR}/config/cfunix.h")
+  elseif (EXISTS "${DCMTK_DIR}/config/osconfig.h")  # This is for Arch Linux
+    set(DCMTK_CONFIGURATION_FILE "${DCMTK_DIR}/config/osconfig.h")
+  else()
     message(FATAL_ERROR "Please install libdcmtk1-dev")
   endif()
 
   # Autodetection of the version of DCMTK
-  file(STRINGS "${DCMTK_DIR}/config/cfunix.h" DCMTK_VERSION_NUMBER1
-    REGEX ".*PACKAGE_VERSION .*")
+  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})
 
-
   IF (EXISTS "${DCMTK_DIR}/oflog")
     set(DCMTK_BUNDLES_LOG4CPLUS 1)
     link_libraries(oflog)