2020-11-16 14:47:43 +08:00
|
|
|
|
|
|
|
set(lib_name pugixml)
|
|
|
|
set(target_name ${lib_name})
|
|
|
|
|
|
|
|
project(${lib_name})
|
|
|
|
|
|
|
|
include(../cmake/CocosExternalConfig.cmake)
|
|
|
|
|
|
|
|
set(${target_name}_src
|
|
|
|
pugixml.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
if(WINDOWS)
|
|
|
|
add_library(${target_name} ${${target_name}_src})
|
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
target_compile_definitions(${target_name} PRIVATE $<$<CXX_COMPILER_ID:MSVC>:PUGIXML_API=__declspec\(dllexport\)>)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
add_library(${target_name} STATIC
|
|
|
|
${${target_name}_src}
|
|
|
|
)
|
|
|
|
target_include_directories(${target_name} PRIVATE .)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_target_properties(${target_name}
|
|
|
|
PROPERTIES
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
2021-03-13 18:18:40 +08:00
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
2020-11-16 14:47:43 +08:00
|
|
|
FOLDER "External"
|
|
|
|
)
|
|
|
|
|
|
|
|
set_target_properties(${target_name} PROPERTIES
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
|
|
)
|