From 8f74e4e44ebbff1bad2a47eb629d7c5a0e3769e8 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Tue, 14 Oct 2014 10:01:46 +0200 Subject: [PATCH] Splitted CMakeLists.txt --- CMakeLists.txt | 18 +++--------------- srcs/CMakeLists.txt | 3 +++ tests/CMakeLists.txt | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 srcs/CMakeLists.txt create mode 100644 tests/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f258a5f..830c7037 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,19 +1,7 @@ cmake_minimum_required(VERSION 2.8.4) project(ArduinoJson) -file(GLOB_RECURSE SRCS_FILES srcs/*.cpp) -file(GLOB TESTS_FILES tests/*.cpp) +enable_testing() -add_library(ArduinoJson ${SRCS_FILES}) - -include_directories( - srcs - third-party/gtest-1.7.0 - third-party/gtest-1.7.0/include) - -add_executable(ArduinoJsonTests - ${TESTS_FILES} - third-party/gtest-1.7.0/src/gtest-all.cc - third-party/gtest-1.7.0/src/gtest_main.cc) - -target_link_libraries(ArduinoJsonTests ArduinoJson) \ No newline at end of file +add_subdirectory(srcs) +add_subdirectory(tests) \ No newline at end of file diff --git a/srcs/CMakeLists.txt b/srcs/CMakeLists.txt new file mode 100644 index 00000000..7c7aaab5 --- /dev/null +++ b/srcs/CMakeLists.txt @@ -0,0 +1,3 @@ +file(GLOB_RECURSE SRCS_FILES *.cpp) + +add_library(ArduinoJson ${SRCS_FILES}) \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..d1a8c667 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,17 @@ +set(GTEST_DIR ../third-party/gtest-1.7.0) + +file(GLOB TESTS_FILES *.cpp) + +include_directories( + ../srcs + ${GTEST_DIR} + ${GTEST_DIR}/include) + +add_executable(ArduinoJsonTests + ${TESTS_FILES} + ${GTEST_DIR}/src/gtest-all.cc + ${GTEST_DIR}/src/gtest_main.cc) + +target_link_libraries(ArduinoJsonTests ArduinoJson) + +add_test(ArduinoJsonTests ArduinoJsonTests) \ No newline at end of file