From 20769404d8955b779d6a44267eae4f94a0626e1c Mon Sep 17 00:00:00 2001 From: Teon Banek Date: Tue, 27 Jun 2017 11:01:44 +0200 Subject: [PATCH] Cleanup includes in CMakeLists Summary: Don't include `${CMAKE_BINARY_DIR}/include` since it is not needed and would only slow down compilation. Also removed `include_directories` for `fmt`, since it is built using `add_subdirectory`. (The `add_subdirectory` also does the include.) Use `add_custom_target` for calling `recursive_include` instead of `custom command`. This allows specifying that `recursive_include` depends on `plan_template_cpp`. Reviewers: mislav.bradac, buda Reviewed By: mislav.bradac, buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D511 --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 89781e3c9..57887027a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z -Wall -Wno-c++1z-extensions") set(src_dir ${CMAKE_SOURCE_DIR}/src) set(libs_dir ${CMAKE_SOURCE_DIR}/libs) set(tests_dir ${CMAKE_SOURCE_DIR}/tests) -set(build_include_dir ${CMAKE_BINARY_DIR}/include) # ----------------------------------------------------------------------------- # build flags ----------------------------------------------------------------- @@ -227,8 +226,6 @@ message(STATUS "Generate coverage from unit tests: ${TEST_COVERAGE}") # includes include_directories(${src_dir}) -include_directories(${build_include_dir}) -include_directories(SYSTEM ${fmt_source_dir}) include_directories(SYSTEM ${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS}) include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/libs) # needed to include configured files (plan_compiler_flags.hpp) @@ -343,10 +340,14 @@ if (ALL_TESTS OR BENCHMARK_TESTS OR CONCURRENT_TEST OR INTEGRATION_TEST endif() # ----------------------------------------------------------------------------- -add_custom_command(TARGET memgraph_lib +add_custom_target(recursive_include_plan_template COMMAND ./recursive_include --roots ${src_dir} ${libs_dir} ${CMAKE_BINARY_DIR}/libs/gflags/include ${libs_dir}/glog/include --start ${src_dir}/query/plan_template_cpp --copy ${CMAKE_BINARY_DIR}/include + DEPENDS ${src_dir}/query/plan_template_cpp + SOURCES ${src_dir}/query/plan_template_cpp WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cmake ) +add_dependencies(recursive_include_plan_template fmt gflags glog) +add_dependencies(memgraph_lib recursive_include_plan_template) # memgraph build name execute_process(