CMakeLists.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #
  2. # Copyright (c) 2008-2017 the Urho3D project.
  3. #
  4. # Permission is hereby granted, free of charge, to any person obtaining a copy
  5. # of this software and associated documentation files (the "Software"), to deal
  6. # in the Software without restriction, including without limitation the rights
  7. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. # copies of the Software, and to permit persons to whom the Software is
  9. # furnished to do so, subject to the following conditions:
  10. #
  11. # The above copyright notice and this permission notice shall be included in
  12. # all copies or substantial portions of the Software.
  13. #
  14. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. # THE SOFTWARE.
  21. #
  22. # Define target name
  23. set (TARGET_NAME Civetweb)
  24. # Define preprocessor macros
  25. # Always disable Common Gateway Interface
  26. add_definitions (-DNO_CGI)
  27. if (WIN32)
  28. include (CheckStructHasMember)
  29. check_struct_has_member (struct\ timespec tv_sec time.h HAVE_STRUCT_TIMESPEC_TV_SEC)
  30. if (HAVE_STRUCT_TIMESPEC_TV_SEC)
  31. include (CheckSymbolExists)
  32. check_symbol_exists (_TIMESPEC_DEFINED time.h HAVE__TIMESPEC_DEFINED)
  33. if (NOT HAVE__TIMESPEC_DEFINED)
  34. add_definitions (-D_TIMESPEC_DEFINED)
  35. endif ()
  36. endif ()
  37. # ATOMIC BEGIN
  38. set(LIBS ws2_32.lib)
  39. # ATOMIC END
  40. elseif (APPLE AND (NOT IOS OR IPHONEOS_DEPLOYMENT_TARGET STREQUAL "" OR NOT IPHONEOS_DEPLOYMENT_TARGET VERSION_LESS 10.0)) # We cheat a little bit here with a hard-coded check because iOS 10.3 SDK when targeting 9.3 has strong symbol for iPhoneOS archs but weak symbol for iPhoneSimulator archs
  41. include (CheckLibraryExists)
  42. check_library_exists (c clock_gettime "" FOUND_CLOCK_GETTIME_IN_C)
  43. if (FOUND_CLOCK_GETTIME_IN_C)
  44. add_definitions (-DHAVE_CLOCK_GETTIME)
  45. endif ()
  46. endif ()
  47. # Define source files
  48. define_source_files (GLOB_CPP_PATTERNS src/*.c GLOB_H_PATTERNS include/*.h)
  49. # Define include directory
  50. set (INCLUDE_DIRS include)
  51. # Setup target
  52. setup_library ()