2023-07-29 10:37:05 +00:00
|
|
|
cmake_minimum_required(VERSION 3.3)
|
2022-10-03 16:25:42 +00:00
|
|
|
|
2023-07-29 10:37:05 +00:00
|
|
|
project(lunasvg VERSION 2.3.8 LANGUAGES CXX C)
|
2022-10-03 16:25:42 +00:00
|
|
|
|
2022-10-16 10:31:43 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2022-10-03 16:25:42 +00:00
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
|
|
|
|
option(BUILD_SHARED_LIBS "Builds as shared library" OFF)
|
|
|
|
option(LUNASVG_BUILD_EXAMPLES "Builds examples" OFF)
|
|
|
|
|
|
|
|
add_library(lunasvg)
|
|
|
|
|
|
|
|
add_subdirectory(include)
|
|
|
|
add_subdirectory(source)
|
|
|
|
add_subdirectory(3rdparty/plutovg)
|
|
|
|
|
2023-07-29 10:37:05 +00:00
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
target_compile_definitions(lunasvg PUBLIC LUNASVG_SHARED)
|
|
|
|
target_compile_definitions(lunasvg PRIVATE LUNASVG_EXPORT)
|
2022-10-03 16:25:42 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(LUNASVG_BUILD_EXAMPLES)
|
|
|
|
add_subdirectory(example)
|
|
|
|
endif()
|
|
|
|
|
2023-07-29 10:37:05 +00:00
|
|
|
set(LUNASVG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
|
|
|
|
set(LUNASVG_INCDIR ${CMAKE_INSTALL_PREFIX}/include)
|
2022-10-03 16:25:42 +00:00
|
|
|
|
|
|
|
install(FILES
|
2023-07-29 10:37:05 +00:00
|
|
|
include/lunasvg.h
|
|
|
|
DESTINATION ${LUNASVG_INCDIR}
|
2022-10-03 16:25:42 +00:00
|
|
|
)
|
|
|
|
|
2023-07-29 10:37:05 +00:00
|
|
|
install(TARGETS lunasvg
|
|
|
|
LIBRARY DESTINATION ${LUNASVG_LIBDIR}
|
|
|
|
ARCHIVE DESTINATION ${LUNASVG_LIBDIR}
|
|
|
|
INCLUDES DESTINATION ${LUNASVG_INCDIR}
|
|
|
|
)
|