Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .bzrignore

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.user
.DS_Store
build*
36 changes: 36 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
language: cpp

matrix:
include:
- os: linux
env: PLATFORM="linux-gcc" CMakeArgs=""
compiler: gcc
- os: linux
env: PLATFORM="linux-clang" CMakeArgs=""
compiler: clang
- os: osx
env: PLATFORM="osx-gcc" CMakeArgs=""
compiler: gcc
- os: osx
env: PLATFORM="osx-clang" CMakeArgs=""
compiler: clang

before_script:
- mkdir debug
- cd debug
- cmake $CMakeArgs -D CMAKE_BUILD_TYPE=Debug ..
- cd ..
- mkdir release
- cd release
- cmake $CMakeArgs -D CMAKE_BUILD_TYPE=Release ..
- cd ..

script:
- cd debug
- make all
- make test
- cd ..
- cd release
- make all
- make test
- cd ..
12 changes: 12 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
v.3.0 (26 January 2019)
- Fixed x64 pointer types.
- Added CI and unit tests.
- Cleaned up project structure and code formatting.
- Switch to C++11 std::mutex.

v.2.8 (20 December 2014)
- Basic support for constructing C++ objects from Python.
- call() returns a pointer to the C++ object.
- Added support for void* arguments.
- Fixed floating point argument bug.
- Fixed char* return value bug.
47 changes: 22 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
cmake_minimum_required(VERSION 2.8)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread -Wall -Wextra")
cmake_minimum_required(VERSION 3.1)

project(EcsPython)

add_subdirectory(example)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W4")
elseif(MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -pedantic -Wall -Wextra -Wnon-virtual-dtor -Wno-unknown-pragmas")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread -pedantic -Wall -Wextra -Wnon-virtual-dtor")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-gnu-zero-variadic-macro-arguments -Wno-vla-extension")
endif()

if(UNIX)
find_package(PythonLibs REQUIRED)
endif(UNIX)
enable_testing()

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(PYTHON_LIBRARIES "C:/Python27/libs/python27.lib")
set(PYTHON_INCLUDE_DIRS "C:/Python27/include")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
find_package(PythonLibs 3.3 EXACT)

if(NOT ${PYTHONLIBS_FOUND})
find_package(PythonLibs 2.7 EXACT REQUIRED)
endif()

include_directories(
${CMAKE_SOURCE_DIR}/include
Expand All @@ -22,22 +30,21 @@ include_directories(

file(GLOB srcs src/*.cpp)
file(GLOB hdrs include/*.h)
file(GLOB in_hdrs include/ecspython/*.h)
file(GLOB dsp_hdrs include/dspatch/*.h)

add_library(
${PROJECT_NAME}
${srcs}
${hdrs}
${in_hdrs}
${dsp_hdrs}
)

target_link_libraries(
${PROJECT_NAME}
${PYTHON_LIBRARIES}
)

add_subdirectory(example)
add_subdirectory(tests)

install(
TARGETS ${PROJECT_NAME}
DESTINATION lib
Expand All @@ -47,13 +54,3 @@ install(
FILES ${hdrs}
DESTINATION include
)

install(
FILES ${in_hdrs}
DESTINATION include/ecspython
)

install(
FILES ${dsp_hdrs}
DESTINATION include/dspatch
)
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
[![Build Status](https://travis-ci.org/cross-platform/ecs-python.svg?branch=master)](https://travis-ci.org/cross-platform/ecs-python)
[![Build status](https://ci.appveyor.com/api/projects/status/95ouh8tha8v5auaq?svg=true)](https://ci.appveyor.com/project/MarcusTomlinson/ecs-python)

# ECS-Python

Light-weight C++ library for embedding Python into C++

ECS:Python (Embedded C++ Scripting with Python) is a simple Python wrapper library designed specifically for C++ developers who wish to add Python scripting to their new / existing C++ projects. ECS:Python allows you to expose objects from a C++ application to an embedded Python interpreter for interactive scripting. ECS:Python is light-weight and easy to use.

To get started all you need to do from your project is #include "EcsPython.h", and link to the EcsPython library. Included with ECS:Python is a demo project (/example) written to assist developers in understanding how to use the API.

ECS:Python requires a Python distribution to be installed on your system. Python can be downloaded from: www.python.org/download

What's new in v2.8:
* Basic support for constructing C++ objects from Python
* __call__() returns a pointer to the C++ object
* Added support for void* arguments
* Fixed floating point argument bug
* Fixed char* return value bug
ECS:Python requires a Python distribution to be installed on your system. Python can be downloaded from: www.python.org/download
17 changes: 0 additions & 17 deletions build

This file was deleted.

2 changes: 0 additions & 2 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ include_directories(

add_executable(
${PROJECT_NAME}

main.cpp
)

target_link_libraries(
${PROJECT_NAME}

EcsPython
)
168 changes: 0 additions & 168 deletions example/EcsDemo.vcproj

This file was deleted.

Loading