[CMake] Re: call a configure command

Alan W. Irwin irwin at beluga.phys.uvic.ca
Sat Dec 22 16:25:05 EST 2007


On 2007-12-22 17:16-0200 Rodolfo Schulz de Lima wrote:

>> Write a CMake script containing the configure command.  Invoke it at
>> build time using ADD_CUSTOM_COMMAND COMMAND ${CMAKE_COMMAND} -P
>> myscript .  Of course, this isn't going to configure anything.  :-)
>> Are you just trying to perform text substitutions or something?
>
> If he's trying to compile an external package from within cmake, I usually do 
> this by adding add_custom_command(OUTPUT ${srcdir}/Makefile COMMAND 
> ${srcdir}/configure ...) to the CMakeFile.txt, create another one to invoke 
> 'make' dependent of the ${srcdir}/Makefile of the last add_custom_command, 
> and finally use add_custom_target to create a target that initiates the whole 
> shebang, having as depedency the output of the last add_custom_command.

Hmm, Rod, those additional details about what you are doing have given me a
follow-up idea for the wx-config problem we previously discussed.

Note, you don't have to do any of the above with add_custom_command.  In
principle, you could also do those external builds with execute_process.
The difference, of course, is execute_process runs at CMake time so that
solves the issue we discussed before of wx-config from your build of
wxwidgets not being available at CMake time for the rest of your build.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list