Skip to content

Commit

Permalink
Support Python 3 for Boost Python
Browse files Browse the repository at this point in the history
  • Loading branch information
knoepfel committed Mar 11, 2020
1 parent 1a0eb40 commit ae01f9e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion framework/logicengine/cxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ set(logicengine_version_minor 0)

set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS} -pedantic -Wall")

find_package(Boost REQUIRED)
find_package(PythonInterp ${PYVER} REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(Boost REQUIRED)

# for vim ycm plugin
set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")

set(BOOST_PY_SUFFIX 3)
if(PYTHONLIBS_VERSION_STRING VERSION_LESS "3.0.0")
set(BOOST_PY_SUFFIX)
endif()

add_subdirectory(ErrorHandler)

add_custom_target(liblinks ln -s ${CMAKE_BINARY_DIR}/ErrorHandler/RE.so ${CMAKE_SOURCE_DIR}/../ COMMAND ln -s ${CMAKE_BINARY_DIR}/ErrorHandler/libLogicEngine.so ${CMAKE_SOURCE_DIR}/../)
5 changes: 4 additions & 1 deletion framework/logicengine/cxx/ErrorHandler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ add_executable(test_main test_main.cc)
target_link_libraries(test_main LogicEngine boost_regex boost_system)

python_add_module(RE py_rule_engine.cc)
target_link_libraries(RE LogicEngine boost_python boost_regex boost_system ${PYTHON_LIBRARIES})
target_link_libraries(RE LogicEngine
boost_python${BOOST_PY_SUFFIX}
boost_system
${PYTHON_LIBRARIES})

0 comments on commit ae01f9e

Please sign in to comment.