<div dir="ltr">The way you proceed is wrong.<div>The system configuration is determined during the 'project' function call. Setting information after this call is useless. So, in your example, on a 64bit system, the compilation configuration will be 64bit (variable CMAKE_SIZEOF_VOID_P has value 8).</div><div>This explain why '<span style="color:rgb(33,33,33)">FIND_LIBRARY_USE_LIB32_PATHS' has no effect. This property is taken in consideration only on 32bit systems.</span></div><div><span style="color:rgb(33,33,33)"><br></span></div><div>Moreover, I am not sure that modifying variable 'CMAKE_SYSTEM_PROCESSOR' is a valid action.</div><div><br></div><div>To configure a 32bit compilation environment, two possibilities:</div><div>* using environment variables: env CFLAGS=-m32 CXXFLAGS=-m32 cmake ...</div><div>* using a toolchain file: see <a href="https://cmake.org/cmake/help/v3.13/manual/cmake-toolchains.7.html">https://cmake.org/cmake/help/v3.13/manual/cmake-toolchains.7.html</a></div><div> <br></div></div><br><div class="gmail_quote"><div dir="ltr">Le mer. 14 nov. 2018 à 14:06, Stéphane Ancelot <<a href="mailto:sancelot@numalliance.com">sancelot@numalliance.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
My system is 64 bits but I can cross compile python c modules for 32 bits .<br>
<br>
Unfortunately I don't manage to retrieve python 32 libs , always the 64 <br>
bits version is found.<br>
<br>
<br>
here is what I tried :<br>
<br>
cmake_minimum_required(VERSION 3.10)<br>
project(py_autom)<br>
<br>
<br>
set(CMAKE_SYSTEM_PROCESSOR "i686")<br>
<br>
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")<br>
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")<br>
<br>
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS TRUE)<br>
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)<br>
<br>
include_directories(python2.6)<br>
find_package(Python2 COMPONENTS Development)<br>
<br>
<br>
<br>
message(STATUS "python ${PYTHON_INCLUDE_DIRS} ${Python2_LIBRARIES_DIR} <br>
${Python2_FOUND}")<br>
<br>
Regards<br>
<br>
Steph<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div>