Git Product home page Git Product logo

Comments (5)

Neumann-A avatar Neumann-A commented on May 7, 2024 1

Do you have a suggestion about how to solve this problem?

After your call to find_package succeeded define:
set(ITKDoubleConversion_LIBRARIES double-conversion::double-conversion)
or you have to change every file which tries to link against ITKDoubleConversion_LIBRARIES

INTERFACE_INCLUDE_DIRECTORIES is correct, but there is no property which points to the library to be linked.

That is hidden in the config. You can query the target with get_target_properties(imp_loc double-conversion::double-conversion IMPORTED_LOCATION_<CONFIG>)

In install tree either debug or release version of the library can be used

Copy the targets file manually and call one xxxTargets-release.cmake and xxxTargets-debug.cmake CMake will automatically pick the right one (requires ${_IMPORT_PREFIX} to point to the correct base directory). That is how VCPKG does it.

from double-conversion.

Neumann-A avatar Neumann-A commented on May 7, 2024

ah it could be that vcpkg manually extracts these information. Can be found in vcpkg_fixup_cmake_targets

No, it just copies files around and fixes paths.

from double-conversion.

dzenanz avatar dzenanz commented on May 7, 2024

set(ITKDoubleConversion_LIBRARIES double-conversion::double-conversion) passes configuration step, but generate step throw a lot of errors of the style:

CMake Error at cmake/ITKModuleMacros.cmake:468 (add_library):
  Target "ITKCommon" links to target "double-conversion::double-conversion"
  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/Core/Common/src/CMakeLists.txt:179 (itk_module_add_library)

CMake Error at cmake/ITKModuleMacros.cmake:468 (add_library):
  Target "ITKIOMeshVTK" links to target
  "double-conversion::double-conversion" 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/IO/MeshVTK/src/CMakeLists.txt:6 (itk_module_add_library)

IMPORTED_LOCATION_<CONFIG> and IMPORTED_LOCATION didn't help either. But LOCATION did! Here is my updated patch, which works for a single configuration (Debug/Release). I guess this will work fine on Linux.

from double-conversion.

Neumann-A avatar Neumann-A commented on May 7, 2024

Target "ITKCommon" links to target "double-conversion::double-conversion"
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/Core/Common/src/CMakeLists.txt:179 (itk_module_add_library)

CMake Error at cmake/ITKModuleMacros.cmake:468 (add_library):
Target "ITKIOMeshVTK" links to target
"double-conversion::double-conversion" 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/IO/MeshVTK/src/CMakeLists.txt:6 (itk_module_add_library)

That means the execution order within your CMakefiles is wrong. 3rd Party libraries must be found first before any non imported add_Library or add_executable call

updated patch

that is a hack I don't recommend. It won't work if the target defines IMPORTED_LOCATION_<CONFIG>. Link the target properly and you don't need INTERFACE_INCLUDE_DIRECTORIES nor IMPORTED_LOCATION_<CONFIG>

from double-conversion.

dzenanz avatar dzenanz commented on May 7, 2024

ITK's build system was made during the time of CMake 2.8. Rewriting it to use modern target-based syntax is a huge effort, which we are postponing for future. So we cannot link the target properly.

from double-conversion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.