cmake_minimum_required(VERSION 3.16)

project(cxxLibrary LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)

set(SOURCES
    src/tinyxml2.cpp
)

file(GLOB_RECURSE BOOST_SOURCES
    src/boost-src/*.cpp
    src/boost-src/*.hpp
    src/boost-src/*.h
)

add_library(cxxLibrary STATIC ${SOURCES} ${BOOST_SOURCES})
target_include_directories(cxxLibrary PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
    target_link_libraries(cxxLibrary PUBLIC ws2_32 bcrypt ntdll)
endif()
target_compile_definitions(cxxLibrary PUBLIC
    BOOST_ALL_NO_LIB
    BOOST_ALL_NO_LIBRARY
    BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF
)
set_target_properties(cxxLibrary PROPERTIES DEBUG_POSTFIX "d"
    # 可选：设置 Release 版本后缀
    # RELEASE_POSTFIX ""
    # RELWITHDEBINFO_POSTFIX "rd"
    # MINSIZEREL_POSTFIX "s"
)
