Add argtable2 port (#3742)

* Add argtable2 port


argtable2 include pdbs

* [argtable2] Revert removal of DEBUG_POSTFIX
This commit is contained in:
Peter Spiess-Knafl 2018-06-19 07:35:23 +02:00 committed by Robert Schumacher
parent 8e6b372f77
commit 89c736c3e4
3 changed files with 59 additions and 0 deletions

3
ports/argtable2/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: argtable2
Version: 2.13-1
Description: Argtable is an ANSI C library for parsing GNU style command line options with a minimum of fuss.

View File

@ -0,0 +1,24 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3427487..a9b8be0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,5 +1,4 @@
-# for now, install in subdirectory of source directory by default
-SET( CMAKE_INSTALL_PREFIX .. )
+include(GNUInstallDirs)
IF( WIN32 )
ADD_LIBRARY( argtable2 arg_dbl.c arg_end.c arg_file.c arg_int.c arg_lit.c arg_rem.c arg_str.c argtable2.c argtable2.h getopt.c getopt.h getopt1.c )
@@ -7,5 +6,9 @@ ELSE( WIN32 )
ADD_LIBRARY( argtable2 arg_date.c arg_dbl.c arg_end.c arg_file.c arg_int.c arg_lit.c arg_rem.c arg_rex.c arg_str.c argtable2.c argtable2.h getopt.c getopt.h getopt1.c )
ENDIF( WIN32 )
-INSTALL( TARGETS argtable2 ARCHIVE DESTINATION lib)
-SET_TARGET_PROPERTIES( argtable2 PROPERTIES DEBUG_POSTFIX d )
\ No newline at end of file
+INSTALL(TARGETS argtable2
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+)
+INSTALL(FILES argtable2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

View File

@ -0,0 +1,32 @@
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/argtable2-13)
vcpkg_download_distfile(ARCHIVE
URLS "http://prdownloads.sourceforge.net/argtable/argtable2-13.tar.gz"
FILENAME "argtable-2.13.zip"
SHA512 3d8303f3ba529e3241d918c0127a16402ece951efb964d14a06a3a7d29a252812ad3c44e96da28798871e9923e73a2cfe7ebc84139c1397817d632cae25c4585
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-install-dirs.patch"
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
# Due to missing dllexport flags we export all symbols
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE
-DCMAKE_DEBUG_POSTFIX=d
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
# Remove duplicate include installs
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/argtable2 RENAME copyright)