40 lines
1.5 KiB
CMake
40 lines
1.5 KiB
CMake
cmake_minimum_required(VERSION 3.28)
|
|
|
|
# define CXX interface library
|
|
|
|
# define target & alias (for other projects consuming the "source-tree")
|
|
add_library(iue-svg_svg INTERFACE)
|
|
|
|
# define sources of target
|
|
target_sources(iue-svg_svg
|
|
INTERFACE FILE_SET public_headers TYPE HEADERS BASE_DIRS ${PROJECT_SOURCE_DIR} FILES tags.hpp tree.hpp render.hpp)
|
|
|
|
# define installation step
|
|
install(TARGETS iue-svg_svg EXPORT iue-svg-export
|
|
FILE_SET public_headers DESTINATION "./")
|
|
|
|
# define test
|
|
|
|
if(BUILD_TESTING AND PROJECT_IS_TOP_LEVEL)
|
|
add_executable(iue-svg_tree.test tree.test.cpp)
|
|
target_link_libraries(iue-svg_tree.test iue-svg_svg)
|
|
add_test(NAME iue-svg_tree.test COMMAND iue-svg_tree.test)
|
|
|
|
add_executable(iue-svg_tags.test tags.test.cpp)
|
|
target_link_libraries(iue-svg_tags.test iue-svg_svg)
|
|
add_test(NAME iue-svg_tags.test COMMAND iue-svg_tags.test)
|
|
|
|
add_executable(iue-svg_render.test render.test.cpp)
|
|
target_link_libraries(iue-svg_render.test iue-svg_svg)
|
|
add_test(NAME iue-svg_render.test COMMAND iue-svg_render.test)
|
|
|
|
endif()
|
|
|
|
# export targets for consuming cmake projects
|
|
|
|
# generate and install a .cmake file to allow dependend projects consuming the "install-tree" to import all targets
|
|
install(EXPORT iue-svg-export DESTINATION "iue-svg" )
|
|
|
|
# allow dependend projects consuming the "build-tree" to use all targets
|
|
export(EXPORT iue-svg-export)
|