CMakeLists.txt 898 B

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