CMakeLists.txt 974 B

123456789101112131415161718192021222324252627282930313233
  1. cmake_minimum_required(VERSION 3.0)
  2. project(raylib)
  3. # Directory for easier includes
  4. # Anywhere you see include(...) you can check <root>/cmake for that file
  5. set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
  6. # RAYLIB_IS_MAIN determines whether the project is being used from root
  7. # or if it is added as a dependency (through add_subdirectory for example).
  8. if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
  9. set(RAYLIB_IS_MAIN TRUE)
  10. else()
  11. set(RAYLIB_IS_MAIN FALSE)
  12. endif()
  13. # Sets compiler flags and language standard
  14. include(CompilerFlags)
  15. # Registers build options that are exposed to cmake
  16. include(CMakeOptions.txt)
  17. # Enforces a few environment and compiler configurations
  18. include(BuildOptions)
  19. # Main sources directory (the second parameter sets the output directory name to raylib)
  20. add_subdirectory(src raylib)
  21. if (${BUILD_EXAMPLES})
  22. MESSAGE(STATUS "Building examples is enabled")
  23. add_subdirectory(examples)
  24. endif()
  25. enable_testing()