-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
260,279 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,113 +1,121 @@ | ||
cmake_minimum_required (VERSION 3.25) | ||
|
||
file(TO_CMAKE_PATH $ENV{VCPKG_ROOT} VCPKG_ROOT) | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
set(SQLITE_HAS_CODEC ON) | ||
set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake") | ||
if(WIN32) | ||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) | ||
set(BUILD_SHARED_LIBS ON) | ||
endif() | ||
if (POLICY CMP0141) | ||
cmake_policy(SET CMP0141 NEW) | ||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>") | ||
cmake_policy(SET CMP0141 NEW) | ||
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() | ||
|
||
project ("libaura" LANGUAGES CXX VERSION 2024.1.0 DESCRIPTION "A cross-platform base for native Nickvision applications.") | ||
#libaura Definition | ||
project ("libaura" LANGUAGES C CXX VERSION 2024.1.0 DESCRIPTION "A cross-platform base for native Nickvision applications.") | ||
include(CMakePackageConfigHelpers) | ||
include(GNUInstallDirs) | ||
include(CTest) | ||
|
||
#libaura Library Setup | ||
include_directories(${PROJECT_SOURCE_DIR}/include) | ||
#libaura Setup | ||
add_compile_definitions(SQLITE_HAS_CODEC) | ||
if(LINUX) | ||
add_compile_definitions(HAVE_USLEEP) | ||
endif() | ||
add_library (${PROJECT_NAME} | ||
src/filesystem/filesystemchangedeventargs.cpp | ||
src/filesystem/filesystemwatcher.cpp | ||
src/helpers/stringhelpers.cpp | ||
src/helpers/webhelpers.cpp | ||
src/keyring/credential.cpp | ||
src/keyring/keyring.cpp | ||
src/keyring/keyringdialogcontroller.cpp | ||
src/keyring/passwordgenerator.cpp | ||
src/keyring/passwordstrength.cpp | ||
src/keyring/store.cpp | ||
src/keyring/systemcredentials.cpp | ||
src/localization/documentation.cpp | ||
src/localization/gettext.cpp | ||
src/network/networkmonitor.cpp | ||
src/network/networkstatechangedeventargs.cpp | ||
src/notifications/notificationsenteventargs.cpp | ||
src/notifications/notifyicon.cpp | ||
src/notifications/notifyiconmenu.cpp | ||
src/notifications/shellnotification.cpp | ||
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/systemdirectories.cpp | ||
src/userdirectories.cpp | ||
src/version.cpp) | ||
set_target_properties(${PROJECT_NAME} PROPERTIES | ||
VERSION ${PROJECT_VERSION} | ||
SOVERSION ${PROJECT_VERSION}) | ||
"src/filesystem/filesystemchangedeventargs.cpp" | ||
"src/filesystem/filesystemwatcher.cpp" | ||
"src/helpers/stringhelpers.cpp" | ||
"src/helpers/webhelpers.cpp" | ||
"src/keyring/credential.cpp" | ||
"src/keyring/keyring.cpp" | ||
"src/keyring/keyringdialogcontroller.cpp" | ||
"src/keyring/passwordgenerator.cpp" | ||
"src/keyring/passwordstrength.cpp" | ||
"src/keyring/store.cpp" | ||
"src/keyring/systemcredentials.cpp" | ||
"src/localization/documentation.cpp" | ||
"src/localization/gettext.cpp" | ||
"src/network/networkmonitor.cpp" | ||
"src/network/networkstatechangedeventargs.cpp" | ||
"src/notifications/notificationsenteventargs.cpp" | ||
"src/notifications/notifyicon.cpp" | ||
"src/notifications/notifyiconmenu.cpp" | ||
"src/notifications/shellnotification.cpp" | ||
"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") | ||
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}") | ||
if(MSVC) | ||
target_compile_options(${PROJECT_NAME} PRIVATE /W4) | ||
else() | ||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic) | ||
endif() | ||
|
||
#libaura Packages | ||
find_package(Boost COMPONENTS locale REQUIRED) | ||
find_package(Boost REQUIRED COMPONENTS locale) | ||
find_package(CURL REQUIRED) | ||
find_package(jsoncpp REQUIRED) | ||
find_package(Intl REQUIRED) | ||
find_package(maddy REQUIRED) | ||
find_package(sqlcipher REQUIRED CONFIG) | ||
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::locale CURL::libcurl JsonCpp::JsonCpp Intl::Intl maddy::maddy sqlcipher::sqlcipher) | ||
find_package(OpenSSL REQUIRED) | ||
find_package(unofficial-maddy REQUIRED) | ||
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::boost Boost::locale CURL::libcurl JsonCpp::JsonCpp Intl::Intl OpenSSL::SSL OpenSSL::Crypto unofficial::maddy::maddy) | ||
if(LINUX) | ||
set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
find_package(Threads REQUIRED) | ||
find_package(libsecret REQUIRED CONFIG) | ||
find_package(libuuid REQUIRED CONFIG) | ||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(glib-2.0 REQUIRED IMPORTED_TARGET glib-2.0) | ||
pkg_check_modules(gio-2.0 REQUIRED IMPORTED_TARGET gio-2.0) | ||
pkg_check_modules(gmodule-2.0 REQUIRED IMPORTED_TARGET gmodule-2.0) | ||
pkg_check_modules(gobject-2.0 REQUIRED IMPORTED_TARGET gobject-2.0) | ||
pkg_check_modules(gthread-2.0 REQUIRED IMPORTED_TARGET gthread-2.0) | ||
target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads libsecret::libsecret libuuid::libuuid PkgConfig::glib-2.0 PkgConfig::gio-2.0 PkgConfig::gmodule-2.0 PkgConfig::gobject-2.0 PkgConfig::gthread-2.0) | ||
endif() | ||
if(MSVC) | ||
target_compile_options(${PROJECT_NAME} PRIVATE /W4) | ||
else() | ||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic) | ||
pkg_check_modules(glib REQUIRED IMPORTED_TARGET glib-2.0) | ||
pkg_check_modules(gio REQUIRED IMPORTED_TARGET gio-2.0) | ||
pkg_check_modules(gmodule REQUIRED IMPORTED_TARGET gmodule-2.0) | ||
pkg_check_modules(gobject REQUIRED IMPORTED_TARGET gobject-2.0) | ||
pkg_check_modules(gthread REQUIRED IMPORTED_TARGET gthread-2.0) | ||
pkg_check_modules(libsecret REQUIRED IMPORTED_TARGET libsecret-1) | ||
find_package(unofficial-libuuid CONFIG REQUIRED) | ||
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 | ||
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) | ||
install(TARGETS ${PROJECT_NAME} EXPORT "${PROJECT_NAME}Targets" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") | ||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/include" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}") | ||
install(FILES "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}.pc" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig") | ||
install(EXPORT "${PROJECT_NAME}Targets" FILE "${PROJECT_NAME}Targets.cmake" NAMESPACE ${PROJECT_NAME}:: DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_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 | ||
if (NOT BUILD_TESTING STREQUAL OFF) | ||
#libaura_test Setup | ||
add_executable(${PROJECT_NAME}_test | ||
tests/auratests.cpp | ||
tests/eventtests.cpp | ||
tests/filewatchertests.cpp | ||
tests/ipctests.cpp | ||
tests/keyringtests.cpp | ||
tests/main.cpp | ||
tests/networktests.cpp | ||
tests/notifyicontests.cpp | ||
tests/passwordtests.cpp | ||
tests/storetests.cpp | ||
tests/stringtests.cpp | ||
tests/systemcredentialstests.cpp | ||
tests/taskbartests.cpp | ||
tests/updatertests.cpp | ||
tests/versiontests.cpp | ||
tests/webtests.cpp) | ||
|
||
#libaura_test Packages | ||
"tests/auratests.cpp" | ||
"tests/eventtests.cpp" | ||
"tests/filewatchertests.cpp" | ||
"tests/ipctests.cpp" | ||
"tests/keyringtests.cpp" | ||
"tests/main.cpp" | ||
"tests/networktests.cpp" | ||
"tests/notifyicontests.cpp" | ||
"tests/passwordtests.cpp" | ||
"tests/storetests.cpp" | ||
"tests/stringtests.cpp" | ||
"tests/systemcredentialstests.cpp" | ||
"tests/taskbartests.cpp" | ||
"tests/updatertests.cpp" | ||
"tests/versiontests.cpp" | ||
"tests/webtests.cpp") | ||
find_package(GTest REQUIRED) | ||
target_link_libraries(${PROJECT_NAME}_test PRIVATE GTest::gtest_main GTest::gmock_main libaura) | ||
endif() | ||
|
||
#libaura Install | ||
configure_file(${PROJECT_SOURCE_DIR}/pkg-config/libaura.pc.in libaura.pc @ONLY) | ||
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}) | ||
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) | ||
install(FILES ${CMAKE_BINARY_DIR}/libaura.pc DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig) | ||
target_link_libraries(${PROJECT_NAME}_test PRIVATE GTest::gtest_main GTest::gmock_main ${PROJECT_NAME}) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"version": 3, | ||
"configurePresets": [ | ||
{ | ||
"name": "windows-base", | ||
"hidden": true, | ||
"generator": "Ninja", | ||
"binaryDir": "${sourceDir}/out/build/${presetName}", | ||
"installDir": "${sourceDir}/out/install/${presetName}", | ||
"cacheVariables": { | ||
"CMAKE_C_COMPILER": "cl.exe", | ||
"CMAKE_CXX_COMPILER": "cl.exe" | ||
}, | ||
"condition": { | ||
"type": "equals", | ||
"lhs": "${hostSystemName}", | ||
"rhs": "Windows" | ||
} | ||
}, | ||
{ | ||
"name": "x64-debug", | ||
"displayName": "x64 Debug", | ||
"inherits": "windows-base", | ||
"architecture": { | ||
"value": "x64", | ||
"strategy": "external" | ||
}, | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Debug" | ||
} | ||
}, | ||
{ | ||
"name": "x64-release", | ||
"displayName": "x64 Release", | ||
"inherits": "x64-debug", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Release" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.