Skip to content

Commit

Permalink
libaura --> libnick (#15)
Browse files Browse the repository at this point in the history
* libaura --> libnick

* Update documentation.cpp

* Update auratests.cpp

* Update auratests.cpp
  • Loading branch information
nlogozzo authored Jan 8, 2024
1 parent 097baf5 commit 5082ac5
Show file tree
Hide file tree
Showing 104 changed files with 531 additions and 526 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
working-directory: ${{github.workspace}}/build
run: cmake --install . --prefix "${{github.workspace}}/install"
- name: "Test"
run: ${{github.workspace}}/build/libaura_test
run: ${{github.workspace}}/build/libnick_test
- name: Upload
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
working-directory: ${{github.workspace}}/build
run: cmake --install . --prefix "${{github.workspace}}/install"
- name: "Test"
run: ${{github.workspace}}/build/Release/libaura_test.exe
run: ${{github.workspace}}/build/Release/libnick_test.exe
- name: Upload
uses: actions/upload-artifact@v3
with:
Expand Down
28 changes: 14 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,25 @@ if (POLICY CMP0141)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

#libaura Definition
project ("libaura" LANGUAGES C CXX VERSION 2024.1.2 DESCRIPTION "A cross-platform base for native Nickvision applications.")
#libnick Definition
project ("libnick" LANGUAGES C CXX VERSION 2024.1.3 DESCRIPTION "A cross-platform base for native Nickvision applications.")
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)

#libaura Setup
#libnick Setup
add_compile_definitions(SQLITE_HAS_CODEC)
if(LINUX)
add_compile_definitions(HAVE_USLEEP)
endif()
add_library (${PROJECT_NAME}
"src/aura/appinfo.cpp"
"src/aura/aura.cpp"
"src/aura/configurationbase.cpp"
"src/aura/interprocesscommunicator.cpp"
"src/filesystem/filesystemchangedeventargs.cpp"
"src/filesystem/filesystemwatcher.cpp"
"src/filesystem/systemdirectories.cpp"
"src/filesystem/userdirectories.cpp"
"src/helpers/stringhelpers.cpp"
"src/helpers/webhelpers.cpp"
"src/keyring/credential.cpp"
Expand All @@ -50,14 +56,8 @@ add_library (${PROJECT_NAME}
"src/notifications/shellnotificationsenteventargs.cpp"
"src/taskbar/taskbaritem.cpp"
"src/update/updater.cpp"
"src/appinfo.cpp"
"src/aura.cpp"
"src/configurationbase.cpp"
"src/interprocesscommunicator.cpp"
"src/sqlite3.c"
"src/systemdirectories.cpp"
"src/userdirectories.cpp"
"src/version.cpp")
"src/update/version.cpp"
"src/sqlite3.c")
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>" "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION "${PROJECT_VERSION}" SOVERSION "${PROJECT_VERSION}")
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "${PROJECT_VERSION}")
Expand All @@ -67,7 +67,7 @@ else()
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic)
endif()

#libaura Packages
#libnick Packages
find_package(Boost REQUIRED COMPONENTS locale)
find_package(CURL REQUIRED)
find_package(jsoncpp CONFIG REQUIRED)
Expand All @@ -91,7 +91,7 @@ elseif(LINUX)
target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads PkgConfig::glib PkgConfig::gio PkgConfig::gmodule PkgConfig::gobject PkgConfig::gthread PkgConfig::libsecret unofficial::UUID::uuid)
endif()

