Skip to content

Commit c55c215

Browse files
LucasGandelthewtex
authored andcommitted
BUG: Fix link error related to ITKExpat when using ITK > v4.8.1
ITKEXPAT is no longer used and has been replaced by the ITKExpat module which is now included by setting the project's COMPONENTS. This allows the use of a system installed and packaged expat library, which saves build time and improves integration into package managers. See InsightSoftwareConsortium/ITK@ad26080 This commit integrates contribution by Hans Johnson (See PR #48), where ITKExpat is add to the COMPONENTS to find_packages ITK. This results in the following test failures: 6 - GenerateCLPTest-Slicer3Example-Build (Failed) 7 - GenerateCLPTest-Slicer3Example-Test (Failed) 9 - GenerateCLPTest-PointExample1-Build (Failed) 11 - GenerateCLPTest-CLPExample1-Build (Failed) That fail with the error: 11: [3/3] Linking CXX executable CLPExample1 11: 11: FAILED: : && /home/matt/bin/exe/c++ -Os -DNDEBUG 11: CMakeFiles/CLPExample1.dir/CLPExample1.cxx.o -o CLPExample1 -rdynamic 11: -lITKEXPAT && : 11: 11: 11: /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/../../../../x86_64-pc-linux-gnu/bin/ld: 11: cannot find -lITKEXPAT
1 parent 4d4e69a commit c55c215

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

GenerateCLP/Testing/CLPExample1/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ endif()
2626
set(${PROJECT_NAME}_SOURCE ${PROJECT_NAME}.cxx)
2727
GENERATECLP(${PROJECT_NAME}_SOURCE ${PROJECT_NAME}.xml)
2828
add_executable(${PROJECT_NAME} ${${PROJECT_NAME}_SOURCE})
29-
target_link_libraries(${PROJECT_NAME} ITKEXPAT ${_additional_link_libraries})
30-
29+
if(_additional_link_libraries)
30+
target_link_libraries(${PROJECT_NAME} ${_additional_link_libraries})
31+
endif()
3132
#-----------------------------------------------------------------------------
3233
# Test
3334
#-----------------------------------------------------------------------------

GenerateCLP/Testing/PointExample1/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ endif()
2626
set(${PROJECT_NAME}_SOURCE ${PROJECT_NAME}.cxx)
2727
GENERATECLP(${PROJECT_NAME}_SOURCE ${PROJECT_NAME}.xml)
2828
add_executable(${PROJECT_NAME} ${${PROJECT_NAME}_SOURCE})
29-
target_link_libraries(${PROJECT_NAME} ITKEXPAT ${_additional_link_libraries})
29+
if(_additional_link_libraries)
30+
target_link_libraries(${PROJECT_NAME} ${_additional_link_libraries})
31+
endif()

GenerateCLP/Testing/Slicer3Example/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ endif()
2626
set(${PROJECT_NAME}_SOURCE ${PROJECT_NAME}.cxx)
2727
GENERATECLP(${PROJECT_NAME}_SOURCE ${PROJECT_NAME}.xml)
2828
add_executable(${PROJECT_NAME} ${${PROJECT_NAME}_SOURCE})
29-
target_link_libraries(${PROJECT_NAME} ITKEXPAT ${_additional_link_libraries})
29+
if(_additional_link_libraries)
30+
target_link_libraries(${PROJECT_NAME} ${_additional_link_libraries})
31+
endif()
3032

3133
#-----------------------------------------------------------------------------
3234
# Test

0 commit comments

Comments
 (0)