A little toolkit for single-quad fragment shader demos
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.

54 lines
1.9 KiB

8 years ago
  1. cmake_minimum_required(VERSION 3.1)
  2. project(zinnia VERSION 0.1
  3. LANGUAGES C CXX)
  4. set(CMAKE_CXX_STANDARD 17)
  5. # ## Thanks to yipdw/ninjawedding for this snippet: https://gitlab.peach-bun.com/snippets/103
  6. # If ld.gold is available, use it -- it's faster. Also enable incremental
  7. # linking for debug and release.
  8. # TODO: It's probably a good idea to enable -z relro for non-development
  9. # builds. That's more CMake archaeology, though, and I'm not really in the
  10. # mood for that now.
  11. # option(USE_LD_GOLD "Use GNU gold linker" ON)
  12. # execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
  13. # if(USE_LD_GOLD)
  14. # execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
  15. # if("${LD_VERSION}" MATCHES "GNU gold")
  16. # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,-z,norelro -Wl,--incremental")
  17. # else()
  18. # message(WARNING "GNU gold linker isn't available, using the default system linker.")
  19. # endif()
  20. # endif()
  21. find_package(PkgConfig REQUIRED)
  22. find_package(OpenGL REQUIRED)
  23. pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
  24. pkg_search_module(GLFW REQUIRED glfw3)
  25. include_directories(deps/imgui deps/imgui/examples/opengl3_example)
  26. file(GLOB IMGUI_SOURCE
  27. deps/imgui/imgui.cpp
  28. deps/imgui/imgui_draw.cpp
  29. deps/imgui/imgui_demo.cpp
  30. deps/imgui/examples/opengl3_example/imgui_impl_glfw_gl3.cpp)
  31. include_directories(deps/cpptoml/include)
  32. include_directories(deps/inotify)
  33. include_directories(deps/handmademath)
  34. add_subdirectory(deps/gl3w gl3w)
  35. include_directories(${PROJECT_SOURCE_DIR})
  36. add_executable(zinnia src/main.cpp src/geom.cpp src/gui/gui.cpp src/project.cpp
  37. src/shaders.cpp
  38. ${IMGUI_SOURCE})
  39. target_link_libraries(zinnia stdc++fs)
  40. target_link_libraries(zinnia gl3w)
  41. target_link_libraries(zinnia ${OPENGL_LIBRARIES})
  42. target_link_libraries(zinnia ${GLFW_LIBRARIES})
  43. target_link_libraries(zinnia ${GTK3_LIBRARIES})