diff --git a/Step1/CMakeLists.txt b/Step1/CMakeLists.txt index 243606c..9b2f09e 100644 --- a/Step1/CMakeLists.txt +++ b/Step1/CMakeLists.txt @@ -1,16 +1,14 @@ -# TODO 1: Set the minimum required version of CMake to be 3.10 cmake_minimum_required(VERSION 3.10) -# TODO 2: Create a project named Tutorial project(Tutorial) # TODO 7: Set the project version number as 1.0 in the above project command # 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 -# 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} diff --git a/Step1/tutorial.cxx b/Step1/tutorial.cxx index 64d0916..1c4977e 100644 --- a/Step1/tutorial.cxx +++ b/Step1/tutorial.cxx @@ -1,6 +1,6 @@ // A simple program that computes the square root of a number #include -#include // TODO 5: Remove this line + #include #include @@ -16,8 +16,7 @@ int main(int argc, char* argv[]) } // convert input to double - // TODO 4: Replace atof(argv[1]) with std::stod(argv[1]) - const double inputValue = atof(argv[1]); + const double inputValue = std::stod(argv[1]); // calculate square root const double outputValue = sqrt(inputValue);