diff options
| author | JackBoosY <yuzaiyang@beyondsoft.com> | 2020-01-13 23:55:59 -0800 |
|---|---|---|
| committer | JackBoosY <yuzaiyang@beyondsoft.com> | 2020-01-13 23:55:59 -0800 |
| commit | 2514481b42ebdeec28649582fc666955cf206c84 (patch) | |
| tree | 60c9809a5c3c8adbad240a40b1088a6f8e42c019 /ports/libaaplus | |
| parent | b751326c91c9a307aaf5e340b61ab9f2d1ad45a4 (diff) | |
| parent | 28eee51adb36f2165be846e77ef7b3ee5b3f8789 (diff) | |
| download | vcpkg-2514481b42ebdeec28649582fc666955cf206c84.tar.gz vcpkg-2514481b42ebdeec28649582fc666955cf206c84.zip | |
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/jack/upgrade_libi
Diffstat (limited to 'ports/libaaplus')
| -rw-r--r-- | ports/libaaplus/CMakeLists.txt | 69 | ||||
| -rw-r--r-- | ports/libaaplus/CONTROL | 7 | ||||
| -rw-r--r-- | ports/libaaplus/portfile.cmake | 36 |
3 files changed, 112 insertions, 0 deletions
diff --git a/ports/libaaplus/CMakeLists.txt b/ports/libaaplus/CMakeLists.txt new file mode 100644 index 000000000..fa8f60f80 --- /dev/null +++ b/ports/libaaplus/CMakeLists.txt @@ -0,0 +1,69 @@ +PROJECT (AstronomicalAlgorithms) + +cmake_minimum_required(VERSION 3.11) +cmake_policy(VERSION 3.11) + +project(libaaplus LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 14) + +option(BUILD_TOOLS "Build libaaplus tools" OFF) + +file(GLOB LIBS_SRC RELATIVE ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/*.cpp) + +list(REMOVE_ITEM ${LIBS_SRC} AATest.cpp) + +file(GLOB PUBLIC_HEADERS RELATIVE ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/*.h) + +set(TEST_SRCS + AATest.cpp +) + +add_library(libaaplus + ${LIBS_SRC} +) + +if (MSVC AND BUILD_SHARED_LIBS) +target_compile_definitions(libaaplus + PRIVATE + -DAAPLUS_EXT_CLASS\=__declspec\(dllexport\) +) +endif (MSVC AND BUILD_SHARED_LIBS) + +install( + TARGETS libaaplus + EXPORT libaaplus + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +# Headers makes relative includes so directory structure must be kept +foreach(HEADER ${PUBLIC_HEADERS}) + get_filename_component(HEADER_DIR ${HEADER} DIRECTORY) + install( + FILES ${HEADER} + DESTINATION include/aaplus/${HEADER_DIR} + ) +endforeach() + + +if (BUILD_TOOLS) + add_executable(aatest AATest.cpp) + target_link_libraries(aatest PRIVATE libaaplus) + if (BUILD_SHARED_LIBS AND MSVC) + target_compile_definitions(aatest + PUBLIC + -DAAPLUS_EXT_CLASS\=__declspec\(dllimport\) + ) + endif (BUILD_SHARED_LIBS AND MSVC) + + install(TARGETS aatest RUNTIME DESTINATION tools/aaplus) +endif() + +install( + EXPORT libaaplus + DESTINATION share/libaaplus + FILE libaaplusConfig.cmake + NAMESPACE libaaplus:: +) diff --git a/ports/libaaplus/CONTROL b/ports/libaaplus/CONTROL new file mode 100644 index 000000000..eb5df3ff0 --- /dev/null +++ b/ports/libaaplus/CONTROL @@ -0,0 +1,7 @@ +Source: libaaplus
+Version: 2.12
+Description: libaaplus is an astronomical computations library by naughter software
+Homepage: http://www.naughter.com/aa.html
+
+Feature: tools
+Description: Build libaaplus tools
\ No newline at end of file diff --git a/ports/libaaplus/portfile.cmake b/ports/libaaplus/portfile.cmake new file mode 100644 index 000000000..d0b862655 --- /dev/null +++ b/ports/libaaplus/portfile.cmake @@ -0,0 +1,36 @@ +set(VERSION 2.12)
+
+vcpkg_download_distfile(
+ ARCHIVE_FILE
+ URLS "http://www.naughter.com/download/aaplus.zip"
+ FILENAME "aaplus.zip"
+ SHA512 ec3a3d1346637fbed3ec5093ded821c6d80950a6432378d9826ed842571d8670cd5d2a1c9ff58a18f308e18669d786f72d24961e26bd8e070ee35674688a39e7
+)
+
+vcpkg_extract_source_archive_ex(
+ OUT_SOURCE_PATH SOURCE_PATH
+ ARCHIVE ${ARCHIVE_FILE}
+ REF ${VERSION}
+ NO_REMOVE_ONE_LEVEL
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ tools BUILD_TOOLS
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS ${FEATURE_OPTIONS}
+)
+
+vcpkg_install_cmake()
+vcpkg_copy_pdbs()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH share/libaaplus)
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+file(INSTALL ${SOURCE_PATH}/AA+.htm DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
