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

Hendrik Sattler post at hendrik-sattler.de
Wed Jan 23 07:11:06 EST 2008


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.

HS




More information about the CMake mailing list