From 9ff0f8d92bcb9b5cf732cc12f15075e384d39c69 Mon Sep 17 00:00:00 2001 From: Henning Schild Date: Wed, 8 Oct 2014 13:48:38 +0200 Subject: [PATCH] cmake: make build independant of build-dir source-dir location The old version depended on the build-dir to be a subdirectory of the source directory. With this patch one can build in tree or put the build-dir anywhere. Signed-off-by: Henning Schild --- CMakeLists.txt | 2 +- algorithms_cpp/CMakeLists.txt | 2 +- base_c/CMakeLists.txt | 2 +- base_cpp/CMakeLists.txt | 2 +- containers_cpp/CMakeLists.txt | 2 +- dataflow_cpp/CMakeLists.txt | 2 +- mtapi_c/CMakeLists.txt | 2 +- mtapi_cpp/CMakeLists.txt | 2 +- partest.tar | Bin 161792 -> 0 bytes 9 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 83524f4..52f2d47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,7 +105,7 @@ else() set(test_script_out run_tests.bat) endif() execute_process( - COMMAND ${CMAKE_COMMAND} -E copy ../scripts/${test_script_in} binaries/${test_script_out} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/scripts/${test_script_in} binaries/${test_script_out} ) ## Test and Partest build diff --git a/algorithms_cpp/CMakeLists.txt b/algorithms_cpp/CMakeLists.txt index 4088cec..b5ce17f 100644 --- a/algorithms_cpp/CMakeLists.txt +++ b/algorithms_cpp/CMakeLists.txt @@ -5,7 +5,7 @@ file(GLOB_RECURSE EMBB_ALGORITHMS_CPP_HEADERS "include/*.h") file(GLOB_RECURSE EMBB_ALGORITHMS_CPP_TEST_SOURCES "test/*.cc" "test/*.h") # Execute the GroupSources macro -include(../CMakeCommon/GroupSourcesMSVC.cmake) +include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake) GroupSourcesMSVC(include) GroupSourcesMSVC(src) GroupSourcesMSVC(test) diff --git a/base_c/CMakeLists.txt b/base_c/CMakeLists.txt index cfc98ef..f2ac385 100644 --- a/base_c/CMakeLists.txt +++ b/base_c/CMakeLists.txt @@ -1,6 +1,6 @@ project (project_embb_base_c) -include(../CMakeCommon/GroupSourcesMSVC.cmake) +include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake) ## CODE FILE DETECTION diff --git a/base_cpp/CMakeLists.txt b/base_cpp/CMakeLists.txt index ea5a1f7..e7cfd27 100644 --- a/base_cpp/CMakeLists.txt +++ b/base_cpp/CMakeLists.txt @@ -14,7 +14,7 @@ configure_file("include/embb/base/internal/cmake_config.h.in" "include/embb/base/internal/cmake_config.h") # Execute the GroupSources macro -include(../CMakeCommon/GroupSourcesMSVC.cmake) +include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake) GroupSourcesMSVC(include/embb/base) GroupSourcesMSVC(src) if (BUILD_TESTS STREQUAL ON) diff --git a/containers_cpp/CMakeLists.txt b/containers_cpp/CMakeLists.txt index 1ca0ccf..014d2d3 100644 --- a/containers_cpp/CMakeLists.txt +++ b/containers_cpp/CMakeLists.txt @@ -5,7 +5,7 @@ file(GLOB_RECURSE EMBB_CONTAINERS_CPP_HEADERS "include/*.h") file(GLOB_RECURSE EMBB_CONTAINERS_CPP_TEST_SOURCES "test/*.cc" "test/*.h") # Execute the GroupSources macro -include(../CMakeCommon/GroupSourcesMSVC.cmake) +include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake) GroupSourcesMSVC(include) GroupSourcesMSVC(src) GroupSourcesMSVC(test) diff --git a/dataflow_cpp/CMakeLists.txt b/dataflow_cpp/CMakeLists.txt index f5949aa..6c5d4e6 100644 --- a/dataflow_cpp/CMakeLists.txt +++ b/dataflow_cpp/CMakeLists.txt @@ -5,7 +5,7 @@ file(GLOB_RECURSE EMBB_DATAFLOW_CPP_HEADERS "include/*.h") file(GLOB_RECURSE EMBB_DATAFLOW_CPP_TEST_SOURCES "test/*.cc" "test/*.h") # Execute the GroupSources macro -include(../CMakeCommon/GroupSourcesMSVC.cmake) +include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake) GroupSourcesMSVC(include) GroupSourcesMSVC(src) GroupSourcesMSVC(test) diff --git a/mtapi_c/CMakeLists.txt b/mtapi_c/CMakeLists.txt index ad4f535..0e147b1 100644 --- a/mtapi_c/CMakeLists.txt +++ b/mtapi_c/CMakeLists.txt @@ -15,7 +15,7 @@ ENDFOREACH(src_tmp) ENDIF() # Execute the GroupSources macro -include(../CMakeCommon/GroupSourcesMSVC.cmake) +include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake) GroupSourcesMSVC(include) GroupSourcesMSVC(src) GroupSourcesMSVC(test) diff --git a/mtapi_cpp/CMakeLists.txt b/mtapi_cpp/CMakeLists.txt index 1f2c7e4..301766c 100644 --- a/mtapi_cpp/CMakeLists.txt +++ b/mtapi_cpp/CMakeLists.txt @@ -5,7 +5,7 @@ file(GLOB_RECURSE EMBB_MTAPI_CPP_HEADERS "include/*.h") file(GLOB_RECURSE EMBB_MTAPI_CPP_TEST_SOURCES "test/*.cc" "test/*.h") # Execute the GroupSources macro -include(../CMakeCommon/GroupSourcesMSVC.cmake) +include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake) GroupSourcesMSVC(include) GroupSourcesMSVC(src) GroupSourcesMSVC(test) diff --git a/partest.tar b/partest.tar index ff8ecdc..5a3f65d 100644 Binary files a/partest.tar and b/partest.tar differ -- libgit2 0.26.0