-
Notifications
You must be signed in to change notification settings - Fork 147
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
cmake: allow overriding GME_ZLIB and GME_UNRAR options by user #632
Conversation
CMakeLists.txt
Outdated
if(NOT DEFINED GME_ZLIB) | ||
set(GME_ZLIB OFF) | ||
endif() | ||
if(NOT DEFINED GME_UNRAR) | ||
set(GME_UNRAR OFF) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this work for you too?
if(NOT DEFINED GME_ZLIB) | |
set(GME_ZLIB OFF) | |
endif() | |
if(NOT DEFINED GME_UNRAR) | |
set(GME_UNRAR OFF) | |
endif() | |
set(GME_ZLIB "OFF" CACHE BOOL "Build GME with zlib support") | |
set(GME_UNRAR "OFF" CACHE BOOL "Build GME with unrar support") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't work for me. I am setting GME_ZLIB from the project CMakeLists.txt before including SDL_mixer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to do the following in your cmake script:
set(GME_ZLIB ON CACHE BOOL "GME with zlib" FORCE)
set(GME_UNRAR ON CACHE BOOL "GME with unrar" FORCE)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it works, but as user just writing:
set(GME_ZLIB ON)
seems like more intuitive way for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one has a better behavior, I think.
if(NOT DEFINED GME_ZLIB) | |
set(GME_ZLIB OFF) | |
endif() | |
if(NOT DEFINED GME_UNRAR) | |
set(GME_UNRAR OFF) | |
endif() | |
option(GME_ZLIB "GME with zlib" OFF) | |
option(GME_UNRAR "GME with unrar" OFF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this seems like a better way. Also libgme CMakeLists no longer has GME_UNRAR option.
Could you please merge it into SDL2 too? |
I am using vendored SDL_mixer in my project and I need zlib support in libgme to load compressed VGMs. Current SDL_mixer CMake config disables it and doesn't allow user to enable it.