2017-09-04 03:23:07 +08:00
|
|
|
cmake_minimum_required(VERSION 3.4)
|
|
|
|
project(tinyxml)
|
|
|
|
|
|
|
|
set(HEADERS "tinyxml.h")
|
|
|
|
|
|
|
|
set(SOURCES "tinyxml.cpp"
|
|
|
|
"tinyxmlerror.cpp"
|
|
|
|
"tinyxmlparser.cpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
option(BUILD_SHARED_LIBS "Build shared libs" OFF)
|
|
|
|
|
|
|
|
add_library(tinyxml ${SOURCES})
|
|
|
|
target_compile_definitions(tinyxml PRIVATE "-DTIXML_USE_STL")
|
|
|
|
|
2018-12-17 21:13:02 +08:00
|
|
|
include(GenerateExportHeader)
|
|
|
|
generate_export_header(tinyxml)
|
|
|
|
|
|
|
|
target_include_directories(tinyxml PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2017-09-04 03:23:07 +08:00
|
|
|
install(
|
|
|
|
TARGETS tinyxml
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
)
|
|
|
|
|
2019-05-03 13:57:43 +08:00
|
|
|
install(FILES ${HEADERS}
|
2018-12-17 21:13:02 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/tinyxml_export.h DESTINATION include)
|