[CMake] an akward preprocessor

Michael Hertling mhertling at online.de
Tue Nov 23 00:43:17 EST 2010


On 11/22/2010 10:39 PM, luxInteg wrote:
> Greetings
> I am learning cmake
> 
> I have a small project     to be installed in some directory $INSTALLED 
> =/whatever/installed/directory/is
> 
> 
> I have some files say  fila1.c ..File2.c  to compile   with a preprocessor 
> that includes a reference to  $INSTALL
> how do I set  the compile properties of files with this?
> 
> do I do :- 
> -DWITH_INSTALL_DIR or 
> -Dwhatever_installed_directory_is (i.e. for example -D/usr/local)  
> or ?????

Consider ADD_DEFINITIONS(-DWITH_INSTALL_DIR=...); alternatively, you
might add "WITH_INSTALL_DIR=..." to the COMPILE_DEFINITIONS target/
directory/source properties.

Regards,

Michael


More information about the CMake mailing list