From 49c7d986626b2c2acd80707e6f3997e0719ded1f Mon Sep 17 00:00:00 2001 From: Kim Date: Fri, 16 Mar 2018 11:39:40 +0000 Subject: [PATCH 1/2] cmake support --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f731985..2982d3f 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ *.log Debug/* Release/* +build/* *.opendb *.db *.suo From 0d424aaf6580812eece008212023db94034f0b71 Mon Sep 17 00:00:00 2001 From: Kim Date: Fri, 16 Mar 2018 11:41:01 +0000 Subject: [PATCH 2/2] cmake support --- CMakeLists.txt | 6 ++++++ crunch/CMakeLists.txt | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 crunch/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..5203655 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.5) + +project(crunch VERSION 0.1.0 LANGUAGES CXX) + +add_subdirectory(crunch) + diff --git a/crunch/CMakeLists.txt b/crunch/CMakeLists.txt new file mode 100644 index 0000000..e07d293 --- /dev/null +++ b/crunch/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.8) + +if(!MSVC) +set_compile_options( + -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual + -pedantic -fno-rtti -fPIE -fstack-protector-all +) +endif() + +add_library( + libcrunch +STATIC + binary.cpp + bitmap.cpp + GuillotineBinPack.cpp + hash.cpp + lodepng.cpp + MaxRectsBinPack.cpp + packer.cpp + Rect.cpp + str.cpp +) +target_compile_features(libcrunch PUBLIC cxx_std_14) + +add_executable(crunch main.cpp) +target_link_libraries(crunch libcrunch) +target_compile_features(crunch PUBLIC cxx_std_14) + +install(TARGETS crunch DESTINATION bin) \ No newline at end of file