Re: [CMake] Global dependency

2014-08-27 Thread Petr Kmoch
Hi Jonas. As a hacky solution, you could override add_library() and add_executable(), like this: function(add_library targetName) _add_library(${targetName} ${ARGN}) add_dependencies(${targetName} BuildInfoDateTime) endfunction() Petr On Wed, Aug 27, 2014 at 5:44 AM, Jonas Lippuner

Re: [CMake] Global dependency

2014-08-27 Thread Jonas Lippuner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Petr, Thanks! This works. Best, Jonas - Original Message Subject: Re: [CMake] Global dependency From: Petr Kmoch petr.km...@gmail.com To: Jonas Lippuner jo...@lippuner.ca CC: cmake@cmake.org cmake@cmake.org Date: Tue 26 Aug

[CMake] Global dependency

2014-08-26 Thread Jonas Lippuner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I have a custom target called BuildInfoDateTime that generates a *.cpp file containing the date and time of the build. I specified the target with ALL, so it gets run if I simply type make. However, I would also like all other targets