aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>2019-07-15 16:33:11 -0700
committerVictor Romero <romerosanchezv@gmail.com>2019-07-15 16:33:11 -0700
commit583abdf87ae50365d617e10ded348231b2af5011 (patch)
tree9e0be15abfc3d82fd8b57b36c1f5ebb1e1fc7089
parent0c8139dbe8ef08ddf38c7f38e094c3cbc4c8bce9 (diff)
downloadvcpkg-583abdf87ae50365d617e10ded348231b2af5011.tar.gz
vcpkg-583abdf87ae50365d617e10ded348231b2af5011.zip
[wintoast] Add new port. (#7006)
* [wintoast] Add new port. * Add CMakeLists.txt. * Change the way to install headers.
-rw-r--r--ports/wintoast/CMakeLists.txt25
-rw-r--r--ports/wintoast/CONTROL3
-rw-r--r--ports/wintoast/portfile.cmake32
3 files changed, 60 insertions, 0 deletions
diff --git a/ports/wintoast/CMakeLists.txt b/ports/wintoast/CMakeLists.txt
new file mode 100644
index 000000000..eb70fb9cf
--- /dev/null
+++ b/ports/wintoast/CMakeLists.txt
@@ -0,0 +1,25 @@
+cmake_minimum_required(VERSION 3.11)
+project(wintoast)
+
+set(SRC_FILES
+src/wintoastlib.cpp
+)
+
+add_library(wintoast ${SRC_FILES})
+
+target_include_directories(wintoast PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
+ $<INSTALL_INTERFACE:include/wintoast>
+)
+
+# Install targets
+install(TARGETS wintoast
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
+
+# Install headers
+if (INSTALL_HEADERS)
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/wintoastlib.h DESTINATION include/wintoast)
+endif() \ No newline at end of file
diff --git a/ports/wintoast/CONTROL b/ports/wintoast/CONTROL
new file mode 100644
index 000000000..d9d410796
--- /dev/null
+++ b/ports/wintoast/CONTROL
@@ -0,0 +1,3 @@
+Source: wintoast
+Version: 1.2.0
+Description: WinToast is a lightly library written in C++ which brings a complete integration of the modern toast notifications of Windows 8 & Windows 10. \ No newline at end of file
diff --git a/ports/wintoast/portfile.cmake b/ports/wintoast/portfile.cmake
new file mode 100644
index 000000000..c7f2f8952
--- /dev/null
+++ b/ports/wintoast/portfile.cmake
@@ -0,0 +1,32 @@
+if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ message(FATAL_ERROR "${PORT} does not currently support UWP")
+endif()
+
+include(vcpkg_common_functions)
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO mohabouje/WinToast
+ REF v1.2.0
+ SHA512 d8bd44439100772929eb8a4eb4aebfd66fa54562c838eb4c081a382dc1d73c545faa6d9675e320864d9b533e4a0c4a673e44058c7f643ccd56ec90830cdfaf45
+ HEAD_REF master
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS_RELEASE -DINSTALL_HEADERS=ON
+ OPTIONS_DEBUG -DINSTALL_HEADERS=OFF
+
+)
+
+vcpkg_install_cmake()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# Install license
+file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)