1
0
Fork 0

Use namespaced library aliases.

This commit is contained in:
John Preston 2019-11-21 17:39:27 +03:00
parent 118ce81dd4
commit 33612794c6
20 changed files with 180 additions and 15 deletions

View file

@ -4,15 +4,16 @@
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_subdirectory(qt)
add_subdirectory(openssl)
add_subdirectory(variant)
add_subdirectory(ranges)
add_subdirectory(auto_updates)
add_subdirectory(crash_reports)
add_subdirectory(gsl)
add_subdirectory(lz4)
add_subdirectory(crash_reports)
add_subdirectory(auto_updates)
add_subdirectory(zlib)
add_subdirectory(opus)
add_subdirectory(openal)
add_subdirectory(openssl)
add_subdirectory(opus)
add_subdirectory(qt)
add_subdirectory(ranges)
add_subdirectory(rlottie)
add_subdirectory(variant)
add_subdirectory(xxhash)
add_subdirectory(zlib)

View file

@ -5,17 +5,18 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_auto_updates INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_auto_updates ALIAS external_auto_updates)
if (WIN32)
add_subdirectory(lzma)
target_link_libraries(external_auto_updates
INTERFACE
external_lzma
desktop-app::external_lzma
)
else()
add_subdirectory(xz)
target_link_libraries(external_auto_updates
INTERFACE
external_xz
desktop-app::external_xz
)
endif()

View file

@ -5,6 +5,7 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_lzma INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_lzma ALIAS external_lzma)
target_include_directories(external_lzma SYSTEM
INTERFACE

View file

@ -5,16 +5,17 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_crash_reports INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_crash_reports ALIAS external_crash_reports)
if (WIN32)
add_subdirectory(breakpad)
target_link_libraries(external_crash_reports
INTERFACE
external_breakpad
desktop-app::external_breakpad
)
else()
target_link_libraries(external_crash_reports
INTERFACE
external_crashpad
desktop-app::external_crashpad
)
endif()

View file

@ -5,6 +5,7 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_breakpad INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_breakpad ALIAS external_breakpad)
target_include_directories(external_breakpad SYSTEM
INTERFACE

View file

@ -5,6 +5,7 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_gsl INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_gsl ALIAS external_gsl)
target_include_directories(external_gsl SYSTEM
INTERFACE

View file

@ -5,6 +5,7 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_lz4 OBJECT)
add_library(desktop-app::external_lz4 ALIAS external_lz4)
init_target(external_lz4 "(external)")
set(lz4_loc ${third_party_loc}/lz4/lib)

View file

@ -5,6 +5,7 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_openal INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_openal ALIAS external_openal)
target_include_directories(external_openal SYSTEM
INTERFACE

View file

@ -5,6 +5,7 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_openssl INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_openssl ALIAS external_openssl)
target_include_directories(external_openssl SYSTEM
INTERFACE

View file

@ -5,6 +5,7 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_opus INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_opus ALIAS external_opus)
target_include_directories(external_opus SYSTEM
INTERFACE

View file

@ -5,6 +5,7 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_qt INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_qt ALIAS external_qt)
if (LINUX)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)

View file

