Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/editors/diamond/files/patch-src_CMakeLists.txt
18157 views
1
--- src/CMakeLists.txt.orig 2021-01-28 22:43:22 UTC
2
+++ src/CMakeLists.txt
3
@@ -120,6 +120,8 @@ target_link_libraries(Diamond
4
CopperSpice::CsNetwork
5
)
6
7
+set(install_resource_dir ${CMAKE_INSTALL_DATADIR}/copperspice/diamond)
8
+
9
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
10
set_target_properties(Diamond PROPERTIES OUTPUT_NAME diamond)
11
12
@@ -160,7 +162,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
13
)
14
15
elseif(CMAKE_SYSTEM_NAME MATCHES "(Linux|OpenBSD|FreeBSD|NetBSD|DragonFly)")
16
- set_target_properties(Diamond PROPERTIES OUTPUT_NAME diamond)
17
+ set_target_properties(Diamond PROPERTIES OUTPUT_NAME diamond-cs)
18
19
find_package(PkgConfig)
20
pkg_check_modules(Hunspell IMPORTED_TARGET hunspell)
21
@@ -169,8 +171,9 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "(Linux|OpenBSD|FreeB
22
PRIVATE
23
PkgConfig::Hunspell
24
)
25
+ target_compile_definitions(Diamond PRIVATE DIAMOND_SHARE_DIR="${CMAKE_INSTALL_PREFIX}/${install_resource_dir}")
26
27
- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../resources/diamond.png DESTINATION .)
28
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../resources/diamond.png DESTINATION ${install_resource_dir})
29
30
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
31
32
@@ -198,28 +201,21 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
33
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../resources/diamond.ico DESTINATION .)
34
endif()
35
36
-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../source_extra/syntax/ DESTINATION syntax)
37
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../source_extra/syntax/ DESTINATION ${install_resource_dir}/syntax)
38
39
# installs English by default
40
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../source_extra/dictionary/en_US.aff DESTINATION dictionary)
41
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../source_extra/dictionary/en_US.dic DESTINATION dictionary)
42
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../source_extra/dictionary/en_US.aff DESTINATION ${install_resource_dir}/dictionary)
43
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../source_extra/dictionary/en_US.dic DESTINATION ${install_resource_dir}/dictionary)
44
45
-# will not overwrite dictionary/userDict.txt
46
-install(CODE "
47
- if (NOT EXISTS \"${CMAKE_INSTALL_PREFIX}/dictionary/userDict.txt \")
48
- file(INSTALL \"${CMAKE_CURRENT_SOURCE_DIR}/../source_extra/dictionary/userDict.txt\" DESTINATION \"${CMAKE_INSTALL_PREFIX}/dictionary\")
49
- endif()
50
-")
51
-
52
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
53
install(TARGETS Diamond DESTINATION ../MacOS)
54
else()
55
- install(TARGETS Diamond DESTINATION .)
56
+ install(TARGETS Diamond)
57
endif()
58
59
-cs_copy_library(CsCore)
60
-cs_copy_library(CsGui)
61
-cs_copy_library(CsNetwork)
62
+# cs_copy_library(CsCore)
63
+# cs_copy_library(CsGui)
64
+# cs_copy_library(CsNetwork)
65
66
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
67
# copy required plugins to the bundle
68
@@ -227,6 +223,6 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
69
cs_copy_plugins(CsPrinterDriver ../plugins)
70
else()
71
# installs required plugins
72
- cs_copy_plugins(CsGui)
73
- cs_copy_plugins(CsPrinterDriver)
74
+ # cs_copy_plugins(CsGui)
75
+ # cs_copy_plugins(CsPrinterDriver)
76
endif()
77
78