From a7dc451db17bce4d1513296b5f2d414a6c771fd4 Mon Sep 17 00:00:00 2001 From: Julien Finet Date: Fri, 26 Jun 2020 13:17:55 +0200 Subject: [PATCH] COMP: Do not link ModuleDescriptionParser with entire ITK find_package(ParameterSerializer) may do a find_package(ITK) that may changes ITK_LIBRARIES used to target_link_libraries. See https://github.com/InsightSoftwareConsortium/ITK/issues/1892 --- ModuleDescriptionParser/CMakeLists.txt | 31 +++++++++++++------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/ModuleDescriptionParser/CMakeLists.txt b/ModuleDescriptionParser/CMakeLists.txt index b5375a6..017142c 100644 --- a/ModuleDescriptionParser/CMakeLists.txt +++ b/ModuleDescriptionParser/CMakeLists.txt @@ -15,21 +15,6 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) "MinSizeRel" "RelWithDebInfo") endif() -# -------------------------------------------------------------------------- -# Prerequisites -# -------------------------------------------------------------------------- - -# -# ITK -# -set(${PROJECT_NAME}_ITK_COMPONENTS - ITKCommon# For itksys - ITKIOXML # For ITKEXPAT - ITKExpat # For Expat library - ) -find_package(ITK 4.3 COMPONENTS ${${PROJECT_NAME}_ITK_COMPONENTS} REQUIRED) -include(${ITK_USE_FILE}) - # -------------------------------------------------------------------------- # Option(s) # -------------------------------------------------------------------------- @@ -46,6 +31,22 @@ if(ModuleDescriptionParser_USE_SERIALIZER) include_directories(${ParameterSerializer_INCLUDE_DIRS}) endif() +# -------------------------------------------------------------------------- +# Prerequisites +# -------------------------------------------------------------------------- + +# +# ITK +# +set(${PROJECT_NAME}_ITK_COMPONENTS + ITKCommon# For itksys + ITKIOXML # For ITKEXPAT + ITKExpat # For Expat library + ) + +find_package(ITK 4.3 COMPONENTS ${${PROJECT_NAME}_ITK_COMPONENTS} REQUIRED) +include(${ITK_USE_FILE}) + #----------------------------------------------------------------------------- # Testing #-----------------------------------------------------------------------------