aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt28
-rw-r--r--Makefile25
2 files changed, 28 insertions, 25 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..683e7d6
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,28 @@
+cmake_minimum_required(VERSION 2.8)
+project(CodepointIterator)
+
+set(
+ CMAKE_CXX_FLAGS
+ "-std=c++11 -W -Wall -Wextra -Winline -pedantic"
+)
+
+include_directories(
+ src/
+)
+
+add_executable(
+ test
+ test.cc
+ src/utility.cc
+ src/codepoint_iterator.cc
+)
+
+target_link_libraries(
+ test
+ gtest
+)
+
+add_custom_command(
+ TARGET test
+ POST_BUILD COMMAND ./test
+)
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 6d82904..0000000
--- a/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-CXX = g++
-CXXFLAGS = -std=c++11 -W -Wall -Wextra -pedantic
-
-SRC = src/utility.cc \
- src/codepoint_iterator.cc \
- test.cc
-OBJ = $(subst .cc,.o,$(SRC))
-
-all: test
-
-test: ${OBJ}
- $(CXX) -o test -lgtest $(OBJ)
- ./test
-
-.PHONY: clean;
-clean:
- rm -f $(OBJ)
- rm test
-
-depend: .depend
-
-.depend: $(SRC)
- $(CXX) -M $(CXXFLAGS) $< > $@
-
-include .depend