Giter Club home page Giter Club logo

Comments (12)

jheaff1 avatar jheaff1 commented on June 3, 2024 1

Apologies I was incorrect in my original description, the CMake output structure looks like:

include/osmscout
include/osmscoutclientqt
include/osmscoutmap
include/osmscoutmapqt

In this comment, @Framstag, your meson build would generate an output structure like:

include/libosmscout
include/libosmscout-client-qt
include/libosmscout-map
include/libosmscout-map-qt

This would result in unresolved includes in dependant projects

from libosmscout.

Framstag avatar Framstag commented on June 3, 2024

The meson install_headers command has a subdir parameter that allows to fix this.

Example for qt:

install_headers(osmscoutmapqtHeader, subdir : 'libosmscout-map-qt')

results in:

...
Installing /home/tim/projects/libosmscout/libosmscout-map-qt/include/osmscoutmapqt/MapQtImportExport.h to /usr/local/include/libosmscout-map-qt/
...

If you additional add preserve_path : true, this will result in:

...
Installing /home/tim/projects/libosmscout/libosmscout-map-qt/include/osmscoutmapqt/MapQtImportExport.h to /usr/local/include/libosmscout-map-qt/osmscoutmapqt
...

I'll have to check what the CMake installation does. Both build systems should result to the same structure.

from libosmscout.

Framstag avatar Framstag commented on June 3, 2024

It looks like the CMake build does similar (though not for all libraries?):

	install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscout DESTINATION include FILES_MATCHING PATTERN "*.h" PATTERN "private" EXCLUDE)

@Karry , @jheaff1 : Any opinions against using version two (subdir and preserve) of the meson install above?

from libosmscout.

Karry avatar Karry commented on June 3, 2024

On Linux, CMake install directory structure looks like this (relative to install prefix):

./bin
./share/osmscout (stylesheets, shaders, fonts, demos, OSMScout2, docs, tests)
./lib/cmake/libosmscout

./include/osmscout
./include/osmscoutimport
./include/osmscoutgpx
./include/osmscoutmap
./include/osmscoutmapagg
./include/osmscoutmapcairo
./include/osmscoutmapopengl
./include/osmscoutmapqt
./include/osmscoutmapsvg
./include/osmscoutclientqt
./include/osmscout-test

So the only problem is that Meson is using directory names with dash, right? Or is there anything wrong on CMake install dir structure?

from libosmscout.

jheaff1 avatar jheaff1 commented on June 3, 2024

On Linux, CMake install directory structure looks like this (relative to install prefix):


./bin

./share/osmscout (stylesheets, shaders, fonts, demos, OSMScout2, docs, tests)

./lib/cmake/libosmscout



./include/osmscout

./include/osmscoutimport

./include/osmscoutgpx

./include/osmscoutmap

./include/osmscoutmapagg

./include/osmscoutmapcairo

./include/osmscoutmapopengl

./include/osmscoutmapqt

./include/osmscoutmapsvg

./include/osmscoutclientqt

./include/osmscout-test

So the only problem is that Meson is using directory names with dash, right? Or is there anything wrong on CMake install dir structure?

Yeah that's right. The CMake install dir structure is fine, the issue is that the meson install structure has a "lib" prefix and has dashes in the name. It needs to match the CMake install dir structure exactly

from libosmscout.

Framstag avatar Framstag commented on June 3, 2024

As you can see from https://mesonbuild.com/Reference-manual_functions.html#install_headers meson is flexible regarding the naming and structure.

The current code in master does not set subdir and uses the default for preserve_path, which is false. This is wrong.

IMHO, we should set preserve_path to true and the value of the subdir attribute should be in line with the cmake files. As I assume this is the dashed subdirectory name I set it accordingly, but seems, I'm wrong. From your input regarding the cmake structure, subdir should stay empty. Correct?

One can easily check what would happen by calling meson install --dry-run in the build directory. I can make a pull request, just tell me which values you want and will work ;-)

Btw., should the meson build also create *.pc files?

from libosmscout.

Karry avatar Karry commented on June 3, 2024

Yes, preserve_path: true helps. But it is supported with Meson 0.63.0 and newer... I also synced installation directories of demos and tests: #1378

from libosmscout.

Framstag avatar Framstag commented on June 3, 2024

You mean, it is supported since 0.63.0?

from libosmscout.

Karry avatar Karry commented on June 3, 2024

Yes, exactly ;-)

from libosmscout.

jheaff1 avatar jheaff1 commented on June 3, 2024

As you can see from https://mesonbuild.com/Reference-manual_functions.html#install_headers meson is flexible regarding the naming and structure.

The current code in master does not set subdir and uses the default for preserve_path, which is false. This is wrong.

IMHO, we should set preserve_path to true and the value of the subdir attribute should be in line with the cmake files. As I assume this is the dashed subdirectory name I set it accordingly, but seems, I'm wrong. From your input regarding the cmake structure, subdir should stay empty. Correct?

One can easily check what would happen by calling meson install --dry-run in the build directory. I can make a pull request, just tell me which values you want and will work ;-)

Btw., should the meson build also create *.pc files?

Thank you very much. I'm not familiar with meson so can my really offer any help there, but as long as the output install structure matches that of the cmake build, client applications should be able to include osmscout header files with no issue :

from libosmscout.

Framstag avatar Framstag commented on June 3, 2024

The change by @Karry was merged. Can you close the issue, if it was resolved for you?

from libosmscout.

jheaff1 avatar jheaff1 commented on June 3, 2024

Thank you very much for resolving this issue so quickly!

from libosmscout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.