我正在尝试构建一个依赖于 GDCM 的库。因此,我按照 INSTAL.txt 文件中提供的说明安装了 GDCM,并且没有任何问题。但是,当我尝试使用 cmake 构建依赖它的库时,我收到以下消息:
CMake Error at /usr/local/lib/gdcm-3.0/GDCMTargets.cmake:37 (message):
Some (but not all) targets in this export set were already defined.
Targets Defined:
gdcmjpeg8;gdcmjpeg12;gdcmjpeg16;gdcmuuid;gdcmCommon;gdcmDICT;gdcmDSED;gdcmIOD;gdcmMSFF
Targets not yet defined:
gdcmexpat;gdcmopenjp2;gdcmcharls;gdcmzlib;socketxx;gdcmMEXD
Call Stack (most recent call first):
/usr/local/lib/gdcm-3.0/GDCMConfig.cmake:39 (include)
CMakeLists.txt:109 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/stefan/Desktop/BioClinica/bdtk/CMakeFiles/CMakeOutput.log".
See also "/home/stefan/Desktop/BioClinica/bdtk/CMakeFiles/CMakeError.log
这是文件中的一部分代码(来自报告的行GDCMConfig.make:37
)/usr/local/lib/gdcm-3.8/GDCMConfig.make
:
if(EXISTS ${SELF_DIR}/GDCMTargets.cmake)
# This is an install tree
include(${SELF_DIR}/GDCMTargets.cmake)
get_filename_component(GDCM_INCLUDE_ROOT "${SELF_DIR}/../../include/gdcm-3.0" ABSOLUTE)
set(GDCM_INCLUDE_DIRS ${GDCM_INCLUDE_ROOT})
get_filename_component(GDCM_LIB_ROOT "${SELF_DIR}/../../lib" ABSOLUTE)
set(GDCM_LIBRARY_DIRS ${GDCM_LIB_ROOT})
else()
if(EXISTS ${SELF_DIR}/GDCMExports.cmake)
# This is a build tree
set( GDCM_INCLUDE_DIRS "/home/stefan/gdcm-3.0.7/gdcm/Source/Common;/home/stefan/gdcm-3.0.7/gdcmbin/Source/Common;/home/stefan/gdcm-3.0.7/gdcm/Source/DataStructureAndEncodingDefinition;/home/stefan/gdcm-3.0.7/gdcm/Source/MediaStorageAndFileFormat;/home/stefan/gdcm-3.0.7/gdcm/Source/MessageExchangeDefinition;/home/stefan/gdcm-3.0.7/gdcm/Source/DataDictionary;/home/stefan/gdcm-3.0.7/gdcm/Source/InformationObjectDefinition")
set(GDCM_LIBRARY_DIRS "/home/stefan/gdcm-3.0.7/gdcmbin/bin/.")
include(${SELF_DIR}/GDCMExports.cmake)
else()
message(FATAL_ERROR "ooops")
endif()
endif()