[CMake] Variables in cmake-scripts
Michael Jackson
mike.jackson at bluequartz.net
Fri Oct 2 10:30:44 EDT 2009
where is TESTVAR ever set?
_________________________________________________________
Mike Jackson mike.jackson at bluequartz.net
BlueQuartz Software www.bluequartz.net
Principal Software Engineer Dayton, Ohio
On Oct 2, 2009, at 10:20 AM, mereandor at gmail.com wrote:
> Hi!
>
> I have a question regarding cmake-scripts:
>
> I have this simple example:
>
> ----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
> )
>
> Here is the input and output that I get:
>
> $ cmake -DTESTVAR=something
> -- The C compiler identification is GNU
> -- The CXX compiler identification is GNU
> -- Check for working C compiler: /usr/bin/gcc
> -- Check for working C compiler: /usr/bin/gcc -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working CXX compiler: /usr/bin/c++
> -- Check for working CXX compiler: /usr/bin/c++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/mereandor/test
> $ make install
> Install the project...
> -- Install configuration: ""
> --test= --prefix=/usr/local
>
> Why is ${CMAKE_INSTALL_PREFIX} set and ${TESTVAR} not?
>
> thanks in advance for any help
>
> regards
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
More information about the CMake
mailing list