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

Fix CMake compatibility with older SDL2 config files + improve install tree #78

Merged
merged 3 commits into from
Oct 14, 2022

Conversation

madebr
Copy link
Contributor

@madebr madebr commented Oct 12, 2022

  • Fixes Error building with macOS Monterey and CMake 3.24 #77
  • Installs CMake configuration files such that people can use SDL2_sound in their CMake project as follows:
    find_package(SDL2_sound REQUIRED CONFIG)
    target_link_libraries(mygame PRIVATE SDL2_sound::SDL2_sound)
    This is also tested on CI

A Linux install tree looks like follows:

prefix
├── bin
│   └── playsound
├── include
│   └── SDL2
│       └── SDL_sound.h
└── lib64
    ├── cmake
    │   └── SDL2_sound
    │       ├── SDL2_soundConfig.cmake
    │       ├── SDL2_soundConfigVersion.cmake
    │       ├── SDL2_sound-shared-targets.cmake
    │       ├── SDL2_sound-shared-targets-debug.cmake
    │       ├── SDL2_sound-static-targets.cmake
    │       └── SDL2_sound-static-targets-debug.cmake
    ├── libSDL2_sound.a
    ├── libSDL2_sound.so -> libSDL2_sound.so.2
    ├── libSDL2_sound.so.2 -> libSDL2_sound.so.2.0.1
    ├── libSDL2_sound.so.2.0.1
    └── pkgconfig
        └── SDL2_sound.pc

A MinGW install tree looks like follows:

prefix
├── bin
│   ├── playsound.exe
│   └── SDL2_sound.dll
├── include
│   └── SDL2
│       └── SDL_sound.h
└── lib
    ├── cmake
    │   └── SDL2_sound
    │       ├── SDL2_soundConfig.cmake
    │       ├── SDL2_soundConfigVersion.cmake
    │       ├── SDL2_sound-shared-targets.cmake
    │       ├── SDL2_sound-shared-targets-release.cmake
    │       ├── SDL2_sound-static-targets.cmake
    │       └── SDL2_sound-static-targets-release.cmake
    ├── libSDL2_sound.a
    ├── libSDL2_sound.dll.a
    └── pkgconfig
        └── SDL2_sound.pc

@ericoporto
Copy link
Contributor

Hey, this is pretty good! These config CMake files are very useful and would be really cool to have a release tag including this PR so they can propagate to the package managers.

@sezero
Copy link
Collaborator

sezero commented Oct 13, 2022

Is the patch finalized?

@madebr
Copy link
Contributor Author

madebr commented Oct 13, 2022

Is the patch finalized?

I think so. Let it settle for a day for eventual passers-by, and merge.

@sezero sezero merged commit 3dc2d1b into icculus:main Oct 14, 2022
@sezero
Copy link
Collaborator

sezero commented Oct 14, 2022

This is in now.

@madebr madebr deleted the cmake-fixes branch October 14, 2022 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error building with macOS Monterey and CMake 3.24
3 participants