SgRC.cmake 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #.rst:
  2. # SgRC
  3. # ----
  4. #
  5. # RC file generation.
  6. #
  7. # Generates the RC file.
  8. #
  9. # ::
  10. #
  11. # SG_LIBSAGUI_RC - RC file path.
  12. # _
  13. # ___ __ _ __ _ _ _(_)
  14. # / __|/ _` |/ _` | | | | |
  15. # \__ \ (_| | (_| | |_| | |
  16. # |___/\__,_|\__, |\__,_|_|
  17. # |___/
  18. #
  19. # Cross-platform library which helps to develop web servers or frameworks.
  20. #
  21. # Copyright (C) 2016-2020 Silvio Clecio <[email protected]>
  22. #
  23. # Sagui library is free software; you can redistribute it and/or
  24. # modify it under the terms of the GNU Lesser General Public
  25. # License as published by the Free Software Foundation; either
  26. # version 2.1 of the License, or (at your option) any later version.
  27. #
  28. # Sagui library is distributed in the hope that it will be useful,
  29. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  30. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  31. # Lesser General Public License for more details.
  32. #
  33. # You should have received a copy of the GNU Lesser General Public
  34. # License along with Sagui library; if not, write to the Free Software
  35. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  36. #
  37. if(__SG_RC_INCLUDED)
  38. return()
  39. endif()
  40. set(__SG_RC_INCLUDED ON)
  41. set(SG_LIBSAGUI_RC ${CMAKE_BINARY_DIR}/libsagui.rc)
  42. if(${CMAKE_BUILD_TYPE} MATCHES "[Dd]ebug|DEBUG")
  43. set(FILEFLAGS VS_FF_DEBUG)
  44. else()
  45. set(FILEFLAGS 0)
  46. endif()
  47. set(RC_FILE_DESC "Sagui library for")
  48. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  49. set(RC_FILE_DESC "${RC_FILE_DESC} Win64")
  50. else()
  51. set(RC_FILE_DESC "${RC_FILE_DESC} Win32")
  52. endif()
  53. unset(RC_FILE_DESC_MODS)
  54. if(SG_HTTPS_SUPPORT)
  55. list(APPEND RC_FILE_DESC_MODS "TLS")
  56. endif()
  57. if(SG_HTTP_COMPRESSION)
  58. list(APPEND RC_FILE_DESC_MODS "ZLIB")
  59. endif()
  60. if(SG_PATH_ROUTING)
  61. list(APPEND RC_FILE_DESC_MODS "PCRE2")
  62. endif()
  63. if(SG_MATH_EXPR_EVAL)
  64. list(APPEND RC_FILE_DESC_MODS "EXPR")
  65. endif()
  66. if(RC_FILE_DESC_MODS)
  67. string(REPLACE ";" "," RC_FILE_DESC_MODS "${RC_FILE_DESC_MODS}")
  68. set(RC_FILE_DESC "${RC_FILE_DESC} (${RC_FILE_DESC_MODS})")
  69. endif()
  70. configure_file(${CMAKE_MODULE_PATH}/libsagui.rc.cmake.in
  71. ${CMAKE_BINARY_DIR}/libsagui.rc @ONLY)
  72. unset(FILEFLAGS)
  73. unset(RC_FILE_DESC)
  74. unset(RC_FILE_DESC_MODS)