From ebda0b9fc2533cf1d44c57840d595dfe90de2359 Mon Sep 17 00:00:00 2001 From: Thomas Krause Date: Mon, 27 Jan 2020 23:19:27 +0100 Subject: [sfsexp] Add new port (#9420) * Add sfsexp, S-expressions library * Use CMakeLists.txt directly instead of patching it * Use sub-folder for sfsexp header files * Manually set the header files and make sure the resulting include/ folder is the same as with the autotools installation * Add runtime parameter for the DLL * Export all symbols in the DLLAA * Use PUBLIC_HEADER property install of install(FILES...) * Remove boilerplate comments from portfile * Only create static library on windows * Throw error on UWP * Disable some windows UWP warnings * Use VCPKG_TARGET_IS_WINDOWS and put it on top of file * Deleted extra blank lines * Missed one blank line * Use ${PORT} variable instead of the specific "sfsexp" string. This should make it easier to change the name of the port later on. * Use vcpkg_from_github to fetch the release. * Remove extra empty lines --- ports/sfsexp/CMakeLists.txt | 20 ++++++++++++++++++++ ports/sfsexp/CONTROL | 4 ++++ ports/sfsexp/portfile.cmake | 23 +++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 ports/sfsexp/CMakeLists.txt create mode 100644 ports/sfsexp/CONTROL create mode 100644 ports/sfsexp/portfile.cmake diff --git a/ports/sfsexp/CMakeLists.txt b/ports/sfsexp/CMakeLists.txt new file mode 100644 index 000000000..e770b9d6d --- /dev/null +++ b/ports/sfsexp/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.13) +project(sexp) + +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS) +endif() + +file(GLOB sources src/*.c src/*.h) +include_directories(src/) + +add_library(sexp ${sources}) + +set_target_properties(sexp PROPERTIES PUBLIC_HEADER "src/cstring.h;src/faststack.h;src/sexp.h;src/sexp_errors.h;src/sexp_memory.h;src/sexp_ops.h;src/sexp_vis.h") + +install(TARGETS sexp + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + PUBLIC_HEADER DESTINATION include +) \ No newline at end of file diff --git a/ports/sfsexp/CONTROL b/ports/sfsexp/CONTROL new file mode 100644 index 000000000..bb6d25a6a --- /dev/null +++ b/ports/sfsexp/CONTROL @@ -0,0 +1,4 @@ +Source: sfsexp +Version: 1.3 +Homepage: https://github.com/mjsottile/sfsexp +Description: Small Fast S-Expression Library diff --git a/ports/sfsexp/portfile.cmake b/ports/sfsexp/portfile.cmake new file mode 100644 index 000000000..6bc6f2c9d --- /dev/null +++ b/ports/sfsexp/portfile.cmake @@ -0,0 +1,23 @@ +if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO mjsottile/sfsexp + REF ad589f9e6e0eca20345320e9c82a3aecc0a5c8aa #v1.3 + SHA512 cdd469e23de48a5d6cd633b7b97b394cbfcba330ac2c3ae549811d856f2eec0c8558f99313e56a9f1cc9d72d4f17077584b6cf15c87814b91fe44ddd76895a8c + HEAD_REF master +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) \ No newline at end of file -- cgit v1.2.3