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

cmake: set RELEASE variable to generate install target #50581

Merged
merged 1 commit into from
Aug 8, 2021

Conversation

jwt27
Copy link
Contributor

@jwt27 jwt27 commented Aug 7, 2021

Summary

Build "Set RELEASE variable in root CMake script based on CMAKE_BUILD_TYPE, to generate install targets"

Purpose of change

The CMake scripts in the src and data subdirectories generate install targets when a RELEASE variable is set, but the root script does not define it. Perhaps users are expected to pass this to CMake manually (this is what I've been doing), but to my knowledge this is not documented anywhere.

Describe the solution

Set a RELEASE variable based on CMAKE_BUILD_TYPE in the root script.

Describe alternatives you've considered

This variable could be removed entirely, and the sub-CMakeLists could check CMAKE_BUILD_TYPE directly. I think having a separate variable is more convenient and readable.

Testing

Ran CMake with -DCMAKE_BUILD_TYPE=Release, the generated Makefile now has a working install target.

Additional context

N/A

@actual-nh actual-nh added <Bugfix> This is a fix for a bug (or closes open issue) Code: Build Issues regarding different builds and build environments labels Aug 7, 2021
@ZhilkinSerg ZhilkinSerg merged commit 37ceda9 into CleverRaven:master Aug 8, 2021
ZhilkinSerg added a commit to ZhilkinSerg/Cataclysm-DDA that referenced this pull request Aug 12, 2021
@jbytheway
Copy link
Contributor

Is there any reason not to always generate the install target? People might plausibly want to install the debug version too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) Code: Build Issues regarding different builds and build environments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants