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.

97 lines
3.1 KiB

  1. set( GAL_SRCS
  2. # Common part
  3. ../callback_gal.cpp
  4. ../draw_panel_gal.cpp
  5. ../gl_context_mgr.cpp
  6. ../newstroke_font.cpp
  7. ../painter.cpp
  8. color4d.cpp
  9. cursors.cpp
  10. dpi_scaling.cpp
  11. gal_display_options.cpp
  12. graphics_abstraction_layer.cpp
  13. hidpi_gl_canvas.cpp
  14. hidpi_gl_3D_canvas.cpp
  15. ../view/view_controls.cpp
  16. ../view/view_overlay.cpp
  17. ../view/wx_view_controls.cpp
  18. ../view/zoom_controller.cpp
  19. # OpenGL GAL
  20. opengl/opengl_gal.cpp
  21. opengl/gl_resources.cpp
  22. opengl/shader.cpp
  23. opengl/vertex_item.cpp
  24. opengl/vertex_container.cpp
  25. opengl/cached_container.cpp
  26. opengl/cached_container_gpu.cpp
  27. opengl/cached_container_ram.cpp
  28. opengl/noncached_container.cpp
  29. opengl/vertex_manager.cpp
  30. opengl/gpu_manager.cpp
  31. opengl/antialiasing.cpp
  32. opengl/opengl_compositor.cpp
  33. opengl/utils.cpp
  34. # Cairo GAL
  35. cairo/cairo_gal.cpp
  36. cairo/cairo_compositor.cpp
  37. cairo/cairo_print.cpp
  38. )
  39. add_library( gal STATIC ${GAL_SRCS} )
  40. if( WIN32 )
  41. # we need the gdiplus library for cairo printing on windows
  42. set( GDI_PLUS_LIBRARIES gdiplus )
  43. endif()
  44. target_link_libraries( gal
  45. common # This is needed until the circular dependency is removed
  46. kimath
  47. nlohmann_json
  48. ${GLEW_LIBRARIES}
  49. ${CAIRO_LIBRARIES}
  50. ${PIXMAN_LIBRARIES}
  51. ${OPENGL_LIBRARIES}
  52. ${GDI_PLUS_LIBRARIES}
  53. # outline font support
  54. ${FREETYPE_LIBRARIES}
  55. ${HarfBuzz_LIBRARIES}
  56. ${Fontconfig_LIBRARIES}
  57. )
  58. function( add_shader outTarget inFile shaderName )
  59. set(outCppName "${shaderName}.cpp")
  60. set(outHeaderName "${shaderName}.h")
  61. add_custom_command(
  62. OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${outCppName}
  63. ${CMAKE_BINARY_DIR}/include/gal/shaders/${outHeaderName}
  64. COMMAND ${CMAKE_COMMAND}
  65. -DSOURCE_FILE="${CMAKE_CURRENT_SOURCE_DIR}/shaders/${inFile}"
  66. -DOUT_CPP_DIR="${CMAKE_CURRENT_BINARY_DIR}/"
  67. -DOUT_HEADER_DIR="${CMAKE_BINARY_DIR}/include/gal/shaders/"
  68. -DOUT_CPP_FILENAME="${outCppName}"
  69. -DOUT_HEADER_FILENAME="${outHeaderName}"
  70. -DOUT_VAR_NAME="${shaderName}"
  71. -P ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/CreateShaderCpp.cmake
  72. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/shaders/${inFile}
  73. ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/CreateShaderCpp.cmake
  74. )
  75. target_sources( ${outTarget} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/${outCppName} )
  76. target_include_directories( ${outTarget} PUBLIC ${CMAKE_BINARY_DIR}/include/gal/shaders/ )
  77. endfunction()
  78. add_shader( gal kicad_frag.glsl glsl_kicad_frag )
  79. add_shader( gal kicad_vert.glsl glsl_kicad_vert )
  80. add_shader( gal smaa_base.glsl glsl_smaa_base )
  81. add_shader( gal smaa_pass_1_frag_color.glsl glsl_smaa_pass_1_frag_color )
  82. add_shader( gal smaa_pass_1_frag_luma.glsl glsl_smaa_pass_1_frag_luma )
  83. add_shader( gal smaa_pass_1_vert.glsl glsl_smaa_pass_1_vert )
  84. add_shader( gal smaa_pass_2_frag.glsl glsl_smaa_pass_2_frag )
  85. add_shader( gal smaa_pass_2_vert.glsl glsl_smaa_pass_2_vert )
  86. add_shader( gal smaa_pass_3_frag.glsl glsl_smaa_pass_3_frag )
  87. add_shader( gal smaa_pass_3_vert.glsl glsl_smaa_pass_3_vert )