MantisBT - CMake | ||||||||||
View Issue Details | ||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0013449 | CMake | CMake | public | 2012-08-01 08:00 | 2014-06-02 08:37 | |||||
Reporter | Miguel FIGUEIREDO | |||||||||
Assigned To | jschueller | |||||||||
Priority | normal | Severity | minor | Reproducibility | always | |||||
Status | closed | Resolution | fixed | |||||||
Platform | x86_64 | OS | linux-3.2.0-27-generic | OS Version | Ubuntu 12.04 LTS | |||||
Product Version | CMake 2.8.7 | |||||||||
Target Version | CMake 3.0 | Fixed in Version | ||||||||
Summary | 0013449: [CROSS-CC] FindSWIG.cmake does not work when CMAKE_FIND_ROOT is redefined and CMAKE_FIND_ROOT_PATH_MODE_INCLUDE is set to ONLY | |||||||||
Description | The "FindSWIG.cmake" script internally uses the command FIND_PATH() to set SWIG_DIR variable. This command may have the path prefix overriden if : - the variable CMAKE_FIND_ROOT is redefined to point to a different root path than the host machine root path, and - the variable CMAKE_FIND_ROOT_PATH_MODE_INCLUDE is set to ONLY. This is a typical use case when building for embedded targets. | |||||||||
Steps To Reproduce | - Create a CMakeList.txt which have "find_package(SWIG)" into it (see http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_use_CMake_to_generate_SWIG_wrapper_libraries.3F [^]). - Create a cmake toolchain script which redefines CMAKE_FIND_ROOT and set CMAKE_FIND_ROOT_PATH_MODE_INCLUDE to only (see http://www.vtk.org/Wiki/CMake_Cross_Compiling#The_toolchain_file [^]). - Run cmake and make - The build system should report the following error : "CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE): Could NOT find SWIG (missing: SWIG_DIR) Call Stack (most recent call first): /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-2.8/Modules/FindSWIG.cmake:74 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) lw_pvod_core/binding/CMakeLists.txt:1 (find_package)" | |||||||||
Additional Information | I solve the issue by adding the parameter NO_CMAKE_FIND_ROOT_PATH to FIND_PATH() command avoiding path prefix overriding. --- /usr/share/cmake-2.8/Modules/FindSWIG.cmake 2012-08-01 13:57:45.732656623 +0200 +++ FindSWIG.cmake 2012-08-01 13:57:51.528656642 +0200 @@ -45,7 +45,7 @@ STRING(REGEX REPLACE "[\n\r]+" ";" SWIG_swiglib_output ${SWIG_swiglib_output}) # force the path to be computed each time in case SWIG_EXECUTABLE has changed. SET(SWIG_DIR SWIG_DIR-NOTFOUND) - FIND_PATH(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output}) + FIND_PATH(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output} NO_CMAKE_FIND_ROOT_PATH) IF(SWIG_DIR) SET(SWIG_USE_FILE ${CMAKE_ROOT}/Modules/UseSWIG.cmake) EXECUTE_PROCESS(COMMAND ${SWIG_EXECUTABLE} -version | |||||||||
Tags | No tags attached. | |||||||||
Relationships |
| |||||||||
Attached Files | ||||||||||
Issue History | ||||||||||
Date Modified | Username | Field | Change | |||||||
2012-08-01 08:00 | Miguel FIGUEIREDO | New Issue | ||||||||
2013-10-22 05:25 | Michel Zou | Note Added: 0034213 | ||||||||
2013-10-22 05:26 | Michel Zou | Note Edited: 0034213 | bug_revision_view_page.php?rev_id=1290 | |||||||
2013-11-22 09:08 | Brad King | Assigned To | => jschueller | |||||||
2013-11-22 09:08 | Brad King | Status | new => assigned | |||||||
2013-11-22 09:14 | Brad King | Note Added: 0034518 | ||||||||
2013-11-22 09:20 | Brad King | Target Version | => CMake 3.0 | |||||||
2013-11-25 09:03 | jschueller | Note Deleted: 0034213 | ||||||||
2013-11-25 09:04 | jschueller | Note Added: 0034543 | ||||||||
2013-11-25 09:04 | jschueller | Status | assigned => resolved | |||||||
2013-11-25 09:04 | jschueller | Resolution | open => fixed | |||||||
2013-11-25 09:21 | jschueller | Relationship added | has duplicate 0014359 | |||||||
2014-06-02 08:37 | Robert Maynard | Note Added: 0036039 | ||||||||
2014-06-02 08:37 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|