diff --git a/chapter-14/recipe-02/cxx-example/CTestConfig.cmake b/chapter-14/recipe-02/cxx-example/CTestConfig.cmake deleted file mode 100644 index 895d2e92f..000000000 --- a/chapter-14/recipe-02/cxx-example/CTestConfig.cmake +++ /dev/null @@ -1,4 +0,0 @@ -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "my.cdash.org") -set(CTEST_DROP_LOCATION "/submit.php?project=cmake-cookbook") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/chapter-14/recipe-02/cxx-example/CTestConfig.cmake b/chapter-14/recipe-02/cxx-example/CTestConfig.cmake new file mode 120000 index 000000000..29ab86d9c --- /dev/null +++ b/chapter-14/recipe-02/cxx-example/CTestConfig.cmake @@ -0,0 +1 @@ +../../recipe-01/cxx-example/CTestConfig.cmake \ No newline at end of file diff --git a/chapter-14/recipe-03/cxx-example/CTestConfig.cmake b/chapter-14/recipe-03/cxx-example/CTestConfig.cmake deleted file mode 100644 index 895d2e92f..000000000 --- a/chapter-14/recipe-03/cxx-example/CTestConfig.cmake +++ /dev/null @@ -1,4 +0,0 @@ -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "my.cdash.org") -set(CTEST_DROP_LOCATION "/submit.php?project=cmake-cookbook") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/chapter-14/recipe-03/cxx-example/CTestConfig.cmake b/chapter-14/recipe-03/cxx-example/CTestConfig.cmake new file mode 120000 index 000000000..29ab86d9c --- /dev/null +++ b/chapter-14/recipe-03/cxx-example/CTestConfig.cmake @@ -0,0 +1 @@ +../../recipe-01/cxx-example/CTestConfig.cmake \ No newline at end of file diff --git a/chapter-14/recipe-03/fortran-example/CTestConfig.cmake b/chapter-14/recipe-03/fortran-example/CTestConfig.cmake index 24dab7857..29ab86d9c 120000 --- a/chapter-14/recipe-03/fortran-example/CTestConfig.cmake +++ b/chapter-14/recipe-03/fortran-example/CTestConfig.cmake @@ -1 +1 @@ -../cxx-example/CTestConfig.cmake \ No newline at end of file +../../recipe-01/cxx-example/CTestConfig.cmake \ No newline at end of file diff --git a/chapter-14/recipe-04/cxx-example/CMakeLists.txt b/chapter-14/recipe-04/cxx-example/CMakeLists.txt index c84ad4768..9ca177523 100644 --- a/chapter-14/recipe-04/cxx-example/CMakeLists.txt +++ b/chapter-14/recipe-04/cxx-example/CMakeLists.txt @@ -12,8 +12,7 @@ find_package(Threads REQUIRED) add_executable(example example.cpp) -target_link_libraries( - example +target_link_libraries(example PUBLIC Threads::Threads ) @@ -22,13 +21,12 @@ option(ENABLE_TSAN "Enable ThreadSanitizer" OFF) if(ENABLE_TSAN) if(CMAKE_CXX_COMPILER_ID MATCHES GNU) - target_compile_options( - example + message(STATUS "ThreadSanitizer enabled") + target_compile_options(example PUBLIC -g -O1 -fsanitize=thread -fno-omit-frame-pointer -fPIC ) - target_link_libraries( - example + target_link_libraries(example PUBLIC tsan ) @@ -46,5 +44,5 @@ add_test( NAME example COMMAND - ${PROJECT_BINARY_DIR}/example + $ ) diff --git a/chapter-14/recipe-04/cxx-example/CTestConfig.cmake b/chapter-14/recipe-04/cxx-example/CTestConfig.cmake deleted file mode 100644 index 895d2e92f..000000000 --- a/chapter-14/recipe-04/cxx-example/CTestConfig.cmake +++ /dev/null @@ -1,4 +0,0 @@ -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "my.cdash.org") -set(CTEST_DROP_LOCATION "/submit.php?project=cmake-cookbook") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/chapter-14/recipe-04/cxx-example/CTestConfig.cmake b/chapter-14/recipe-04/cxx-example/CTestConfig.cmake new file mode 120000 index 000000000..29ab86d9c --- /dev/null +++ b/chapter-14/recipe-04/cxx-example/CTestConfig.cmake @@ -0,0 +1 @@ +../../recipe-01/cxx-example/CTestConfig.cmake \ No newline at end of file diff --git a/chapter-14/recipe-04/cxx-example/dashboard.cmake b/chapter-14/recipe-04/cxx-example/dashboard.cmake index a7d4a654f..3a4ba99cb 100644 --- a/chapter-14/recipe-04/cxx-example/dashboard.cmake +++ b/chapter-14/recipe-04/cxx-example/dashboard.cmake @@ -1,5 +1,6 @@ set(CTEST_PROJECT_NAME "example") -set(CTEST_SITE "localhost") +cmake_host_system_information(RESULT _site QUERY HOSTNAME) +set(CTEST_SITE ${_site}) set(CTEST_BUILD_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}") set(CTEST_SOURCE_DIRECTORY "${CTEST_SCRIPT_DIRECTORY}")