[CMake] Variables in cmake-scripts

James C. Sutherland James.Sutherland at utah.edu
Fri Oct 2 10:37:02 EDT 2009


On Oct 2, 2009, at 8:20 AM, <mereandor at gmail.com>  
<mereandor at gmail.com> wrote:
>
> ----CMakeLists.txt----
> cmake_minimum_required(VERSION 2.6)
> SET(TEST CACHE STRING "test variable")
> INSTALL(SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/install.cmake)
>
> ----install.cmake----
> EXECUTE_PROCESS(
>  COMMAND "/bin/echo" "--test=${TESTVAR} --prefix=$ 
> {CMAKE_INSTALL_PREFIX}"
>  RESULT_VARIABLE AD_HDM_RV
> )
>
>
> Why is ${CMAKE_INSTALL_PREFIX} set and ${TESTVAR} not?
>
> thanks in advance for any help

CMAKE_INSTALL_PREFIX is a variable that is set by CMake to a default  
value of /usr/local on linux/unix flavor systems.

TESTVAR is something you need to set.


More information about the CMake mailing list