Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build*/
*build*/
.*
17 changes: 4 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

# project name and supported languages
project(example Fortran C CXX)
project(example)

set(CMAKE_CXX_STANDARD 14)

# guard against in-source builds and bad build-type strings
include(cmake/safeguards.cmake)
Expand Down Expand Up @@ -41,17 +43,8 @@ configure_file(

add_subdirectory(src)

# set cdash buildname
set(BUILDNAME
"${CMAKE_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}-${CMAKE_Fortran_COMPILER_ID}-${cmake_build_type_tolower}"
CACHE STRING
"Name of build on the dashboard"
)

# allow to report to a cdash dashboard
include(CTest)

# fetch googletest
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
include(cmake/googletest.cmake)
fetch_googletest(
${PROJECT_SOURCE_DIR}/cmake
Expand All @@ -64,5 +57,3 @@ enable_testing()
# define tests
add_subdirectory(test)

# cpack
include(cmake/packaging.cmake)
7 changes: 0 additions & 7 deletions CTestConfig.cmake

This file was deleted.

2 changes: 0 additions & 2 deletions cmake/googletest-download.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ ExternalProject_Add(
BINARY_DIR "@GOOGLETEST_DOWNLOAD_ROOT@/googletest-build"
GIT_REPOSITORY
https://github.com/google/googletest.git
GIT_TAG
release-1.8.0
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
5 changes: 0 additions & 5 deletions cmake/packaging.cmake

This file was deleted.

6 changes: 6 additions & 0 deletions test/example_add.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ TEST(example, add)
res = add_numbers(1.0, 2.0);
ASSERT_NEAR(res, 3.0, 1.0e-11);
}

TEST(example, add_another)
{
auto res = add_numbers(1000, 1000);
ASSERT_NEAR(res, 2000.0, 1.0e-11);
}