CMakeLists.txt 923 B

1234567891011121314151617181920212223242526272829303132
  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. # configure a header file to pass some of the CMake settings
  8. # to the source code
  9. configure_file(TutorialConfig.h.in TutorialConfig.h)
  10. # TODO 2: Remove EXTRA_INCLUDES list
  11. # add the MathFunctions library
  12. add_subdirectory(MathFunctions)
  13. list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/MathFunctions")
  14. # add the executable
  15. add_executable(Tutorial tutorial.cxx)
  16. target_link_libraries(Tutorial PUBLIC MathFunctions)
  17. # TODO 3: Remove use of EXTRA_INCLUDES
  18. # add the binary tree to the search path for include files
  19. # so that we will find TutorialConfig.h
  20. target_include_directories(Tutorial PUBLIC
  21. "${PROJECT_BINARY_DIR}"
  22. ${EXTRA_INCLUDES}
  23. )