Commit c8c51626 authored by Alexander Dielen's avatar Alexander Dielen

Added link directories and log file.

parent 1a96ae05
Pipeline #2424 passed with stage
in 69 minutes and 59 seconds
......@@ -11,6 +11,10 @@ IF(NOT DEFINED OPENMESH_PYTHON_VERSION)
ENDIF()
IF(OPENMESH_BUILD_PYTHON_BINDINGS)
# Create log file
SET(PYTHONLOG "${CMAKE_CURRENT_BINARY_DIR}/PythonLog.txt")
FILE(WRITE ${PYTHONLOG} "")
# Look for the python libs
MESSAGE(STATUS "Looking for PythonLibs")
FIND_PACKAGE(PythonLibs ${OPENMESH_PYTHON_VERSION} QUIET)
......@@ -29,13 +33,15 @@ IF(OPENMESH_BUILD_PYTHON_BINDINGS)
FOREACH(NAME ${BOOST_PYTHON_COMPONENT_NAMES})
IF(NOT Boost_FOUND)
FILE(APPEND ${PYTHONLOG} "Looking for component ${NAME}\n")
FIND_PACKAGE(Boost QUIET COMPONENTS ${NAME})
ENDIF()
ENDFOREACH()
FILE(APPEND ${PYTHONLOG} "\n")
IF(Boost_FOUND)
MESSAGE(STATUS "Looking for Boost Python -- found")
MESSAGE(STATUS "Checking the Boost Python configuration")
SET(CMAKE_TRY_COMPILE_CONFIGURATION "Release")
......@@ -47,9 +53,16 @@ IF(OPENMESH_BUILD_PYTHON_BINDINGS)
Example
CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES:STRING=${PYTHON_INCLUDE_DIRS};${Boost_INCLUDE_DIRS}"
"-DLINK_DIRECTORIES:STRING=${Boost_LIBRARY_DIRS}"
"-DLINK_LIBRARIES:STRING=${PYTHON_LIBRARIES};${Boost_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT_TRY_COMPILE
)
FILE(APPEND ${PYTHONLOG} "INCLUDE_DIRECTORIES: ${PYTHON_INCLUDE_DIRS};${Boost_INCLUDE_DIRS}\n")
FILE(APPEND ${PYTHONLOG} "LINK_DIRECTORIES: ${Boost_LIBRARY_DIRS}\n")
FILE(APPEND ${PYTHONLOG} "LINK_LIBRARIES: ${PYTHON_LIBRARIES};${Boost_LIBRARIES}\n\n")
FILE(APPEND ${PYTHONLOG} "${OUTPUT_TRY_COMPILE}")
IF(COMPILE_WORKS)
# Look for the python interpreter to check if the example works
......@@ -88,12 +101,14 @@ IF(OPENMESH_BUILD_PYTHON_BINDINGS)
FILE(MAKE_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
FILE(GLOB SOURCES *.cc *hh)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ../)
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
ADD_LIBRARY(openmesh SHARED ${SOURCES})
install(TARGETS openmesh DESTINATION ${ACG_PROJECT_LIBDIR}/python )
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ../)
TARGET_LINK_LIBRARIES(
openmesh
OpenMeshCore
......
......@@ -3,10 +3,10 @@ PROJECT(Example)
FILE(GLOB SOURCES *.cc *hh)
ADD_LIBRARY(example SHARED ${SOURCES})
INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES})
LINK_DIRECTORIES(${LINK_DIRECTORIES})
ADD_LIBRARY(example SHARED ${SOURCES})
TARGET_LINK_LIBRARIES(example ${LINK_LIBRARIES})
SET_TARGET_PROPERTIES(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment