-
Notifications
You must be signed in to change notification settings - Fork 663
/
THEME.cmake
57 lines (45 loc) · 1.99 KB
/
THEME.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
if(WITH_EXTERNAL_BRANDING)
include(FetchContent)
FetchContent_Declare(branding
GIT_REPOSITORY ${WITH_EXTERNAL_BRANDING}
GIT_TAG main
)
FetchContent_MakeAvailable(branding)
set(OEM_THEME_DIR ${branding_SOURCE_DIR} CACHE STRING "The directory containing a custom theme")
else()
if (EXISTS "${PROJECT_SOURCE_DIR}/branding")
set(OEM_THEME_DIR "${PROJECT_SOURCE_DIR}/branding" CACHE STRING "The directory containing a custom theme")
else()
set(OEM_THEME_DIR "${PROJECT_SOURCE_DIR}/src/resources/" CACHE STRING "Define directory containing a custom theme")
endif()
endif()
if (EXISTS "${OEM_THEME_DIR}/OEM.cmake")
include("${OEM_THEME_DIR}/OEM.cmake")
else()
include ("${CMAKE_CURRENT_LIST_DIR}/OWNCLOUD.cmake")
endif()
message(STATUS "Branding: ${APPLICATION_NAME}")
# Default suffix if the theme doesn't define one
if(NOT DEFINED APPLICATION_VIRTUALFILE_SUFFIX)
set(APPLICATION_VIRTUALFILE_SUFFIX "${APPLICATION_SHORTNAME}_virtual" CACHE STRING "Virtual file suffix (not including the .)")
endif()
# need this logic to not mess with re/uninstallations via macosx.pkgproj
if(${APPLICATION_REV_DOMAIN} STREQUAL "com.owncloud.desktopclient")
set(APPLICATION_REV_DOMAIN_INSTALLER "com.ownCloud.client")
else()
set(APPLICATION_REV_DOMAIN_INSTALLER ${APPLICATION_REV_DOMAIN})
endif()
# For usage in XML files we preprocess
string(REPLACE "&" "&" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME}")
string(REPLACE "<" "<" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME_XML_ESCAPED}")
string(REPLACE ">" ">" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME_XML_ESCAPED}")
if (NOT DEFINED LINUX_PACKAGE_SHORTNAME)
set(LINUX_PACKAGE_SHORTNAME "${APPLICATION_SHORTNAME}")
endif()
if (NOT DEFINED PACKAGE)
set(PACKAGE "${LINUX_PACKAGE_SHORTNAME}-client")
endif()
if(NOT CRASHREPORTER_EXECUTABLE)
set(CRASHREPORTER_EXECUTABLE "${APPLICATION_EXECUTABLE}_crash_reporter")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/VERSION.cmake")