aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/x-plane
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/x-plane
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/x-plane')
-rw-r--r--vcpkg/ports/x-plane/CMakeLists.txt99
-rw-r--r--vcpkg/ports/x-plane/portfile.cmake37
-rw-r--r--vcpkg/ports/x-plane/unofficial-x-plane-config.cmake.in62
-rw-r--r--vcpkg/ports/x-plane/usage4
-rw-r--r--vcpkg/ports/x-plane/vcpkg.json19
5 files changed, 221 insertions, 0 deletions
diff --git a/vcpkg/ports/x-plane/CMakeLists.txt b/vcpkg/ports/x-plane/CMakeLists.txt
new file mode 100644
index 0000000..a04fbbc
--- /dev/null
+++ b/vcpkg/ports/x-plane/CMakeLists.txt
@@ -0,0 +1,99 @@
+cmake_minimum_required(VERSION 3.21)
+project(x-plane LANGUAGES C CXX)
+
+if(WIN32 OR APPLE)
+ add_library(unofficial::x-plane::xplm SHARED IMPORTED)
+ if(WIN32)
+ set_target_properties(
+ unofficial::x-plane::xplm
+ PROPERTIES IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/Libraries/Win/XPLM_64.lib")
+ set_target_properties(
+ unofficial::x-plane::xplm PROPERTIES INTERFACE_COMPILE_DEFINITIONS
+ "-DIBM=1;-DAPL=0;-DLIN=0")
+ else()
+ set_target_properties(
+ unofficial::x-plane::xplm
+ PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/Libraries/Mac/XPLM.framework/XPLM")
+ set_target_properties(
+ unofficial::x-plane::xplm PROPERTIES INTERFACE_COMPILE_DEFINITIONS
+ "-DIBM=0;-DAPL=1;-DLIN=0")
+ endif()
+else()
+ add_library(unofficial::x-plane::xplm INTERFACE IMPORTED)
+ set_target_properties(
+ unofficial::x-plane::xplm PROPERTIES INTERFACE_COMPILE_DEFINITIONS
+ "-DIBM=0;-DAPL=0;-DLIN=1")
+endif()
+set_target_properties(
+ unofficial::x-plane::xplm PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
+ "${CMAKE_CURRENT_SOURCE_DIR}/CHeaders/XPLM")
+
+if(WIN32 OR APPLE)
+ add_library(unofficial::x-plane::xpwidgets SHARED IMPORTED)
+ if(WIN32)
+ set_target_properties(
+ unofficial::x-plane::xpwidgets
+ PROPERTIES IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/Libraries/Win/XPWidgets_64.lib")
+ else()
+ set_target_properties(
+ unofficial::x-plane::xpwidgets
+ PROPERTIES IMPORTED_LOCATION
+ "${CMAKE_CURRENT_SOURCE_DIR}/Libraries/Mac/XPWidgets.framework/XPWidgets")
+ endif()
+else()
+ add_library(unofficial::x-plane::xpwidgets INTERFACE IMPORTED)
+endif()
+set_target_properties(
+ unofficial::x-plane::xpwidgets PROPERTIES INTERFACE_LINK_LIBRARIES
+ "unofficial::x-plane::xplm")
+set_target_properties(
+ unofficial::x-plane::xpwidgets
+ PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/CHeaders/Widgets")
+
+add_library(xplm_cpp STATIC)
+
+target_sources(
+ xplm_cpp
+ PRIVATE CHeaders/Wrappers/XPCBroadcaster.cpp
+ CHeaders/Wrappers/XPCDisplay.cpp
+ CHeaders/Wrappers/XPCListener.cpp
+ CHeaders/Wrappers/XPCProcessing.cpp
+ CHeaders/Wrappers/XPCWidget.cpp
+ CHeaders/Wrappers/XPCWidgetAttachments.cpp)
+
+target_include_directories(
+ xplm_cpp
+ INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/CHeaders/Wrappers>
+ $<INSTALL_INTERFACE:include>)
+
+target_link_libraries(xplm_cpp PUBLIC unofficial::x-plane::xplm
+ unofficial::x-plane::xpwidgets)
+
+install(
+ TARGETS xplm_cpp
+ EXPORT xplm-targets
+ ARCHIVE DESTINATION lib)
+
+file(GLOB HEADERS "${CMAKE_CURRENT_LIST_DIR}/CHeaders/XPLM/*.h")
+install(FILES ${HEADERS} DESTINATION "include")
+
+file(GLOB HEADERS "${CMAKE_CURRENT_LIST_DIR}/CHeaders/Widgets/*.h")
+install(FILES ${HEADERS} DESTINATION "include")
+
+file(GLOB HEADERS "${CMAKE_CURRENT_LIST_DIR}/CHeaders/Wrappers/*.h")
+install(FILES ${HEADERS} DESTINATION "include")
+
+include(CMakePackageConfigHelpers)
+configure_package_config_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/unofficial-x-plane-config.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/unofficial-x-plane-config.cmake"
+ INSTALL_DESTINATION "share/unofficial-x-plane")
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-x-plane-config.cmake"
+ DESTINATION "share/unofficial-x-plane")
+
+install(
+ EXPORT xplm-targets
+ DESTINATION share/unofficial-x-plane
+ FILE unofficial-x-plane-targets.cmake
+ NAMESPACE unofficial::x-plane::)
diff --git a/vcpkg/ports/x-plane/portfile.cmake b/vcpkg/ports/x-plane/portfile.cmake
new file mode 100644
index 0000000..974bc51
--- /dev/null
+++ b/vcpkg/ports/x-plane/portfile.cmake
@@ -0,0 +1,37 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+string(REPLACE "." "" XPSDK_VERSION "${VERSION}")
+vcpkg_download_distfile(
+ XPLANE_SDK_ZIP
+ URLS "https://developer.x-plane.com/wp-content/plugins/code-sample-generation/sdk_zip_files/XPSDK${XPSDK_VERSION}.zip"
+ FILENAME "XPSDK${XPSDK_VERSION}.zip"
+ SHA512 3ad66ce34b9e1e6dfba0c4547f3976b4a9862bdea0c498f43f3eedfb164d4e1b357e631b72b572b7646bffaa4ffe38698000a63dea1ae8f4c50c4037b8b6471a
+)
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE "${XPLANE_SDK_ZIP}"
+)
+
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/unofficial-x-plane-config.cmake.in" DESTINATION "${SOURCE_PATH}")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-x-plane)
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ file(COPY "${SOURCE_PATH}/Libraries/Win/XPLM_64.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
+ file(COPY "${SOURCE_PATH}/Libraries/Win/XPLM_64.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
+ file(COPY "${SOURCE_PATH}/Libraries/Win/XPWidgets_64.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
+ file(COPY "${SOURCE_PATH}/Libraries/Win/XPWidgets_64.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
+endif()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license.txt")
+
+configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
diff --git a/vcpkg/ports/x-plane/unofficial-x-plane-config.cmake.in b/vcpkg/ports/x-plane/unofficial-x-plane-config.cmake.in
new file mode 100644
index 0000000..f4b7e77
--- /dev/null
+++ b/vcpkg/ports/x-plane/unofficial-x-plane-config.cmake.in
@@ -0,0 +1,62 @@
+@PACKAGE_INIT@
+
+get_filename_component(ROOT "${CMAKE_CURRENT_LIST_DIR}" PATH)
+get_filename_component(ROOT "${ROOT}" PATH)
+
+if(NOT TARGET unofficial::x-plane::xplm)
+ if(WIN32 OR APPLE)
+ add_library(unofficial::x-plane::xplm SHARED IMPORTED)
+ if(WIN32)
+ set_target_properties(
+ unofficial::x-plane::xplm
+ PROPERTIES IMPORTED_IMPLIB "${ROOT}/lib/x-plane/XPLM_64.lib")
+ set_target_properties(
+ unofficial::x-plane::xplm PROPERTIES INTERFACE_COMPILE_DEFINITIONS
+ "-DIBM=1;-DAPL=0;-DLIN=0")
+ else()
+ set_target_properties(
+ unofficial::x-plane::xplm
+ PROPERTIES IMPORTED_LOCATION "${ROOT}/lib/x-plane/XPLM.framework/XPLM")
+ set_target_properties(
+ unofficial::x-plane::xplm PROPERTIES INTERFACE_COMPILE_DEFINITIONS
+ "-DIBM=0;-DAPL=1;-DLIN=0")
+ endif()
+ else()
+ add_library(unofficial::x-plane::xplm INTERFACE IMPORTED)
+ set_target_properties(
+ unofficial::x-plane::xplm PROPERTIES INTERFACE_COMPILE_DEFINITIONS
+ "-DIBM=0;-DAPL=0;-DLIN=1")
+ endif()
+ set_target_properties(
+ unofficial::x-plane::xplm PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
+ "${ROOT}/include")
+endif()
+
+if(NOT TARGET unofficial::x-plane::xpwidgets)
+ if(WIN32 OR APPLE)
+ add_library(unofficial::x-plane::xpwidgets SHARED IMPORTED)
+ if(WIN32)
+ set_target_properties(
+ unofficial::x-plane::xpwidgets
+ PROPERTIES IMPORTED_IMPLIB "${ROOT}/lib/x-plane/XPWidgets_64.lib")
+ else()
+ set_target_properties(
+ unofficial::x-plane::xpwidgets
+ PROPERTIES IMPORTED_LOCATION
+ "${ROOT}/lib/x-plane/XPWidgets.framework/XPWidgets")
+ endif()
+ else()
+ add_library(unofficial::x-plane::xpwidgets INTERFACE IMPORTED)
+ endif()
+ set_target_properties(
+ unofficial::x-plane::xpwidgets PROPERTIES INTERFACE_LINK_LIBRARIES
+ "unofficial::x-plane::xplm")
+ set_target_properties(
+ unofficial::x-plane::xpwidgets
+ PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
+ "${ROOT}/include")
+endif()
+
+include("${CMAKE_CURRENT_LIST_DIR}/unofficial-x-plane-targets.cmake")
+
+check_required_components(unofficial-x-plane)
diff --git a/vcpkg/ports/x-plane/usage b/vcpkg/ports/x-plane/usage
new file mode 100644
index 0000000..de07716
--- /dev/null
+++ b/vcpkg/ports/x-plane/usage
@@ -0,0 +1,4 @@
+x-plane provides CMake targets:
+
+ find_package(unofficial-x-plane CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE unofficial::x-plane::xplm unofficial::x-plane::xpwidgets unofficial::x-plane::xplm_cpp)
diff --git a/vcpkg/ports/x-plane/vcpkg.json b/vcpkg/ports/x-plane/vcpkg.json
new file mode 100644
index 0000000..6fb073d
--- /dev/null
+++ b/vcpkg/ports/x-plane/vcpkg.json
@@ -0,0 +1,19 @@
+{
+ "name": "x-plane",
+ "version": "4.1.1",
+ "port-version": 1,
+ "description": "The X-Plane Plugin SDK",
+ "homepage": "https://developer.x-plane.com/sdk/",
+ "license": null,
+ "supports": "(windows & !uwp & x64) | (osx & (x64 | arm64)) | (linux & x64)",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}