vcpkg/ports/libmaxminddb/CMakeLists.txt
atkawa7 093900b225 [new port] libmaxminddb init (#4132)
* maxminddb init

* [libmaxminddb] CMake cleanup. Build static lib instead of exporting all symbols on Windows.
2018-08-21 15:57:50 -07:00

35 lines
703 B
CMake

cmake_minimum_required (VERSION 3.9)
project(maxminddb C)
set(CMAKE_DEBUG_POSTFIX d)
set(CMAKE_SHARED_LIBRARY_PREFIX lib)
set(CMAKE_STATIC_LIBRARY_PREFIX lib)
if(MSVC)
add_compile_options(-D_CRT_SECURE_NO_WARNINGS)
endif()
set(SRCS
src/maxminddb.c
src/data-pool.c
)
include_directories(. src include projects/VS12)
add_library(maxminddb ${SRCS})
if(WIN32)
target_link_libraries(maxminddb ws2_32)
endif()
install(
TARGETS maxminddb
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
if(NOT DISABLE_INSTALL_HEADERS)
install(FILES include/maxminddb.h projects/VS12/maxminddb_config.h DESTINATION include/maxminddb)
endif()