💿🐜 Antkeeper source code https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

  1. cmake_minimum_required(VERSION 3.7)
  2. # Set compiler flags
  3. set(CMAKE_CXX_FLAGS "-Wall -Wextra")
  4. set(CMAKE_CXX_FLAGS_DEBUG "-g -O3 -DDEBUG")
  5. set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
  6. # Include project macro
  7. include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/project.cmake)
  8. # Find dependency packages
  9. find_package(emergent REQUIRED CONFIG)
  10. find_package(OpenAL REQUIRED CONFIG)
  11. # Determine dependencies
  12. set(STATIC_LIBS
  13. emergent
  14. OpenAL::OpenAL)
  15. # Generate configuration header file
  16. configure_file(${PROJECT_SOURCE_DIR}/src/configuration.hpp.in
  17. ${PROJECT_BINARY_DIR}/src/configuration.hpp)
  18. # Collect source files
  19. file(GLOB_RECURSE SOURCE_FILES
  20. ${PROJECT_SOURCE_DIR}/src/*.cpp)
  21. # Add executable target
  22. set(EXECUTABLE_TARGET ${PROJECT_NAME}-executable)
  23. add_executable(${EXECUTABLE_TARGET} ${SOURCE_FILES})
  24. set_target_properties(${EXECUTABLE_TARGET} PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
  25. # Set include directories
  26. target_include_directories(${EXECUTABLE_TARGET}
  27. PUBLIC
  28. ${PROJECT_SOURCE_DIR}/src
  29. ${PROJECT_BINARY_DIR}/src)
  30. # Link to dependencies
  31. target_link_libraries(${EXECUTABLE_TARGET} ${STATIC_LIBS})
  32. # Install executable
  33. install(TARGETS ${EXECUTABLE_TARGET} DESTINATION bin)