Excercise 3 - Step 1
This commit is contained in:
parent
40bab85440
commit
69ad259a4e
@ -1,14 +1,11 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
project(Tutorial)
|
project(
|
||||||
# TODO 7: Set the project version number as 1.0 in the above project command
|
Tutorial
|
||||||
|
VERSION 1.0
|
||||||
# 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 11)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
|
|
||||||
# TODO 8: Use configure_file to configure and copy TutorialConfig.h.in to
|
configure_file(TutorialConfig.h.in TutorialConfig.h)
|
||||||
# TutorialConfig.h
|
|
||||||
|
|
||||||
add_executable(Tutorial 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})
|
@ -1,2 +1,4 @@
|
|||||||
// the configured options and settings for Tutorial
|
// the configured options and settings for Tutorial
|
||||||
// TODO 10: Define Tutorial_VERSION_MAJOR and Tutorial_VERSION_MINOR
|
// 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 <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
// TODO 11: Include TutorialConfig.h
|
#include "TutorialConfig.h"
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
// TODO 12: Create a print statement using Tutorial_VERSION_MAJOR
|
std::cout << argv[0] << " V " << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR << std::endl;
|
||||||
// and Tutorial_VERSION_MINOR
|
|
||||||
std::cout << "Usage: " << argv[0] << " number" << std::endl;
|
std::cout << "Usage: " << argv[0] << " number" << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user