aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2020-01-07 05:18:22 +0800
committerdan-shaw <51385773+dan-shaw@users.noreply.github.com>2020-01-06 13:18:22 -0800
commit0c481e12f150ef8dd57f3fd8fae4b19a52f46d43 (patch)
tree04b0e7ed9832ae8562a52816d4b8741b57e33f1b
parentef3a7fb29c4f1333915623737f4b021a53df08ce (diff)
downloadvcpkg-0c481e12f150ef8dd57f3fd8fae4b19a52f46d43.tar.gz
vcpkg-0c481e12f150ef8dd57f3fd8fae4b19a52f46d43.zip
[nanovg] Add dependency port stb (#8813)
* [nanovg]Add depends port stb. Do not install stb headers. * [nanovg] Remove stb files from source to ensure the vcpkg-packaged copies are preferred. * [nanovg]Disable build with uwp. Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
-rw-r--r--ports/nanovg/CMakeLists.txt7
-rw-r--r--ports/nanovg/CONTROL3
-rw-r--r--ports/nanovg/portfile.cmake13
3 files changed, 14 insertions, 9 deletions
diff --git a/ports/nanovg/CMakeLists.txt b/ports/nanovg/CMakeLists.txt
index 16d7afa4b..8caf73238 100644
--- a/ports/nanovg/CMakeLists.txt
+++ b/ports/nanovg/CMakeLists.txt
@@ -1,11 +1,13 @@
cmake_minimum_required(VERSION 3.11)
project(nanovg C)
+find_path(STB_INCLUDES stb_image.h include)
+
set(NANOVG_SOURCES src/nanovg.c)
-set(NANOVG_HEADERS src/nanovg.h src/nanovg_gl.h src/nanovg_gl_utils.h src/stb_image.h)
+set(NANOVG_HEADERS src/nanovg.h src/nanovg_gl.h src/nanovg_gl_utils.h)
add_library(nanovg STATIC ${NANOVG_SOURCES} ${NANOVG_HEADERS})
set_target_properties(nanovg PROPERTIES PUBLIC_HEADER "${NANOVG_HEADERS}")
-target_include_directories(nanovg PRIVATE 3rdparty/nanovg/src)
+target_include_directories(nanovg PRIVATE ${STB_INCLUDES})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(nanovg PRIVATE DEBUG)
@@ -25,7 +27,6 @@ install(EXPORT nanovgTargets
NAMESPACE nanovg::
DESTINATION share/nanovg)
-include(CMakePackageConfigHelpers)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/nanovgConfig.cmake
DESTINATION share/nanovg)
diff --git a/ports/nanovg/CONTROL b/ports/nanovg/CONTROL
index 5291576ac..57bd00f72 100644
--- a/ports/nanovg/CONTROL
+++ b/ports/nanovg/CONTROL
@@ -1,4 +1,5 @@
Source: nanovg
-Version: 2019-8-30-1
+Version: 2019-8-30-3
Homepage: https://github.com/memononen/nanovg
Description: NanoVG is small antialiased vector graphics rendering library for OpenGL.
+Build-Depends: stb \ No newline at end of file
diff --git a/ports/nanovg/portfile.cmake b/ports/nanovg/portfile.cmake
index 9a2cbc7ac..6a838808b 100644
--- a/ports/nanovg/portfile.cmake
+++ b/ports/nanovg/portfile.cmake
@@ -1,4 +1,5 @@
-include(vcpkg_common_functions)
+vcpkg_fail_port_install(ON_TARGET "UWP")
+
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO memononen/nanovg
@@ -10,12 +11,14 @@ vcpkg_from_github(
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/nanovgConfig.cmake DESTINATION ${SOURCE_PATH})
+file(GLOB STB_SRCS ${SOURCE_PATH}/src/stb_*)
+if(STB_SRCS)
+ file(REMOVE_RECURSE ${STB_SRCS})
+endif()
+
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
- PREFER_NINJA # Disable this option if project cannot be built with Ninja
- # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2
- # OPTIONS_RELEASE -DOPTIMIZE=1
- # OPTIONS_DEBUG -DDEBUGGABLE=1
+ PREFER_NINJA
)
vcpkg_install_cmake()