Thank you both for you responses. As a side note, it might be nice to add a function to cmake along the lines of add_cmake_cache_dependency(…) or some better name that just adds the dependency without having to configure a dummy file.
-Kris From: David Cole [mailto:[email protected]] Sent: Tuesday, October 15, 2013 8:55 AM To: [email protected]; [email protected] Cc: [email protected] Subject: Re: [CMake] Correct way to make an arbitrary file trigger a reconfigure... Kris, I would use your configure_file construct if I had a reason to do this. It will work regardless of platform or CMake generator chosen... I would even go so far as to call it "the recommended way." HTH, David -----Original Message----- From: Sergey Lekhanov <[email protected]<mailto:[email protected]>> To: Kris Malfettone <[email protected]<mailto:[email protected]>> Cc: Kris Malfettone <[email protected]<mailto:[email protected]>>; cmake <[email protected]<mailto:[email protected]>> Sent: Mon, Oct 14, 2013 9:30 pm Subject: Re: [CMake] Correct way to make an arbitrary file trigger a reconfigure... Hi Kris, I have done that by following: 1) use Ninja Generator; 2) include empty "rerun.cmake" file, I put this file into binary dir, so I need a patch; 3) add a patch to Ninja Generator to correctly write dependencies for "build.ninja" from included cmake files, if cmake file is in the binary directory; 4) add a custom commands that check the new files and touching "rerun.cmake" file; 5) once "rerun.cmake" file is touched ninja will rerun cmake; Best regards, Sergey — Sent from Mailbox for iPhone On Tue, Oct 15, 2013 at 7:02 AM, Malfettone, Kris <[email protected]<mailto:[email protected]>> wrote: Anyone? From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Malfettone, Kris Sent: Thursday, October 03, 2013 8:43 AM To: [email protected]<mailto:[email protected]> Subject: [CMake] Correct way to make an arbitrary file trigger a reconfigure... Hi, I am trying to make cmake reconfigure whenever a certain file is touched. This is because the file ends up listing out a set of directories that need to be built during the build. Currently I do a trick where I use configure file to write out a file that will never be used but causes the input file to trigger reconfigures. For example: configure_file( file_i_care_about.txt ${CMAKE_CURRENT_BINARY_DIR}/tmp_file_that_isn’t_used.txt ) Is there another recommended way or is this the best approach. I have tried searching for this but haven’t found anything on it yet. -Kris ________________________________ IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses. ________________________________ IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses. -- Powered by www.kitware.com<http://www.kitware.com> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ________________________________ IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
