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

Overriding CMAKE_INSTALL_PREFIX is bad practice #12

Open
patbrandt opened this issue Mar 31, 2021 · 0 comments
Open

Overriding CMAKE_INSTALL_PREFIX is bad practice #12

patbrandt opened this issue Mar 31, 2021 · 0 comments

Comments

@patbrandt
Copy link

SET(CMAKE_INSTALL_PREFIX ${FMILIB_INSTALL_PREFIX} CACHE INTERNAL "Prefix prepended to install directories" FORCE)

Though calling it "practice" implies that I've ever seen it done elsewhere. This is silently and forcibly(!) setting a core cmake option to something other than what the user might specify, which is not great. In isolation to one project (this one), it's... probably fine? When building code with/against FMILibrary it blows up.

We are attempting to use FMILibrary as a sub-project, and this line nukes the install path for the rest of our code, unless we set the FMI-specific install path to the same one. Which, to be fair, we probably would, but it's a pit that we easily fell into.

My recommendation would be to simply use CMAKE_INSTALL_PREFIX natively, but at the very least don't override user settings for standard cmake variables.

jschueller added a commit to jschueller/fmi-library that referenced this issue Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant