Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CMake packaging and test with examples #42

Merged
merged 1 commit into from
Oct 14, 2023

Conversation

ntadej
Copy link
Collaborator

@ntadej ntadej commented Oct 14, 2023

Improve how CMake package is exported. Now one does

find_package(QMapLibre COMPONENTS Core REQUIRED)

or

find_package(QMapLibre COMPONENTS Widgets REQUIRED)

Also update and cleanup the examples and test the installation using them.

@birkskyum, you can start using the widgets example for WASM. Separately I'll prepare a branch for the unstable WASM experiments.

@ntadej ntadej force-pushed the targets-examples branch 2 times, most recently from 8a7a67d to 297c928 Compare October 14, 2023 19:03
@ntadej ntadej merged commit 5dbd98a into maplibre:main Oct 14, 2023
7 checks passed
@ntadej ntadej deleted the targets-examples branch October 14, 2023 19:56
@birkskyum
Copy link
Member

@birkskyum, you can start using the widgets example for WASM.

doesn't that require this experimental singleton as well?

@ntadej
Copy link
Collaborator Author

ntadej commented Oct 14, 2023

Yes, but while you're waiting, you may as well already try to build with this setup. Just changing the branch later will be very fast (especially if you use ccache).

@birkskyum
Copy link
Member

birkskyum commented Oct 14, 2023

Hmm, so I clone maplibre-native-qt, and then from a sibling folder run something like this? How do I specify which executable to build?

qt-cmake ../maplibre-native-qt \   
-G Ninja \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DMLN_WITH_QT=ON \
-DMLN_QT_STATIC=ON \
-DMLN_QT_WITH_INTERNAL_SQLITE=ON

ninja

ninja install

emrun --browser=chrome appname.html (do I build/link all executables, and select here?)

@ntadej
Copy link
Collaborator Author

ntadej commented Oct 14, 2023

See the README 😉

First you build MapLibre with

mkdir build && cd build
cmake ../maplibre-native-qt -GNinja \
  -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
  -DCMAKE_C_COMPILER_LAUNCHER="ccache" \
  -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
  -DCMAKE_INSTALL_PREFIX="../install" \
  -DMLN_QT_WITH_INTERNAL_SQLITE=ON
ninja
ninja install

Then you build the widgets example

mkdir build-example && cd build-example
qt-cmake ../maplibre-native-qt/examples/widgets -GNinja \
  -DCMAKE_C_COMPILER_LAUNCHER="ccache" \
  -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
  -DCMAKE_PREFIX_PATH="<absolute-path-to-install>"
ninja

@ntadej ntadej added this to the 3.0 milestone Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants