MantisBT - CMake
View Issue Details
0015567CMakeCMakepublic2015-05-14 01:472015-11-02 09:15
Ruslan Baratov 
Daniele E. Domenichelli 
normalminoralways
closedfixed 
CMake 3.2.1 
CMake 3.3CMake 3.3 
0015567: "LOG_CONFIGURE 1" breaks ExternalProject_Add with empty CONFIGURE_COMMAND
In case when CONFIGURE_COMMAND of ExternalProject_Add is optional and can be empty setting LOG_CONFIGURE 1 lead to error:
    
    *-configure.cmake:4 (execute_process):
      execute_process given COMMAND argument with no value.
Works fine:

    cmake_minimum_required(VERSION 3.0)
    project(Foo)

    include(ExternalProject)

    set(configure "")

    ExternalProject_Add(
        Foo
        DOWNLOAD_COMMAND ""
        CONFIGURE_COMMAND ${configure}
        COMMAND "${CMAKE_COMMAND}" -E echo ""
        BUILD_COMMAND ""
        INSTALL_COMMAND ""
    )

Not working:

    cmake_minimum_required(VERSION 3.0)
    project(Foo)

    include(ExternalProject)

    set(configure "")

    ExternalProject_Add(
        Foo
        DOWNLOAD_COMMAND ""
        CONFIGURE_COMMAND ${configure}
        COMMAND "${CMAKE_COMMAND}" -E echo ""
        BUILD_COMMAND ""
        INSTALL_COMMAND ""
        LOG_CONFIGURE 1
    )
No tags attached.
Issue History
2015-05-14 01:47Ruslan BaratovNew Issue
2015-05-20 09:56Daniele E. DomenichelliNote Added: 0038778
2015-05-20 09:59Brad KingAssigned To => Daniele E. Domenichelli
2015-05-20 09:59Brad KingStatusnew => resolved
2015-05-20 09:59Brad KingResolutionopen => fixed
2015-05-20 09:59Brad KingFixed in Version => CMake 3.3
2015-05-20 09:59Brad KingTarget Version => CMake 3.3
2015-05-20 10:53Daniele E. DomenichelliNote Added: 0038780
2015-05-20 11:04Brad KingNote Added: 0038782
2015-05-20 11:04Brad KingStatusresolved => assigned
2015-05-20 11:04Brad KingResolutionfixed => open
2015-05-20 11:04Brad KingFixed in VersionCMake 3.3 =>
2015-05-21 09:16Brad KingNote Added: 0038788
2015-05-21 09:16Brad KingStatusassigned => resolved
2015-05-21 09:16Brad KingResolutionopen => fixed
2015-05-21 09:16Brad KingFixed in Version => CMake 3.3
2015-11-02 09:15Robert MaynardNote Added: 0039819
2015-11-02 09:15Robert MaynardStatusresolved => closed

Notes
(0038778)
Daniele E. Domenichelli   
2015-05-20 09:56   
This happens because the first argument of the CONFIGURE_COMMAND becomes COMMAND and add_custom_command accepts it, but execute process does not: i.e.

   add_custom_command(OUTPUT foo
                      COMMAND
                      COMMAND /usr/bin/cmake -E echo add_custom_command)
   add_custom_target(bar ALL
                     DEPENDS foo)

Works, but

   execute_process(COMMAND
                   COMMAND /usr/bin/cmake -E echo execute_process)

fails.


I pushed a fix in topic ExternalProject_FixLog:

   ExternalProject: Fix log when the first arg of commands is "COMMAND" (0015567)
   http://www.cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=a0d620d [^]
(0038780)
Daniele E. Domenichelli   
2015-05-20 10:53   
Hello Brad,
You marked this bug as fixed, but I don't see the commit yet in master...
Should I merge it in next?
(0038782)
Brad King   
2015-05-20 11:04   
Re 0015567:0038780: Oops, I missed that it is not in 'next' yet.
(0038788)
Brad King   
2015-05-21 09:16   
The fix linked in 0015567:0038778 is now in 'master'.
(0039819)
Robert Maynard   
2015-11-02 09:15   
Closing resolved issues that have not been updated in more than 4 months.