aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/cspice/CMakeLists.txt
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/cspice/CMakeLists.txt
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/cspice/CMakeLists.txt')
-rw-r--r--vcpkg/ports/cspice/CMakeLists.txt47
1 files changed, 47 insertions, 0 deletions
diff --git a/vcpkg/ports/cspice/CMakeLists.txt b/vcpkg/ports/cspice/CMakeLists.txt
new file mode 100644
index 0000000..96a2ceb
--- /dev/null
+++ b/vcpkg/ports/cspice/CMakeLists.txt
@@ -0,0 +1,47 @@
+cmake_minimum_required(VERSION 3.10)
+project(cspice LANGUAGES C)
+
+file(GLOB CSPICE_SOURCES "${PROJECT_SOURCE_DIR}/src/cspice/*.c")
+set(INCLUDE_PATH "${PROJECT_SOURCE_DIR}/include")
+
+add_library(cspice ${CSPICE_SOURCES})
+target_include_directories(cspice PUBLIC
+ $<BUILD_INTERFACE:${INCLUDE_PATH}>
+ $<INSTALL_INTERFACE:include>
+)
+
+if (WIN32)
+ # cf. src/cspice/mkprodct.bat
+ target_compile_definitions(cspice PRIVATE "_COMPLEX_DEFINED;MSDOS;OMIT_BLANK_CC;NON_ANSI_STDIO;_CRT_SECURE_NO_WARNINGS")
+ set_target_properties(cspice PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
+ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ target_compile_options(cspice PRIVATE /sdl-)
+ endif()
+elseif (UNIX)
+ target_compile_definitions(cspice PRIVATE "NON_UNIX_STDIO")
+ set_target_properties(cspice PROPERTIES C_STANDARD 90)
+ target_compile_options(cspice PRIVATE -Wno-error=implicit-function-declaration)
+endif ()
+
+set_target_properties(cspice PROPERTIES
+ VERSION "${VERSION}"
+ SOVERSION "${VERSION}"
+)
+
+file(GLOB SPICE_HEADERS ${INCLUDE_PATH}/*.h)
+install(FILES ${SPICE_HEADERS} DESTINATION include/cspice)
+
+install(
+ TARGETS cspice
+ EXPORT cspice
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin
+)
+
+install(
+ EXPORT cspice
+ FILE unofficial-cspice-config.cmake
+ NAMESPACE unofficial::cspice::
+ DESTINATION share/unofficial-cspice
+)