<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div>I agree. That was a debug snippet...but is wrong ... I setted
      up again the toolchain, but does not help.<br>
    </div>
    <div><br>
    </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/libpython2.6.so )<br>
       target_include_directories(python SYSTEM ...</div>
    <br>
    <div><br>
      Le 14/11/2018 à 17:53, Marc CHEVRIER a écrit :</div>
    <blockquote type="cite"
cite="mid:CAHKTGrdWS21FQQUZwVmkbQqnQcaaC9nvqB0UidA2R4xXMn8Srw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <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"
            moz-do-not-send="true">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"
            moz-do-not-send="true">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" moz-do-not-send="true">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" moz-do-not-send="true">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" moz-do-not-send="true">http://cmake.org/cmake/help/support.html</a><br>
          CMake Consulting: <a
            href="http://cmake.org/cmake/help/consulting.html"
            rel="noreferrer" target="_blank" moz-do-not-send="true">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" moz-do-not-send="true">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" moz-do-not-send="true">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" moz-do-not-send="true">https://cmake.org/mailman/listinfo/cmake</a><br>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>