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)
if(GDCM_FOUND)
include(${GDCM_USE_FILE})
if (MSVC)
set(GDCM_LIBRARIES
debug ${GDCM_DIR}/../gdcmcharls${CAMITK_DEBUG_POSTFIX}.lib
debug ${GDCM_DIR}/../gdcmCommon${CAMITK_DEBUG_POSTFIX}.lib
debug ${GDCM_DIR}/../gdcmDICT${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
debug ${GDCM_DIR}/../gdcmIOD${CAMITK_DEBUG_POSTFIX}.lib
debug ${GDCM_DIR}/../gdcmjpeg8${CAMITK_DEBUG_POSTFIX}.lib
debug ${GDCM_DIR}/../gdcmjpeg12${CAMITK_DEBUG_POSTFIX}.lib
debug ${GDCM_DIR}/../gdcmjpeg16${CAMITK_DEBUG_POSTFIX}.lib
debug ${GDCM_DIR}/../gdcmMEXD${CAMITK_DEBUG_POSTFIX}.lib
debug ${GDCM_DIR}/../gdcmMSFF${CAMITK_DEBUG_POSTFIX}.lib
debug ${GDCM_DIR}/../gdcmopenjpeg${CAMITK_DEBUG_POSTFIX}.lib
debug ${GDCM_DIR}/../gdcmzlib${CAMITK_DEBUG_POSTFIX}.lib
debug ${GDCM_DIR}/../socketxx${CAMITK_DEBUG_POSTFIX}.lib
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
)
# List all available GDCM library files
file(GLOB GDCM_LIB_FILES
LIST_DIRECTORIES false
"${GDCM_DIR}/../*${CAMITK_DEBUG_POSTFIX}.lib"
)
unset(GDCM_LIBRARIES)
foreach(GDCM_LIB_FILE ${GDCM_LIB_FILES})
# Get the actual name of the library
string(REGEX REPLACE "^.*/(.*)${CAMITK_DEBUG_POSTFIX}.lib"
"\\1" GDCM_LIB_FILE_OPTIMIZED
"${GDCM_LIB_FILE}")
# Add both debug and optimized version
set(GDCM_LIBRARIES ${GDCM_LIBRARIES} debug ${GDCM_LIB_FILE}
optimized ${GDCM_LIB_FILE_OPTIMIZED})
endforeach()
else()
set(GDCM_LIBRARIES gdcmCommon gdcmDICT gdcmDSED gdcmMEXD gdcmMSFF vtkgdcm)
endif()
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()
......
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