Skip to content

Instantly share code, notes, and snippets.

@marcinwol
Created November 5, 2015 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcinwol/af69cf83bb6582bc3fc7 to your computer and use it in GitHub Desktop.
Save marcinwol/af69cf83bb6582bc3fc7 to your computer and use it in GitHub Desktop.
CMakeList.txt for ubuntu and bython boost
cmake_minimum_required(VERSION 3.3)
project(boost_python_example)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
find_package(Boost COMPONENTS python REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
find_package(PythonLibs 3.4 REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
add_library(boost_python_example SHARED
main.cpp)
target_link_libraries(boost_python_example
boost_python-py34 # ${Boost_LIBRARIES} does not work, as it takes 2.7 only for some reason.
${PYTHON_LIBRARIES})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment