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()
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
......
......@@ -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)
......
project (project_embb_base_c)
include(../CMakeCommon/GroupSourcesMSVC.cmake)
include(${CMAKE_SOURCE_DIR}/CMakeCommon/GroupSourcesMSVC.cmake)
## CODE FILE DETECTION
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
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