Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding cmake build to cpp splines #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ Release
*.exe
*.out
*.app
build/*
build/
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 2.8.12)
project(spline_proj)


set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -march=native")

set(SRCS_SPLINE
spline/src/main/cpp/Bezier.cpp
spline/src/main/cpp/BSpline.cpp
spline/src/main/cpp/CatmullRom.cpp
spline/src/main/cpp/Curve.cpp
spline/src/main/cpp/Vector.cpp)

include_directories(
${PROJECT_SOURCE_DIR}/spline/src/main/cpp
)

add_library(${PROJECT_NAME} SHARED ${SRCS_SPLINE})
add_executable(spline_app
spline/src/test/cpp/main.cpp)
target_link_libraries(spline_app ${PROJECT_NAME})

20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,23 @@ int main(char** argv, int argc) {
delete curve;
}
```
## Building
cpp-spline comes bundled with sln and vcxproj files so that it can be directly opened and built using Visual Studio in windows.


cpp-spline can now be build using cmake as well.

Cmake can be installed in debian based systems by

```bash
sudo apt install cmake
```
### Build instructions (linux)
```bash
git clone https://github.com/chen0040/cpp-spline.git
mkdir build
cd build
cmake ..
make all
./spline_app
```