Difference between revisions of "RecipeAppendVersionNumberToInstallpath"

From KitwarePublic
Jump to navigationJump to search
(Replace content with link to new CMake community wiki)
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
In some situations, it's necessary to keep older versions of a program along with the newer.  Here is a recipe for appending the version number to your install path:

<pre>PROJECT(MyProg C)
This page has moved [https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/recipe/AppendVersionNumberToInstallpath here].
SET (VERSION "0.1.4")
CACHE STRING "Install path" FORCE)
# and if you use CPack, just default the installer to the right path using:
The CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT is necessary here because if it's missing, the path becomes recursive and will continue to append ${PROJECT_NAME}-${VERSION} to the path infinitely.  The conditional ensures that it only does this once.

Latest revision as of 15:41, 30 April 2018

The CMake community Wiki has moved to the Kitware GitLab Instance.

This page has moved here.