]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/libpopt/CMakeLists.txt
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / libpopt / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.0)
2 project(popt VERSION 1.16 LANGUAGES C)
3
4 set(PACKAGE "popt")
5 set(POPT_SYSCONFDIR "C:\\\\")
6 set(CMAKE_DEBUG_POSTFIX "d")
7
8 file(GLOB SOURCES "popt.c"
9 "poptconfig.c"
10 "popthelp.c"
11 "poptint.c"
12 "poptparse.c"
13 "popt.def"
14 )
15
16 option(POPT_USE_CONFIG "Use configuration file" OFF)
17
18 if(POPT_USE_CONFIG)
19 include(CheckIncludeFile)
20 include(CheckFunctionExists)
21
22 check_include_file(float.h HAVE_FLOAT_H)
23 check_include_file(fnmatch.h HAVE_FNMATCH_H)
24 check_include_file(glob.h HAVE_GLOB_H)
25 check_include_file(langinfo.h HAVE_LANGINFO_H)
26 check_include_file(libintl.h HAVE_LIBINTL_H)
27 check_include_file(mcheck.h HAVE_MCHECK_H)
28 check_include_file(unistd.h HAVE_UNISTD_H)
29
30
31 check_function_exists(gettext HAVE_GETTEXT)
32 check_function_exists(iconv HAVE_ICONV)
33 check_function_exists(mtrace HAVE_MTRACE)
34 check_function_exists(srandom HAVE_SRANDOM)
35 check_function_exists(stpcpy HAVE_STPCPY)
36 check_function_exists(strerror HAVE_STRERROR)
37 check_function_exists(vasprintf HAVE_VASPRINTF)
38 check_function_exists(__secure_getenv HAVE___SECURE_GETENV)
39
40 configure_file(config.h.cmake config.h @ONLY)
41 add_definitions(-DHAVE_CONFIG_H)
42 endif()
43
44 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
45
46 include_directories(${CMAKE_BINARY_DIR})
47
48 add_library(popt ${SOURCES})
49 if (MSVC)
50 target_compile_options(popt PRIVATE /wd4996)
51 endif()
52
53 install(TARGETS popt
54 RUNTIME DESTINATION bin
55 LIBRARY DESTINATION lib
56 ARCHIVE DESTINATION lib
57 )
58
59 install(FILES "popt.h" DESTINATION "include")