Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # CMakeLists.txt file for IP2PROXY library - 2026-06-01
- #
- # Licensed to the Apache Software Foundation (ASF) under one or more
- # contributor license agreements. See the NOTICE file distributed with
- # this work for additional information regarding copyright ownership.
- # The ASF licenses this file to You under the Apache License, Version 2.0
- # (the "License"); you may not use this file except in compliance with
- # the License. You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- #
- CMAKE_MINIMUM_REQUIRED(VERSION 3.15)
- PROJECT(ip2proxy C)
- # Extra libraries.
- #
- SET(extra_libraries ws2_32.lib)
- # Miscellaneous options.
- #
- OPTION(INSTALL_PDB "Install .pdb file (if generated)" OFF)
- SET(ip2proxy_sources
- libip2proxy/ip2proxy.c
- )
- SET(ip2proxy_headers
- libip2proxy/ip2proxy.h
- )
- SET(ip2proxy_cli_sources
- ip2proxy.c
- )
- INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/include ${CMAKE_SOURCE_DIR}/libip2proxy)
- ADD_LIBRARY(ip2proxy STATIC ${ip2proxy_sources})
- ADD_EXECUTABLE(ip2proxy_cli ${ip2proxy_cli_sources})
- TARGET_LINK_LIBRARIES(ip2proxy ${extra_libraries})
- TARGET_LINK_LIBRARIES(ip2proxy_cli ip2proxy ${extra_libraries})
- # Request compiler generated PDB file for ip2proxy library.
- #
- SET_TARGET_PROPERTIES(ip2proxy PROPERTIES
- COMPILE_PDB_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
- COMPILE_PDB_NAME ip2proxy
- )
- SET_TARGET_PROPERTIES(ip2proxy_cli PROPERTIES OUTPUT_NAME ip2proxy)
- INSTALL(TARGETS ip2proxy RUNTIME DESTINATION lib)
- INSTALL(FILES ${ip2proxy_headers} DESTINATION include)
- INSTALL(TARGETS ip2proxy_cli RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
- IF(INSTALL_PDB)
- # Install named PDB file for static build.
- #
- INSTALL(FILES ${CMAKE_BINARY_DIR}/ip2proxy.pdb
- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
- CONFIGURATIONS RelWithDebInfo Debug OPTIONAL)
- ENDIF()
Add Comment
Please, Sign In to add comment