2009/6/5 James Bigler <jamesbig...@gmail.com>: > if(NOT EXISTS ${dependency_file}) > #message("configuring dependency_file = ${dependency_file}") > configure_file( > ${empty_file} > ${dependency_file} IMMEDIATE) > endif()
The "IMMEDIATE" thing doesn't seem to be document, is it obsolete or undocumented? > # Always include this file to force CMake to run again next > # invocation and rebuild the dependencies. > #message("including dependency_file = ${dependency_file}") > include(${dependency_file}) > > I need to include the dependency file in my CMakeLists.txt file, so that if > the dependency file changes, CMake needs to rerun. If the file doesn't > exist, I need to create an empty file and include it, so that after the > first build (when the dependency file is finally generated) cmake runs again > to generate new build rules to incorporate the dependencies. CMake won't rerun itself on the first run right? You'll have to 1) cmake 2) first build will eventually rerun CMake ? > When I originally wrote this script several years ago, I had to use > configure_file, because write_file() wouldn't work. Since I'm updating the > script, I would like to remove the dependency on calling configure_file with > a blank file (empty file). Would file(WRITE ) ... + include(${dependency_file} OPTIONAL) be working for you ? See the extra OPTIONAL to include. I'm afraid I cannot answer to your question "theoretically" CMake developer may. >From my point of view you'll have to try. -- Erk _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake