]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | vcpkg_from_github( |
2 | OUT_SOURCE_PATH SOURCE_PATH | |
3 | REPO nanomsg/nanomsg | |
4 | REF 1.1.5 | |
5 | SHA512 773b8e169a7accac21414c63972423a249164f5b843c6c65c1b03a2eb90d21da788a98debdeb396dab795e52d30605696bc2cf65e5e05687bf115438d5b22717 | |
6 | HEAD_REF master | |
7 | ) | |
8 | ||
9 | string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" NN_STATIC_LIB) | |
10 | ||
11 | if("tool" IN_LIST FEATURES) | |
12 | set(NN_ENABLE_NANOCAT ON) | |
13 | else() | |
14 | set(NN_ENABLE_NANOCAT OFF) | |
15 | endif() | |
16 | ||
17 | vcpkg_configure_cmake( | |
18 | SOURCE_PATH ${SOURCE_PATH} | |
19 | PREFER_NINJA | |
20 | OPTIONS | |
21 | -DCMAKE_DISABLE_FIND_PACKAGE_Git=TRUE | |
22 | -DNN_STATIC_LIB=${NN_STATIC_LIB} | |
23 | -DNN_TESTS=OFF | |
24 | -DNN_TOOLS=OFF | |
25 | -DNN_ENABLE_DOC=OFF | |
26 | -DNN_ENABLE_NANOCAT=${NN_ENABLE_NANOCAT} | |
27 | ) | |
28 | ||
29 | vcpkg_install_cmake() | |
30 | ||
31 | file(STRINGS ${SOURCE_PATH}/.version NN_PACKAGE_VERSION) | |
32 | ||
33 | vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/nanomsg-${NN_PACKAGE_VERSION}) | |
34 | ||
35 | vcpkg_replace_string( | |
36 | ${CURRENT_PACKAGES_DIR}/share/${PORT}/nanomsg-config.cmake | |
37 | "lib/cmake/nanomsg-${NN_PACKAGE_VERSION}" | |
38 | "share/nanomsg" | |
39 | ) | |
40 | ||
41 | if(NN_ENABLE_NANOCAT) | |
42 | vcpkg_copy_tools(TOOL_NAMES nanocat AUTO_CLEAN) | |
43 | endif() | |
44 | ||
45 | file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) | |
46 | ||
47 | if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") | |
48 | vcpkg_replace_string( | |
49 | ${CURRENT_PACKAGES_DIR}/include/nanomsg/nn.h | |
50 | "defined(NN_STATIC_LIB)" | |
51 | "1 // defined(NN_STATIC_LIB)" | |
52 | ) | |
53 | ||
54 | vcpkg_replace_string( | |
55 | ${CURRENT_PACKAGES_DIR}/share/${PORT}/nanomsg-config.cmake | |
56 | "set_and_check(nanomsg_BINDIR \${PACKAGE_PREFIX_DIR}/bin)" | |
57 | "" | |
58 | ) | |
59 | endif() | |
60 | ||
61 | configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) | |
62 | ||
63 | vcpkg_copy_pdbs() |