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

IgnImportTarget does not work correctly with <project>_LIBRARIES variables that contains link-time keyworks #65

Open
osrf-migration opened this issue Sep 14, 2019 · 0 comments
Labels
bug Something isn't working major

Comments

@osrf-migration
Copy link

Original report (archived issue) by Silvio Traversaro (Bitbucket: traversaro).


Prerequisites

  • Put an X between the brackets on this line if you have done all of the following:

Description

If a variable <project>_LIBRARIES contains a link-type keyword such as optimized or debug (such as `optimized;C:/vcpkg/installed/x64-windows/lib/libcurl.lib;debug;C:/vcpkg/installed/x64-windows/debug/lib/libcurl-d.lib`, see https://cmake.org/cmake/help/latest/command/target_link_libraries.html#overview), the ign_import_target CMake function does not work correctly.

Steps to Reproduce

  1. Install curl via vcpkg (that install curl both in Release and in Debug)
  2. Configure a CMake project with the following code:
find_package(CURL REQUIRED)
ign_import_target(curl
  LIB_VAR CURL_LIBRARIES
  INCLUDE_VAR CURL_INCLUDE_DIRS)

Expected behavior:

The curl::curl is correctly created without any error.

Actual behavior:

-- Found CURL: optimized;C:/vsts/_work/1/s/installed/arm64-windows/lib/libcurl.lib;debug;C:/vsts/_work/1/s/installed/arm64-windows/debug/lib/libcurl-d.lib (found version "7.65.2-DEV")  
CMake Error at C:/vsts/_work/1/s/installed/arm64-windows/share/ignition-cmake0/cmake0/IgnImportTarget.cmake:172 (set_target_properties):
  Property INTERFACE_LINK_LIBRARIES may not contain link-type keyword
  "debug".  The INTERFACE_LINK_LIBRARIES property may contain
  configuration-sensitive generator-expressions which may be used to specify
  per-configuration rules.
Call Stack (most recent call first):
  C:/vsts/_work/1/s/installed/arm64-windows/share/ignition-cmake0/cmake0/IgnImportTarget.cmake:100 (_ign_sort_libraries)
  C:/vsts/_work/1/s/installed/arm64-windows/share/ignition-cmake0/cmake0/FindIgnCURL.cmake:52 (ign_import_target)
  C:/vsts/_work/1/s/scripts/buildsystems/vcpkg.cmake:256 (_find_package)
  C:/vsts/_work/1/s/installed/arm64-windows/share/ignition-cmake0/cmake0/IgnUtils.cmake:146 (find_package)
  CMakeLists.txt:31 (ign_find_package)


CMake Error at C:/vsts/_work/1/s/installed/arm64-windows/share/ignition-cmake0/cmake0/IgnImportTarget.cmake:106 (set_target_properties):
  Property INTERFACE_LINK_LIBRARIES may not contain link-type keyword
  "optimized".  The INTERFACE_LINK_LIBRARIES property may contain
  configuration-sensitive generator-expressions which may be used to specify
  per-configuration rules.
Call Stack (most recent call first):
  C:/vsts/_work/1/s/installed/arm64-windows/share/ignition-cmake0/cmake0/FindIgnCURL.cmake:52 (ign_import_target)
  C:/vsts/_work/1/s/scripts/buildsystems/vcpkg.cmake:256 (_find_package)
  C:/vsts/_work/1/s/installed/arm64-windows/share/ignition-cmake0/cmake0/IgnUtils.cmake:146 (find_package)
  CMakeLists.txt:31 (ign_find_package)


-- Looking for IgnCURL - found

Reproduces how often:

All the time.

Versions

ignition-cmake0 0.6.1

Additional Information

Problem emerged in microsoft/vcpkg#8136 (comment) .

@osrf-migration osrf-migration added major bug Something isn't working labels Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working major
Projects
None yet
Development

No branches or pull requests

1 participant