Commit 13c87b6a authored by Jean-Loup Haberbusch's avatar Jean-Loup Haberbusch

Fix File not found at compile time due to GDCM version changing

When using GDCM 2.X all goes right with lib names, but not with GDCM 3.X this update add
a correction to this problem
parent 73f4b960
...@@ -368,34 +368,28 @@ macro(camitk_extension) ...@@ -368,34 +368,28 @@ macro(camitk_extension)
if(GDCM_FOUND) if(GDCM_FOUND)
include(${GDCM_USE_FILE}) include(${GDCM_USE_FILE})
if (MSVC) if (MSVC)
set(GDCM_LIBRARIES # List all available GDCM library files
debug ${GDCM_DIR}/../gdcmcharls${CAMITK_DEBUG_POSTFIX}.lib file(GLOB GDCM_LIB_FILES
debug ${GDCM_DIR}/../gdcmCommon${CAMITK_DEBUG_POSTFIX}.lib LIST_DIRECTORIES false
debug ${GDCM_DIR}/../gdcmDICT${CAMITK_DEBUG_POSTFIX}.lib "${GDCM_DIR}/../*${CAMITK_DEBUG_POSTFIX}.lib"
debug ${GDCM_DIR}/../gdcmDSED${CAMITK_DEBUG_POSTFIX}.lib
debug ${GDCM_DIR}/../gdcmexpat${CAMITK_DEBUG_POSTFIX}.lib )
debug ${GDCM_DIR}/../gdcmgetopt${CAMITK_DEBUG_POSTFIX}.lib unset(GDCM_LIBRARIES)
debug ${GDCM_DIR}/../gdcmIOD${CAMITK_DEBUG_POSTFIX}.lib foreach(GDCM_LIB_FILE ${GDCM_LIB_FILES})
debug ${GDCM_DIR}/../gdcmjpeg8${CAMITK_DEBUG_POSTFIX}.lib # Get the actual name of the library
debug ${GDCM_DIR}/../gdcmjpeg12${CAMITK_DEBUG_POSTFIX}.lib string(REGEX REPLACE "^.*/(.*)${CAMITK_DEBUG_POSTFIX}.lib"
debug ${GDCM_DIR}/../gdcmjpeg16${CAMITK_DEBUG_POSTFIX}.lib "\\1" GDCM_LIB_FILE_OPTIMIZED
debug ${GDCM_DIR}/../gdcmMEXD${CAMITK_DEBUG_POSTFIX}.lib "${GDCM_LIB_FILE}")
debug ${GDCM_DIR}/../gdcmMSFF${CAMITK_DEBUG_POSTFIX}.lib # Add both debug and optimized version
debug ${GDCM_DIR}/../gdcmopenjpeg${CAMITK_DEBUG_POSTFIX}.lib set(GDCM_LIBRARIES ${GDCM_LIBRARIES} debug ${GDCM_LIB_FILE}
debug ${GDCM_DIR}/../gdcmzlib${CAMITK_DEBUG_POSTFIX}.lib optimized ${GDCM_LIB_FILE_OPTIMIZED})
debug ${GDCM_DIR}/../socketxx${CAMITK_DEBUG_POSTFIX}.lib endforeach()
debug ${GDCM_DIR}/../vtkgdcm${CAMITK_DEBUG_POSTFIX}.lib
debug ${GDCM_DIR}/../gdcmDSED${CAMITK_DEBUG_POSTFIX}.lib
optimized gdcmcharls gdcmCommon gdcmDICT gdcmDSED gdcmexpat
optimized gdcmgetopt gdcmIOD gdcmjpeg8 gdcmjpeg12 gdcmjpeg16
optimized gdcmMEXD gdcmMSFF gdcmopenjpeg gdcmzlib socketxx vtkgdcm
optimized gdcmDSED
)
else() else()
set(GDCM_LIBRARIES gdcmCommon gdcmDICT gdcmDSED gdcmMEXD gdcmMSFF vtkgdcm) set(GDCM_LIBRARIES gdcmCommon gdcmDICT gdcmDSED gdcmMEXD gdcmMSFF vtkgdcm)
endif() endif()
else() else()
message(ERROR "${EXTENSION_NAME}: GDCM 2.x library required. Please install GDCM.") message(ERROR "${EXTENSION_NAME}: GDCM 2.x or above library required. Please install GDCM.")
endif() endif()
endif() endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment