Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find_package(ITK 4.5 COMPONENT) corrupted by SEM #35

Closed
hjmjohnson opened this issue Jul 7, 2014 · 4 comments
Closed

find_package(ITK 4.5 COMPONENT) corrupted by SEM #35

hjmjohnson opened this issue Jul 7, 2014 · 4 comments

Comments

@hjmjohnson
Copy link
Member

The CMakeLists.txt file below is a simple example that demonstrates that including SEM before ITK causes find_package(ITK COMPONENTS ) to be corrupted.

SlicerExecutionModel hash 865e2a7 does not seem to exhibit this behavior.

cmake_minimum_required(VERSION 3.0)
project(test)

set(ITK_IO_MODULES_USED "")
set(ITK_MODULES_USED
ITKAnisotropicSmoothing
ITKBinaryMathematicalMorphology
ITKCommon
ITKConnectedComponents
ITKCurvatureFlow
ITKDeprecated
ITKDiffusionTensorImage
ITKDisplacementField
ITKDistanceMap
ITKFFT
ITKFastMarching
ITKHDF5
ITKIOBMP
ITKIOBioRad
ITKIODCMTK
ITKIOGDCM
ITKIOGE
ITKIOGIPL
ITKIOImageBase
ITKIOJPEG
ITKIOLSM
ITKIOMeta
ITKIONIFTI
ITKIONRRD
ITKIOPNG
ITKIORAW
MGHIO
ITKIOSpatialObjects
ITKIOStimulate
ITKIOTIFF
ITKIOTransformBase
ITKIOXML
ITKImageAdaptors
ITKImageCompare
ITKImageCompose
ITKImageFeature
ITKImageFilterBase
ITKImageFunction
ITKImageFusion
ITKImageGradient
ITKImageGrid
ITKImageIntensity
ITKImageSources
ITKImageStatistics
ITKLabelMap
ITKLabelVoting
ITKLevelSets
ITKMathematicalMorphology
ITKMesh
ITKMetricsv4
ITKOptimizers
ITKOptimizersv4
ITKPDEDeformableRegistration
ITKQuadEdgeMesh
ITKQuadEdgeMeshFiltering
ITKRegionGrowing
ITKRegistrationCommon
ITKRegistrationMethodsv4
ITKReview
ITKSmoothing
ITKSpatialObjects
ITKStatistics
ITKTestKernel
ITKThresholding
ITKTransform
ITKV3Compatibility
${ITK_VTK_COMPONENTS}
${ITK_IO_MODULES_USED}
)

option(SEMFIRST "Include SEM First" ON)

if(SEMFIRST)

THIS FAILS

find_package(SlicerExecutionModel REQUIRED GenerateCLP)
include(${GenerateCLP_USE_FILE})
include(${SlicerExecutionModel_USE_FILE})
include(${SlicerExecutionModel_CMAKE_DIR}/SEMMacroBuildCLI.cmake)
message(STATUS "YYYY ${ITK_INCLUDE_DIRS}")

find_package(ITK 4.5 COMPONENTS
${ITK_MODULES_USED}
REQUIRED
)
include(${ITK_USE_FILE})
message(STATUS "XXXX ${ITK_INCLUDE_DIRS}")
else()

THIS WORKS

find_package(ITK 4.5 COMPONENTS
${ITK_MODULES_USED}
REQUIRED
)
include(${ITK_USE_FILE})
find_package(SlicerExecutionModel REQUIRED GenerateCLP)
include(${GenerateCLP_USE_FILE})
include(${SlicerExecutionModel_USE_FILE})
include(${SlicerExecutionModel_CMAKE_DIR}/SEMMacroBuildCLI.cmake)
message(STATUS "YYYY ${ITK_INCLUDE_DIRS}")

message(STATUS "XXXX ${ITK_INCLUDE_DIRS}")

endif()

@hjmjohnson
Copy link
Member Author

@thewtex

Matt, I think you may also be interested in knowing about this funny behavior when using recent SlicerExecutionModel checkouts.

@hjmjohnson
Copy link
Member Author

@jcfr
JC,

I think this most recent patch in SlicerExecutionModel breaks behavior of find_package(ITK 4.5 COMPONENTS XXXX).

The included CMakeLists.txt file demonstrates the bad behavior.

When SEM is found first, and ITK found second, the incorrect (severely truncated include paths) is present.

When SEM is second, then all seems to work OK.

Hans

@thewtex
Copy link
Member

thewtex commented Jul 8, 2014

@hjmjohnson Thanks for identifying the issue.

Tracker here

https://issues.itk.org/jira/browse/ITK-3294

@jcfr

thewtex added a commit to thewtex/SlicerExecutionModel that referenced this issue Jul 21, 2014
…er#35

Setting ITK_FOUND to FALSE after calling find_package(ITK COMPONENTS
${components}) will cause CMake to re-run the find_package process with
a new set of COMPONENTS.
thewtex added a commit to thewtex/SlicerExecutionModel that referenced this issue Jul 21, 2014
…er#35

Setting ITK_FOUND to FALSE after calling find_package(ITK COMPONENTS
${components}) will cause CMake to re-run the find_package process with
a new set of COMPONENTS.
jcfr added a commit that referenced this issue Jul 21, 2014
BUG: Allow projects to specify their own list of ITK COMPONENTS. #35
jcfr added a commit to Slicer/SlicerGitSVNArchive that referenced this issue Jul 21, 2014
Associated issues:
  https://issues.itk.org/jira/browse/ITK-3294
  Slicer/SlicerExecutionModel#35

Thanks to "Hans Johnson <hans-johnson@uiowa.edu>" for tracking down
and identifying the problem and thanks to "Matt McCormick <matt.mccormick@kitware.com>"
for submitting a fix.

//---------------
$ git shortlog 4e61f6..feef59e --no-merges
Matt McCormick (1):
      BUG: Allow projects to specify their own list of ITK COMPONENTS. #35
//---------------

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23471 3bd1e089-480b-0410-8dfb-8563597acbee
finetjul pushed a commit to finetjul/Slicer that referenced this issue Jul 30, 2014
Associated issues:
  https://issues.itk.org/jira/browse/ITK-3294
  Slicer/SlicerExecutionModel#35

Thanks to "Hans Johnson <hans-johnson@uiowa.edu>" for tracking down
and identifying the problem and thanks to "Matt McCormick <matt.mccormick@kitware.com>"
for submitting a fix.

//---------------
$ git shortlog 4e61f6..feef59e --no-merges
Matt McCormick (1):
      BUG: Allow projects to specify their own list of ITK COMPONENTS. Slicer#35
//---------------

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23471 3bd1e089-480b-0410-8dfb-8563597acbee
@hjmjohnson
Copy link
Member Author

Assuming this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants