[CMake] Feature request (with patch): add #cmakedefine-like directive without #define

Pau Garcia i Quiles pgquiles at elpauer.org
Wed Jan 23 07:24:06 EST 2008


Quoting Hendrik Sattler <post at hendrik-sattler.de>:

> Quoting Pau Garcia i Quiles <pgquiles at elpauer.org>:
>> It would be nice if we had something like #cmakedefine but for
>> arbitrary files which only wrote the value. For example: "#cmakewrite
>> my_text", which would generate "my_text".
>>
>> Use case: combined use of configuration files and INSTALL directives.
>> I need to specify the application directory both in pfsi.conf and in
>> CMakeLists.txt for INSTALL( FILES ${PROJECT_SOURCE_DIR}/pfsi.png
>> DESTINATION ${CMAKE_INSTALL_PREFIX}/{PFSI_APP_DIR} ).
>>
>> For example, the configuration file pfsi.conf.cmake could then be:
>> --------------------
>> [global]
>>
>> #cmakewrite application_directory = ${PFSI_APP_DIR}
>>
>> [shared_folders]
>>
>> digest = /usr/wt/pfsi/htdigest-pfsi
>> shared_folders_directory = /media/tragabytes/webdav
>> ---------------------
>
> You mean something like
> [global]
> application_directory = @PFSI_APP_DIR@
>
> That's already possible.

Holy shit, I'm reinventing the wheel! :-)

Thank you.

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)



More information about the CMake mailing list