Hello,<br>I&#39;m trying to cross-compiling a library for the PSP platform, this is my toolchain:<br><br><b># The name of the target operating system.<br>set(CMAKE_SYSTEM_NAME Generic)<br><br># Which compilers to use for C and C++.<br>
set(CMAKE_C_COMPILER /usr/local/pspdev/bin/psp-gcc)<br>set(CMAKE_CXX_COMPILER /usr/local/pspdev/bin/psp-g++)<br><br>set(CMAKE_FIND_ROOT_PATH /usr/local/pspdev/psp)<br><br># Adjust the default behaviour of the FIND_XXX() commands:<br>
# search headers and libraries in the target environment, search<br># programs in the host environment.<br>set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)<br>set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)<br>set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)</b><br>
<br><br>And this is the code (from CmakeLists.txt) to find the zlib.h header located in /usr/local/pspdev/psp/include:<br><br><b>cmake_minimum_required(VERSION 2.6 FATAL_ERROR)<br>if(COMMAND cmake_policy)<br>    cmake_policy(SET CMP0003 NEW)<br>
endif(COMMAND cmake_policy)<br><br>if(NOT CMAKE_BUILD_TYPE)<br>  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING<br>      &quot;Choose the type of build, options are:<br>        None Debug Release RelWithDebInfo MinSizeRel Profile.&quot;<br>
      FORCE)<br>endif()<br># Restrict configuration types to the selected build type.<br># Note: This needs to be done before the project command<br>set(CMAKE_CONFIGURATION_TYPES &quot;${CMAKE_BUILD_TYPE}&quot; CACHE INTERNAL &quot;internal&quot;)<br>
<br># Set the project name.<br>project(MyLibrary C CXX)<br><br>FIND_PATH(ZLIB_INCLUDE_DIR zlib.h)<br><br>message(STATUS &quot;zlib include dir ${ZLIB_INCLUDE_DIR}&quot;)</b><br><br>It returns not found but it should.<br><br>
Setting <b>CMAKE INCLUDE_PATH</b> to <b>/usr/local/pspdev/psp/include </b>(and commenting the line set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) works as expected.<br><br>What I&#39;m doing wrong?<br><br>