Commit 99588005 authored by Alexander Dielen's avatar Alexander Dielen

removed the old try_compile example project

parent d209a926
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
PROJECT(Example)
FILE(GLOB SOURCES *.cc *hh)
INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES})
LINK_DIRECTORIES(${LINK_DIRECTORIES})
ADD_LIBRARY(example SHARED ${SOURCES})
TARGET_LINK_LIBRARIES(example ${LINK_LIBRARIES})
SET_TARGET_PROPERTIES(
example
PROPERTIES
PREFIX ""
DEBUG_POSTFIX ""
RELEASE_POSTFIX ""
)
IF(APPLE)
SET_TARGET_PROPERTIES(example PROPERTIES SUFFIX ".so")
IF (NOT (CMAKE_MAJOR_VERSION LESS 3))
SET_TARGET_PROPERTIES(example PROPERTIES MACOSX_RPATH TRUE)
ENDIF()
ENDIF()
IF(WIN32)
SET_TARGET_PROPERTIES(example PROPERTIES SUFFIX ".pyd")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
ENDIF()
#include <boost/python.hpp>
char const * greet() {
return "hello, world";
}
struct World {
void set(std::string msg) { this->msg = msg; }
std::string greet() { return msg; }
std::string msg;
};
BOOST_PYTHON_MODULE(example) {
using namespace boost::python;
def("greet", greet);
class_<World>("World")
.def("greet", &World::greet)
.def("set", &World::set)
;
}
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