From e709c9ead4f2ece711a76a7188024c551b65a146 Mon Sep 17 00:00:00 2001 From: Robert Ramey Date: Tue, 19 Apr 2016 13:30:44 -0700 Subject: [PATCH] added CTestConfig.cmake to library root. --- CMake/CMakeLists.txt | 27 ++++++++++++++++++++++++--- CMakeLists.txt | 3 +++ CTestConfig.cmake | 11 +++++++++++ examples/CMakeLists.txt | 20 ++++++++++++++++---- include/CMakeLists.txt | 2 -- test/CMakeLists.txt | 36 +++++++++++++++--------------------- 6 files changed, 69 insertions(+), 30 deletions(-) create mode 100644 CTestConfig.cmake diff --git a/CMake/CMakeLists.txt b/CMake/CMakeLists.txt index 2d323c8..5872941 100644 --- a/CMake/CMakeLists.txt +++ b/CMake/CMakeLists.txt @@ -142,9 +142,30 @@ foreach(dir ${dirs}) message(STATUS " ${dir}") endforeach() -# create script to run all tests and examples -include(CTest) - #use folders in organization of the IDE set(USE_FOLDERS TRUE) +########################### +# testing and submitting test results to the test dashboard + +# create script to run all tests and examples +include(CTest) + +if(0) + +## Create a file named CTestConfig.cmake adjacent to the current file. +## This new file should contain the following: + +set(CTEST_PROJECT_NAME "Safe Numerics") +set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") + +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "my.cdash.org") +# set(CTEST_DROP_LOCATION "/cdash/submit.php?project=MyProject") +set(CTEST_DROP_LOCATION "/index.php?project=Safe+Numerics") +set(CTEST_DROP_SITE_CDASH TRUE) + +endif() + + + diff --git a/CMakeLists.txt b/CMakeLists.txt index 262b225..fa08449 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,9 @@ include("CMake/CMakeLists.txt") include_directories("${Boost_INCLUDE_DIRS}") include_directories("include") +# create target to run test andpwd examples +include (CTest) + add_subdirectory("include") add_subdirectory("examples") add_subdirectory("test") diff --git a/CTestConfig.cmake b/CTestConfig.cmake new file mode 100644 index 0000000..a0b5924 --- /dev/null +++ b/CTestConfig.cmake @@ -0,0 +1,11 @@ +## This file should be placed in the root directory of your project. +## Then modify the CMakeLists.txt file in the root directory of your +## project to incorporate the testing dashboard. +## # The following are required to uses Dart and the Cdash dashboard +set(CTEST_PROJECT_NAME "Safe Numerics") +set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") + +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "my.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=Safe+Numerics") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index b8355ab..cb7f2ca 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -8,12 +8,11 @@ include("../CMake/CMakeLists.txt" ) include_directories("${Boost_INCLUDE_DIRS}") include_directories("../include") -# create target to run test of examples -include (CTest) - ########################### # examples +message( STATUS "Runtimes are stored in ${CMAKE_CURRENT_BINARY_DIR}" ) + file(GLOB example_list RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" @@ -24,7 +23,7 @@ foreach(file_name ${example_list}) message(STATUS ${base_name}) add_executable(${base_name} ${file_name}) add_test(NAME ${base_name} COMMAND ${base_name}) - set_target_properties(${base_name} PROPERTIES FOLDER "examples") + set_target_properties(${base_name} PROPERTIES FOLDER "example") endforeach(file_name) set_target_properties(example84 PROPERTIES @@ -37,3 +36,16 @@ set_target_properties(example81 example93 PROPERTIES # end examples targets #################### + +########################### +# add misc files to IDE + +file(GLOB misc_files + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/*.c" +) +add_custom_target(miscellaneous SOURCES ${misc_files}) +set_target_properties(miscellaneous PROPERTIES FOLDER "example") + +# end headers in IDE +#################### diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index a6f74da..9172b8f 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1,8 +1,6 @@ #################### # add include headers to IDE -set(USE_FOLDERS TRUE) - file(GLOB include_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp" diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8cd07f4..edfe910 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -8,30 +8,11 @@ include("../CMake/CMakeLists.txt" ) include_directories("${Boost_INCLUDE_DIRS}") include_directories("../include") -########################### -# testing and submitting test results to the test dashboard - -include (CTest) - -if(0) - -## Create a file named CTestConfig.cmake adjacent to the current file. -## This new file should contain the following: - -set(CTEST_PROJECT_NAME "Safe Numerics") -set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") - -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "my.cdash.org") -# set(CTEST_DROP_LOCATION "/cdash/submit.php?project=MyProject") -set(CTEST_DROP_LOCATION "/index.php?project=Safe+Numerics") -set(CTEST_DROP_SITE_CDASH TRUE) - -endif() - ########################### # test targets +message( STATUS "Runtimes are stored in ${CMAKE_CURRENT_BINARY_DIR}" ) + file(GLOB test_list RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" @@ -46,3 +27,16 @@ endforeach(file_name) # end test targets #################### + +########################### +# add headers to IDE + +file(GLOB include_files + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp" +) +add_custom_target(include SOURCES ${include_files}) +set_target_properties(include PROPERTIES FOLDER "tests") + +# end headers in IDE +####################