Skip to content

Commit 447a81e

Browse files
Merge pull request #2 from cross-platform/devel
EcsPython 3.0
2 parents f0a18fe + 7018a7e commit 447a81e

25 files changed

+12516
-1681
lines changed

.bzrignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.user
2+
.DS_Store
3+
build*

.travis.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
language: cpp
2+
3+
matrix:
4+
include:
5+
- os: linux
6+
env: PLATFORM="linux-gcc" CMakeArgs=""
7+
compiler: gcc
8+
- os: linux
9+
env: PLATFORM="linux-clang" CMakeArgs=""
10+
compiler: clang
11+
- os: osx
12+
env: PLATFORM="osx-gcc" CMakeArgs=""
13+
compiler: gcc
14+
- os: osx
15+
env: PLATFORM="osx-clang" CMakeArgs=""
16+
compiler: clang
17+
18+
before_script:
19+
- mkdir debug
20+
- cd debug
21+
- cmake $CMakeArgs -D CMAKE_BUILD_TYPE=Debug ..
22+
- cd ..
23+
- mkdir release
24+
- cd release
25+
- cmake $CMakeArgs -D CMAKE_BUILD_TYPE=Release ..
26+
- cd ..
27+
28+
script:
29+
- cd debug
30+
- make all
31+
- make test
32+
- cd ..
33+
- cd release
34+
- make all
35+
- make test
36+
- cd ..

CHANGES

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
v.3.0 (26 January 2019)
2+
- Fixed x64 pointer types.
3+
- Added CI and unit tests.
4+
- Cleaned up project structure and code formatting.
5+
- Switch to C++11 std::mutex.
6+
7+
v.2.8 (20 December 2014)
8+
- Basic support for constructing C++ objects from Python.
9+
- call() returns a pointer to the C++ object.
10+
- Added support for void* arguments.
11+
- Fixed floating point argument bug.
12+
- Fixed char* return value bug.

CMakeLists.txt

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
1-
cmake_minimum_required(VERSION 2.8)
2-
3-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread -Wall -Wextra")
1+
cmake_minimum_required(VERSION 3.1)
42

53
project(EcsPython)
64

7-
add_subdirectory(example)
5+
set(CMAKE_CXX_STANDARD 11)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
set(CMAKE_CXX_EXTENSIONS OFF)
8+
9+
if(MSVC)
10+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W4")
11+
elseif(MINGW)
12+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -pedantic -Wall -Wextra -Wnon-virtual-dtor -Wno-unknown-pragmas")
13+
else()
14+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread -pedantic -Wall -Wextra -Wnon-virtual-dtor")
15+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-gnu-zero-variadic-macro-arguments -Wno-vla-extension")
16+
endif()
817

9-
if(UNIX)
10-
find_package(PythonLibs REQUIRED)
11-
endif(UNIX)
18+
enable_testing()
1219

13-
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
14-
set(PYTHON_LIBRARIES "C:/Python27/libs/python27.lib")
15-
set(PYTHON_INCLUDE_DIRS "C:/Python27/include")
16-
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
20+
find_package(PythonLibs 3.3 EXACT)
21+
22+
if(NOT ${PYTHONLIBS_FOUND})
23+
find_package(PythonLibs 2.7 EXACT REQUIRED)
24+
endif()
1725

1826
include_directories(
1927
${CMAKE_SOURCE_DIR}/include
@@ -22,22 +30,21 @@ include_directories(
2230

2331
file(GLOB srcs src/*.cpp)
2432
file(GLOB hdrs include/*.h)
25-
file(GLOB in_hdrs include/ecspython/*.h)
26-
file(GLOB dsp_hdrs include/dspatch/*.h)
2733

2834
add_library(
2935
${PROJECT_NAME}
3036
${srcs}
3137
${hdrs}
32-
${in_hdrs}
33-
${dsp_hdrs}
3438
)
3539

3640
target_link_libraries(
3741
${PROJECT_NAME}
3842
${PYTHON_LIBRARIES}
3943
)
4044

45+
add_subdirectory(example)
46+
add_subdirectory(tests)
47+
4148
install(
4249
TARGETS ${PROJECT_NAME}
4350
DESTINATION lib
@@ -47,13 +54,3 @@ install(
4754
FILES ${hdrs}
4855
DESTINATION include
4956
)
50-
51-
install(
52-
FILES ${in_hdrs}
53-
DESTINATION include/ecspython
54-
)
55-
56-
install(
57-
FILES ${dsp_hdrs}
58-
DESTINATION include/dspatch
59-
)

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1+
[![Build Status](https://travis-ci.org/cross-platform/ecs-python.svg?branch=master)](https://travis-ci.org/cross-platform/ecs-python)
2+
[![Build status](https://ci.appveyor.com/api/projects/status/95ouh8tha8v5auaq?svg=true)](https://ci.appveyor.com/project/MarcusTomlinson/ecs-python)
3+
14
# ECS-Python
5+
26
Light-weight C++ library for embedding Python into C++
37

48
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.
59

610
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.
711

8-
ECS:Python requires a Python distribution to be installed on your system. Python can be downloaded from: www.python.org/download
9-
10-
What's new in v2.8:
11-
* Basic support for constructing C++ objects from Python
12-
* __call__() returns a pointer to the C++ object
13-
* Added support for void* arguments
14-
* Fixed floating point argument bug
15-
* Fixed char* return value bug
12+
ECS:Python requires a Python distribution to be installed on your system. Python can be downloaded from: www.python.org/download

build

Lines changed: 0 additions & 17 deletions
This file was deleted.

example/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ include_directories(
66

77
add_executable(
88
${PROJECT_NAME}
9-
109
main.cpp
1110
)
1211

1312
target_link_libraries(
1413
${PROJECT_NAME}
15-
1614
EcsPython
1715
)

example/EcsDemo.vcproj

Lines changed: 0 additions & 168 deletions
This file was deleted.

0 commit comments

Comments
 (0)