From cd3e5c175fb1492084976ada263991370c0eec75 Mon Sep 17 00:00:00 2001 From: Sameeul B Samee Date: Thu, 20 Apr 2023 06:50:43 -0400 Subject: [PATCH 1/2] Fix link error by using fully qualified path --- CMakeLists.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef0da8b..5d97063 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,8 +16,11 @@ add_definitions(-DOPJ_STATIC) endif() find_package(DCMTK) +foreach(LIB ${DCMTK_LIBRARIES}) + FIND_LIBRARY(FOUND_LIB_${LIB} ${LIB}) + LIST(APPEND FQP_DCMTK_LIBRARIES ${FOUND_LIB_${LIB}}) +endforeach(LIB) find_package(OpenJPEG) - INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${DCMTK_INCLUDE_DIRS} ${OPENJPEG_INCLUDE_DIRS}) LINK_DIRECTORIES(${FMJPEG2K}/lib) @@ -54,14 +57,14 @@ endif() ADD_EXECUTABLE(dcmcjp2k dcmcjp2k.cc) TARGET_LINK_LIBRARIES(dcmcjp2k - ${DCMTK_LIBRARIES} + ${FQP_DCMTK_LIBRARIES} ${OPENJPEG_LIBRARIES} fmjpeg2k ) ADD_EXECUTABLE(dcmdjp2k dcmdjp2k.cc) TARGET_LINK_LIBRARIES(dcmdjp2k - ${DCMTK_LIBRARIES} + ${FQP_DCMTK_LIBRARIES} ${OPENJPEG_LIBRARIES} fmjpeg2k ) @@ -70,7 +73,7 @@ TARGET_LINK_LIBRARIES(dcmdjp2k add_library(fmjpeg2k ${fmjpeg2k_SRCS}) set(fmjpeg2k_LIBRARY_NAME fmjpeg2k) TARGET_LINK_LIBRARIES(fmjpeg2k - ${DCMTK_LIBRARIES} + ${FQP_DCMTK_LIBRARIES} ${OPENJPEG_LIBRARIES} ) From 90b3ea952b4f92209960d016175268386727bdb4 Mon Sep 17 00:00:00 2001 From: Sameeul B Samee Date: Thu, 20 Apr 2023 07:03:37 -0400 Subject: [PATCH 2/2] Fix formatting --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d97063..f6042f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,8 +18,10 @@ endif() find_package(DCMTK) foreach(LIB ${DCMTK_LIBRARIES}) FIND_LIBRARY(FOUND_LIB_${LIB} ${LIB}) + # link library using fully qualified path LIST(APPEND FQP_DCMTK_LIBRARIES ${FOUND_LIB_${LIB}}) endforeach(LIB) + find_package(OpenJPEG) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${DCMTK_INCLUDE_DIRS} ${OPENJPEG_INCLUDE_DIRS}) LINK_DIRECTORIES(${FMJPEG2K}/lib)