-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake: Support building as shared library / QML module. #35
base: master
Are you sure you want to change the base?
Conversation
@benlau Hi! I am currently packaging this project for Debian as it is needed to bring to Ubuntu Touch apps to Debian: telePORTS (a Telegram chat client) and Dekko2 (an email client). For this, I need to be able to build quickflux as a shared library / QML module (rather then linking it into the application statically at build-time). In this PR find a patch, that should achieve this (note: I haven't tested it yet, will do so soon). |
CMakeLists.txt
Outdated
@@ -6,8 +6,15 @@ | |||
cmake_minimum_required(VERSION 3.0.0) | |||
project(quickflux VERSION 1.1.3) | |||
|
|||
option(quickflux_INSTALL "Enable the installation of targets." ON) | |||
option(quickflux_BUILD_SHARED "Build as shared library" OFF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should define BUILD_SHARED_LIBS
, the CMake-integrated way of controlling this? https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html
CMakeLists.txt
Outdated
|
||
if(quickflux_BUILD_SHARED) | ||
SET(SOVERSION_MAJOR 1) | ||
SET(SOVERSION_MINOR 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Project version above is 1.1.3, where does the 0 here come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ouch! Typo.
CMakeLists.txt
Outdated
) | ||
add_library(QuickFlux::quickflux ALIAS quickflux) | ||
if(quickflux_BUILD_SHARED) | ||
add_library(quickflux SHARED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See question about BUILD_SHARED_LIBS
above, that would alleviate the need for duplicating all of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OPNA2608 You are a much better CMake dev than I am. Could you come up with a follow-up PR bringing this more into harmony?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Submitted as a PR to this branch: sunweaver#1
- Use
BUILD_SHARED_LIBS
for determining static/dynamic library - Directly use
PROJECT_VERSION
for library versioning - Configure
qmldir
with@ONLY
(option name mangled so GitHub doesn't ping a random person)
d41bfa9
to
a29c4d0
Compare
No description provided.