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

empty PREFIX leads to wrong path in INTERFACE_INCLUDE_DIRECTORIES on CMake #1481

Closed
dkroenke opened this issue Jul 11, 2022 · 0 comments · Fixed by #1503 or #1485
Closed

empty PREFIX leads to wrong path in INTERFACE_INCLUDE_DIRECTORIES on CMake #1481

dkroenke opened this issue Jul 11, 2022 · 0 comments · Fixed by #1503 or #1485
Assignees
Labels
bug Something isn't working

Comments

@dkroenke
Copy link
Member

Required information

Operating system:
E.g. Ubuntu 22.04

CMake version:
CMake 3.22.1

Observed result or behaviour:
The INTERFACE_INCLUDE_DIRECTORIES defined in the generated iceoryx_poshTargets.cmake
file contains invalid directory set to ${_IMPORT_PREFIX}/include//iceoryx/v2.90.0.
This affects all iceoryx packages.

When an external application tries to use the INTERFACE_INCLUDE_DIRECTORIES property,
the includes cannot be found.

test code in iceoryx example:

set(HOOFS_LIB)
get_target_property(HOOFS_LIB iceoryx_hoofs::iceoryx_hoofs INTERFACE_INCLUDE_DIRECTORIES)
message("HOOFS_LIB: " ${HOOFS_LIB})

output in out-of-tree build:

HOOFS_LIB: /home/my/folder/iceoryx/build/install/prefix/include//iceoryx/v2.90.0

Expected result or behaviour:

INTERFACE_INCLUDE_DIRECTORIES evaluates always to a valid directory
with set/unset PREFIX variable.

Conditions where it occurred / Performed steps:

The reason lies in this code snippet:

if(PREFIX STREQUAL "")
  set(PREFIX "${_unique_dir}")
else()
  set(PREFIX "${PREFIX}/${_unique_dir}")
endif()

The PREFIX expression evaluates here always to false even when the variable
is not set which is the case in iceoryx.

This leads to an attached / character
in the install include directories.
The generated include directory seems not to be affected by this.

Solution could be to evaluate the actual content of the Variable:

if("${PREFIX}" STREQUAL "")

FYI @sloretz

@dkroenke dkroenke added the bug Something isn't working label Jul 11, 2022
@dkroenke dkroenke self-assigned this Jul 11, 2022
dkroenke added a commit to ApexAI/iceoryx that referenced this issue Jul 11, 2022
dkroenke added a commit to ApexAI/iceoryx that referenced this issue Jul 11, 2022
dkroenke added a commit to ApexAI/iceoryx that referenced this issue Jul 11, 2022
dkroenke added a commit to ApexAI/iceoryx that referenced this issue Jul 13, 2022
dkroenke added a commit to ApexAI/iceoryx that referenced this issue Jul 13, 2022
dkroenke added a commit to ApexAI/iceoryx that referenced this issue Jul 14, 2022
dkroenke added a commit to ApexAI/iceoryx that referenced this issue Jul 14, 2022
dkroenke added a commit that referenced this issue Jul 14, 2022
…e-include-directories-cmake

iox-#1481 Fix interface include directories in CMake
elBoberido pushed a commit to ApexAI/iceoryx that referenced this issue Jul 14, 2022
dkroenke added a commit that referenced this issue Jul 15, 2022
…e-include-directories-cmake-release_2.0

iox-#1481 Set PREFIX in CMake directly [release_2.0]
@elBoberido elBoberido linked a pull request Jul 26, 2022 that will close this issue
21 tasks
@dkroenke dkroenke linked a pull request Sep 9, 2022 that will close this issue
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants