diff --git a/osrf_testing_tools_cpp/CMakeLists.txt b/osrf_testing_tools_cpp/CMakeLists.txt index c45e710..30da891 100644 --- a/osrf_testing_tools_cpp/CMakeLists.txt +++ b/osrf_testing_tools_cpp/CMakeLists.txt @@ -20,7 +20,7 @@ if(BUILD_TESTING) include(cmake/osrf_testing_tools_cpp_require_googletest.cmake) # ensures target gtest_main exists osrf_testing_tools_cpp_require_googletest(VERSION_GTE 1.8 - VENDOR_DIR "${CMAKE_SOURCE_DIR}/vendor") + VENDOR_DIR "${PROJECT_SOURCE_DIR}/vendor") add_subdirectory(test) endif() diff --git a/osrf_testing_tools_cpp/cmake/osrf_testing_tools_cpp_extract_and_build_googletest.cmake b/osrf_testing_tools_cpp/cmake/osrf_testing_tools_cpp_extract_and_build_googletest.cmake index 7fae240..93f6dfc 100644 --- a/osrf_testing_tools_cpp/cmake/osrf_testing_tools_cpp_extract_and_build_googletest.cmake +++ b/osrf_testing_tools_cpp/cmake/osrf_testing_tools_cpp_extract_and_build_googletest.cmake @@ -48,14 +48,14 @@ macro(osrf_testing_tools_cpp_extract_and_build_googletest execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . RESULT_VARIABLE result - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-${GOOGLETEST_VERSION}-extracted) + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-${GOOGLETEST_VERSION}-extracted) if(result) message(FATAL_ERROR "CMake step for googletest failed: ${result}") endif() execute_process(COMMAND ${CMAKE_COMMAND} --build . RESULT_VARIABLE result - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-${GOOGLETEST_VERSION}-extracted) + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-${GOOGLETEST_VERSION}-extracted) if(result) message(FATAL_ERROR "Build step for googletest failed: ${result}") endif() @@ -74,13 +74,13 @@ macro(osrf_testing_tools_cpp_extract_and_build_googletest # add the -pthread flag for Linux machines so it will always work execute_process(COMMAND bash "-c" "sed -i 's@\${CMAKE_THREAD_LIBS_INIT}@\${CMAKE_THREAD_LIBS_INIT} -pthread@' ${__prefix}-src/googletest/cmake/internal_utils.cmake" RESULT_VARIABLE result - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${__prefix}-extracted) + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${__prefix}-extracted) endif() # Add googletest directly to our build. This defines # the gtest and gtest_main targets. add_subdirectory( - ${CMAKE_BINARY_DIR}/${__prefix}-extracted/${__prefix}-src - ${CMAKE_BINARY_DIR}/${__prefix}-extracted/${__prefix}-build + ${CMAKE_CURRENT_BINARY_DIR}/${__prefix}-extracted/${__prefix}-src + ${CMAKE_CURRENT_BINARY_DIR}/${__prefix}-extracted/${__prefix}-build EXCLUDE_FROM_ALL ) unset(__prefix) diff --git a/osrf_testing_tools_cpp/src/memory_tools/CMakeLists.txt b/osrf_testing_tools_cpp/src/memory_tools/CMakeLists.txt index 3a892ee..f429d0a 100644 --- a/osrf_testing_tools_cpp/src/memory_tools/CMakeLists.txt +++ b/osrf_testing_tools_cpp/src/memory_tools/CMakeLists.txt @@ -13,7 +13,7 @@ add_library(memory_tools SHARED target_include_directories(memory_tools PUBLIC - $ + $ $ ) @@ -97,4 +97,4 @@ install(EXPORT memory_tools_interpose set(memory_tools_extra_test_env "${memory_tools_extra_test_env}" PARENT_SCOPE) set(memory_tools_is_available "${memory_tools_is_available}" PARENT_SCOPE) set(memory_tools_src_dir_internal_testing_only - "$" PARENT_SCOPE) + "$" PARENT_SCOPE) diff --git a/osrf_testing_tools_cpp/test/cmake/CMakeLists.txt b/osrf_testing_tools_cpp/test/cmake/CMakeLists.txt index cfa08b2..b04f335 100644 --- a/osrf_testing_tools_cpp/test/cmake/CMakeLists.txt +++ b/osrf_testing_tools_cpp/test/cmake/CMakeLists.txt @@ -3,5 +3,5 @@ add_test( NAME "test_osrf_testing_tools_cpp_filter_versions_cmake" COMMAND ${CMAKE_COMMAND} -P - "${CMAKE_SOURCE_DIR}/test/cmake/test_osrf_testing_tools_cpp_filter_versions.cmake" + "${PROJECT_SOURCE_DIR}/test/cmake/test_osrf_testing_tools_cpp_filter_versions.cmake" ) \ No newline at end of file diff --git a/osrf_testing_tools_cpp/vendor/google/googletest/googletest-external-project-add.cmake.in b/osrf_testing_tools_cpp/vendor/google/googletest/googletest-external-project-add.cmake.in index ae7b0ce..fb6ea54 100644 --- a/osrf_testing_tools_cpp/vendor/google/googletest/googletest-external-project-add.cmake.in +++ b/osrf_testing_tools_cpp/vendor/google/googletest/googletest-external-project-add.cmake.in @@ -9,8 +9,8 @@ include(ExternalProject) ExternalProject_Add(googletest URL "@GOOGLETEST_ARCHIVE_LOCATION@" URL_MD5 "@GOOGLETEST_MD5SUM@" - SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-@GOOGLETEST_VERSION@-src" - BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-@GOOGLETEST_VERSION@-build" + SOURCE_DIR "@CMAKE_CURRENT_BINARY_DIR@/googletest-@GOOGLETEST_VERSION@-src" + BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/googletest-@GOOGLETEST_VERSION@-build" CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""