From 02a6f029add693ed213dd32abf61261e06935c6d Mon Sep 17 00:00:00 2001 From: Jordan Williams <19399197+jwillikers@users.noreply.github.com> Date: Mon, 24 Feb 2020 07:59:59 -0600 Subject: [PATCH] use ExternalProject to download the toml tests In order to evaluate the relative paths correctly, add_test should use the current binary directory as the working directory. --- tests/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e6a1f5b..544d56c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,3 +1,12 @@ +include(ExternalProject) +ExternalProject_Add(toml + SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/toml + GIT_REPOSITORY https://github.com/toml-lang/toml + GIT_TAG v0.5.0 + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "") + set(TEST_NAMES test_datetime test_string @@ -158,7 +167,7 @@ foreach(TEST_NAME ${TEST_NAMES}) endif() endif() - add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) + add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # Set the PATH to be able to find Boost DLL if(WIN32)