mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-22 23:28:11 +08:00
2c2735a9e1
* use proper cmake targets * change target name to be unofficial
41 lines
1017 B
CMake
41 lines
1017 B
CMake
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(unofficial-tinyxml ${SOURCES})
|
|
target_compile_definitions(unofficial-tinyxml PRIVATE "-DTIXML_USE_STL")
|
|
set_target_properties(unofficial-tinyxml PROPERTIES OUTPUT_NAME tinyxml)
|
|
|
|
include(GenerateExportHeader)
|
|
generate_export_header(unofficial-tinyxml BASE_NAME tinyxml)
|
|
|
|
target_include_directories(unofficial-tinyxml
|
|
PUBLIC
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
|
$<INSTALL_INTERFACE:include>
|
|
)
|
|
install(TARGETS unofficial-tinyxml
|
|
EXPORT tinyxml-export
|
|
ARCHIVE DESTINATION lib
|
|
LIBRARY DESTINATION lib
|
|
RUNTIME DESTINATION bin
|
|
)
|
|
install(EXPORT tinyxml-export
|
|
FILE
|
|
tinyxmlTargets.cmake
|
|
NAMESPACE
|
|
unofficial-tinyxml::
|
|
DESTINATION
|
|
share/tinyxml
|
|
)
|
|
install(FILES ${HEADERS}
|
|
${CMAKE_CURRENT_BINARY_DIR}/tinyxml_export.h DESTINATION include)
|