[CMake] Problem with CMake 3.3.0-rc3

Brad King brad.king at kitware.com
Mon Jul 6 11:53:05 EDT 2015


On 07/02/2015 05:06 PM, Clifford Yapp wrote:
> When running the BRL-CAD configure process with the latest CMake
> release candidate, the first configure pass completes successfully.
> The second pass fails almost immediately with the error:
> 
> CMake Error at CMakeLists.txt:120 (configure_file):
> Unknown CMake command "configure_file".

Thanks for testing the RC!  I cannot reproduce that, but BRL-CAD
is a huge project with many configuration options.  What exact version
did you build, on what platform, and with what cmake command line?

I see the top-level CMakeLists.txt file in BRL-CAD is using
undocumented and unsupported behavior by re-defining many core
commands as functions, including configure_file:

>   function(add_library name)
>     _add_library(${name} ${ARGN})
...
>   function(add_executable name)
>     _add_executable(${name} ${ARGN})
...
>   function(add_custom_target name)
>     _add_custom_target(${name} ${ARGN})
...
>   function(configure_file file targetfile)
>     _configure_file(${file} ${targetfile} ${ARGN})
...
>   function(add_subdirectory name)
>     _add_subdirectory(${name} ${ARGN})
...
>   function(message)
>     _message(${ARGN})

The ability to do that is meant only for local debugging and is
not documented.  I see comments justifying it with a link to old
discussion here:

 http://www.cmake.org/pipermail/cmake/2010-September/039388.html

but unfortunately that advice was wrong.  BRL-CAD should be using
its own names for those.  Or, someone could come to the cmake
developers list to discuss how to add functionality to CMake to
overcome the need for such wrapper functions.

Still, if we can easily fix 3.3 to not regress existing BRL-CAD
releases then we should do so.  Can you use the above information
to strip it down to a minimal example showing the problem?

Thanks,
-Brad



More information about the CMake mailing list