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

COMP: Ensure proxTV dependencies are found when building against ITK build tree #29

Conversation

jcfr
Copy link
Contributor

@jcfr jcfr commented Dec 6, 2019

This issue was discovered in the following context:

  • ITK configured with Module_TotalVariation:BOOL=ON
  • OpenMP installed on the system: This means proxTV depends on OpenMP
  • ITK used from a build tree

Error reported was the following:

  CMake Error at /path/to/project-build/SlicerExecutionModel-build/CMake/SEMMacroBuildCLI.cmake:159 (add_executable):
    Target "AwesomeModule" links to target "OpenMP::OpenMP_CXX" but the
    target was not found.  Perhaps a find_package() call is missing for an
    IMPORTED target, or an ALIAS target is missing?
  Call Stack (most recent call first):
    Modules/AwesomeModule/CMakeLists.txt:46 (SEMMacroBuildCLI)

…build tree

This issue was discovered in the following context:
* ITK configured with Module_TotalVariation:BOOL=ON
* OpenMP installed on the system: This means proxTV depends on OpenMP
* ITK used from a build tree

Error reported was the following:

  CMake Error at /path/to/project-build/SlicerExecutionModel-build/CMake/SEMMacroBuildCLI.cmake:159 (add_executable):
    Target "AwesomeModule" links to target "OpenMP::OpenMP_CXX" but the
    target was not found.  Perhaps a find_package() call is missing for an
    IMPORTED target, or an ALIAS target is missing?
  Call Stack (most recent call first):
    Modules/AwesomeModule/CMakeLists.txt:46 (SEMMacroBuildCLI)
@jcfr jcfr requested review from thewtex and phcerdan December 6, 2019 00:51
@jcfr
Copy link
Contributor Author

jcfr commented Dec 6, 2019

Clean build is failing with the following configuration error:

CMake Error at /home/vsts/work/1/build/_deps/proxtv_fetch-build/proxTVConfig.cmake:11 (message):
  File or directory
  /home/vsts/work/1/build/_deps/proxtv_fetch-build/proxTVTargets.cmake
  referenced by variable proxTV_TARGETS does not exist !
Call Stack (most recent call first):
  /home/vsts/work/1/build/_deps/proxtv_fetch-build/proxTVConfig.cmake:17 (set_and_check)
  /home/vsts/work/1/ITK-build/lib/cmake/ITK-5.0/Modules/TotalVariation.cmake:20 (find_package)
  /home/vsts/work/1/ITK/CMake/ITKModuleAPI.cmake:76 (include)
  /home/vsts/work/1/ITK/CMake/ITKModuleAPI.cmake:7 (itk_module_load)
  /home/vsts/work/1/ITK/CMake/ITKModuleAPI.cmake:153 (_itk_module_use_recurse)
  /home/vsts/work/1/ITK/CMake/ITKModuleMacros.cmake:327 (itk_module_use)
  test/CMakeLists.txt:1 (itk_module_test)

Note that when I tested, I used an already configured ITK tree with an existing build of ProxTV

@phcerdan
Copy link
Collaborator

phcerdan commented Dec 6, 2019

Nice, thanks @jcfr.

About the new error:
could you paste the content of /home/vsts/work/1/build/_deps/proxtv_fetch-build/proxTVConfig.cmake?
The set_and_check line there (17), seems brittle.

set_and_check(proxTV_TARGETS "${CMAKE_CURRENT_LIST_DIR}/proxTVTargets.cmake")

Not sure what is the most reliable way to point to the xTargets,cmake file in xConfig.cmake, I assumed that both files are always in the same dir. But seems failing...

@phcerdan
Copy link
Collaborator

phcerdan commented Dec 6, 2019

I have no problems when building a project using a build tree of ITK when this module is built externally, i.e without Module_TotalVariation:BOOL=ON.

The in-source build has problems when not using SYSTEM_EIGEN too, but that not might be a problem if you are doing a superbuild. See #21

@phcerdan
Copy link
Collaborator

phcerdan commented Feb 7, 2020

Merging, as the _EXPORT_CODE_BUILD of this PR looks good.

@hjmjohnson hjmjohnson merged commit aee8abe into InsightSoftwareConsortium:master Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants