[CMake] Set directory path in release mode

Arturo Caissut arturo_caissut at tiscali.it
Sat Jan 16 12:10:40 EST 2010


So I should do it in my code instead of trying a CMake based solution,
like with a file attributes check.

Thank you very much,
Arturo


Michael Wild wrote:
> Usually one configures such config.h files for the installation paths, not the build directory. For my programs I do it like this to find some file:
>
> - check whether the environment variable ATLAS_CONFIG_DIR is set and the file $ATLAS_CONFIG_DIR/aal.txt exists
> - check whether the file $HOME/.config/Atlas/aal.txt exists (or similar)
> - check whether the configured path (e.g. ${CMAKE_INSTALL_PREFIX}/etc/Atlas/aal.txt exists
> - abort and scold the user
>
> This way the user (and you, while debugging!) can override the location of the file(s), provide a user-specific version in $HOME/.config/Atlas (doesn't make sense for some kind of configuration/data files) or simply use the default, installed one.
>
>
> HTH
>
> Michael
>
>
>   



More information about the CMake mailing list