kcat / alure

Alure is a utility library for OpenAL, providing a C++ API and managing common tasks that include file loading, caching, and streaming
zlib License
70 stars 20 forks source link

CMakeList ability to include/exclude static, shared and install targets #18

Closed edin-m closed 5 years ago

edin-m commented 6 years ago
  1. Use case: I want to include alure in my project through add_subdirectory() and I want to use it as a static library. I don't want to build the shared library if I don't need to. Or vice versa.

  2. When added with add_subdirectory() I got

    CMake Error: install(EXPORT "alure2" ...) includes target "alure2_s" which requires target "vorbisfile" that is not in the export set.

To go around I introduced ALURE_INSTALL_TARGETS which provides the ability to turn off creating installation targets if one needs for use case mentioned above.

All these variables are set as ON by default and their behavior is exactly like it was.

  1. Added macOS build instructions.
kcat commented 6 years ago

This should be mostly handled now with commit 7df89fada77c719529a580eeb91c50ca7f3d597c. It's lacking an option to disable the install, but I don't think that should be necessary. Does this work for you?

edin-m commented 5 years ago

I'd like an option to disable install as well. My use case is including this library through add_subdirectory. https://github.com/edin-m/gamedev-articles/blob/master/CMakeLists.txt#L341

kcat commented 5 years ago

Should be possible now with commit 95e9f29a9026cae4d52df1dbde5847cc8fb2b241. Building with ALURE_INSTALL set to OFF/FALSE disables the install targets.

edin-m commented 5 years ago

Cool, thanks.