CMakeLists.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. file(GLOB SOURCES Source/*.cpp Contrib/fastlz/fastlz.c)
  2. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
  3. if(NOT SDL2_ROOT_DIR)
  4. set(SDL2_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Contrib/SDL")
  5. endif()
  6. find_package(OpenGL REQUIRED)
  7. find_package(SDL2 REQUIRED)
  8. include_directories(SYSTEM ${OPENGL_INCLUDE_DIR})
  9. include_directories(SYSTEM Contrib/fastlz)
  10. include_directories(SYSTEM Contrib)
  11. include_directories(../DebugUtils/Include)
  12. include_directories(../Detour/Include)
  13. include_directories(../DetourCrowd/Include)
  14. include_directories(../DetourTileCache/Include)
  15. include_directories(../Recast/Include)
  16. include_directories(Include)
  17. if (WIN32)
  18. add_executable(RecastDemo WIN32 ${SOURCES})
  19. elseif(APPLE)
  20. add_executable(RecastDemo MACOSX_BUNDLE ${SOURCES})
  21. else()
  22. add_executable(RecastDemo ${SOURCES})
  23. endif()
  24. file(COPY Bin/Meshes DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
  25. file(COPY Bin/TestCases DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
  26. file(COPY Bin/DroidSans.ttf DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
  27. if (WIN32)
  28. file(COPY "${SDL2_RUNTIME_LIBRARY}" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
  29. endif()
  30. add_dependencies(RecastDemo DebugUtils Detour DetourCrowd DetourTileCache Recast)
  31. target_link_libraries(RecastDemo ${OPENGL_LIBRARIES} SDL2::SDL2main DebugUtils Detour DetourCrowd DetourTileCache Recast)
  32. install(TARGETS RecastDemo
  33. RUNTIME DESTINATION bin
  34. BUNDLE DESTINATION bin)
  35. install(DIRECTORY Bin/Meshes DESTINATION bin)
  36. install(DIRECTORY Bin/TestCases DESTINATION bin)
  37. install(FILES Bin/DroidSans.ttf DESTINATION bin)
  38. if (WIN32)
  39. install(FILES "${SDL2_RUNTIME_LIBRARY}" DESTINATION bin)
  40. endif()