diff options
author | ConfuSomu | 2024-01-08 08:45:17 +0100 |
---|---|---|
committer | ConfuSomu | 2024-01-08 08:45:17 +0100 |
commit | 2ae3c4cd7a4d5678f89f9e104571a934418ea265 (patch) | |
tree | 4d39af7381df4db44db6a0b20b88c083a80ef3a3 /CMakeLists.txt | |
parent | 58240fa2e1ac4234cf67374349ce606f1b6df643 (diff) | |
download | ActorViewer-2ae3c4cd7a4d5678f89f9e104571a934418ea265.tar ActorViewer-2ae3c4cd7a4d5678f89f9e104571a934418ea265.tar.gz ActorViewer-2ae3c4cd7a4d5678f89f9e104571a934418ea265.zip |
Make mastodonpp support configurable
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 68c3d28..a81928c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,12 +15,17 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # For Kate's LSP find_package(QT NAMES Qt5 REQUIRED COMPONENTS Widgets Concurrent) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Concurrent) -find_package(mastodonpp REQUIRED) +# Compile option for mastodonpp support +option(MASTODONPP_BUILD "Build a version with mastodonpp support" ON) + +if(MASTODONPP_BUILD) + find_package(mastodonpp REQUIRED) +endif() # Get Git commit hash, from http://xit0.org/2013/04/cmake-use-git-branch-and-commit-details-in-project/ # Get a human-readable name of the latest commit on the current branch execute_process( - COMMAND git log -1 --format=%(describe) + COMMAND git log -1 "--format=%(describe)" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GIT_DESCRIBE_TEXT OUTPUT_STRIP_TRAILING_WHITESPACE @@ -75,8 +80,6 @@ set(PROJECT_SOURCES src/command_line.h src/net/instance.cpp src/net/instance.h - src/net/mastodon_instance.cpp - src/net/mastodon_instance.h src/activitypub/fields.h src/activitypub/apactivity.h src/activitypub/apactor.h @@ -96,6 +99,13 @@ set(PROJECT_SOURCES src/activitypub/apquestion.cpp ) +if(MASTODONPP_BUILD) + list(APPEND PROJECT_SOURCES + src/net/mastodon_instance.cpp + src/net/mastodon_instance.h + ) +endif() + if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) qt_add_executable(ActorViewer MANUAL_FINALIZATION @@ -119,6 +129,10 @@ else() endif() endif() +if(MASTODONPP_BUILD) + target_compile_definitions(ActorViewer PRIVATE MASTODONPP_BUILD) +endif() + configure_file(gen/git_version.h.in gen/git_version.h) target_include_directories(ActorViewer PRIVATE gen) |