Hi all,

I want to setup a default value for CMAKE_INSTALL_PREFIX
if the user did not indicate a value.

so I put:

IF (NOT CMAKE_INSTALL_PREFIX)
 SET(CMAKE_INSTALL_PREFIX "/opt/${PACKAGE_NAME}-${PACKAGE_VERSION}"
CACHE PATH "Install path prefix" FORCE)
ELSE (NOT CMAKE_INSTALL_PREFIX)
 MESSAGE("CMAKE_INSTALL_PREFIX already set to: ${CMAKE_INSTALL_PREFIX}")
ENDIF (NOT CMAKE_INSTALL_PREFIX)

but is seems that CMAKE_INSTALL_PREFIX is always set in cache
BEFORE I test this :((

What is the good way to change the default value of CMAKE_INSTALL_PREFIX
besides the usual:

cmake -DCMAKE_INSTALL_PREFIX=/opt/ ../mysource

I wanted the cmake run as simple as possible like

cmake /path/to/source


--
Erk
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to