#libaura Install
#libnick Install
configure_file("${CMAKE_SOURCE_DIR}/cmake/${PROJECT_NAME}.pc.in" "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}.pc" @ONLY)
configure_package_config_file("${CMAKE_SOURCE_DIR}/cmake/config.cmake.in" "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
write_basic_package_version_file("${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" VERSION "${PROJECT_VERSION}" COMPATIBILITY AnyNewerVersion)
Expand All @@ -102,7 +102,7 @@ install(EXPORT "${PROJECT_NAME}Targets" FILE "${PROJECT_NAME}Targets.cmake" NAME
install(FILES "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
export(EXPORT "${PROJECT_NAME}Targets" FILE "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}Targets.cmake" NAMESPACE ${PROJECT_NAME}::)

#libaura Test
#libnick Test
if (NOT BUILD_TESTING STREQUAL OFF)
add_executable(${PROJECT_NAME}_test
"tests/auratests.cpp"
Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# libaura
# libnick

<img width='96' height='96' alt='Logo' src='resources/logo.png'/>

**A cross-platform base for native Nickvision applications.**

libaura provides Nickvision apps with a common set of cross-platform (Windows and Linux) APIs for managing system and desktop app functionality such as network management, taskbar icons, translations, app updates, and more.
libnick provides Nickvision apps with a common set of cross-platform (Windows and Linux) APIs for managing system and desktop app functionality such as network management, taskbar icons, translations, app updates, and more.

## Documentation

Documentation for this library and its modules can be found [here](/docs).

## Dependencies
The following are a list of dependencies used by libaura.
The following are a list of dependencies used by libnick.

Following the [build instructions](#building-and-installing) below using vcpkg, will ensure these dependencies are installed properly for your platform.

Expand All @@ -23,7 +23,7 @@ Following the [build instructions](#building-and-installing) below using vcpkg,
- libgettext
- maddy
- openssl
- Used for sqlcipher, as libaura manually includes and compiles sqlcipher.
- Used for sqlcipher, as libnick manually includes and compiles sqlcipher.

### Linux Only
The above dependencies must be installed, plus the following for linux systems:
Expand All @@ -32,41 +32,41 @@ The above dependencies must be installed, plus the following for linux systems:
- libuuid

## Building and Installing
libaura uses `vcpkg` to manage its dependencies and `cmake` as its build system.
libnick uses `vcpkg` to manage its dependencies and `cmake` as its build system.

Ensure both `vcpkg` and `cmake` are installed on your system before building and installing libaura.
Ensure both `vcpkg` and `cmake` are installed on your system before building and installing libnick.

A C++20 compiler is also required to build libaura.
A C++20 compiler is also required to build libnick.

### Configuring vcpkg
1. Set the `VCPKG_ROOT` environment variable to the path of your vcpkg installation's root directory.
#### Windows
1. Set `VCPKG_DEFAULT_TRIPLET` to `x64-windows`
1. Run `vcpkg install boost-locale curl gettext gettext-libintl gtest jsoncpp maddy openssl`
1. Run `vcpkg install boost-locale curl gettext-libintl gtest jsoncpp maddy openssl`
#### Linux
1. Set `VCPKG_DEFAULT_TRIPLET` to `x64-linux`
1. Run `vcpkg install boost-locale curl gettext gettext-libintl glib gtest jsoncpp libsecret libuuid maddy openssl`
1. Run `vcpkg install boost-locale curl gettext-libintl glib gtest jsoncpp libsecret libuuid maddy openssl`

### Building
1. First, clone/download the repo.
1. Open a terminal and navigate to the repo's root directory.
1. Create a new `build` directory and `cd` into it.
#### Windows
1. From the `build` folder, run `cmake .. -G "Visual Studio 17 2022"`.
- To skip building libaura's test suite, add `-DBUILD_TESTING="OFF"` to the end of the command.
- To skip building libnick's test suite, add `-DBUILD_TESTING="OFF"` to the end of the command.
1. From the `build` folder, run `cmake --build . --config Release`.
1. After these commands complete, libaura will be successfully built and its binaries can be found in the `Release` folder of the `build` folder.
1. After these commands complete, libnick will be successfully built and its binaries can be found in the `Release` folder of the `build` folder.
#### Linux
1. From the `build` folder, run `cmake .. -DCMAKE_BUILD_TYPE=Release`.
- To skip building libaura's test suite, add `-DBUILD_TESTING="OFF"` to the end of the command.
- To skip building libnick's test suite, add `-DBUILD_TESTING="OFF"` to the end of the command.
1. From the `build` folder, run `cmake --build .`.
1. After these commands complete, libaura will be successfully built and its binaries can be found in the `build` folder.
1. After these commands complete, libnick will be successfully built and its binaries can be found in the `build` folder.

### Installing
1. To install libaura to the system, from the `build` folder, run `cmake --install . --prefix "PATH_TO_INSTALL_DIR"`.
- Replace `PATH_TO_INSTALL_DIR` with the path to a folder to install libaura to.
1. To install libnick to the system, from the `build` folder, run `cmake --install . --prefix "PATH_TO_INSTALL_DIR"`.
- Replace `PATH_TO_INSTALL_DIR` with the path to a folder to install libnick to.
- This is usually a dependencies folder set up by the programmer, added to the PATH variable, to allow linking to said dependencies.
- On linux, `PATH_TO_INSTALL_DIR` would usually be `/usr`.
- This command will export and install libaura cmake targets allowing you to simply use libaura in other cmake projects by adding:
- `find_package(libaura CONFIG REQUIRED)`
- `target_link_libraries(main PRIVATE libaura::libaura)`
- This command will export and install libnick cmake targets allowing you to simply use libnick in other cmake projects by adding:
- `find_package(libnick CONFIG REQUIRED)`
- `target_link_libraries(main PRIVATE libnick::libnick)`
4 changes: 2 additions & 2 deletions cmake/config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/libauraTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/libnickTargets.cmake")
include(CMakeFindDependencyMacro)

find_dependency(Boost REQUIRED COMPONENTS locale)
Expand All @@ -21,4 +21,4 @@ if(LINUX)
find_dependency(unofficial-libuuid CONFIG REQUIRED)
endif()

check_required_components(libaura)
check_required_components(libnick)
2 changes: 1 addition & 1 deletion cmake/libaura.pc.in → cmake/libnick.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Description: @PROJECT_DESCRIPTION@
Version: @PROJECT_VERSION@

Requires:
Libs: -L${libdir} -llibaura
Libs: -L${libdir} -llibnick
Cflags: -I${includedir}
28 changes: 14 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# libaura Documentation
# libnick Documentation

This folder contains all of the necessary documentation for using libaura and it's provided modules.
This folder contains all of the necessary documentation for using libnick and it's provided modules.

Each module (separated by namespace) contains its own documentation file that can be found within this folder or via one of the links below.

Expand All @@ -20,20 +20,20 @@ This means that the class provides the following methods for `m_var`: `std::stri
If a member variable is get or set only, we will document this as `std::string Var: get` and `std::string Var: set` respectively.

### Events
libaura provides a C#-inspired event system module under the Nickvision::Aura::Events namespace. This module contains a class `Event<T>` that handles registering and calling callbacks when said event is invoked.
libnick provides a C#-inspired event system module under the Nickvision::Events namespace. This module contains a class `Event<T>` that handles registering and calling callbacks when said event is invoked.

For example, assume a class has an event defined as `Nickvision::Aura::Events::Event<Nickvision::Aura::Events::EventArgs> m_saved`. We will document exposure of this event as `Event<Nickvision::Aura::Events::EventArgs> Saved`.
For example, assume a class has an event defined as `Nickvision::Events::Event<Nickvision::Events::EventArgs> m_saved`. We will document exposure of this event as `Event<Nickvision::Events::EventArgs> Saved`.

This means that the class provides the following method, allowing consumers to register callbacks to the event using the `+=` operator: `Nickvision::Aura::Events::Event<Nickvision::Aura::Events::EventArgs>& saved()`.
This means that the class provides the following method, allowing consumers to register callbacks to the event using the `+=` operator: `Nickvision::Events::Event<Nickvision::Events::EventArgs>& saved()`.

## Modules
- [Nickvision::Aura](aura.md)
- [Nickvision::Aura::Events](events.md)
- [Nickvision::Aura::Filesystem](filesystem.md)
- [Nickvision::Aura::Helpers](helpers.md)
- [Nickvision::Aura::Keyring](keyring.md)
- [Nickvision::Aura::Localization](localization.md)
- [Nickvision::Aura::Network](network.md)
- [Nickvision::Aura::Notifications](notifications.md)
- [Nickvision::Aura::Taskbar](taskbar.md)
- [Nickvision::Aura::Update](update.md)
- [Nickvision::Events](events.md)
- [Nickvision::Filesystem](filesystem.md)
- [Nickvision::Helpers](helpers.md)
- [Nickvision::Keyring](keyring.md)
- [Nickvision::Localization](localization.md)
- [Nickvision::Network](network.md)
- [Nickvision::Notifications](notifications.md)
- [Nickvision::Taskbar](taskbar.md)
- [Nickvision::Update](update.md)
Loading

0 comments on commit 5082ac5

Please sign in to comment.