Hi, On Tue, Apr 03, 2012 at 05:33:15AM -0400, cmake-requ...@cmake.org wrote: > Date: Tue, 03 Apr 2012 11:33:10 +0200 > From: Gregor Jasny <gja...@googlemail.com> > Subject: [CMake] How to declare a text file as CMakeLists.txt > dependency > To: cmake@cmake.org > Message-ID: <4f7ac3d6.6020...@googlemail.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hello, > > In my root project CMakeLists.txt file I'm using the file(STRINGS ...) > command to read some version numbers from a text file. Now I'd like to > declare this text file as a CMakeLists.txt dependency to re-trigger the > CMake configuration step if a version number changes (Just like > re-configuration is triggered if I touch any CMakeLists.txt file). > > Is there an easy way to accomplish this?
Hrmm, I should be knowing this fully, but somehow I'm currently not entirely sure, but IMHO using configure_file() should provide exactly that. I.e. configure_file() from original file to the destination file which you then file(STRINGS...), and it should trigger re-configure whenever the original file changed. Andreas Mohr -- 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