2017-07-31 02:09:07 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO RainerKuemmerle/g2o
|
2020-02-12 08:32:28 +08:00
|
|
|
REF fcba4eaca6f20d9a5792404cc8ef303aeb8ba5d2
|
|
|
|
SHA512 41e5a6d40db10d66182653d56f937f29264bf4f9412dfa651be949caeb055741c9d9ba75a122180892aafe7d45b334d50470284121148c0561e1d49f6ba5e20a
|
2017-07-31 02:09:07 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
2018-02-28 01:01:24 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_LGPL_SHARED_LIBS)
|
|
|
|
|
2017-07-31 02:09:07 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-08-02 09:00:52 +08:00
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
2018-02-28 01:01:24 +08:00
|
|
|
-DBUILD_LGPL_SHARED_LIBS=${BUILD_LGPL_SHARED_LIBS}
|
2017-08-02 09:00:52 +08:00
|
|
|
-DG2O_BUILD_EXAMPLES=OFF
|
|
|
|
-DG2O_BUILD_APPS=OFF
|
2017-07-31 02:09:07 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2020-02-12 08:32:28 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/g2o)
|
2019-04-09 14:24:31 +08:00
|
|
|
|
2017-07-31 07:18:22 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
2017-08-02 09:00:52 +08:00
|
|
|
file(GLOB_RECURSE HEADERS "${CURRENT_PACKAGES_DIR}/include/*")
|
|
|
|
foreach(HEADER ${HEADERS})
|
|
|
|
file(READ ${HEADER} HEADER_CONTENTS)
|
2017-07-31 07:18:22 +08:00
|
|
|
string(REPLACE "#ifdef G2O_SHARED_LIBS" "#if 1" HEADER_CONTENTS "${HEADER_CONTENTS}")
|
2017-08-02 09:00:52 +08:00
|
|
|
file(WRITE ${HEADER} "${HEADER_CONTENTS}")
|
2017-07-31 07:18:22 +08:00
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
2017-07-31 02:09:07 +08:00
|
|
|
file(GLOB EXE ${CURRENT_PACKAGES_DIR}/bin/*.exe)
|
|
|
|
file(GLOB DEBUG_EXE ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
|
2017-08-02 09:00:52 +08:00
|
|
|
if(EXE OR DEBUG_EXE)
|
|
|
|
file(REMOVE ${EXE} ${DEBUG_EXE})
|
|
|
|
endif()
|
2017-07-31 02:09:07 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
|
|
|
|
2020-02-12 08:32:28 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/doc/license-bsd.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|