This commit is contained in:
sha512sum 2024-08-26 04:29:16 +00:00
parent 86bb9c9a7f
commit 002ffeed78
7 changed files with 51 additions and 45 deletions

14
.gitignore vendored
View file

@ -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

View file

@ -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()

View file

@ -1,2 +1,2 @@
# xmpp_client
# Larra
XMPP Client on C++ with GTK

View file

@ -1 +1 @@
export module xmpp_client.library;
export module larra.library;

View file

@ -1,16 +1,10 @@
module;
#include <gtkmm.h>
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<MainWindow>(argc, argv);
};

10
src/main_window.cpp Normal file
View file

@ -0,0 +1,10 @@
module;
#include <gtkmm.h>
export module larra.main_window;
export struct MainWindow : public Gtk::Window {
MainWindow() {
this->set_title("XMPP Client");
this->set_default_size(200, 200);
};
};