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

Claus Klein claus.klein at arcormail.de
Fri Jul 13 17:26:09 EDT 2012


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:

#
# CMAKE_TOOLCHAIN_FILE
#
# the name of the target operating system
set(CMAKE_SYSTEM_NAME Windows)

# Choose an appropriate compiler prefix

# for classical mingw32
# see http://www.mingw.org/
set(COMPILER_PREFIX "i386-mingw32")
### set(COMPILER_PREFIX "i586-mingw32msvc")

# for 32 or 64 bits mingw-w64
# see http://mingw-w64.sourceforge.net/
## set(COMPILER_PREFIX "i686-w64-mingw32")
## set(COMPILER_PREFIX "x86_64-w64-mingw32"


# here is the target environment located
set(USER_ROOT_PATH /opt/local/bin)
set(CMAKE_INSTALL_PREFIX /opt/local/${COMPILER_PREFIX} CACHE PATH ""  
FORCE )
set(CMAKE_FIND_ROOT_PATH ${DCMAKE_INSTALL_PREFIX} ${USER_ROOT_PATH} )


# which compilers to use for C and C++ (with path!)
## find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc)
set(CMAKE_C_COMPILER ${USER_ROOT_PATH}/${COMPILER_PREFIX}-gcc)
## find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++)
set(CMAKE_CXX_COMPILER ${USER_ROOT_PATH}/${COMPILER_PREFIX}-g++)

# FIXME for Windows, windres is needed too! (with path!)
## find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres)
set(CMAKE_RC_COMPILER ${USER_ROOT_PATH}/${COMPILER_PREFIX}-windres)

# FIXME on APPLE this is needed too? (CmakeFindBinUtils.cmke)
set(CMAKE_INSTALL_NAME_TOOL ${USER_ROOT_PATH}/install_name_tool)

# 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)



# adjust the default behaviour of the FIND_XXX() commands:
# search NEVER for programs in the build host directories!
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# search headers and libraries in the target environment only.
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)


On 12.07.2012, at 23:05, Claus Klein wrote:

> I found a way, but now the CMAKE_EXECUTABLE_SUFFIX is not empty?



More information about the CMake mailing list