Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ports/nanovg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
3 changes: 2 additions & 1 deletion ports/nanovg/CONTROL
Original file line number Diff line number Diff line change
@@ -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
13 changes: 8 additions & 5 deletions ports/nanovg/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()
Expand Down