Comments (14)
+if(LINUX OR BSD)
Works perfectly.
Understand it about TREESHEETS_RELOCATABLE_INSTALLATION.
Related to:
-install(DIRECTORY TS/examples DESTINATION ${TREESHEETS_DOCDIR})
+install(DIRECTORY TS/examples DESTINATION ${CMAKE_INSTALL_DATADIR}/examples/ {CMAKE_PROJECT_NAME})
It has to do with our hier and ports framework:
DATADIR gets expanded to PREFIX/share/PORTNAME.
DOCSDIR gets expanded to PREFIX/share/doc/PORTNAME.
EXAMPLESDIR gets expanded to PREFIX/share/examples/PORTNAME.
cmake apears to not have a variable for examples like it do for doc, so I've patched it.
from treesheets.
Ok :-) Thanks for your feedback! Is it okay for you to keep the patch at your (port) side?
But if you keep it that way, does not TreeSheet complain about the missing example file? If you run treesheets on the commandline there should be a warning?
from treesheets.
Sure, not problem.
Thanks for help solving this issue.
from treesheets.
Thanks for posting this issue.
Does BSD implement the Hierarchical File System from Linux? If yes, then it can be fixed by adding BSD to the condition check.
from treesheets.
I don't think so from what I'm reading on https://wiki.freebsd.org/HFS
At version 7861249636 I didn't change values from CMakeLists.txt appart from sending examples to other dir, so it is a good start the check what changed.
from treesheets.
Sorry I meant Filesystem Hierarchy Standard.
from treesheets.
FreeBSD Unix don't conform with FHS and it is the first time that I'm seing it being configured in cmake:
https://man.freebsd.org/cgi/man.cgi?hier(7)
from treesheets.
First approach: Follow the Filesystem Hierarchy Standard also on BSD.
You may seem to use it anyway in your patch, because when you include(GNUInstallDirs)
, you follow the Filesystem Hierarchy Standard, meaning that you put the documentation into $CMAKE_INSTALL_PREFIX/share/doc/
... during installation (e.g. when you use make install
or cmake --install <builddir>
).
In this case: Does it help to only replace LINUX
with BSD
in CMakeLists.txt
, not keeping the original patch? You may need to clean up the CMake cache, too. (That means removing CMakeCache.txt and then re-generate the Makefiles with CMake).
Second approach: Keep everything relative to the TreeSheets binary (this is just the case on every operating system apart from Linux where TREESHEETS_RELOCATABLE_INSTALLATION
is not set, thus following the Filesystem Hierarchy Standard). In this case, you should leave the CMakeLists.txt
as is from upstream without patching it and configure CMAKE_INSTALL_PREFIX
to a suitable location where it does not interfere with the root filesystem hierarchy. You need to check then that examples
and images
directories are installed relative to/along with the TreeSheets binary.
When you change between the two approaches, please remind to also clean the CMake Cache because otherwise the variables TREESHEETS_DOCDIR
etc. will be left over (the variables indicate absolute paths in the case of the Filesystem Hierarchy Standard used). These are used by the preprocessor to determine whether it should consider these paths, too or only the paths relative to the binary.
from treesheets.
@t2b3
It worked fine! I've run so many tests and even so I did missed something.
My test patch is:
--- CMakeLists.txt.orig 2024-03-28 08:00:11 UTC
+++ CMakeLists.txt
@@ -99,7 +99,7 @@ endif()
OPTION(TREESHEETS_RELOCATABLE_INSTALLATION "Install data relative to the treesheets binary, instead of respecting the Filesystem Hierarchy Standard" OFF)
endif()
-if(LINUX AND NOT TREESHEETS_RELOCATABLE_INSTALLATION)
+if(NOT LINUX AND NOT TREESHEETS_RELOCATABLE_INSTALLATION)
include(GNUInstallDirs)
set(TREESHEETS_BINDIR ${CMAKE_INSTALL_BINDIR})
@@ -125,7 +125,7 @@ install(FILES TS/readme.html DESTINATION ${TREESHEETS_
install(TARGETS treesheets DESTINATION ${TREESHEETS_BINDIR})
install(DIRECTORY TS/docs DESTINATION ${TREESHEETS_DOCDIR})
install(FILES TS/readme.html 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})
So, for my understanding FreeBSD could be added to this block.
from treesheets.
Thanks for your reply! Happy to hear that it works.
One more question: Is it sufficient to patch the CMakeLists.txt with the patch below to make it work on FreeBSD?
I am curious whether and why it is needed to patch the install destination for TS/examples
because in the branch now used TREESHEETS_DOCDIR
is now set and thus that path is considered by the compiler preprocessor and thus hardcoded as candidate into the candidate path array for the TreeSheets example files, like tutorial, into the binary.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 576cf3f..84d0f57 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -95,11 +95,11 @@ target_link_libraries(
########## TREESHEETS INSTALLATION SETTINGS ###############
-if(LINUX)
+if(LINUX OR FREEBSD)
OPTION(TREESHEETS_RELOCATABLE_INSTALLATION "Install data relative to the treesheets binary, instead of respecting the Filesystem Hierarchy Standard" OFF)
endif()
-if(LINUX AND NOT TREESHEETS_RELOCATABLE_INSTALLATION)
+if((LINUX OR FREEBSD) AND NOT TREESHEETS_RELOCATABLE_INSTALLATION)
include(GNUInstallDirs)
set(TREESHEETS_BINDIR ${CMAKE_INSTALL_BINDIR})
from treesheets.
+if(LINUX OR FREEBSD)
Adding FREEBSD like this doesn't work (all files get installed into cmake install prefix).
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" seems the right setting, don't know if a generic one exists for *bsd.
Don't know if TREESHEETS_RELOCATABLE_INSTALLATION will have any use on FreeBSD...
from treesheets.
Ok, what about BSD
then directly? Sorry, you are completely right!
https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 576cf3f..0ed952d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -95,11 +95,11 @@ target_link_libraries(
########## TREESHEETS INSTALLATION SETTINGS ###############
-if(LINUX)
+if(LINUX OR BSD)
OPTION(TREESHEETS_RELOCATABLE_INSTALLATION "Install data relative to the treesheets binary, instead of respecting the Filesystem Hierarchy Standard" OFF)
endif()
-if(LINUX AND NOT TREESHEETS_RELOCATABLE_INSTALLATION)
+if((LINUX OR BSD) AND NOT TREESHEETS_RELOCATABLE_INSTALLATION)
include(GNUInstallDirs)
set(TREESHEETS_BINDIR ${CMAKE_INSTALL_BINDIR})
from treesheets.
+if(LINUX OR FREEBSD)
Adding FREEBSD like this doesn't work (all files get installed into cmake install prefix).
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" seems the right setting, don't know if a generic one exists for *bsd.
Don't know if TREESHEETS_RELOCATABLE_INSTALLATION will have any use on FreeBSD...
Yes, I think it has its use case if you do not want to install it directly to the /usr/
hierarchy, but e.g. only to install it somewhere in your home directory (adjust CMAKE_INSTALL_PREFIX
for it) and/or if you want to keep everything (binary, translation, documentation, tutorial) in one folder and move it around. Then relocatable install is needed. But normally packages distributed by the distribution should integrate directly with the Filesystem Hierarchy Standard structure, so and that case it is not needed.
from treesheets.
Sure, not problem.
Thanks for help solving this issue.
You are welcome.
from treesheets.
Related Issues (20)
- Orientation of the program interface HOT 3
- The editing view is inconsistent with the preview and export views HOT 4
- Exported csv file code irrecognized HOT 3
- Cell content does not follow cell widening after narrowing HOT 5
- F7 not working to toggle text placement to above or beside grids HOT 3
- Bug: cursor position wrong on Windows 10 when not using default font HOT 1
- Make sub-grids use all available width for a large number of them -- possible? HOT 2
- TreeSheets freezes when I try to import file HOT 3
- Material icons all look the same HOT 5
- [Feature request] Copy table as CSV HOT 1
- /usr/bin/ld: lib/wxWidgets/lib/libwx_gtk3u_core-3.3.a(utilsx11.cpp.o): undefined reference to symbol 'XGetWindowAttributes'
- I propose a translation of the RU help file... HOT 15
- How are the colors in xml coded? HOT 4
- Does TS honor attribute-sets in the xml import? HOT 2
- XML export>import loses formatting HOT 8
- Latest binaries mising libtiff.so.5 HOT 6
- Inconsistency when coloring cell with "apply last cell color" and "open cell colors"
- Suggestion: Version number in "About..." window, semantic versioning HOT 2
- Possible to support wxGTK 3.0? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from treesheets.