🛠️🐜 Antkeeper superbuild with dependencies included 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.

87 lines
2.5 KiB

  1. newoption {
  2. trigger = "with-gtk3nfd",
  3. description = "Build with nativefiledialog support. GTK3 required(Linux only)"
  4. }
  5. sources = {
  6. "main.cc",
  7. "exr-io.cc",
  8. "../../deps/miniz/miniz.c"
  9. }
  10. -- premake4.lua
  11. solution "EXRViewSolution"
  12. configurations { "Release", "Debug" }
  13. platforms { "native", "x64", "x32" }
  14. projectRootDir = os.getcwd() .. "/"
  15. dofile ("findOpenGLGlewGlut.lua")
  16. initOpenGL()
  17. initGlew()
  18. -- A project defines one build target
  19. project "exrview"
  20. kind "ConsoleApp"
  21. language "C++"
  22. files { sources }
  23. includedirs { "./", "../../", "../../deps/miniz" }
  24. if os.is("Windows") then
  25. defines { "USE_NATIVEFILEDIALOG" }
  26. files{
  27. "OpenGLWindow/Win32OpenGLWindow.cpp",
  28. "OpenGLWindow/Win32OpenGLWindow.h",
  29. "OpenGLWindow/Win32Window.cpp",
  30. "OpenGLWindow/Win32Window.h",
  31. }
  32. includedirs { "./ThirdPartyLibs/nativefiledialog/src/include/" }
  33. files {
  34. "ThirdPartyLibs/nativefiledialog/src/nfd_common.c",
  35. "ThirdPartyLibs/nativefiledialog/src/nfd_win.cpp"
  36. }
  37. end
  38. if os.is("Linux") then
  39. files {
  40. "OpenGLWindow/X11OpenGLWindow.cpp",
  41. "OpenGLWindow/X11OpenGLWindows.h"
  42. }
  43. links {"X11", "pthread", "dl"}
  44. if _OPTIONS["with-gtk3nfd"] then -- NFD + GTK3
  45. defines { "USE_NATIVEFILEDIALOG" }
  46. includedirs { "./ThirdPartyLibs/nativefiledialog/src/include/" }
  47. buildoptions { "`pkg-config --cflags gtk+-3.0`" }
  48. linkoptions { "`pkg-config --libs gtk+-3.0`" }
  49. files {
  50. "ThirdPartyLibs/nativefiledialog/src/nfd_common.c",
  51. "ThirdPartyLibs/nativefiledialog/src/nfd_gtk.c"
  52. }
  53. end
  54. end
  55. if os.is("MacOSX") then
  56. defines { "USE_NATIVEFILEDIALOG" }
  57. links {"Cocoa.framework"}
  58. files {
  59. "OpenGLWindow/MacOpenGLWindow.h",
  60. "OpenGLWindow/MacOpenGLWindow.mm",
  61. }
  62. includedirs { "./ThirdPartyLibs/nativefiledialog/src/include/" }
  63. files {
  64. "ThirdPartyLibs/nativefiledialog/src/nfd_common.c",
  65. "ThirdPartyLibs/nativefiledialog/src/nfd_cocoa.m"
  66. }
  67. end
  68. configuration "Debug"
  69. defines { "DEBUG" } -- -DDEBUG
  70. flags { "Symbols" }
  71. targetname "exrview_debug"
  72. configuration "Release"
  73. -- defines { "NDEBUG" } -- -NDEBUG
  74. flags { "Symbols", "Optimize" }
  75. targetname "exrview"