| 1 |
cmake_minimum_required(VERSION 3.5...4.0) |
| 2 |
project(tinyxml) |
| 3 |
|
| 4 |
set(SOURCES src/tinystr.cpp |
| 5 |
src/tinyxml.cpp |
| 6 |
src/tinyxmlerror.cpp |
| 7 |
src/tinyxmlparser.cpp) |
| 8 |
|
| 9 |
if(WIN32) |
| 10 |
add_definitions(-DWIN32 -D_LIB) |
| 11 |
endif() |
| 12 |
add_definitions(-DTIXML_USE_STL) |
| 13 |
|
| 14 |
add_library(tinyxml ${SOURCES}) |
| 15 |
|
| 16 |
include_directories(${PROJECT_SOURCE_DIR}/include) |
| 17 |
|
| 18 |
set(HEADERS ${PROJECT_SOURCE_DIR}/include/tinystr.h |
| 19 |
${PROJECT_SOURCE_DIR}/include/tinyxml.h) |
| 20 |
|
| 21 |
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include) |
| 22 |
install(TARGETS tinyxml DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) |