File: CMakeLists.txt

package info (click to toggle)
wlmaker 0.6.1%2Bgit20250919%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 12,056 kB
  • sloc: ansic: 144,965; sh: 10,507; xml: 4,163; python: 1,400; makefile: 499; yacc: 119; lex: 70; awk: 12
file content (53 lines) | stat: -rw-r--r-- 1,874 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Default arguments:
# cmake -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/.local . -B build

CMAKE_MINIMUM_REQUIRED(VERSION 3.13)
PROJECT(wlmaker VERSION 0.1
  DESCRIPTION "Wayland Maker - Examples & Tools")

# Requires out-of-source builds.
FILE(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOCATION_PATH)
IF(EXISTS "${LOCATION_PATH}")
  MESSAGE(
    FATAL_ERROR
    "You cannot build into a source directory (containing a CMakeLists.txt file).\n"
    "Please make a build subdirectory, for example:\n"
    "cmake -B build\n"
    "(cd build && make)")
ENDIF()

# If not found: Try 'pip3 install --user meson'
FIND_PROGRAM(MESON_EXECUTABLE NAMES meson REQUIRED)
FIND_PROGRAM(NINJA_EXECUTABLE NAMES ninja REQUIRED)

INCLUDE(ExternalProject)

# Extra packages required on Debian:
#
# libgtk-3-dev
# libgirepository1.0-dev
# valac
#
# Hm. Could also have installed gtk-layer-shell-examples ?
# Also, there is https://github.com/wmww/gtk4-layer-shell.
ExternalProject_Add(gtk_layer_shell
  SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gtk-layer-shell"
  INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
  CONFIGURE_COMMAND ${MESON_EXECUTABLE} --prefix=<INSTALL_DIR> <BINARY_DIR> <SOURCE_DIR> -Dexamples=true
  BUILD_COMMAND ${NINJA_EXECUTABLE} -C <BINARY_DIR>
  INSTALL_COMMAND ${NINJA_EXECUTABLE} -C <BINARY_DIR> install
)