diff --git a/.gitignore b/.gitignore index f6d84f0..3e0ec2f 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ Release *.exe *.out *.app +build/* +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..f5388d5 --- /dev/null +++ b/CMakeLists.txt @@ -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}) + diff --git a/README.md b/README.md index 59bc045..e4945e5 100644 --- a/README.md +++ b/README.md @@ -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 +```