diff options
Diffstat (limited to 'vcpkg/ports/libaaplus')
| -rw-r--r-- | vcpkg/ports/libaaplus/fix-cmakelists.patch | 85 | ||||
| -rw-r--r-- | vcpkg/ports/libaaplus/portfile.cmake | 37 | ||||
| -rw-r--r-- | vcpkg/ports/libaaplus/vcpkg.json | 22 |
3 files changed, 144 insertions, 0 deletions
diff --git a/vcpkg/ports/libaaplus/fix-cmakelists.patch b/vcpkg/ports/libaaplus/fix-cmakelists.patch new file mode 100644 index 0000000..a57e05b --- /dev/null +++ b/vcpkg/ports/libaaplus/fix-cmakelists.patch @@ -0,0 +1,85 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9bb8ea3..c445c4b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,6 +5,7 @@ cmake_minimum_required(VERSION 3.8) + SET(CMAKE_CXX_STANDARD 17) + SET(CMAKE_CXX_STANDARD_REQUIRED ON) + ++option(BUILD_TOOLS "Build libaaplus tools" OFF) + #----------------------------------------------------------------------------- + # Output directories. + SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH +@@ -261,18 +262,66 @@ SET ( SRCS + #----------------------------------------------------------------------------- + # Executables. + #----------------------------------------------------------------------------- ++if(BUILD_TOOLS) + ADD_EXECUTABLE(AATest ${SRCS} ) +- ++endif() + #----------------------------------------------------------------------------- + # Libraries. ++if(NOT BUILD_SHARED_LIBS) + ADD_LIBRARY(aaplus-static STATIC ${SRCS_LIB} ${INCS}) + SET_TARGET_PROPERTIES(aaplus-static PROPERTIES OUTPUT_NAME "aaplus") +- ++target_include_directories(aaplus-static PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}> $<INSTALL_INTERFACE:include/aaplus>) ++else() + ADD_LIBRARY(aaplus-shared SHARED ${SRCS_LIB} ${INCS}) + SET_TARGET_PROPERTIES(aaplus-shared PROPERTIES OUTPUT_NAME "aaplus") ++target_include_directories(aaplus-shared PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}> $<INSTALL_INTERFACE:include/aaplus>) ++endif() ++ ++if (MSVC AND BUILD_SHARED_LIBS) ++target_compile_definitions(aaplus-shared ++ PRIVATE ++ -DAAPLUS_EXT_CLASS\=__declspec\(dllexport\) ++) ++endif (MSVC AND BUILD_SHARED_LIBS) ++ ++if(BUILD_SHARED_LIBS) ++ install( ++ TARGETS aaplus-shared ++ EXPORT aaplus ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin ++ ) ++else() ++ install( ++ TARGETS aaplus-static ++ EXPORT aaplus ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin ++ ) ++endif() + +-install(TARGETS aaplus-shared aaplus-static +- DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" ) ++if(BUILD_TOOLS) ++ if(BUILD_SHARED_LIBS) ++ TARGET_LINK_LIBRARIES(AATest aaplus-shared) ++ if(MSVC) ++ target_compile_definitions(AATest ++ PUBLIC ++ -DAAPLUS_EXT_CLASS\=__declspec\(dllimport\) ++ ) ++ endif() ++ ++ else() ++ TARGET_LINK_LIBRARIES(AATest aaplus-static) ++ endif() ++endif() + +-TARGET_LINK_LIBRARIES(AATest aaplus-static) ++install( ++ EXPORT aaplus ++ DESTINATION share/aaplus ++ FILE aaplusConfig.cmake ++ NAMESPACE aaplus:: ++) + ++install(FILES ${INCS} DESTINATION include/aaplus) +\ No newline at end of file diff --git a/vcpkg/ports/libaaplus/portfile.cmake b/vcpkg/ports/libaaplus/portfile.cmake new file mode 100644 index 0000000..0d88d1d --- /dev/null +++ b/vcpkg/ports/libaaplus/portfile.cmake @@ -0,0 +1,37 @@ +set(VERSION 2.36)
+
+vcpkg_download_distfile(
+ ARCHIVE_FILE
+ URLS "http://www.naughter.com/download/aaplus_v${VERSION}.zip"
+ FILENAME "aaplus_v${VERSION}.zip"
+ SHA512 a7abf20feb49df00b95be987809a3dc8df3e9ff706dd5a873ecfdd695af125f858264e092b6b856e83685e9eb46fd46520cf09dfae892c32cbb71f925ba17b86
+)
+
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE ${ARCHIVE_FILE}
+ SOURCE_BASE ${VERSION}
+ NO_REMOVE_ONE_LEVEL
+ PATCHES
+ fix-cmakelists.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ tools BUILD_TOOLS
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS ${FEATURE_OPTIONS}
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+vcpkg_cmake_config_fixup(PACKAGE_NAME aaplus CONFIG_PATH share/aaplus)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+file(INSTALL "${SOURCE_PATH}/AA+.htm" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
\ No newline at end of file diff --git a/vcpkg/ports/libaaplus/vcpkg.json b/vcpkg/ports/libaaplus/vcpkg.json new file mode 100644 index 0000000..2282eba --- /dev/null +++ b/vcpkg/ports/libaaplus/vcpkg.json @@ -0,0 +1,22 @@ +{ + "name": "libaaplus", + "version": "2.36", + "port-version": 1, + "description": "libaaplus is an astronomical computations library by naughter software", + "homepage": "http://www.naughter.com/aa.html", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "tools": { + "description": "Build libaaplus tools" + } + } +} |