[CMake] Cross-compilation for windows on Darwin with nighlty build fails

Claus Klein claus.klein at arcormail.de
Sat Jul 14 07:08:23 EDT 2012


Hi Eric,

I have the same behavior from command line and GUI.

The orig. project setup was: project(ftplibcpp)

with project(ftplibcpp CXX) it works:

claus-kleins-macbook-pro:build clausklein$ /opt/local/bin/cmake - 
DCMAKE_TOOLCHAIN_FILE=/Users/clausklein/Toolchain-cross-mingw32- 
linux.cmake ..
-- The CXX compiler identification is GNU 3.4.5
-- Check for working CXX compiler: /opt/local/bin/i386-mingw32-g++
-- Check for working CXX compiler: /opt/local/bin/i386-mingw32-g++ --  
works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/clausklein/Workspace/cpp/ 
ftplibpp-2.0.2/build

claus-kleins-macbook-pro:build clausklein$ rm -rf *

with language not set it fails:

claus-kleins-macbook-pro:build clausklein$ /opt/local/bin/cmake - 
DCMAKE_TOOLCHAIN_FILE=/Users/clausklein/Toolchain-cross-mingw32- 
linux.cmake ..
-- The C compiler identification is GNU 3.4.5
-- The CXX compiler identification is GNU 3.4.5
CMake Error at /Applications/CMake 2.8-8.app/Contents/share/cmake-2.8/ 
Modules/CMakeFindBinUtils.cmake:71 (MESSAGE):
   Could not find install_name_tool, please check your installation.
Call Stack (most recent call first):
   /Applications/CMake 2.8-8.app/Contents/share/cmake-2.8/Modules/ 
CMakeDetermineCXXCompiler.cmake:177 (INCLUDE)
   CMakeLists.txt:3 (project)


CMake Error: Error required internal CMake variable not set, cmake may  
be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Could not find cmake module file:/Users/clausklein/ 
Workspace/cpp/ftplibpp-2.0.2/build/CMakeFiles/CMakeCXXCompiler.cmake
-- Configuring incomplete, errors occurred!
claus-kleins-macbook-pro:build clausklein$

#--------------------------------------------------------

The interesting this is that this works too without language setting:

/opt/local/bin/cmake -G "Unix Makefiles" \
     -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_INSTALL_PREFIX="C:/usr" \
     -DCMAKE_RC_COMPILER:FILEPATH=/opt/local/bin/i386-mingw32-windres \
     -DCMAKE_CXX_COMPILER=/opt/local/bin/i386-mingw32-g++ \
     -DCMAKE_C_COMPILER=/opt/local/bin/i386-mingw32-gcc \
     -DCMAKE_FIND_ROOT_PATH=/opt/local/i386-mingw32/bin \
     --check-system-vars \
     ..

Thank you for help :))

Claus

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakelists.txt
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120714/1aed9062/attachment.txt>
-------------- next part --------------



On 14.07.2012, at 12:22, Eric Noulard wrote:

> 2012/7/13 Claus Klein <claus.klein at arcormail.de>:
>> Can anyone please help?
>>
>> Thanks in advance
>> Best Regards
>> Claus
>>
>> With this CMAKE_TOOLCHAIN_FILE it just works, but there is always  
>> an error
>> the first time cmake configure step is started from GUI:
>
> Do you have the same error with command line cmake?
> [...]
>>
>> # FIXME on APPLE this is needed too? (CmakeFindBinUtils.cmke)
>> set(CMAKE_INSTALL_NAME_TOOL ${USER_ROOT_PATH}/install_name_tool)
>
> FindBinUtils should find this one on his own as soon as C or C++  
> compiler
> has been found (this is not working for fortran, see:
> http://public.kitware.com/Bug/view.php?id=13379)
>
>>
>> # CMake Error at /Applications/CMake
>> 2.8-8.app/Contents/share/cmake-2.8/Modules/CMakeFindBinUtils.cmake:71
>> (MESSAGE):
>> #   Could not find install_name_tool, please check your installation.
>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>> # Call Stack (most recent call first):
>> #   /Applications/CMake
>> 2.8-8.app/Contents/share/cmake-2.8/Modules/ 
>> CMakeDetermineCXXCompiler.cmake:177
>> (INCLUDE)
>> #   CMakeLists.txt:3 (project)
>>
>
> if it works on the second run then may be you didn't enable C or C++
> language in your project
> what is the project statement you use in your CMakeLists.txt
>
> is it project(Blah NONE) ?
> is it project(Blah Fortran)
>
> in any case could you try
> project(Blah C)?
>
> -- 
> Erk
> Le gouvernement repr?sentatif n'est pas la d?mocratie --
> http://www.le-message.org



More information about the CMake mailing list