Skip to content

Commit

Permalink
Allow using custom mir libraries directory (#198)
Browse files Browse the repository at this point in the history
* allow using custom mir libraries directory

* update cmake options ordering to improve readability

* CI: install libmirwayland-dev

* CI: install libmirwayland-dev
  • Loading branch information
TibboddiT committed Aug 9, 2024
1 parent ea33fb1 commit ea8c9db
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 --slave /usr/bin/g++ g++ /usr/bin/g++-13
sudo apt install libmiral-dev libmircommon-internal-dev libmircommon-dev libmirserver-internal-dev \
libgtest-dev libyaml-cpp-dev libglib2.0-dev libevdev-dev nlohmann-json3-dev libnotify-dev pcre2-utils \
libmiroil-dev libmirrenderer-dev libgles2-mesa-dev
libmiroil-dev libmirrenderer-dev libgles2-mesa-dev libmirwayland-dev
- name: Configure CMake
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ parts:
- libnotify-dev
- libgles2-mesa-dev
- libmirrenderer-dev
- libmirwayland-dev
stage-packages:
- libmiral7
- libmiroil5
Expand Down
5 changes: 5 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ pkg_check_modules(MIRSERVER mirserver REQUIRED)
find_package(GTest REQUIRED)
pkg_check_modules(YAML REQUIRED IMPORTED_TARGET yaml-cpp)

if(MIR_LIBRARIES_PKGCONFIG_DIRECTORY)
list( PREPEND CMAKE_INSTALL_RPATH ${MIRAL_LIBRARY_DIRS} )
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
endif()

add_executable(miracle-wm-tests
filesystem_configuration_test.cpp
tiling_window_tree_test.cpp
Expand Down

0 comments on commit ea8c9db

Please sign in to comment.