-
Notifications
You must be signed in to change notification settings - Fork 14
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
Allow using custom mir libraries directory #198
Changes from 3 commits
d68b9aa
ae7912c
6c2dedc
4aa767b
5a298d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,15 @@ set(CMAKE_CXX_STANDARD 23) | |
set(CMAKE_CXX_EXTENSIONS OFF) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
set(ENV{PKG_CONFIG_PATH} "/usr/local/lib/pkgconfig/") | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
|
||
set(MIR_LIBRARIES_PKGCONFIG_DIRECTORY "" CACHE STRING "Search for Mir libraries pc files in this directory") | ||
option(SNAP_BUILD "Building as a snap?" OFF) | ||
|
||
set(ENV{PKG_CONFIG_PATH} "${MIR_LIBRARIES_PKGCONFIG_DIRECTORY}:/usr/local/lib/pkgconfig/") | ||
|
||
find_package(PkgConfig) | ||
pkg_check_modules(MIRAL miral REQUIRED) | ||
pkg_check_modules(MIROIL miroil REQUIRED) | ||
|
@@ -24,6 +26,7 @@ pkg_check_modules(MIRCOMMON mircommon REQUIRED) | |
pkg_check_modules(MIRCOMMON_INTERNAL mircommon-internal REQUIRED) | ||
pkg_check_modules(MIRSERVER mirserver REQUIRED) | ||
pkg_check_modules(MIRSERVER_INTERNAL mirserver-internal REQUIRED) | ||
pkg_check_modules(MIRWAYLAND mirwayland REQUIRED) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why would Mirwayland be required here? I don't remember using it in the project anywhere There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's only required at link time, otherwise building fails with /usr/bin/ld: warning: libmirwayland.so.5, needed by <mir_install_directory>/lib/libmirplatform.so, not found (try using -rpath or -rpath-link) and a bunch of undefined symbols. Maybe
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah okay that's probably an issue on their end, but I am happy to patch it on our end in the meantime. Filed the bug: canonical/mir#3536 |
||
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) | ||
pkg_check_modules(YAML REQUIRED IMPORTED_TARGET yaml-cpp) | ||
pkg_check_modules(LIBEVDEV REQUIRED IMPORTED_TARGET libevdev) | ||
|
@@ -91,6 +94,7 @@ target_link_libraries(miracle-wm-implementation | |
${MIRPLATFORM_LDFLAGS} | ||
${MIRSERVER_LDFLAGS} | ||
${MIRSERVER_INTERNAL_LDFLAGS} | ||
${MIRWAYLAND_LDFLAGS} | ||
PkgConfig::YAML | ||
PkgConfig::GLIB | ||
PkgConfig::LIBEVDEV | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks any existing
PKG_CONFIG_PATH
setup.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry. The pre-existing code already broke it, and I see this was supposed to close the issue for this: #196
Why is setting
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
and further messing around with it in CMake even necessary, is something wrong with some build environment somewhere? I feel like this setup should just be left to whatever build environment CMake is executed in, prepending a custom Mir path as desired.Submitted #211 to instead use the existing
ENV{PKG_CONFIG_PATH}
, or set/usr/local/lib/pkgconfig
as a fallback if it's empty.