From 002ffeed7820798ace52bec74ea0f25e72eac2f3 Mon Sep 17 00:00:00 2001 From: sha512sum Date: Mon, 26 Aug 2024 04:29:16 +0000 Subject: [PATCH] Rename --- .gitignore | 14 ++--- CMakeLists.txt | 54 ++++++++++--------- README.md | 2 +- ...nfig.cmake.in => larraXMPPConfig.cmake.in} | 0 lib/src/library.cpp | 2 +- src/main.cpp | 14 ++--- src/main_window.cpp | 10 ++++ 7 files changed, 51 insertions(+), 45 deletions(-) rename cmake/{xmppClientLibConfig.cmake.in => larraXMPPConfig.cmake.in} (100%) create mode 100644 src/main_window.cpp diff --git a/.gitignore b/.gitignore index 6c7e121..6cbf7fc 100644 --- a/.gitignore +++ b/.gitignore @@ -9,12 +9,12 @@ cmake/CPM.cmake cmake_install.cmake compile_commands.json cpm-package-lock.cmake -xmppClientLibConfig.cmake -xmppClientLibVersionConfig.cmake -xmpp_client -xmpp_client_tests -xmpp_client_tests\[1\]_include.cmake -xmpp_client_tests\[1\]_tests.cmake +larraXMPPConfig.cmake +larraXMPPVersionConfig.cmake +larra +larra_xmpp_tests +larra_xmpp_tests\[1\]_include.cmake +larra_xmpp_tests\[1\]_tests.cmake utemplConfigVersion.cmake install_manifest.txt CPM_modules/ @@ -22,4 +22,4 @@ Makefile _deps/ examples/output lib__cmake_cxx23.a -libxmpp_client_lib.so +liblarra_xmpp.so diff --git a/CMakeLists.txt b/CMakeLists.txt index 09ef35f..1450f30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD # your CMake build for the exact value to use. "0e5b6991-d74f-4b3d-a41c-cf096e0b2508") -project(xmpp_client +project(larra VERSION 0.1 LANGUAGES CXX) @@ -76,69 +76,71 @@ include(GNUInstallDirs) -add_library(xmpp_client_lib) +add_library(larra_xmpp) -target_compile_features(xmpp_client_lib INTERFACE cxx_std_23) +add_library(larra::larra_xmpp ALIAS larra_xmpp) -target_sources(xmpp_client_lib PUBLIC FILE_SET xmpp_client_lib_set TYPE CXX_MODULES +target_compile_features(larra_xmpp INTERFACE cxx_std_23) + +target_sources(larra_xmpp PUBLIC FILE_SET larraXMPPSet TYPE CXX_MODULES FILES ${LIB_SOURCES}) -install(TARGETS xmpp_client_lib - EXPORT xmppClientLibTargets +install(TARGETS larra_xmpp + EXPORT larraXMPPTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - FILE_SET xmpp_client_lib_set DESTINATION ${CMAKE_INSTALL_LIBDIR} + FILE_SET larraXMPPSet DESTINATION ${CMAKE_INSTALL_LIBDIR} ) if(TARGET Boost::pfr) - target_link_libraries(xmpp_client_lib INTERFACE fmt::fmt + target_link_libraries(larra_xmpp INTERFACE fmt::fmt Boost::pfr utempl::utempl ${GTKMM_LIBRARIES}) else() find_package(Boost 1.85.0 REQUIRED) - target_link_libraries(xmpp_client_lib INTERFACE fmt::fmt + target_link_libraries(larra_xmpp INTERFACE fmt::fmt utempl::utempl ${Boost_LIBRARIES} ${GTKMM_LIBRARIES}) endif() -add_executable(xmpp_client) +add_executable(larra) -target_compile_features(xmpp_client INTERFACE cxx_std_23) +target_compile_features(larra INTERFACE cxx_std_23) -target_link_libraries(xmpp_client xmpp_client_lib) +target_link_libraries(larra larra_xmpp) -target_sources(xmpp_client PUBLIC FILE_SET xmpp_client TYPE CXX_MODULES +target_sources(larra PUBLIC FILE_SET larraSet TYPE CXX_MODULES FILES ${SOURCES}) -install(TARGETS xmpp_client +install(TARGETS larra RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) include(CMakePackageConfigHelpers) -write_basic_package_version_file("xmppClientLibVersionConfig.cmake" +write_basic_package_version_file("larraXMPPVersionConfig.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion) configure_package_config_file( - "${PROJECT_SOURCE_DIR}/cmake/xmppClientLibConfig.cmake.in" - "${PROJECT_BINARY_DIR}/xmppClientLibConfig.cmake" + "${PROJECT_SOURCE_DIR}/cmake/larraXMPPConfig.cmake.in" + "${PROJECT_BINARY_DIR}/larraXMPPConfig.cmake" INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/xmpp_client/cmake) -install(EXPORT xmppClientLibTargets +install(EXPORT larraXMPPTargets FILE xmppClientLibTargets.cmake - NAMESPACE xmpp_client:: + NAMESPACE larra:: DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/xmpp_client/cmake) - install(FILES "${PROJECT_BINARY_DIR}/xmppClientLibConfig.cmake" - "${PROJECT_BINARY_DIR}/xmppClientLibVersionConfig.cmake" + install(FILES "${PROJECT_BINARY_DIR}/larraXMPPConfig.cmake" + "${PROJECT_BINARY_DIR}/larraXMPPVersionConfig.cmake" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/xmpp_client/cmake) @@ -149,12 +151,12 @@ if(ENABLE_TESTS) find_package(GTest REQUIRED) enable_testing() file(GLOB_RECURSE SOURCES "tests/*.cpp" ) - add_executable(xmpp_client_tests) - target_sources(xmpp_client_tests PUBLIC FILE_SET tests TYPE CXX_MODULES + add_executable(larra_xmpp_tests) + target_sources(larra_xmpp_tests PUBLIC FILE_SET tests TYPE CXX_MODULES FILES ${SOURCES}) - target_link_libraries(xmpp_client_tests GTest::gtest_main + target_link_libraries(larra_xmpp_tests GTest::gtest_main xmpp_client_lib) - set_property(TARGET xmpp_client_tests PROPERTY CXX_STANDARD 23) + set_property(TARGET larra_xmpp_tests PROPERTY CXX_STANDARD 23) include(GoogleTest) - gtest_discover_tests(xmpp_client_tests) + gtest_discover_tests(larra_xmpp_tests) endif() diff --git a/README.md b/README.md index 9497c5f..0939aa1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# xmpp_client +# Larra XMPP Client on C++ with GTK diff --git a/cmake/xmppClientLibConfig.cmake.in b/cmake/larraXMPPConfig.cmake.in similarity index 100% rename from cmake/xmppClientLibConfig.cmake.in rename to cmake/larraXMPPConfig.cmake.in diff --git a/lib/src/library.cpp b/lib/src/library.cpp index 97cfbee..79cac43 100644 --- a/lib/src/library.cpp +++ b/lib/src/library.cpp @@ -1 +1 @@ -export module xmpp_client.library; +export module larra.library; diff --git a/src/main.cpp b/src/main.cpp index 7302cce..a536faf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,16 +1,10 @@ module; #include -export module xmpp_client.main; -import xmpp_client.library; - -struct MainWindow : public Gtk::Window { - MainWindow() { - this->set_title("XMPP Client"); - this->set_default_size(200, 200); - }; -}; +export module larra.main; +import larra.library; +import larra.main_window; auto main(int argc, char* argv[]) -> int { - auto app = Gtk::Application::create("org.xmpp_client.xmpp_client"); + auto app = Gtk::Application::create("org.larra.larra"); return app->make_window_and_run(argc, argv); }; diff --git a/src/main_window.cpp b/src/main_window.cpp new file mode 100644 index 0000000..ab1caa9 --- /dev/null +++ b/src/main_window.cpp @@ -0,0 +1,10 @@ +module; +#include +export module larra.main_window; + +export struct MainWindow : public Gtk::Window { + MainWindow() { + this->set_title("XMPP Client"); + this->set_default_size(200, 200); + }; +};