MantisBT - CMake
View Issue Details
0009963CMakeCMakepublic2009-11-24 15:302016-06-06 13:37
Shane Dixon 
David Cole 
highmajoralways
closedfixed 
CMake-2-8 
CMake 2.8.3CMake 2.8.3 
0009963: Passing command-line arguments to ExternalProject truncates variables
When passing CMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR} to an external project, the path should be C:\temp\deploy2, but the path instead shows up as just "C:". I fix it by adding a bogus variable TEST=${PROJECT_BINARY_DIR} which fixes the CAMKE_INSTAALL_PREFIX definition, but then TEST shows up as the wrong thing. I have this in two separate external projects that I build.
    ExternalProject_Add( ExtFMEmul
        URL "${CMAKE_CURRENT_SOURCE_DIR}/fm"
        CMAKE_GENERATOR "NMake Makefiles"
        CMAKE_ARGS cmake_install_prefix
            -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}
            -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
            -DMYPROJ_FM_H_PATH=${PROJECT_SOURCE_DIR}/include
            -DEXTRA_INCLUDES=${PROJECT_BINARY_DIR}/include
        BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/ExtFM_cl
        INSTALL_DIR ${PROJECT_BINARY_DIR} )

In the external project, the CMAKE_INSTALL_PREFIX yields this:
-- CMAKE_INSTALL_PREFIX...............C:

Now if I change the ExternalProject_Add to this:

    ExternalProject_Add( ExtFMEmul
        URL "${CMAKE_CURRENT_SOURCE_DIR}/fm"
        CMAKE_GENERATOR "NMake Makefiles"
        CMAKE_ARGS # Test is needed b/c of glitch in passing cmake_install_prefix
            -DTEST=${PROJECT_BINARY_DIR}
            -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}
            -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
            -DMYPROJ_FM_H_PATH=${PROJECT_SOURCE_DIR}/include
            -DEXTRA_INCLUDES=${PROJECT_BINARY_DIR}/include
        BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/ExtFM_cl
        INSTALL_DIR ${PROJECT_BINARY_DIR} )

The external project now yields the correct result for CMAKE_INSTALL_PREFIX, but the TEST variable is now wrong:

-- CMAKE_INSTALL_PREFIX...............C:/temp/deploy2
-- TEST...............................C:
No tags attached.
has duplicate 0010735closed David Cole Passing Paths containing colons through ExternalProject_Add's CMAKE_ARGS argument 
has duplicate 0009971closed David Cole Parameters pass to command-line entirely wrong 
related to 0011462closed David Cole "the input line is too long" error after upgrading from 2.8.2 to 2.8.3 
Issue History
2009-11-24 15:30Shane DixonNew Issue
2009-11-24 15:32Shane DixonNote Added: 0018580
2009-11-25 14:09Shane DixonNote Added: 0018591
2010-07-13 09:31Bill HoffmanStatusnew => assigned
2010-07-13 09:31Bill HoffmanAssigned To => David Cole
2010-07-23 06:10David ColeRelationship addedhas duplicate 0010735
2010-08-29 02:37Kovarththanan RajaratnamCategoryCMake => Modules
2010-08-29 02:40Kovarththanan RajaratnamCategoryModules => CMake
2010-09-08 17:44David ColeRelationship addedhas duplicate 0009971
2010-09-08 17:46David ColeTarget Version => CMake 2.8.3
2010-09-08 18:43David ColeNote Added: 0022145
2010-09-08 18:43David ColeStatusassigned => resolved
2010-09-08 18:43David ColeResolutionopen => fixed
2010-09-08 19:09David ColeNote Added: 0022147
2010-09-09 11:11David ColeNote Added: 0022162
2010-09-09 11:11David ColeStatusresolved => feedback
2010-09-09 11:11David ColeResolutionfixed => reopened
2010-09-09 17:59David ColePrioritynormal => high
2010-09-10 18:59David ColeNote Added: 0022184
2010-09-10 18:59David ColeStatusfeedback => resolved
2010-09-10 18:59David ColeResolutionreopened => fixed
2010-09-10 19:08David ColeNote Added: 0022187
2010-10-06 13:40David ColeFixed in Version => CMake 2.8.3
2010-11-09 22:57Philip LowmanStatusresolved => closed
2010-11-15 17:57David ColeRelationship addedrelated to 0011462
2011-01-05 15:52David ColeNote Added: 0024438
2016-06-06 13:37Brad KingView Statusprivate => public

Notes
(0018580)
Shane Dixon   
2009-11-24 15:32   
I'm running cmake 2.8.0 on Windows XP:

C:\temp\deploy2>cmake --version
cmake version 2.8.0
(0018591)
Shane Dixon   
2009-11-25 14:09   
Might be related to this other bug that I reported:
http://public.kitware.com/Bug/view.php?id=9971 [^]
(0022145)
David Cole   
2010-09-08 18:43   
fixed in CVS of KWSys:

$ cvs commit -m "CMake: quote ':' in Windows NMake Makefiles (0009963)"
/cvsroot/KWSys/KWSys/System.c,v <-- System.c
new revision: 1.18; previous revision: 1.17

should be in the CMake 'master' branch momentarily...
(0022147)
David Cole   
2010-09-08 19:09   
The fixing commit is now in CMake 'master' :
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fcbdd3129e7edec4b07f96662aa21371d671cb83 [^]
(0022162)
David Cole   
2010-09-09 11:11   
Reverting previous change, which was not the correct fix for this bug... Still pending.
(0022184)
David Cole   
2010-09-10 18:59   
The fix for this is now merged to the 'next' branch of CMake with this commit:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=269a4b876a34483c5cb664499dc6b1634fa453ff [^]

It's a crazy, crazy hackish fix. Don't look. Not sure whether to feel embarrassed or proud. :-}

As long as all the dashboards agree with this fix, we'll merge this into master next week, and it will make it into the 2.8.3 release...
(0022187)
David Cole   
2010-09-10 19:08   
There is an issue with the test modifications on the Borland Continuous dashboard. Looks like Borland doesn't like the space in the "bin dir" directory name. I'll be looking at the nightly dashboard results in the morning and formulating a response to fix this and any other issues that crop up overnight...

Bleh.
(0024438)
David Cole   
2011-01-05 15:52   
In this commit's message:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c2a9b8140829ba886d67bca084ee40eb0a20b84 [^]

...I inadvertently made a typo that references this bug, 0009963. The commit actually fixes part of 0009663, and that's the one that I should have referenced in the commit message. Sorry for the noise.