@ -5,6 +5,7 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_ranges INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_ranges ALIAS external_ranges)
target_include_directories(external_ranges SYSTEM
INTERFACE

119
external/rlottie/CMakeLists.txt vendored Normal file
View file

@ -0,0 +1,119 @@
# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_rlottie OBJECT)
add_library(desktop-app::external_rlottie ALIAS external_rlottie)
init_target(external_rlottie "(external)")
get_filename_component(src_loc . REALPATH)
set(rlottie_loc ${third_party_loc}/rlottie)
target_sources(external_rlottie
PRIVATE
${src_loc}/config/config.h
${rlottie_loc}/inc/rlottie.h
${rlottie_loc}/inc/rlottie_capi.h
${rlottie_loc}/inc/rlottiecommon.h
${rlottie_loc}/src/lottie/lottieanimation.cpp
${rlottie_loc}/src/lottie/lottieitem.cpp
${rlottie_loc}/src/lottie/lottieitem.h
${rlottie_loc}/src/lottie/lottiekeypath.cpp
${rlottie_loc}/src/lottie/lottiekeypath.h
${rlottie_loc}/src/lottie/lottieloader.cpp
${rlottie_loc}/src/lottie/lottieloader.h
${rlottie_loc}/src/lottie/lottiemodel.cpp
${rlottie_loc}/src/lottie/lottiemodel.h
${rlottie_loc}/src/lottie/lottieparser.cpp
${rlottie_loc}/src/lottie/lottieparser.h
${rlottie_loc}/src/lottie/lottieproxymodel.cpp
${rlottie_loc}/src/lottie/lottieproxymodel.h
${rlottie_loc}/src/vector/freetype/v_ft_math.cpp
${rlottie_loc}/src/vector/freetype/v_ft_math.h
${rlottie_loc}/src/vector/freetype/v_ft_raster.cpp
${rlottie_loc}/src/vector/freetype/v_ft_raster.h
${rlottie_loc}/src/vector/freetype/v_ft_stroker.cpp
${rlottie_loc}/src/vector/freetype/v_ft_stroker.h
${rlottie_loc}/src/vector/freetype/v_ft_types.h
# ${rlottie_loc}/src/vector/pixman/pixman-arm-neon-asm.h
# ${rlottie_loc}/src/vector/pixman/pixman-arm-neon-asm.S
${rlottie_loc}/src/vector/pixman/vregion.cpp
${rlottie_loc}/src/vector/pixman/vregion.h
${rlottie_loc}/src/vector/vbezier.cpp
${rlottie_loc}/src/vector/vbezier.h
${rlottie_loc}/src/vector/vbitmap.cpp
${rlottie_loc}/src/vector/vbitmap.h
${rlottie_loc}/src/vector/vbrush.cpp
${rlottie_loc}/src/vector/vbrush.h
${rlottie_loc}/src/vector/vcompositionfunctions.cpp
${rlottie_loc}/src/vector/vcowptr.h
${rlottie_loc}/src/vector/vdasher.cpp
${rlottie_loc}/src/vector/vdasher.h
${rlottie_loc}/src/vector/vdebug.cpp
${rlottie_loc}/src/vector/vdebug.h
${rlottie_loc}/src/vector/vdrawable.cpp
${rlottie_loc}/src/vector/vdrawable.h
${rlottie_loc}/src/vector/vdrawhelper.cpp
${rlottie_loc}/src/vector/vdrawhelper.h
${rlottie_loc}/src/vector/vdrawhelper_neon.cpp
${rlottie_loc}/src/vector/vdrawhelper_sse2.cpp
${rlottie_loc}/src/vector/velapsedtimer.cpp
${rlottie_loc}/src/vector/velapsedtimer.h
${rlottie_loc}/src/vector/vglobal.h
${rlottie_loc}/src/vector/vimageloader.cpp
${rlottie_loc}/src/vector/vimageloader.h
${rlottie_loc}/src/vector/vinterpolator.cpp
${rlottie_loc}/src/vector/vinterpolator.h
${rlottie_loc}/src/vector/vline.h
${rlottie_loc}/src/vector/vmatrix.cpp
${rlottie_loc}/src/vector/vmatrix.h
${rlottie_loc}/src/vector/vpainter.cpp
${rlottie_loc}/src/vector/vpainter.h
${rlottie_loc}/src/vector/vpath.cpp
${rlottie_loc}/src/vector/vpath.h
${rlottie_loc}/src/vector/vpathmesure.cpp
${rlottie_loc}/src/vector/vpathmesure.h
${rlottie_loc}/src/vector/vpoint.h
${rlottie_loc}/src/vector/vraster.cpp
${rlottie_loc}/src/vector/vraster.h
${rlottie_loc}/src/vector/vrect.cpp
${rlottie_loc}/src/vector/vrect.h
${rlottie_loc}/src/vector/vrle.cpp
${rlottie_loc}/src/vector/vrle.h
${rlottie_loc}/src/vector/vstackallocator.h
${rlottie_loc}/src/vector/vtaskqueue.h
)
target_compile_definitions(external_rlottie
PUBLIC
LOT_BUILD
PRIVATE
_USE_MATH_DEFINES
"RAPIDJSON_ASSERT=(void)"
)
target_include_directories(external_rlottie
PUBLIC
${rlottie_loc}/inc
PRIVATE
${src_loc}/config
${rlottie_loc}/src/lottie
${rlottie_loc}/src/vector
${rlottie_loc}/src/vector/pixman
${rlottie_loc}/src/vector/freetype
)
if (WIN32)
target_compile_options(external_rlottie
PRIVATE
/w44244 # 'initializing': conversion from 'double' to 'float'
/w44251 # needs to have dll-interface to be used by clients of class
)
endif()

25
external/rlottie/config/config.h vendored Normal file
View file

@ -0,0 +1,25 @@
// This file is part of Desktop App Toolkit,
// a set of libraries for developing nice desktop applications.
//
// For license and copyright information please follow this link:
// https://github.com/desktop-app/legal/blob/master/LEGAL
//
#ifndef CONFIG_H
#define CONFIG_H
// enable threading
#define LOTTIE_THREAD_SUPPORT
//enable logging
//#define LOTTIE_LOGGING_SUPPORT
//enable module building of image loader
//#define LOTTIE_IMAGE_MODULE_SUPPORT
//enable lottie model caching
//#define LOTTIE_CACHE_SUPPORT
// disable image loader
#define LOTTIE_IMAGE_MODULE_DISABLED
#endif // CONFIG_H

View file

@ -5,6 +5,7 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_variant INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_variant ALIAS external_variant)
target_include_directories(external_variant SYSTEM
INTERFACE

View file

@ -5,6 +5,7 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_xxhash INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_xxhash ALIAS external_xxhash)
target_include_directories(external_xxhash SYSTEM
INTERFACE

View file

@ -5,6 +5,7 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_zlib INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_zlib ALIAS external_zlib)
target_include_directories(external_zlib SYSTEM
INTERFACE

View file

@ -13,9 +13,14 @@ endfunction()
function(init_target target_name) # init_target(my_target folder_name)
init_target_folder(${target_name} "${ARGV1}")
if (WIN32)
set_property(TARGET ${target_name} PROPERTY
set_target_properties(${target_name} PROPERTIES
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
target_link_libraries(${target_name} PUBLIC common_options)
target_link_libraries(${target_name} PUBLIC desktop-app::common_options)
set_target_properties(${target_name} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE True
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO True
INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL True
)
endfunction()

View file

@ -5,6 +5,7 @@
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(common_options INTERFACE)
add_library(desktop-app::common_options ALIAS common_options)
target_compile_features(common_options
INTERFACE

View file

@ -29,7 +29,7 @@ INTERFACE
target_link_options(common_options
INTERFACE
/NODEFAULTLIB:LIBCMT
$<$<CONFIG:Debug>:/NODEFAULTLIB:LIBCMT>
)
target_link_libraries(common_options