From 5b0eeaa8bbe0d590845e572de50e4081d6253e6d Mon Sep 17 00:00:00 2001 From: Ricardo Novak Date: Sat, 10 Aug 2024 21:50:20 +0100 Subject: [PATCH 1/5] chg: remove submodules --- .gitmodules | 6 ------ catch | 1 - tinyxml2 | 1 - 3 files changed, 8 deletions(-) delete mode 160000 catch delete mode 160000 tinyxml2 diff --git a/.gitmodules b/.gitmodules index 84ad92e4..e69de29b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +0,0 @@ -[submodule "tinyxml2"] - path = tinyxml2 - url = https://github.com/leethomason/tinyxml2.git -[submodule "catch"] - path = catch - url = https://github.com/philsquared/Catch.git diff --git a/catch b/catch deleted file mode 160000 index d758428f..00000000 --- a/catch +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d758428fe297655e558a86cc6a013fcb1bcc8c7d diff --git a/tinyxml2 b/tinyxml2 deleted file mode 160000 index 70fd52a5..00000000 --- a/tinyxml2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 70fd52a5743871dc230b03d615e0170ae3caa3e5 From f54fb10934b07dac5ea045e46970b9ab435db68e Mon Sep 17 00:00:00 2001 From: Ricardo Novak Date: Sat, 10 Aug 2024 21:51:18 +0100 Subject: [PATCH 2/5] new: add vcpkg dependencies --- CMakeLists.txt | 6 +----- src/mfast/xml_parser/CMakeLists.txt | 19 ++----------------- vcpkg-configuration.json | 14 ++++++++++++++ vcpkg.json | 8 ++++++++ 4 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 vcpkg-configuration.json create mode 100644 vcpkg.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 10b4a17f..9a9db80f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,16 +30,12 @@ include(FastTypeGenTarget) # dependencies find_package(Boost 1.56.0 REQUIRED) +find_package(tinyxml2 CONFIG REQUIRED) add_compile_definitions(SIZEOF_VOID_P=${CMAKE_SIZEOF_VOID_P}) add_subdirectory (src) -if(BUILD_TESTS) - enable_testing() - add_subdirectory (tests) -endif(BUILD_TESTS) - if(BUILD_EXAMPLES) add_subdirectory (examples) endif(BUILD_EXAMPLES) diff --git a/src/mfast/xml_parser/CMakeLists.txt b/src/mfast/xml_parser/CMakeLists.txt index 028c99fc..d3319c07 100644 --- a/src/mfast/xml_parser/CMakeLists.txt +++ b/src/mfast/xml_parser/CMakeLists.txt @@ -1,21 +1,10 @@ file (GLOB_RECURSE headers CONFIGURE_DEPENDS "*.h") ## retrieve all header files in current directory file (GLOB_RECURSE sources CONFIGURE_DEPENDS "*.cpp") ## retrieve all source files in current directory -set(TINYXML2_ROOT ${PROJECT_SOURCE_DIR}/tinyxml2/) - -# create our own tinyxml2 target, easier to integrate in the build -add_library(tinyxml2_static OBJECT) -target_sources(tinyxml2_static PRIVATE ${TINYXML2_ROOT}/tinyxml2.cpp) -target_sources(tinyxml2_static PUBLIC FILE_SET HEADERS BASE_DIRS ${TINYXML2_ROOT} FILES ${TINYXML2_ROOT}/tinyxml2.h) - -install(TARGETS tinyxml2_static - EXPORT mFASTTargets - FILE_SET HEADERS DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mfast/xml_parser) - add_library(mfast_xml_parser_static STATIC) target_sources(mfast_xml_parser_static PRIVATE ${sources}) target_sources(mfast_xml_parser_static PUBLIC FILE_SET HEADERS BASE_DIRS ${PROJECT_SOURCE_DIR}/src FILES ${headers}) -target_link_libraries(mfast_xml_parser_static PUBLIC mfast_static tinyxml2_static) +target_link_libraries(mfast_xml_parser_static PUBLIC mfast_static tinyxml2::tinyxml2) target_compile_definitions(mfast_xml_parser_static PUBLIC MFAST_CODER_STATIC_DEFINE) if (UNIX) @@ -27,16 +16,12 @@ install(TARGETS mfast_xml_parser_static FILE_SET HEADERS) if (BUILD_SHARED_LIBS) - add_library(tinyxml2_shared OBJECT) - target_sources(tinyxml2_shared PRIVATE ${TINYXML2_ROOT}/tinyxml2.cpp) - target_sources(tinyxml2_shared PUBLIC FILE_SET HEADERS BASE_DIRS ${TINYXML2_ROOT} FILES ${TINYXML2_ROOT}/tinyxml2.h) - set_property(TARGET tinyxml2_shared PROPERTY POSITION_INDEPENDENT_CODE ON) add_library(mfast_xml_parser SHARED) target_sources(mfast_xml_parser PRIVATE ${sources}) target_sources(mfast_xml_parser PUBLIC FILE_SET HEADERS BASE_DIRS ${PROJECT_SOURCE_DIR}/src FILES ${headers}) target_compile_definitions(mfast_xml_parser INTERFACE MFAST_DYN_LINK) - target_link_libraries(mfast_xml_parser PUBLIC mfast PRIVATE tinyxml2_shared) + target_link_libraries(mfast_xml_parser PUBLIC mfast PRIVATE tinyxml2::tinyxml2) set_property(TARGET mfast_xml_parser PROPERTY VERSION ${MFAST_VERSION}) set_property(TARGET mfast_xml_parser PROPERTY SOVERSION ${MFAST_VERSION}) diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 00000000..ad4b64f1 --- /dev/null +++ b/vcpkg-configuration.json @@ -0,0 +1,14 @@ +{ + "default-registry": { + "kind": "git", + "baseline": "3850888eb8480abc8f73f84bf618de3b68900572", + "repository": "https://github.com/microsoft/vcpkg" + }, + "registries": [ + { + "kind": "artifact", + "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", + "name": "microsoft" + } + ] +} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 00000000..bed2e731 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "mfast", + "version": "1.2.2", + "dependencies": [ + "boost", + "tinyxml2" + ] +} From 084c013153ed32027c3a854aefa5a5027a19c06a Mon Sep 17 00:00:00 2001 From: Ricardo Novak Date: Sat, 10 Aug 2024 21:51:35 +0100 Subject: [PATCH 3/5] chg: update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5acb669b..af9400d4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build .vscode +cmake-build-*/ \ No newline at end of file From a8dc05387a8b14cb09cf2ab09bf69fcadfe12d78 Mon Sep 17 00:00:00 2001 From: Ricardo Novak Date: Sun, 11 Aug 2024 13:38:28 +0100 Subject: [PATCH 4/5] new: version 1.3.0 --- cmake/mFASTConfig.cmake.in | 1 + vcpkg.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/mFASTConfig.cmake.in b/cmake/mFASTConfig.cmake.in index 9228bc9f..bcc05327 100644 --- a/cmake/mFASTConfig.cmake.in +++ b/cmake/mFASTConfig.cmake.in @@ -23,6 +23,7 @@ include(CMakeFindDependencyMacro) @PACKAGE_INIT@ find_dependency(Boost 1.56.0) +find_dependency(tinyxml CONFIG REQUIRED) include("${CMAKE_CURRENT_LIST_DIR}/mFASTTargets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/FastTypeGenTarget.cmake") diff --git a/vcpkg.json b/vcpkg.json index bed2e731..d9bd0744 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "name": "mfast", - "version": "1.2.2", + "version": "1.3.0", "dependencies": [ "boost", "tinyxml2" From 4735aecb2a7fc93f81176880f7e4c2afe75fc0de Mon Sep 17 00:00:00 2001 From: Ricardo Novak Date: Sun, 11 Aug 2024 15:01:51 +0100 Subject: [PATCH 5/5] fix: use correct tinyxml2 target name on config input file --- cmake/mFASTConfig.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/mFASTConfig.cmake.in b/cmake/mFASTConfig.cmake.in index bcc05327..e41e4e87 100644 --- a/cmake/mFASTConfig.cmake.in +++ b/cmake/mFASTConfig.cmake.in @@ -23,7 +23,7 @@ include(CMakeFindDependencyMacro) @PACKAGE_INIT@ find_dependency(Boost 1.56.0) -find_dependency(tinyxml CONFIG REQUIRED) +find_dependency(tinyxml2 CONFIG REQUIRED) include("${CMAKE_CURRENT_LIST_DIR}/mFASTTargets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/FastTypeGenTarget.cmake")