Excercise 3 - Step 1
This commit is contained in:
parent
40bab85440
commit
e2564d1ea8
@ -1,14 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
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
|
||||
project(
|
||||
Tutorial
|
||||
VERSION 1.0
|
||||
)
|
||||
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)
|
||||
add_executable(Tutorial tutorial.cxx)
|
||||
# TODO 9: Use target_include_directories to include ${PROJECT_BINARY_DIR}
|
||||
target_include_directories(Tutorial PUBLIC ${PROJECT_BINARY_DIR})
|
@ -1,2 +1,4 @@
|
||||
// the configured options and settings for Tutorial
|
||||
// TODO 10: Define Tutorial_VERSION_MAJOR and Tutorial_VERSION_MINOR
|
||||
#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
|
||||
#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
|
@ -4,13 +4,12 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
// TODO 11: Include TutorialConfig.h
|
||||
#include "TutorialConfig.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
if (argc < 2) {
|
||||
// TODO 12: Create a print statement using Tutorial_VERSION_MAJOR
|
||||
// and Tutorial_VERSION_MINOR
|
||||
std::cout << argv[0] << " V " << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR << std::endl;
|
||||
std::cout << "Usage: " << argv[0] << " number" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user