<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Le jeu. 15 nov. 2018 à 09:47, 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">
<div>
<div>I agree. That was a debug snippet...but is wrong ... I setted
up again the toolchain, but does not help.<br></div></div></blockquote><div><br></div><div>If you are using a proper toolchain for 32bit compilation.</div><div>It looks like a bug in the find_package for Python in the cross-compiling case.</div><div>Do you have a stripped down example which exhibit the issue?</div><div>Which version of CMake are you using?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<div> So, I know where are include_dirs and libs for 32 bits cross
compiling, I have to hardcode it like this ?<br>
</div>
<div><br>
add_library(python SHARED IMPORTED)<br>
set_target_properties( python PROPERTIES IMPORTED_LOCATION
/usr/lib32/<a href="http://libpython2.6.so" target="_blank">libpython2.6.so</a> )<br>
target_include_directories(python SYSTEM ...</div></div></blockquote><div><br></div><div>I think you can do that but it replaces the use of find_package(Python2 COMPONENTS Development) </div><div>may be fixing this would be a better long-term solution ?</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<br>
<div><br>
Le 14/11/2018 à 17:53, Marc CHEVRIER a écrit :</div>
<blockquote type="cite">
<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" target="_blank">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" target="_blank">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>
</blockquote>
</div>
-- <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><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div></div>