Skip to content

SDLWindow links to and export invalid target names #3

Description

@khardix

When building the GPUEngine addons (geAd), the configuration fails with following error(s):

$ cd GPUEngine
$ cmake . -DGPUENGINE_BUILD_geAd=ON
...
CMake Error at geAd/SDLWindow/CMakeLists.txt:34 (add_library):
  Target "SDLWindow" links to target "SDL2::SDL2" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at geAd/SDLWindow/CMakeLists.txt:34 (add_library):
  Target "SDLWindow" links to target "SDL2::SDL2main" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at geAd/SDLOrbitManipulator/CMakeLists.txt:32 (add_library):
  Target "SDLOrbitManipulator" links to target "SDL2::SDL2" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at geAd/SDLOrbitManipulator/CMakeLists.txt:32 (add_library):
  Target "SDLOrbitManipulator" links to target "SDL2::SDL2main" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
...

The SDL2 library is installed and found (the SDL2_FOUND variable is set).


After poking in the module search definitions, it seems that FindSDL2.cmake produces only target SDL2, not SDL2::SDL2 and SDL2::SDL2main – at least on my machine :)

After skype discussion with @forry, the suggested fix is to set External_deps_Export and External_libs in geAd/SDLWindow/CMakeLists.txt to only SDL2. I can confirm this fixes the issue on my machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions