[CMake] Can't set EXECUTABLE_OUTPUT_PATH ?

Miguel A. Figueroa-Villanueva miguelf at ieee.org
Sat Nov 24 20:40:37 EST 2007


On Nov 24, 2007 4:52 PM, Convey Christian J NPRI
<ConveyCJ at npt.nuwc.navy.mil> wrote:
> Hi guys,
>
> I'm using CMake 2.4-7 on Ubuntu Linux 7.10.  I have a trivial CMakeLists.txt
> file in which I'm just trying to specify where my build programs will go.
> (This is a distilled version of a larger, actually useful CMakeLists.txt
> file.):
>
> PROJECT(IVP_LOCAL)
> SET(EXECUTABLE_OUTPUT_PATH ${IVP_LOCAL_SOURCE_DIR}/bin)
> MESSAGE("EXECUTABLE_OUTPUT_PATH = " ${EXECUTABLE_OUTPUT_PATH})

Try the following:

SET(EXECUTABLE_OUTPUT_PATH ${IVP_LOCAL_SOURCE_DIR}/bin
    CACHE PATH "Single output directory for building all executables.")

> My problem is this:  When I run cmake, I get the following output, which is
> what I was hoping for:
>
> -- Check for working C compiler: /usr/bin/gcc
> -- Check for working C compiler: /usr/bin/gcc -- works
<snip>
> EXECUTABLE_OUTPUT_PATH = /home/cjc/moos-ivp-local/trunk/src/bin
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/cjc/moos-ivp-local/trunk/src
>
> But then when I run "ccmake ./", the variable EXECUTABLE_OUTPUT_PATH appears
> to be unset!
>
> Does anyone know why I might be seeing this?

EXECUTABLE_OUTPUT_PATH is a cache variable so you need to use this
version. The problem you are having is due to having a non-cache
variable named the same as your cache variable... ccmake will use the
cache, while message(...) is printing the non-cached version.

--Miguel


More information about the CMake mailing list