View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015248CMakeCMakeSetuppublic2014-11-12 17:232015-04-06 09:07
ReporterDavide Viti 
Assigned ToBrad King 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformBuildrootOSLinuxOS VersionDebian 7.7
Product VersionCMake 3.0.2 
Target VersionCMake 3.1Fixed in VersionCMake 3.1 
Summary0015248: When cross compiling, "make install" invokes target "cmake" instead of host version
DescriptionCrosscompilation goes smooth up to "make install" step where it fails:

 bin/cmake: 1: bin/cmake: Syntax error: word unexpected (expecting ")")

it is trying to invoke cross compiled cmake instead of the version available for the host machine.

The problem can be workarounded replacing "make install" with "cmake -P cmake_install.cmake"
Steps To ReproduceI've run into the problem while crosscompiling cmake in buildroot (http://buildroot.uclibc.org/ [^]) for arm.
The build process invokes bootstrap:

        LDFLAGS="$(TARGET_LDFLAGS)" \
        CFLAGS="$(TARGET_CFLAGS)" \
        ./bootstrap --prefix=$(TARGET_DIR)/usr \
            --parallel=$(PARALLEL_JOBS) -- \
            -DCMAKE_C_FLAGS="$(TARGET_CFLAGS)" \
            -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS)" \
            -DCMAKE_EXE_LINKER_FLAGS="$(TARGET_LDFLAGS)" \
            -DCMAKE_C_COMPILER="$(TARGET_CC)" \
            -DCMAKE_CXX_COMPILER="$(TARGET_CXX)" \
            -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \
            -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY="ONLY" \
            -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE="ONLY" \
            -DBUILD_CursesDialog=OFF

then "make" and finally "make install"
TagsNo tags attached.
Attached Files

 Relationships
related to 0000891closedSystem Admin make install cmake replace 

  Notes
(0037205)
Brad King (manager)
2014-11-13 08:51

This is due to logic here:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalGenerator.cxx;hb=v3.0.2#l2402 [^]

originally added here:

 When building CMake itself, use the new cmake to install so that the current cmake can be overwritten.
 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=94847d0a [^]

Clearly this should not be done when cross-compiling.
(0037207)
Brad King (manager)
2014-11-13 09:01

Please try this fix:

 Do not use just-built CMake to install itself when cross-compiling
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=15f55cca [^]
(0037225)
Brad King (manager)
2014-11-14 15:03

Re 0015248:0037207: I've merged this fix to the 'release' branch for inclusion in the next 3.1 release candidate.
(0038445)
Robert Maynard (manager)
2015-04-06 09:07

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2014-11-12 17:23 Davide Viti New Issue
2014-11-13 08:50 Brad King Relationship added related to 0000891
2014-11-13 08:51 Brad King Note Added: 0037205
2014-11-13 09:01 Brad King Note Added: 0037207
2014-11-14 15:03 Brad King Note Added: 0037225
2014-11-14 15:03 Brad King Assigned To => Brad King
2014-11-14 15:03 Brad King Status new => resolved
2014-11-14 15:03 Brad King Resolution open => fixed
2014-11-14 15:03 Brad King Fixed in Version => CMake 3.1
2014-11-14 15:03 Brad King Target Version => CMake 3.1
2015-04-06 09:07 Robert Maynard Note Added: 0038445
2015-04-06 09:07 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team