Created
December 30, 2011 21:43
-
-
Save fpersson/1541605 to your computer and use it in GitHub Desktop.
CMakeLists for python libs writen in C++ with boost::python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required (VERSION 2.8) | |
project(demo) | |
find_package(Boost 1.4.2) | |
find_package(Boost COMPONENTS python REQUIRED) | |
find_package(PythonLibs REQUIRED) | |
include_directories(${Boost_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS}) | |
set(CORELIBS ${Boost_LIBRARIES} ${PYTHON_LIBRARIES}) | |
add_library(demo SHARED ./main.cpp) | |
target_link_libraries(demo ${CORELIBS}) | |
if(CMAKE_COMPILER_IS_GNUCXX) | |
add_definitions("-Wall") | |
else() | |
message(FATAL_ERROR "CMakeLists.txt has not been tested/written for your compiler.") | |
endif() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment