Skip to content

cmake: don't use PREFIX variable#50564

Merged
ZhilkinSerg merged 1 commit intoCleverRaven:masterfrom
jwt27:cmake-prefix
Aug 7, 2021
Merged

cmake: don't use PREFIX variable#50564
ZhilkinSerg merged 1 commit intoCleverRaven:masterfrom
jwt27:cmake-prefix

Conversation

@jwt27
Copy link
Copy Markdown
Contributor

@jwt27 jwt27 commented Aug 7, 2021

Summary

Build "Avoid use of reserved word PREFIX in CMake build script"

Purpose of change

The PREFIX variable appears to be a reserved word in CMake. When set, it breaks compiler and library detection, so this should not be used to specify the installation directory.

Describe the solution

Remove the use of PREFIX in CMakeLists.txt, and instead use CMAKE_INSTALL_PREFIX for this purpose.

Describe alternatives you've considered

One could rename this variable to something else, in case it is desirable to define the PREFIX macro to one location and install the game to another. I see no reason why anyone would want to do this.

Testing

Compiled and installed in Release mode. The game launches and plays fine.

Additional context

N/A

`PREFIX` is a reserved word in CMake and breaks compiler and library detection
when set.  Using `CMAKE_INSTALL_PREFIX` instead resolves this.
@BrettDong BrettDong added the Code: Build Issues regarding different builds and build environments label Aug 7, 2021
@ZhilkinSerg ZhilkinSerg merged commit 5e75957 into CleverRaven:master Aug 7, 2021
@actual-nh actual-nh added 0.F Backport Candidate <Bugfix> This is a fix for a bug (or closes open issue) labels Aug 7, 2021
ZhilkinSerg added a commit to ZhilkinSerg/Cataclysm-DDA that referenced this pull request Aug 12, 2021
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