CMakeLists.txt 1.5 KB

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