Advertisement
vladislav_larionov

Untitled

Jan 9th, 2024
860
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.69 KB | None | 0 0
  1. # SPDX-FileCopyrightText: 2023 Open Mobile Platform LLC <community@omp.ru>
  2. # SPDX-License-Identifier: BSD-3-Clause
  3.  
  4. cmake_minimum_required (VERSION 3.1)
  5.  
  6. project(HttpServer)
  7. include(GNUInstallDirs)
  8.  
  9. find_package (Qt5 COMPONENTS Core Network Quick REQUIRED)
  10.  
  11. set(SOURCES
  12.     HttpServer/src/httpServer/httpConnection.cpp
  13.     HttpServer/src/httpServer/httpRequest.cpp
  14.     HttpServer/src/httpServer/httpRequestRouter.cpp
  15.     HttpServer/src/httpServer/httpResponse.cpp
  16.     HttpServer/src/httpServer/httpServer.cpp
  17.     HttpServer/src/httpServer/util.cpp
  18. )
  19.  
  20. set(HEADERS
  21.     HttpServer/src/httpServer/httpConnection.h
  22.     HttpServer/src/httpServer/httpCookie.h
  23.     HttpServer/src/httpServer/httpRequest.h
  24.     HttpServer/src/httpServer/httpRequestHandler.h
  25.     HttpServer/src/httpServer/httpRequestRouter.h
  26.     HttpServer/src/httpServer/httpResponse.h
  27.     HttpServer/src/httpServer/httpServer.h
  28.     HttpServer/src/httpServer/httpServerConfig.h
  29.     HttpServer/src/httpServer/util.h
  30. )
  31.  
  32. add_library(${PROJECT_NAME} SHARED ${SOURCES} ${HEADERS})
  33.  
  34. target_include_directories(${PROJECT_NAME}
  35.     PUBLIC
  36.         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/HttpServer/src/httpServer>
  37.         $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
  38. )
  39.  
  40. set_target_properties(${PROJECT_NAME} PROPERTIES VERSION 1)
  41. set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 1)
  42.  
  43. set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADERS}")
  44. add_compile_definitions(HTTPSERVER_LIBRARY)
  45. add_compile_definitions(QT_DEPRECATED_WARNINGS)
  46. target_link_libraries(${PROJECT_NAME}
  47.     Qt5::Quick
  48.     Qt5::Core
  49.     z
  50. )
  51.  
  52. install(TARGETS ${PROJECT_NAME}
  53.     LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  54. )
  55.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement