Problem with CMake 3.3.0-rc3

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with CMake 3.3.0-rc3

Clifford Yapp
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".

Configuring incomplete, errors occurred!

Has anyone else seen this?

Cheers,
CY
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Problem with CMake 3.3.0-rc3

Brad King
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

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Problem with CMake 3.3.0-rc3

Clifford Yapp
On Mon, Jul 6, 2015 at 11:53 AM, Brad King <[hidden email]> wrote:

> 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?

OK, more info - it looks like the problem is limited to the CMake GUI
configure (although I haven't been able to test ccmake, the basic
cmake works) and the test file is pretty simple:

# Minimum required version of CMake
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

# Set CMake project name
project(TEST)

configure_file(test test1)

function(configure_file file targetfile)
  _configure_file(${file} ${targetfile} ${ARGN})
endfunction(configure_file)

configure_file(test test2)

Having the first configure_file before the redefinition and the second
after it seems to do it in the GUI, but only on the second configure
pass.

Cheers,
CY
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Problem with CMake 3.3.0-rc3

Brad King
On 07/09/2015 01:43 PM, Clifford Yapp wrote:
> OK, more info - it looks like the problem is limited to the CMake GUI
> configure (although I haven't been able to test ccmake, the basic
> cmake works) and the test file is pretty simple:

Thanks.  I've narrowed it down to this session:

-------------------------------------------------------------
$ cat ../CMakeLists.txt
cmake_minimum_required(VERSION 3.2)
project(Sample NONE)
message("message")
function(message)
  _message(${ARGN})
endfunction()

$ cmake-gui  ..
(click configure twice)
-------------------------------------------------------------

It bisects to this commit:

 cmake: Simplify command clean up loop.
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=97e53ebb

Steve, please take a look.  It looks like the cmState methods
RemoveUserDefinedCommands and RenameCommand need to work better
together.  This needs to be fixed for 3.3.

Thanks,
-Brad

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Problem with CMake 3.3.0-rc3

Stephen Kelly-2
Brad King wrote:

> Steve, please take a look.  It looks like the cmState methods
> RemoveUserDefinedCommands and RenameCommand need to work better
> together.  This needs to be fixed for 3.3.

Fixed with

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f2ee169d
 cmState: Restore renamed commands on cleanup

Thanks,

Steve.


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Problem with CMake 3.3.0-rc3

Clifford Yapp
On Sat, Jul 11, 2015 at 5:07 AM, Stephen Kelly <[hidden email]> wrote:

> Brad King wrote:
>
>> Steve, please take a look.  It looks like the cmState methods
>> RemoveUserDefinedCommands and RenameCommand need to work better
>> together.  This needs to be fixed for 3.3.
>
> Fixed with
>
>  http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f2ee169d
>  cmState: Restore renamed commands on cleanup

Confirmed in rc4 - thanks!

CY
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake