Commit 9ff0f8d9 by Henning Schild Committed by Christian Kern

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 <henning...@siemens.com>
parent 6f89a126
...@@ -105,7 +105,7 @@ else() ...@@ -105,7 +105,7 @@ else()
set(test_script_out run_tests.bat) set(test_script_out run_tests.bat)
endif() endif()
execute_process( 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 ## Test and Partest build
......
...@@ -5,7 +5,7 @@ file(GLOB_RECURSE EMBB_ALGORITHMS_CPP_HEADERS "include/*.h") ...@@ -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") file(GLOB_RECURSE EMBB_ALGORITHMS_CPP_TEST_SOURCES "test/*.cc" "test/*.h")
# Execute the GroupSources macro # Execute the GroupSources macro
include(../CMakeCommon/GroupSourcesMSVC.cmake) include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake)
GroupSourcesMSVC(include) GroupSourcesMSVC(include)
GroupSourcesMSVC(src) GroupSourcesMSVC(src)
GroupSourcesMSVC(test) GroupSourcesMSVC(test)
......
project (project_embb_base_c) project (project_embb_base_c)
include(../CMakeCommon/GroupSourcesMSVC.cmake) include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake)
## CODE FILE DETECTION ## CODE FILE DETECTION
......
...@@ -14,7 +14,7 @@ configure_file("include/embb/base/internal/cmake_config.h.in" ...@@ -14,7 +14,7 @@ configure_file("include/embb/base/internal/cmake_config.h.in"
"include/embb/base/internal/cmake_config.h") "include/embb/base/internal/cmake_config.h")
# Execute the GroupSources macro # Execute the GroupSources macro
include(../CMakeCommon/GroupSourcesMSVC.cmake) include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake)
GroupSourcesMSVC(include/embb/base) GroupSourcesMSVC(include/embb/base)
GroupSourcesMSVC(src) GroupSourcesMSVC(src)
if (BUILD_TESTS STREQUAL ON) if (BUILD_TESTS STREQUAL ON)
......
...@@ -5,7 +5,7 @@ file(GLOB_RECURSE EMBB_CONTAINERS_CPP_HEADERS "include/*.h") ...@@ -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") file(GLOB_RECURSE EMBB_CONTAINERS_CPP_TEST_SOURCES "test/*.cc" "test/*.h")
# Execute the GroupSources macro # Execute the GroupSources macro
include(../CMakeCommon/GroupSourcesMSVC.cmake) include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake)
GroupSourcesMSVC(include) GroupSourcesMSVC(include)
GroupSourcesMSVC(src) GroupSourcesMSVC(src)
GroupSourcesMSVC(test) GroupSourcesMSVC(test)
......
...@@ -5,7 +5,7 @@ file(GLOB_RECURSE EMBB_DATAFLOW_CPP_HEADERS "include/*.h") ...@@ -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") file(GLOB_RECURSE EMBB_DATAFLOW_CPP_TEST_SOURCES "test/*.cc" "test/*.h")
# Execute the GroupSources macro # Execute the GroupSources macro
include(../CMakeCommon/GroupSourcesMSVC.cmake) include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake)
GroupSourcesMSVC(include) GroupSourcesMSVC(include)
GroupSourcesMSVC(src) GroupSourcesMSVC(src)
GroupSourcesMSVC(test) GroupSourcesMSVC(test)
......
...@@ -15,7 +15,7 @@ ENDFOREACH(src_tmp) ...@@ -15,7 +15,7 @@ ENDFOREACH(src_tmp)
ENDIF() ENDIF()
# Execute the GroupSources macro # Execute the GroupSources macro
include(../CMakeCommon/GroupSourcesMSVC.cmake) include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake)
GroupSourcesMSVC(include) GroupSourcesMSVC(include)
GroupSourcesMSVC(src) GroupSourcesMSVC(src)
GroupSourcesMSVC(test) GroupSourcesMSVC(test)
......
...@@ -5,7 +5,7 @@ file(GLOB_RECURSE EMBB_MTAPI_CPP_HEADERS "include/*.h") ...@@ -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") file(GLOB_RECURSE EMBB_MTAPI_CPP_TEST_SOURCES "test/*.cc" "test/*.h")
# Execute the GroupSources macro # Execute the GroupSources macro
include(../CMakeCommon/GroupSourcesMSVC.cmake) include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake)
GroupSourcesMSVC(include) GroupSourcesMSVC(include)
GroupSourcesMSVC(src) GroupSourcesMSVC(src)
GroupSourcesMSVC(test) GroupSourcesMSVC(test)
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment