package An official xmake package repository https://xrepo.xmake.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.7 KiB

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,7 +62,11 @@ endif(BUILD_PACKAGES)
find_package(Boost 1.56.0 REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/tinyxml2)
+
+find_package(tinyxml2 REQUIRED)
+include_directories("${tinyxml2_DIR}/../../../include/")
+link_directories("${tinyxml2_DIR}/../../")
+
include_directories ("${PROJECT_SOURCE_DIR}/src")
add_definitions(-DSIZEOF_VOID_P=${CMAKE_SIZEOF_VOID_P})
diff --git a/src/mfast/xml_parser/CMakeLists.txt b/src/mfast/xml_parser/CMakeLists.txt
--- a/src/mfast/xml_parser/CMakeLists.txt
+++ b/src/mfast/xml_parser/CMakeLists.txt
@@ -6,12 +6,10 @@ file (GLOB_RECURSE sources "*.cpp") ## retrieve all source files in current
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
-include_directories("${CMAKE_SOURCE_DIR}/tinyxml2")
-
-set(mfast_xml_parser_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../../../tinyxml2/tinyxml2.cpp ${sources} ${headers})
+set(mfast_xml_parser_SRCS ${sources} ${headers})
add_library(mfast_xml_parser_static STATIC ${mfast_xml_parser_SRCS})
-target_link_libraries(mfast_xml_parser_static mfast_static)
+target_link_libraries(mfast_xml_parser_static mfast_static tinyxml2)
if (UNIX)
set_target_properties(mfast_xml_parser_static PROPERTIES OUTPUT_NAME mfast_xml_parser)
@@ -39,7 +37,7 @@ if (BUILD_SHARED_LIBS)
set_target_properties(mfast_xml_parser PROPERTIES COMPILE_FLAGS -fvisibility=hidden)
endif()
- target_link_libraries(mfast_xml_parser mfast)
+ target_link_libraries(mfast_xml_parser mfast tinyxml2)
set_target_properties(mfast_xml_parser PROPERTIES
LINKER_LANGUAGE CXX
VERSION "${MFAST_VERSION}"