1 cmake_minimum_required(VERSION 3.10)
3 # set the project name and version
4 project(Tutorial VERSION 1.0)
6 # specify the C++ standard
7 set(CMAKE_CXX_STANDARD 11)
8 set(CMAKE_CXX_STANDARD_REQUIRED True)
10 # TODO 7: Create a variable USE_MYMATH using option and set default to ON
12 # configure a header file to pass some of the CMake settings
14 configure_file(TutorialConfig.h.in TutorialConfig.h)
16 # TODO 8: Use list() and APPEND to create a list of optional libraries
17 # called EXTRA_LIBS and a list of optional include directories called
18 # EXTRA_INCLUDES. Add the MathFunctions library and source directory to
19 # the appropriate lists.
21 # Only call add_subdirectory and only add MathFunctions specific values
22 # to EXTRA_LIBS and EXTRA_INCLUDES if USE_MYMATH is true.
24 # TODO 2: Use add_subdirectory() to add MathFunctions to this project
27 add_executable(Tutorial tutorial.cxx)
29 # TODO 9: Use EXTRA_LIBS instead of the MathFunctions specific values
30 # in target_link_libraries.
32 # TODO 3: Use target_link_libraries to link the library to our executable
34 # TODO 4: Add MathFunctions to Tutorial's target_include_directories()
35 # Hint: ${PROJECT_SOURCE_DIR} is a path to the project source. AKA This folder!
37 # TODO 10: Use EXTRA_INCLUDES instead of the MathFunctions specific values
38 # in target_include_directories.
40 # add the binary tree to the search path for include files
41 # so that we will find TutorialConfig.h
42 target_include_directories(Tutorial PUBLIC
43 "${PROJECT_BINARY_DIR}"