-
Notifications
You must be signed in to change notification settings - Fork 196
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
Update CMake scripts #1365
Update CMake scripts #1365
Conversation
…ts. Add FindSamplerate for later use.
…app makes no sense (no proper game browser)
…ncy of Freetype/Harfbuzz. Fix PlayerFindPackage command. Cosmetics.
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.
Not tested yet, but looks nice and clean.
CMakeLists.txt
Outdated
|
||
project(EasyRPG_Player CXX C) | ||
set(PACKAGE_VERSION "0.5.3") | ||
project(EasyRPG_Player VERSION 0.5.3 LANGUAGES CXX C) |
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.
Should be safe to remove C
here.
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.
ping
CMakeLists.txt
Outdated
|
||
# Source Files | ||
set(PLAYER_SRCS | ||
add_library(${PROJECT_NAME}_Static |
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.
Does cmake still not support having different kinds of things (executable, library) with the same name? 👎 Maybe change the name to player_aux
or something.
Also, this might be a shared library without explicit setting STATIC
, no?
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.
is a static library by default because BUILD_SHARED_LIBS is OFF by default (strange default). But you are right, must force STATIC here.
Is not possible to have two targets with the same name but you can cheat:
https://gist.github.com/jlgerber/eafc4ee2b9954e27dd2bb009496b1b03#file-cmakelists-txt-L13
Will do this to get rid of _Static.
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.
nice, you are already using half of the cheat currently 👍
CMakeLists.txt
Outdated
else() | ||
message(STATUS "Resampler: None") | ||
message(STATUS "Resampler: None") | ||
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.
Maybe align everything with spaces (like the rest)?
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 was all really well aligned until fdela came and changed the Ogg playback string to Ogg vorbis playback :P.
Already played around with some alignments (and no alignments). The problem with no spacing at all is that it's harder to read IMHO.
But this change is obivously wrong, is wrong space to tab...... oO
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.
pong
good news: Even without vcpkg we can already switch to CMake completely. |
The opus issue should be fixed in vcpkg master! |
@ras0219-msft |
Good, waiting for the (hopefully final) rebase. |
oooh, I understood this wrong. The opus issue was already solved in the vcpkg package repo. Awesome :D |
…ecutable target with ${PROJECT_NAME}_exe
…pport before CMake 3.11. Handle the circular dependency on Harfbuzz in FindFreetype because the INTERFACE linkage is not supported before CMake 3.11.
…clude directories on macos
…check in player_find_package when no CONDITION is provided.
Fix whitespace.
Okay, that's enough (annoying) CMake work for now. |
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.
Works as expected.
Requires the liblcf cmake PR to work.
This updates all the CMake stuff to use targets.
Works for Windows, Linux and MacOSX, including static builds.
Under Windows I have a vcpkg issue: The opus vcxproj file compiles a sample c++ file in which means the main is overwritten when linking static m(. Must be fixed in vcpkg repo.
Simplified the code a bit by making Wildmidi always ON, doesn't matter if SDL2 or SDL2_Mixer is used. Still no love for OpenAL yet ^^'.
Added a new magical function player_find_package to reduce code duplication.