vcpkg/ports/nanovg/CMakeLists.txt
Jack·Boos·Yu 0c481e12f1 [nanovg] Add dependency port stb ()
* [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>
2020-01-06 13:18:22 -08:00

33 lines
919 B
CMake

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)
add_library(nanovg STATIC ${NANOVG_SOURCES} ${NANOVG_HEADERS})
set_target_properties(nanovg PROPERTIES PUBLIC_HEADER "${NANOVG_HEADERS}")
target_include_directories(nanovg PRIVATE ${STB_INCLUDES})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(nanovg PRIVATE DEBUG)
else()
target_compile_definitions(nanovg PRIVATE NDEBUG)
endif()
install(TARGETS nanovg
EXPORT nanovgTargets
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include)
install(EXPORT nanovgTargets
FILE nanovgTargets.cmake
NAMESPACE nanovg::
DESTINATION share/nanovg)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/nanovgConfig.cmake
DESTINATION share/nanovg)