MantisBT - CMake
View Issue Details
0006266CMakeCMakepublic2008-01-23 04:082008-01-23 08:14
Pau Garcia i Quiles 
 
normalfeaturealways
closedno change required 
 
 
0006266: Feature request: add #cmakedefine-like directive without #define
CMake allows to customize header files by using CONFIGURE_FILE and "#cmakedefine variable value", which generates "#define variable value".

It would be nice if we had something like #cmakedefine but for arbitrary files which only wrote the value. For example: "#cmakeset my_text", which would generate "my_text". It's a bit like having <?php my_php_code ?> tags in a .php file.

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} ).

NB: I know this can the done with FILE but I think the use case is common enough, and the implementation simple enough, to add this feature.
No tags attached.
patch cmakeset.patch (1,381) 2008-01-23 06:06
https://public.kitware.com/Bug/file/1291/cmakeset.patch
patch cmakeset-2.patch (1,382) 2008-01-23 06:39
https://public.kitware.com/Bug/file/1292/cmakeset-2.patch
patch cmakeset-documentation.patch (655) 2008-01-23 06:45
https://public.kitware.com/Bug/file/1293/cmakeset-documentation.patch
Issue History
2008-01-23 04:08Pau Garcia i QuilesNew Issue
2008-01-23 06:06Pau Garcia i QuilesFile Added: cmakeset.patch
2008-01-23 06:07Pau Garcia i QuilesNote Added: 0010220
2008-01-23 06:39Pau Garcia i QuilesFile Added: cmakeset-2.patch
2008-01-23 06:39Pau Garcia i QuilesNote Added: 0010221
2008-01-23 06:45Pau Garcia i QuilesFile Added: cmakeset-documentation.patch
2008-01-23 06:46Pau Garcia i QuilesNote Added: 0010222
2008-01-23 07:22Pau Garcia i QuilesNote Added: 0010223
2008-01-23 08:14Bill HoffmanStatusnew => closed
2008-01-23 08:14Bill HoffmanResolutionopen => no change required

Notes
(0010220)
Pau Garcia i Quiles   
2008-01-23 06:07   
The attached patch (cmakeset.patch) against CVS add the requested feature
(0010221)
Pau Garcia i Quiles   
2008-01-23 06:39   
cmakeset.patch introduced an extra space at the beginning of whatever followed #cmakewrite, cmakeset-2.patch is the right patch.
(0010222)
Pau Garcia i Quiles   
2008-01-23 06:46   
cmakeset-documentation.patch documents #cmakewrite
(0010223)
Pau Garcia i Quiles   
2008-01-23 07:22   
Scrap this feature request, it's already possible. My bad :-)