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

Add CMake support #5

Open
wants to merge 2 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*.log
Debug/*
Release/*
build/*
*.opendb
*.db
*.suo
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cmake_minimum_required(VERSION 3.5)

project(crunch VERSION 0.1.0 LANGUAGES CXX)

add_subdirectory(crunch)

29 changes: 29 additions & 0 deletions crunch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)