aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Tassoux <contact@rt2.fr>2020-07-07 23:13:05 +0200
committerGitHub <noreply@github.com>2020-07-07 14:13:05 -0700
commit4425bf354824536bcd9d53c7f41195698dabbf31 (patch)
tree7cba3c1691d5672b35929e4be4349e03f7219279
parent9606917c81792c52097847fa8037907d92b161a2 (diff)
downloadvcpkg-4425bf354824536bcd9d53c7f41195698dabbf31.tar.gz
vcpkg-4425bf354824536bcd9d53c7f41195698dabbf31.zip
[implot] Add new port (#11920)
* [implot] Initial port Requires https://github.com/microsoft/vcpkg/pull/11919 * [implot] Use find_package instead of find_path function * [implot] Update to 0.3 version * Update CONTROL * [implot] Add linkage check * Update CMakeLists.txt * Revert 962e30a662166c124b97014c2f45eff74f072eb1 * [implot] Fix INSTALL_INTERFACE path case and use find_package Config mode Co-authored-by: Lily <47812810+LilyWangL@users.noreply.github.com>
-rw-r--r--ports/implot/CMakeLists.txt49
-rw-r--r--ports/implot/CONTROL5
-rw-r--r--ports/implot/portfile.cmake25
3 files changed, 79 insertions, 0 deletions
diff --git a/ports/implot/CMakeLists.txt b/ports/implot/CMakeLists.txt
new file mode 100644
index 000000000..0033221ca
--- /dev/null
+++ b/ports/implot/CMakeLists.txt
@@ -0,0 +1,49 @@
+cmake_minimum_required(VERSION 3.8)
+project(implot CXX)
+
+find_package(imgui CONFIG REQUIRED)
+get_target_property(IMGUI_INCLUDE_DIRS imgui::imgui
+ INTERFACE_INCLUDE_DIRECTORIES
+)
+
+set(CMAKE_DEBUG_POSTFIX d)
+
+add_library(${PROJECT_NAME} "")
+add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
+target_include_directories(
+ ${PROJECT_NAME}
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:include>
+ PRIVATE
+ ${IMGUI_INCLUDE_DIRS}
+)
+
+target_sources(
+ ${PROJECT_NAME}
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/implot.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/implot_demo.cpp
+)
+
+install(
+ TARGETS ${PROJECT_NAME}
+ EXPORT ${PROJECT_NAME}_target
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin
+)
+
+if(NOT IMPLOT_SKIP_HEADERS)
+ install(FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/implot.h
+ DESTINATION include
+ )
+endif()
+
+install(
+ EXPORT ${PROJECT_NAME}_target
+ NAMESPACE ${PROJECT_NAME}::
+ FILE ${PROJECT_NAME}-config.cmake
+ DESTINATION share/${PROJECT_NAME}
+)
diff --git a/ports/implot/CONTROL b/ports/implot/CONTROL
new file mode 100644
index 000000000..f887c4579
--- /dev/null
+++ b/ports/implot/CONTROL
@@ -0,0 +1,5 @@
+Source: implot
+Version: 0.3-1
+Homepage: https://github.com/epezent/implot
+Description: Advanced 2D Plotting for Dear ImGui
+Build-Depends: imgui
diff --git a/ports/implot/portfile.cmake b/ports/implot/portfile.cmake
new file mode 100644
index 000000000..d9b59d430
--- /dev/null
+++ b/ports/implot/portfile.cmake
@@ -0,0 +1,25 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO epezent/implot
+ REF v0.3
+ SHA512 28d25a76b725879ad796249edc87910fec721fcd43b80171947e00c4983a945f82f2b555f1794882b79c96a4497da982dc45695fed5eedcf6009f87c05576817
+ HEAD_REF master
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS_DEBUG
+ -DIMPLOT_SKIP_HEADERS=ON
+)
+
+vcpkg_install_cmake()
+
+vcpkg_copy_pdbs()
+vcpkg_fixup_cmake_targets()
+
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file