• Stars
    star
    173
  • Rank 215,959 (Top 5 %)
  • Language CMake
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated 25 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Modern CMake C++ SWIG Sample
OS C++ Python Java .NET
Linux Status Status Status Status
macOS Status Status Status Status
Windows Status Status Status Status

Build Status

Introduction

| Requirement | Codemap | Dependencies | Build | C++ | Swig | Python 3 | .Net Core | Java | CI | Appendices | License |

This is a complete example of how to create a Modern CMake C++ Project with the SWIG code generator to generate wrapper and package for Python, .Net and Java.

This project should run on GNU/Linux, MacOS and Windows.

You can find detailed documentation for C++, Swig, Python 3, .Net Core and Java.

note: You should read C++ and Swig first since since other languages are just swig generated wrappers from the C++.

Requirement

You'll need:

  • "CMake >= 3.18".
  • "Python >= 3.6" and python module 'pip' (ed "setuptools" and "wheel" will be auto installed on demand).

Codemap

The project layout is as follow:

Dependencies

To complexify a little, the CMake project is composed of three libraries (Foo, Bar and FooBar) with the following dependencies:

Foo:
Bar:
FooBar: PUBLIC Foo PRIVATE Bar

Build

To build the C++ project, as usual:

cmake -S. -Bbuild
cmake --build build

Appendices

Few links on the subject...

Resources

Project layout:

  • The Pitchfork Layout Revision 1 (cxx-pflR1)

CMake:

Python:

.Net:

Issues

Some issue related to this process

Misc

Image has been generated using plantuml:

plantuml -Tsvg docs/{file}.dot

So you can find the dot source files in docs.

License

Apache 2. See the LICENSE file for details.

Disclaimer

This is not an official Google product, it is just code that happens to be owned by Google.

More Repositories

1

dotnet-native

Template to build a multi-platforms Native Net 6.0 Nuget package using dotnet cli
C++
79
star
2

cmake-external

Modern CMake C++ ExternalProject Sample
Makefile
25
star
3

cmake-cpp

Modern CMake C++ Sample
C++
24
star
4

vim-colorschemes

My colorscheme for vim
Vim Script
22
star
5

bazel-pybind11

Bazel C++ Pybind11 Sample
Makefile
11
star
6

python-native

Test to build a multi-platforms Native Python 3 package using pip
C++
9
star
7

viewer

Qt widget based on OpenSceneGraph to display image & 3D Point Cloud
C++
6
star
8

li-ov4689

Simple program to test Leopard Imaging StereoCamera (OV4689) and 2DCamera (OV5640)
C++
4
star
9

sdlhana

fork of http://sdlhana.nongnu.org/
C++
3
star
10

qtdroid

Sample using Qt5, Android and CMake cross toolchain (armv7a only)
C++
3
star
11

rftg

fork of http://keldon.net/rftg/ (0.9.4) using cmake
C
2
star
12

bazel-cpp

Bazel C++ sample
C++
2
star
13

cmake-pybind11

Test to build a Native Python 3 package using pybind11
C++
2
star
14

cmake-cbc

Modern CMake C++ Cbc Sample
CMake
2
star
15

config

Linux configuration files (zshrc...)
Lua
2
star
16

bazel-swig

Bazel C++ SWIG Sample
Starlark
2
star
17

cardgame

Card Game Framework
CMake
2
star
18

cmake-abseil

Modern CMake Project consuming abseil/abseil-cpp as add_subdirectory or install
2
star
19

cv

TeX
1
star
20

tournament

Small test for Lucas
Python
1
star
21

target_sources

Test target_source(tgt PUBLIC ...) and PUBLIC_HEADER
Makefile
1
star
22

or-tools_doxygen

Doxygen of google/or-tools using the swig_4 branch
1
star
23

bazel-proto

Investigate CMake/Bazel discrepancy
C++
1
star
24

GLPK

GLPK with CMake support
C
1
star
25

entry_exit

OR-Tools samples with refill station having entry and exit
Python
1
star
26

aur

My archlinux pkbuild
Shell
1
star
27

minetest-101

Some minetest stuff
1
star
28

cybermage

fork of http://www.gatewayheaven.com/projects/arcomage/
C++
1
star
29

java-native

Template to build a multi-platforms Native Java Maven package
C++
1
star
30

absl-cxx

MRE c++ propagation not working
Makefile
1
star
31

adventofcode

My shit for https://adventofcode.com/2021
Python
1
star
32

minetest-textures

Various texture packs for minetest
Makefile
1
star