CMakeLists.txt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. cmake_minimum_required(VERSION 3.19)
  2. # --------------------------------------
  3. # Project
  4. # Minimal bgfx+imgui project with cmake
  5. # --------------------------------------
  6. project(myapp)
  7. # --------------------------------------
  8. # bgfx options
  9. # --------------------------------------
  10. set(BGFX_BUILD_TOOLS OFF CACHE BOOL "Build bgfx tools.")
  11. set(BGFX_BUILD_EXAMPLES OFF CACHE BOOL "Build bgfx examples.")
  12. set(BGFX_INSTALL OFF CACHE BOOL "Create installation target.")
  13. set(BGFX_INSTALL_EXAMPLES OFF CACHE BOOL "Install examples and their runtimes.")
  14. set(BGFX_CUSTOM_TARGETS OFF CACHE BOOL "Include convenience custom targets.")
  15. set(BGFX_AMALGAMATED OFF CACHE BOOL "Amalgamated bgfx build for faster compilation")
  16. set(BX_AMALGAMATED OFF CACHE BOOL "Amalgamated bx build for faster compilation")
  17. set(BGFX_CONFIG_DEBUG OFF CACHE BOOL "Enables debug configuration on all builds")
  18. set(BGFX_CONFIG_RENDERER_WEBGPU OFF CACHE BOOL "Enables the webgpu renderer")
  19. add_subdirectory(3rdparty/bgfx-cmake)
  20. add_subdirectory(3rdparty/bgfx-imgui)
  21. # --------------------------------------
  22. # Sources
  23. # --------------------------------------
  24. set(SOURCES
  25. ${CMAKE_CURRENT_LIST_DIR}/src/main.cpp
  26. )
  27. # --------------------------------------
  28. # Products
  29. # --------------------------------------
  30. add_executable(${PROJECT_NAME} ${SOURCES})
  31. # --------------------------------------
  32. # Includes
  33. # --------------------------------------
  34. target_include_directories(${PROJECT_NAME}
  35. PRIVATE
  36. ${CMAKE_CURRENT_LIST_DIR}/src
  37. )
  38. # --------------------------------------
  39. # Link libraries
  40. # --------------------------------------
  41. target_link_libraries(${PROJECT_NAME}
  42. PRIVATE
  43. bgfx-imgui
  44. )