Err, I meant eval(some_func()) in the wrapper, not eval(include(Module)). Sorry for the top-post, using my phone.<br><br>----- Reply message -----<br>From: "Wojciech Knapik" <wmknapik@gmail.com><br>To: <cmake-developers@cmake.org><br>Subject: [cmake-developers] Function overrides<br>Date: Thu, Jun 6, 2013 11:23<br><br><br>On Mon, Jun 03, 2013 at 09:11:07AM -0400, Brad King wrote:<br>> On 05/30/2013 04:16 PM, Wojciech Knapik wrote:<br>> > A few months pass, a few more modules get written and it all turns out<br>> > to work quite nicely, so I decide to publish them as open source, for<br>> > everyone's benefit. How do I distribute these modules and allow people<br>> > to use any combination of them ? Do I create a separate wrapper for<br>> > every combination ?<br>> <br>> We've done this with many projects.  We just create a project-specific<br>> wrapper in the projects's own CMakeLists.txt files and then teach it<br>> to invoke all the third-party helpers we want.<br>> <br>> include(FancyMod1)<br>> include(FancyMod2)<br>> function(myproj_add_executable)<br>>   add_executable(${ARGN})<br>>   fm1_help_exe(${ARGN})<br>>   fm2_help_exe(${ARGN})<br>> endfunction()<br><br>This is fine in the specific case, where I know which set of modules is<br>going to be used in the project. But I'd like to distribute a number of<br>modules, that only require "include(Module)" from the user. At the most,<br>there could be another module that does the function overrides. But the<br>key thing is, I don't know which subset of modules a user will choose,<br>so I can't blindly construct the overrides.<br><br>If CMake had at least an eval() function, I could append any of my<br>modules included to a list and then eval("include Module") for each<br>element in the list. But that's not possible.<br><br>I don't want to make the user do complex things, like creating overrides<br>for 4 functions - I know what needs to be done and I don't want to<br>require any explicit configuration from the user. Wouldn't it be nice if<br>you could just include a handful of modules and get support for<br>everything you need in your project ? That's what I'm trying to do here.<br><br>WK<br>