aboutsummaryrefslogtreecommitdiffstats
path: root/deskutils/treesheets/files/patch-CMakeLists.txt
blob: b9993f8df96e6d7ee14d9676eff3494a7fc26fbe (plain) (blame)
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
58
Build with system wx workaround:
https://github.com/aardappel/treesheets/issues/1083

--- CMakeLists.txt.orig	2025-11-24 18:18:51 UTC
+++ CMakeLists.txt
@@ -7,7 +7,7 @@ endif()
     set(TREESHEETS_VERSION "${timestamp}")
 endif()
 
-project(TreeSheets
+project(treesheets
     DESCRIPTION "A free-form hierarchical data organizer"
     HOMEPAGE_URL "https://github.com/aardappel/treesheets"
     VERSION "${TREESHEETS_VERSION}")
@@ -32,19 +32,12 @@ FetchContent_Declare(
 
 include(FetchContent)
 FetchContent_Declare(
-    wxwidgets
-    GIT_REPOSITORY https://github.com/wxWidgets/wxWidgets
-    GIT_TAG v3.2.8
-    GIT_SHALLOW ON
-    FIND_PACKAGE_ARGS 3.2.8 NAMES wxWidgets
-)
-FetchContent_Declare(
     lobster
     GIT_REPOSITORY https://github.com/aardappel/lobster
     GIT_TAG v2025.4
     GIT_SHALLOW ON
 )
-FetchContent_MakeAvailable(wxwidgets lobster)
+FetchContent_MakeAvailable(lobster)
 
 ### Options
 
@@ -145,7 +138,12 @@ target_precompile_headers(TreeSheets PUBLIC src/stdafx
 target_precompile_headers(TreeSheets PUBLIC src/stdafx.h)
 
 ## Link wxWidgets, lobster-impl and StackWalker into TreeSheets
-set(TREESHEETS_LIBS wx::aui wx::adv wx::core wx::xml wx::net lobster-impl)
+find_package(wxWidgets REQUIRED COMPONENTS aui adv core xml net)
+set(TREESHEETS_LIBS ${wxWidgets_LIBRARIES} lobster-impl)
+target_link_libraries(TreeSheets PRIVATE ${TREESHEETS_LIBS})
+target_include_directories(TreeSheets PRIVATE ${wxWidgets_INCLUDE_DIRS})
+target_compile_definitions(TreeSheets PRIVATE ${wxWidgets_DEFINITIONS})
+# https://github.com/aardappel/treesheets/issues/1083
 if(WIN32)
     list(APPEND TREESHEETS_LIBS StackWalker)
 endif()
@@ -195,7 +193,7 @@ install(FILES ${treesheets_readme_files} DESTINATION $
 install(DIRECTORY TS/docs DESTINATION ${TREESHEETS_DOCDIR})
 file(GLOB treesheets_readme_files "TS/readme*.html")
 install(FILES ${treesheets_readme_files} DESTINATION ${TREESHEETS_DOCDIR})
-install(DIRECTORY TS/examples DESTINATION ${TREESHEETS_DOCDIR})
+install(DIRECTORY TS/examples DESTINATION ${CMAKE_INSTALL_DATADIR}/examples/${CMAKE_PROJECT_NAME})
 
 install(DIRECTORY TS/images DESTINATION ${TREESHEETS_PKGDATADIR})
 install(DIRECTORY TS/scripts DESTINATION ${TREESHEETS_PKGDATADIR})