wxWidgets.cmake 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. set(_wx_toolkit "")
  2. if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
  3. option(DEP_WX_GTK3 "Build wxWidgets for GTK3 instead of GTK2" OFF)
  4. set(_gtk_ver 2)
  5. if (DEP_WX_GTK3)
  6. set(_gtk_ver 3)
  7. endif ()
  8. set(_wx_toolkit "-DwxBUILD_TOOLKIT=gtk${_gtk_ver}")
  9. endif()
  10. set(_unicode_utf8 OFF)
  11. if (UNIX AND NOT APPLE) # wxWidgets will not use char as the underlying type for wxString unless its forced to.
  12. set (_unicode_utf8 ON)
  13. endif()
  14. if (MSVC)
  15. set(_wx_webview "-DwxUSE_WEBVIEW_EDGE=ON")
  16. else ()
  17. set(_wx_webview "-DwxUSE_WEBVIEW=ON")
  18. endif ()
  19. if (UNIX AND NOT APPLE)
  20. set(_wx_secretstore "-DwxUSE_SECRETSTORE=OFF")
  21. else ()
  22. set(_wx_secretstore "-DwxUSE_SECRETSTORE=ON")
  23. endif ()
  24. add_cmake_project(wxWidgets
  25. URL https://github.com/prusa3d/wxWidgets/archive/323a465e577e03f330e2e6a4c78e564d125340cb.zip
  26. URL_HASH SHA256=B538E4AD3CC93117932F4DED70C476D6650F9C70A9D4055A08F3693864C47465
  27. CMAKE_ARGS
  28. "-DCMAKE_DEBUG_POSTFIX:STRING="
  29. -DwxBUILD_PRECOMP=ON
  30. ${_wx_toolkit}
  31. -DwxUSE_MEDIACTRL=OFF
  32. -DwxUSE_DETECT_SM=OFF
  33. -DwxUSE_UNICODE=ON
  34. -DwxUSE_UNICODE_UTF8=${_unicode_utf8}
  35. -DwxUSE_OPENGL=ON
  36. -DwxUSE_LIBPNG=sys
  37. -DwxUSE_ZLIB=sys
  38. -DwxUSE_NANOSVG=sys
  39. -DwxUSE_NANOSVG_EXTERNAL=ON
  40. -DwxUSE_REGEX=OFF
  41. -DwxUSE_LIBXPM=builtin
  42. -DwxUSE_LIBJPEG=sys
  43. -DwxUSE_LIBTIFF=OFF
  44. -DwxUSE_EXPAT=sys
  45. -DwxUSE_LIBSDL=OFF
  46. -DwxUSE_XTEST=OFF
  47. -DwxUSE_GLCANVAS_EGL=OFF
  48. -DwxUSE_WEBREQUEST=OFF
  49. ${_wx_webview}
  50. ${_wx_secretstore}
  51. )
  52. set(DEP_wxWidgets_DEPENDS ZLIB PNG EXPAT JPEG NanoSVG)
  53. if (MSVC)
  54. # After the build, copy the WebView2Loader.dll into the installation directory.
  55. # This should probably be done better.
  56. add_custom_command(TARGET dep_wxWidgets POST_BUILD
  57. COMMAND ${CMAKE_COMMAND} -E copy
  58. "${CMAKE_CURRENT_BINARY_DIR}/builds/wxWidgets/lib/vc_x64_lib/WebView2Loader.dll"
  59. "${${PROJECT_NAME}_DEP_INSTALL_PREFIX}/bin/WebView2Loader.dll")
  60. endif()