From 4db23a21f338ec5d839ba63d02d6e6bdaf5ea3df Mon Sep 17 00:00:00 2001 From: APTX Date: Fri, 24 Nov 2017 21:29:10 +0900 Subject: [PATCH] Add option to use shared dlib target --- CMakeLists.txt | 3 +++ featureplugins/feature_annotations/CMakeLists.txt | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 67a0b92..c27aec8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 3.8 FATAL_ERROR) include(FeatureSummary) +include(CMakeDependentOption) project(AniPlayer) @@ -17,6 +18,8 @@ add_feature_info(FeatureLocalMyList WITH_FEATURE_LOCALMYLIST "automatically mark option(WITH_FEATURE_ANNOTATIONS "Build annotations feature plugin" ON) add_feature_info(FeatureAnnotations WITH_FEATURE_ANNOTATIONS "annotate certain features in the video") +cmake_dependent_option(USE_SHARED_DLIB "Use shared dlib" OFF "WITH_FEATURE_ANNOTATIONS" OFF) + add_subdirectory(pluginapi) add_subdirectory(core) add_subdirectory(backendplugins) diff --git a/featureplugins/feature_annotations/CMakeLists.txt b/featureplugins/feature_annotations/CMakeLists.txt index a9a098a..5405698 100644 --- a/featureplugins/feature_annotations/CMakeLists.txt +++ b/featureplugins/feature_annotations/CMakeLists.txt @@ -8,10 +8,16 @@ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS find_package(dlib CONFIG REQUIRED) +if(USE_SHARED_DLIB) + set(DLIB_LIBRARY_NAME "dlib::dlib_shared") +else() + set(DLIB_LIBRARY_NAME "dlib::dlib") +endif() + set(feature_annotations_LIBS Qt5::Core Qt5::Gui - dlib::dlib + ${DLIB_LIBRARY_NAME} pluginapi ) -- 2.52.0