#1 Debug build and Python lib

closed-fixed
nobody
Build (2)
5
2009-03-10
2009-01-18
Ali Pouladi
No

There is a bug in CMake that makes the debug build look for PythonXX_d.lib, but adds PythonXX.lib to the list of input libraries for the linker. Because of this problem the debug build fails.

Discussion

  • Filip Volejnik

    Filip Volejnik - 2009-03-02

    I looked at the FindPythonLibs.cmake and that script is to blame for this.

    For ogre, I do:

    Code:
    SET(OGRE_LIBRARIES optimized ${OGRE_LIBRARIES_RELEASE} debug ${OGRE_LIBRARIES_DEBUG})

    However, FindPythonLibs.cmake does not expose two versions of the lib this way, instead it exposes PYTHON_LIBRARIES and PYTHON_DEBUG_LIBRARIES.

    The solution should be to introduce a new cmake variable OPDE_PYTHON_LIBRARIES, like:

    Code:
    FIND_PACKAGE(PythonLibs REQUIRED)
    SET(OPDE_PYTHON_LIBRARIES optimized ${PYTHON_LIBRARIES} debug ${PYTHON_DEBUG_LIBRARIES})

    And replace all the references to PYTHON_LIBRARIES with OPDE_PYTHON_LIBRARIES in the CMakeLists.txt files. Currently that is:

    Code:
    trunk/src/bindings/CMakeLists.txt: ${PYTHON_LIBRARIES}
    trunk/src/main/CMakeLists.txt: ${PYTHON_LIBRARIES}
    trunk/src/main/CMakeLists.txt: ${PYTHON_LIBRARIES}
    trunk/proto/python/CMakeLists.txt: ${PYTHON_LIBRARIES}
    trunk/CMakeLists.txt: FIND_PYTHON_DEPS(PYTHON_LIBRARIES)
    trunk/CMakeLists.txt:IF(PYTHON_LIBRARIES)
    trunk/CMakeLists.txt: MESSAGE(STATUS " - Python libs ${PYTHON_LIBRARIES}")
    trunk/CMakeLists.txt:ELSE(PYTHON_LIBRARIES)
    trunk/CMakeLists.txt:ENDIF(PYTHON_LIBRARIES)
    trunk/CMakeLists.txt:IF (UNIX AND PYTHON_LIBRARIES)
    trunk/CMakeLists.txt:ENDIF (UNIX AND PYTHON_LIBRARIES)

     
  • Ali Pouladi

    Ali Pouladi - 2009-03-10

    Fixed and closed.

     
  • Ali Pouladi

    Ali Pouladi - 2009-03-10
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks