Skip to content

CMakeLists.txt does not expose include directories #1328

Description

@Mrkol

When one adds allegro5 via add_subdirectory to a cmake project, neither does one get the required include directories set as a property on the allegro target (the preferred way), nor does one get a global cmake variable like `allegro_INCLUDE_DIRECTORIES" (the bad, oldschool way).

For now I had to hack my way around this by manually doing
target_include_directories(allegro INTERFACE <main include folder> <build include path for codegen> <list of enabled addon include folders>),
but allegro's cmakelists could and should do this target_include_directories action on its own.
Please consider adding those.

P.S.
This would make using allegro in cmake projects extremely easy via cpm.cmake:

CPMAddPackage("gh:liballeg/allegro5")
...
add_executable(myHelloWorldApp ...)
target_link_libraries(myHelloWorldApp allegro)

while as it is now I had to spend a couple hours hacking my way around the lack of include directory info.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions