-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
46 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.vscode | ||
/Step1_build/ | ||
/Step2_build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
# TODO 1: Set the minimum required version of CMake to be 3.10 | ||
|
||
cmake_minimum_required(VERSION 3.12) | ||
# TODO 2: Create a project named Tutorial | ||
|
||
project(Tutorial) | ||
# TODO 7: Set the project version number as 1.0 in the above project command | ||
|
||
project(Tutorial VERSION 1.5) | ||
# TODO 6: Set the variable CMAKE_CXX_STANDARD to 11 | ||
# and the variable CMAKE_CXX_STANDARD_REQUIRED to True | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED True) | ||
# TODO 8: Use configure_file to configure and copy TutorialConfig.h.in to | ||
# TutorialConfig.h | ||
|
||
configure_file(TutorialConfig.h.in TutorialConfig.h) | ||
# TODO 3: Add an executable called Tutorial to the project | ||
# Hint: Be sure to specify the source file as tutorial.cxx | ||
|
||
add_executable(Tutorial tutorial.cxx) | ||
# TODO 9: Use target_include_directories to include ${PROJECT_BINARY_DIR} | ||
target_include_directories(Tutorial PUBLIC "${PROJECT_BINARY_DIR}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
// the configured options and settings for Tutorial | ||
// TODO 10: Define Tutorial_VERSION_MAJOR and Tutorial_VERSION_MINOR | ||
// clang-format off | ||
#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@ | ||
#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@ | ||
// clang-format on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
#include "MathFunctions.h" | ||
|
||
// TODO 11: include cmath | ||
|
||
#include <cmath> | ||
// TODO 10: Wrap the mysqrt include in a precompiled ifdef based on USE_MYMATH | ||
#ifdef USE_MYMATH | ||
#include "mysqrt.h" | ||
#endif | ||
|
||
namespace mathfunctions { | ||
double sqrt(double x) | ||
{ | ||
// TODO 9: If USE_MYMATH is defined, use detail::mysqrt. | ||
// Otherwise, use std::sqrt. | ||
double sqrt(double x) { | ||
// TODO 9: If USE_MYMATH is defined, use detail::mysqrt. | ||
#ifdef USE_MYMATH | ||
return detail::mysqrt(x); | ||
#else | ||
return std::sqrt(x); | ||
#endif | ||
// Otherwise, use std::sqrt. | ||
} | ||
} | ||
} // namespace mathfunctions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// the configured options and settings for Tutorial | ||
// clang-format off | ||
#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@ | ||
#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters