vcpkg/ports/nanovg/CMakeLists.txt

33 lines
919 B
CMake
Raw Normal View History

2018-11-09 02:53:06 +08:00
cmake_minimum_required(VERSION 3.11)
project(nanovg C)
find_path(STB_INCLUDES stb_image.h include)
2018-11-09 02:53:06 +08:00
set(NANOVG_SOURCES src/nanovg.c)
set(NANOVG_HEADERS src/nanovg.h src/nanovg_gl.h src/nanovg_gl_utils.h)
2018-11-09 02:53:06 +08:00
add_library(nanovg STATIC ${NANOVG_SOURCES} ${NANOVG_HEADERS})
set_target_properties(nanovg PROPERTIES PUBLIC_HEADER "${NANOVG_HEADERS}")
target_include_directories(nanovg PRIVATE ${STB_INCLUDES})
2018-11-09 02:53:06 +08:00
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)