From 2c8e0d1ec0412279c76cda4b01ae5335bdf7ce24 Mon Sep 17 00:00:00 2001 From: Edgar Date: Fri, 12 Feb 2021 12:26:27 +0100 Subject: [PATCH] :tada: Added QtKeychain conan pkg --- conan-pkgs/QtKeychain/conanfile.py | 29 ++++++++++ lib/CMakeLists.txt | 22 +++---- lib/Libcommuni.cmake | 92 ------------------------------ 3 files changed, 36 insertions(+), 107 deletions(-) create mode 100644 conan-pkgs/QtKeychain/conanfile.py delete mode 100644 lib/Libcommuni.cmake diff --git a/conan-pkgs/QtKeychain/conanfile.py b/conan-pkgs/QtKeychain/conanfile.py new file mode 100644 index 000000000..5cd899974 --- /dev/null +++ b/conan-pkgs/QtKeychain/conanfile.py @@ -0,0 +1,29 @@ +from conans import ConanFile, CMake, tools + + +class LibCommuniConan(ConanFile): + name = "QtKeychain" + version = "0.12.90" + license = "MIT" + author = "Edgar Edgar@AnotherFoxGuy.com" + url = "https://github.com/Chatterino/chatterino2" + description = "QtKeychain is a Qt API to store passwords and other secret data securely" + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def source(self): + git = tools.Git() + git.clone("https://github.com/Chatterino/qtkeychain.git") + git.checkout("308ea7e709113dc277be1653fe2044bb20236836") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 2efc89882..3b5685447 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -15,7 +15,6 @@ project(chatterino2-dependencies VERSION 1) # Options with same default value on all platforms option(BUILD_HUMANIZE "Build Humanize IRC framework" ON) -option(BUILD_LIBCOMMUNI "Build LibCommuni IRC framework" OFF) option(BUILD_QTKEYCHAIN "Build QtKeychain" ON) option(BUILD_RAPIDJSON "Build RapidJSON library" ON) option(BUILD_SERIALIZE "Build Serialize library" ON) @@ -84,22 +83,15 @@ endif () if (BUILD_LIBCOMMUNI) ExternalProject_Add( LibCommuni - BUILD_IN_SOURCE 1 - #DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/libcommuni ${CMAKE_BINARY_DIR}/Source/LibCommuni - #UPDATE_COMMAND "" - GIT_REPOSITORY https://github.com/communi/libcommuni.git + GIT_REPOSITORY https://github.com/AnotherFoxGuy/libcommuni-cmake.git GIT_SHALLOW TRUE GIT_PROGRESS TRUE - #PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/libcommuni-patch.pro ${CMAKE_BINARY_DIR}/Source/LibCommuni/libcommuni.pro - #SOURCE_DIR "${CMAKE_SOURCE_DIR}/libcommuni" - CONFIGURE_COMMAND qmake - CONFIG+=$> - IRC_INSTALL_BINS=${DEPENDENCIES_OUTPUT_DIR}/bin - IRC_INSTALL_HEADERS=${DEPENDENCIES_OUTPUT_DIR}/include - IRC_INSTALL_LIBS=${DEPENDENCIES_OUTPUT_DIR}/lib - IRC_INSTALL_FEATURES=${DEPENDENCIES_OUTPUT_DIR}/features - BUILD_COMMAND $,nmake,make> - INSTALL_COMMAND $,nmake,make> install + CMAKE_ARGS + -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_OUTPUT_DIR} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} ) endif () diff --git a/lib/Libcommuni.cmake b/lib/Libcommuni.cmake deleted file mode 100644 index c57dcc626..000000000 --- a/lib/Libcommuni.cmake +++ /dev/null @@ -1,92 +0,0 @@ -project(LibCommuni) - -set(LibCommuni_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/lib/libcommuni/include/") -set(LibCommuni_SOURCE_DIR "${CMAKE_SOURCE_DIR}/lib/libcommuni/src/") - -# ------------------------------------------------------------------------------------------------# -# Core -# ------------------------------------------------------------------------------------------------# - -set(CORE_PUB_HEADERS - ${LibCommuni_INCLUDE_DIR}/IrcCore/irc.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/irccommand.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/ircconnection.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/irccore.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/ircfilter.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/ircglobal.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/ircmessage.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/ircnetwork.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/ircprotocol.h - ) - -set(CORE_PRIV_HEADERS - ${LibCommuni_INCLUDE_DIR}/IrcCore/irccommand_p.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/ircconnection_p.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/ircdebug_p.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/ircmessage_p.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/ircmessagecomposer_p.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/ircmessagedecoder_p.h - ${LibCommuni_INCLUDE_DIR}/IrcCore/ircnetwork_p.h - ) - -set(CORE_SOURCE_FILES - ${LibCommuni_SOURCE_DIR}/core/irc.cpp - ${LibCommuni_SOURCE_DIR}/core/irccommand.cpp - ${LibCommuni_SOURCE_DIR}/core/ircconnection.cpp - ${LibCommuni_SOURCE_DIR}/core/irccore.cpp - ${LibCommuni_SOURCE_DIR}/core/ircfilter.cpp - ${LibCommuni_SOURCE_DIR}/core/ircmessage.cpp - ${LibCommuni_SOURCE_DIR}/core/ircmessage_p.cpp - ${LibCommuni_SOURCE_DIR}/core/ircmessagecomposer.cpp - ${LibCommuni_SOURCE_DIR}/core/ircmessagedecoder.cpp - ${LibCommuni_SOURCE_DIR}/core/ircnetwork.cpp - ${LibCommuni_SOURCE_DIR}/core/ircprotocol.cpp - ${LibCommuni_SOURCE_DIR}/core/ircmessagedecoder_none.cpp - ${LibCommuni_SOURCE_DIR}/3rdparty/mozilla/rdf_utils.c - ) - - -add_library(Communi_Core ${CORE_PRIV_HEADERS} ${CORE_PUB_HEADERS} ${CORE_SOURCE_FILES}) -target_link_libraries(Communi_Core PRIVATE Qt5::Core Qt5::Network) -target_include_directories(Communi_Core PUBLIC "${LibCommuni_INCLUDE_DIR}/IrcCore/") -target_compile_definitions(Communi_Core PUBLIC IRC_STATIC IRC_NAMESPACE=Communi) -set_property(TARGET Communi_Core PROPERTY AUTOMOC ON) -set_property(SOURCE ${CORE_SOURCE_FILES} PROPERTY SKIP_AUTOMOC ON) - -# ------------------------------------------------------------------------------------------------# -# Model -# ------------------------------------------------------------------------------------------------# -file(GLOB_RECURSE MODEL_SOURCE_FILES CONFIGURE_DEPENDS LIST_DIRECTORIES false - "${CMAKE_SOURCE_DIR}/lib/libcommuni/src/core/*.cpp" - "${CMAKE_SOURCE_DIR}/lib/libcommuni/include/IrcModel/*.h" - ) - -add_library(Communi_Model ${MODEL_SOURCE_FILES}) -target_include_directories(Communi_Model PUBLIC "${LibCommuni_INCLUDE_DIR}/IrcModel/") -target_compile_definitions(Communi_Model PUBLIC IRC_STATIC IRC_NAMESPACE=Communi) -#set_property(TARGET Communi_Model PROPERTY AUTOMOC ON) - -# ------------------------------------------------------------------------------------------------# -# Util -# ------------------------------------------------------------------------------------------------# -file(GLOB_RECURSE UTIL_SOURCE_FILES CONFIGURE_DEPENDS LIST_DIRECTORIES false - "${CMAKE_SOURCE_DIR}/lib/libcommuni/src/core/*.cpp" - "${CMAKE_SOURCE_DIR}/lib/libcommuni/include/IrcUtil/*.h" - ) - -add_library(Communi_Util ${UTIL_SOURCE_FILES}) -target_include_directories(Communi_Util PUBLIC "${LibCommuni_INCLUDE_DIR}/IrcUtil/") -target_compile_definitions(Communi_Util PUBLIC IRC_STATIC IRC_NAMESPACE=Communi) -#set_property(TARGET Communi_Util PROPERTY AUTOMOC ON) - -set(LibCommuni_INCLUDE_DIRS ${LibCommuni_INCLUDE_DIR}/IrcCore/ ${LibCommuni_INCLUDE_DIR}/IrcModel/ ${LibCommuni_INCLUDE_DIR}/IrcUtil/) -set(LibCommuni_LIBRARIES ${Communi_Core} ${Communi_Model} ${Communi_Util}) - -add_library(LibCommuni::LibCommuni INTERFACE IMPORTED) -set_target_properties(LibCommuni::LibCommuni PROPERTIES - INTERFACE_LINK_LIBRARIES "${LibCommuni_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${LibCommuni_INCLUDE_DIRS}" - ) - - -