[CMake] EXECUTE_PROCESS too good at running programs

Brandon J. Van Every bvanevery at gmail.com
Sat Jul 22 12:45:30 EDT 2006


William A. Hoffman wrote:
> At 08:17 AM 7/22/2006, Brad King wrote:
>   
>> Brandon J. Van Every wrote:
>>     
>>> Ok, the CMake 2.4.2 documentation for the projectName version of TRY_COMPILE is only 3 short sentences.  IIUYC, you are saying I'm going to have to write a CMakeLists.txt wrapper, and a subdirectory, for each and every tool like "makeinfo," if I want to prove that they work in the build.
>>>       
>> You can create a macro to wrap this all up.  The source tree for the TRY_COMPILE can be created with FILE(WRITE) and FILE(MAKE_DIRECTORY).
>>     
>
> Regardless of the documentation, try-compile and not exec_process is what is supposed
> to be used for system introspection.  The build time environment is often different
> than the cmake time environment, and if you are testing programs that will be run
> at build time, try-compile/try_run is the only way to do that.  I assume that you are
> planning to run makeinfo at build time, so it should be tested at build time.  Remember
> cmake is not a build tool, but rather a build generator, and is not running during
> the build.
>   

Ok, but given the shenanigans that must occur just to test if a tool 
works, the wrapped up functionality really should make it into CMake.  I 
just can't abide that a user should have to do this much stuff to test a 
tool.  I will write a macro and put it on the wiki.  What is the process 
for getting user contributed macros into the Standard CMake Modules?  
That would be good information to have on the wiki, on this page: 
http://www.cmake.org/Wiki/CMake_User_Contributed_Macros


Cheers,
Brandon Van Every

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20060722/c3c87e3b/attachment.html


More information about the CMake mailing list