silverqx / TinyORM

Modern C++ ORM library
https://www.tinyorm.org
MIT License
242 stars 25 forks source link

Tom application referenced in TinyORM: Getting Started but not getting installed #19

Closed SchaichAlonso closed 1 year ago

SchaichAlonso commented 1 year ago

The TinyORM: Getting Started page of the documentation is referring a tom binary.

This tom binary can be compiled by passing -DTOM_EXAMPLE=On to cmake before building TinyORM, but after compilation won't be installed along with TinyORM. Further, it will be placed into

${${TinyOrm_ns}_BINARY_DIR}/examples/tom/$<CONFIG>

of the build path, while the TinyORM DLL resides in

${${TinyOrm_ns}_BINARY_DIR}/$<CONFIG>

i.e. requires PATH / LD_LIBRARY_PATH to be modified to contain the DLL path.

If TOM_EXAMPLE is set, the tom binary should be installed as part of TinyORM to use a standardized binary path, resolve the DLL issue, and not require a TinyORM build directory in order to progress through the getting started section.

silverqx commented 1 year ago

I'm using these pwsh scripts to fastly export debug, release, ... buildtrees on the system path: std.zip

Add-FolderOnPath.ps1 is also part of TinyORM/tools/.

You are right, Tom example isn't installed now, I don't even know if I want to install it, may be yes, but I need to investigate how it interferes with the vcpkg port. Or eg. where to install them on Linux, maybe they should be installed to the /usr/share/tinyorm/examples/? I'm not sure about this. Also I'm not sure if examples should be installed to the /usr/bin or /usr/local/bin.

If I think about it, example applications shouldn't be installed into the bin/? Now I have looked eg. to the libtorrent-rasterbar and it also doesn't install example applications. I'm not sure now how examples should be handled and need to look at how other libraries are doing it.

I personally don't use install, I'm always working with buildtrees and for everything else I'm writing pwsh or bash scripts, eg. deployment or adding things on path.

I will think about it.

SchaichAlonso commented 1 year ago

Most projects would install their demo binaries into ${CMAKE_INSTALL_PREFIX}/bin, and example source code into ${CMAKE_INSTALL_PREFIX}/share/examples/$projectname if source is installed at all.

When building packages, distrubutors normally configure CMAKE_INSTALL_PREFIX to point to a sandbox environment, build and install the project there, and then generate a package containing the contents of the sandbox after the installation step finished. The path a package is finally extracted into when it is installed is determined by the distribution guidelines to decide

silverqx commented 1 year ago

ok, good to know

silverqx commented 1 year ago

Fixed in #8a9cb9b