tangentia

CMakeLists - ip2proxy-c-4.3.0.txt

Jun 1st, 2026 (edited)
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 2.17 KB | None | 0 0
  1. # CMakeLists.txt file for IP2PROXY library - 2026-06-01
  2. #
  3. # Licensed to the Apache Software Foundation (ASF) under one or more
  4. # contributor license agreements.  See the NOTICE file distributed with
  5. # this work for additional information regarding copyright ownership.
  6. # The ASF licenses this file to You under the Apache License, Version 2.0
  7. # (the "License"); you may not use this file except in compliance with
  8. # the License.  You may obtain a copy of the License at
  9. #
  10. #     http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. CMAKE_MINIMUM_REQUIRED(VERSION 3.15)
  19.  
  20. PROJECT(ip2proxy C)
  21.  
  22. # Extra libraries.
  23. #
  24. SET(extra_libraries ws2_32.lib)
  25.  
  26. # Miscellaneous options.
  27. #
  28. OPTION(INSTALL_PDB "Install .pdb file (if generated)" OFF)
  29.  
  30. SET(ip2proxy_sources
  31.   libip2proxy/ip2proxy.c
  32. )
  33.  
  34. SET(ip2proxy_headers
  35.   libip2proxy/ip2proxy.h
  36. )
  37.  
  38. SET(ip2proxy_cli_sources
  39.     ip2proxy.c
  40. )
  41.  
  42. INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/include ${CMAKE_SOURCE_DIR}/libip2proxy)
  43.  
  44. ADD_LIBRARY(ip2proxy STATIC ${ip2proxy_sources})
  45.  
  46. ADD_EXECUTABLE(ip2proxy_cli ${ip2proxy_cli_sources})
  47.  
  48. TARGET_LINK_LIBRARIES(ip2proxy ${extra_libraries})
  49.  
  50. TARGET_LINK_LIBRARIES(ip2proxy_cli ip2proxy ${extra_libraries})
  51.  
  52. # Request compiler generated PDB file for ip2proxy library.
  53. #
  54. SET_TARGET_PROPERTIES(ip2proxy PROPERTIES
  55.   COMPILE_PDB_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
  56.   COMPILE_PDB_NAME ip2proxy
  57. )
  58.  
  59. SET_TARGET_PROPERTIES(ip2proxy_cli PROPERTIES OUTPUT_NAME ip2proxy)
  60.  
  61. INSTALL(TARGETS ip2proxy RUNTIME DESTINATION lib)
  62.  
  63. INSTALL(FILES ${ip2proxy_headers} DESTINATION include)
  64.  
  65. INSTALL(TARGETS ip2proxy_cli RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
  66.  
  67. IF(INSTALL_PDB)
  68.   # Install named PDB file for static build.
  69.   #
  70.   INSTALL(FILES ${CMAKE_BINARY_DIR}/ip2proxy.pdb
  71.     DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
  72.     CONFIGURATIONS RelWithDebInfo Debug OPTIONAL)
  73. ENDIF()
  74.  
Tags: cmake
Add Comment
Please, Sign In to add comment