[CMake] Set directory path in release mode

Tyler Roscoe tyler at cryptio.net
Sat Jan 16 12:20:00 EST 2010


On Sat, Jan 16, 2010 at 05:02:32PM +0100, Arturo Caissut wrote:
> suggest I wrote a config.h.in file with pre-compiler instructions:
> 
> |#define ATLAS_TXT_PATH "@ATLAS_TXT_PATH@"
> #define ATLAS_HDR_PATH "@ATLAS_HDR_PATH@"
> |
> and I added to my CMakeLists.txt file the following lines:
> 
> |set (ATLAS_TXT_PATH "${PROJECT_BINARY_DIR}/ProgramData/Atlas/aal.txt")
> set (ATLAS_HDR_PATH "${PROJECT_BINARY_DIR}/ProgramData/Atlas/aal.hdr")
> 
> configure||_file (
> "${PROJECT_SOURCE_DIR}/path_to_config_file/Config.h.in"
> "${PROJECT_BINARY_DIR}/Config.h")
> 
> |
> This perfectly works as long as I'm using a Debug local version of the
> program I'm working at, but how can I provide the path constants to
> change in order to work as well when I build a Release version of the
> program, I package it and I install it to another computer?
> Package CMake code is working fine, Install id good written as well, but
> I need a way to define path constants to be useful when I'm installing
> the program.

Looks like Michael has already given you enough to move forward but I
don't understand how this code could work with Debug and not work with
Release. What error are you getting? It looks like this is for a Visual
Studio project?

Typically the answer to your question is to use CMAKE_CFG_INTDIR, but I
don't understand your problem.

tyler


More information about the CMake mailing list