Skip to content

Instantly share code, notes, and snippets.

@marcinwol
Created November 5, 2015 04:20
Show Gist options
  • Save marcinwol/af69cf83bb6582bc3fc7 to your computer and use it in GitHub Desktop.
Save marcinwol/af69cf83bb6582bc3fc7 to your computer and use it in GitHub Desktop.

Revisions

  1. marcinwol created this gist Nov 5, 2015.
    22 changes: 22 additions & 0 deletions CMakeList.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    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})