CMakeLists.txt 871 B

123456789101112131415161718192021222324252627282930
  1. project (Tutorial)
  2. # The version number.
  3. set (Tutorial_VERSION_MAJOR 1)
  4. set (Tutorial_VERSION_MINOR 0)
  5. # should we use our own math functions
  6. option(USE_MYMATH "Use tutorial provided math implementation" ON)
  7. # configure a header file to pass some of the CMake settings
  8. # to the source code
  9. configure_file (
  10. "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
  11. "${PROJECT_BINARY_DIR}/TutorialConfig.h"
  12. )
  13. # add the binary tree to the search path for include files
  14. # so that we will find TutorialConfig.h
  15. include_directories ("${PROJECT_BINARY_DIR}")
  16. # add the MathFunctions library?
  17. if (USE_MYMATH)
  18. include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
  19. add_subdirectory (MathFunctions)
  20. set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
  21. endif (USE_MYMATH)
  22. # add the executable
  23. add_executable (Tutorial tutorial.cxx)
  24. target_link_libraries (Tutorial ${EXTRA_LIBS})