[CMake] 'recursive' or multiple level @@ replacement in configure_file

J.S. van Bethlehem j.s.van.bethlehem at astro.rug.nl
Thu May 5 07:08:06 EDT 2011


Today I was trying something along the following lines:
in CMakeLists.txt
set(BASENAME some_text)
set(${BASENAME}_DIR /some/path)
set(${BASENAME}_SHARE /some/other/path)
set(${BASENAME}_INCLUDES file1.h;file2.h;file3.h)
configure_file(config.h.in config.h @ONLY)

and in config.h.in do:
foreach(incl ${INSTALL_PATH})
# do something
endforeach(incl ${INSTALL_PATH})

My expectation was that first @BASENAME@ would evaluate to 'some_text' 
after which @some_text_DIR@ would evaluate to the respective value. This 
fails, so the obvious question is: am I trying something that is simply 
not possible, or should I use different syntax to accomplish this?

Yours sincerely,
Jakob van Bethlehem

More information about the CMake mailing list