Created
January 16, 2019 19:52
-
-
Save geraldcombs/5cfb0f10758cadb582987faec9d4fd56 to your computer and use it in GitHub Desktop.
CMakeLists.txt for libmaxminddb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from https://github.com/Microsoft/vcpkg/blob/master/ports/libmaxminddb/CMakeLists.txt | |
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) | |
include_directories(vcpkg-getopt/installed/x64-windows/include) | |
link_directories(vcpkg-getopt/installed/x64-windows/lib) | |
endif() | |
add_executable(mmdblookup bin/mmdblookup.c) | |
target_link_libraries(mmdblookup maxminddb) | |
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment