MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0014004 | CMake | Modules | public | 2013-03-12 12:51 | 2016-06-10 14:31 |
Reporter | Quintus | ||||
Assigned To | Benjamin Eikel | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | Linux | OS | Arch Linux | OS Version | |
Product Version | CMake 2.8.10.2 | ||||
Target Version | Fixed in Version | ||||
Summary | 0014004: FindSDL fails to find headers for cross-compilation | ||||
Description | FindSDL fails to find the SDL include headers for cross compilation. I have a MXE (http://mxe.cc [^]) cross-compilation environment set up at $HOME/win32/mxe/usr/i686-pc-mingw32 which includes a cross-compiled SDL library for mingw32 (the host system is a 64-bit Arch Linux). Here’s a list of all SDL-related files installed under that root directory: http://pastie.org/6461937 [^] Exact error from CMake: ==================================================== CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (message): Could NOT find SDL (missing: SDL_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-2.8/Modules/FindSDL.cmake:178 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:40 (find_package) ==================================================== In order to cross-compile, I then set CMAKE_FIND_ROOT_PATH in my toolchain file: ==================================================== set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_FIND_ROOT_PATH "$ENV{HOME}/win32/mxe/usr/i686-pc-mingw32") ==================================================== And of course, I also set the other necessary variables: ==================================================== set(CMAKE_C_COMPILER i686-pc-mingw32-gcc) set(CMAKE_CXX_COMPILER i686-pc-mingw32-g++) set(CMAKE_RC_COMPILER i686-pc-mingw32-windres) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) ==================================================== This is the cross-compiler: ==================================================== % i686-pc-mingw32-gcc --version i686-pc-mingw32-gcc (GCC) 4.7.2 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ==================================================== | ||||
Steps To Reproduce | 1. Create a SDL installation for mingw32 somewhere 2. Create CMakeLists.txt that calls find_package(SDL REQUIRED) 3. Create a toolchain file for cross-compilation from Linux to mingw32, variables see above, ensure CMAKE_FIND_ROOT_PATH includes the root of your SDL installation 4. Invoke CMake with -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchain/file 5. CMake fails to find the SDL headers. | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2013-03-12 12:51 | Quintus | New Issue | |||
2013-03-18 12:45 | Benjamin Eikel | Note Added: 0032665 | |||
2013-03-18 12:45 | Benjamin Eikel | Assigned To | => Benjamin Eikel | ||
2013-03-18 12:45 | Benjamin Eikel | Status | new => assigned | ||
2016-06-10 14:28 | Kitware Robot | Note Added: 0042246 | |||
2016-06-10 14:28 | Kitware Robot | Status | assigned => resolved | ||
2016-06-10 14:28 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|