Skip to content

CMake file sets incorrect INTERFACE_INCLUDE_DIRECTORIES path #32

@TheLastRar

Description

@TheLastRar

This was brought to my attention here PCSX2/pcsx2#12819 (who was using an AUR build of plutosvg from git)

Building plutosvg commit eb34f71 with the following CMake args;

-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="E:\Git\TheLastRar\pcsx2\deps" -DBUILD_SHARED_LIBS=ON -DPLUTOSVG_ENABLE_FREETYPE=ON -DPLUTOSVG_BUILD_EXAMPLES=OFF -B build -G Ninja

Will setup a plutosvgTargets.cmake file that creates a plutosvg::plutosvg target like so;

set_target_properties(plutosvg::plutosvg PROPERTIES
  INTERFACE_COMPILE_DEFINITIONS "PLUTOSVG_HAS_FREETYPE"
  INTERFACE_INCLUDE_DIRECTORIES "/plutosvg"
  INTERFACE_LINK_LIBRARIES "plutovg::plutovg;Freetype::Freetype"
)

This differs from release 0.0.7, which created a plutosvg::plutosvg target like so;

set_target_properties(plutosvg::plutosvg PROPERTIES
  INTERFACE_COMPILE_DEFINITIONS "PLUTOSVG_HAS_FREETYPE"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/plutosvg"
  INTERFACE_LINK_LIBRARIES "plutovg::plutovg;Freetype::Freetype"
)

When attempting to use said target from the git build (via target_link_libraries(imgui PUBLIC plutosvg::plutosvg)), I get the following error

CMake Error in 3rdparty/imgui/CMakeLists.txt:
  Imported target "plutosvg::plutosvg" includes non-existent path
    "/plutosvg"
  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
  * The path was deleted, renamed, or moved to another location.
  * An install or uninstall procedure did not complete successfully.
  * The installation package was faulty and references files it does not
  provide.
CMake Generate step failed.  Build files cannot be regenerated correctly.
-- Generating done (0.3s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions