Add xdg auto generation process to cmake pipeline

This commit is contained in:
Sameer Rahmani 2022-08-21 12:39:49 +01:00
parent f786bd01d9
commit 33d0b03b5f
3 changed files with 37 additions and 2 deletions

3
.gitignore vendored
View File

@ -31,3 +31,6 @@ docs/spec.pdf
.tex
.pdf
docs/overall_picture.png
vendor/
\#*#
*.\#*

View File

@ -135,10 +135,11 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
endif()
# Feynman Setup ===================================
add_definitions(-DWLR_USE_UNSTABLE)
include_directories(SYSTEM ${PROJECT_BINARY_DIR}/src)
include_directories(SYSTEM ${FEYNMAN_EMACS_DIR}/inculde)
# Hide all the symbols by default
if(NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET AND
NOT DEFINED CMAKE_VISIBILITY_INLINES_HIDDEN)

View File

@ -14,10 +14,16 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
add_library(feynman SHARED
feynman.c
queue.c
compositor.c
utils.c
xdg-shell-protocol.c
)
set_target_properties(feynman PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
@ -40,4 +46,29 @@ generate_export_header(feynman EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/src/export
find_package(PkgConfig REQUIRED)
pkg_check_modules(WLROOTS REQUIRED IMPORTED_TARGET wlroots)
target_link_libraries(feynman PUBLIC PkgConfig::WLROOTS)
target_link_libraries(feynman PUBLIC
PkgConfig::WLROOTS)
# find Wayland protocols
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
# find 'wayland-scanner' executable
pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
set(XDG_PROT_DEF "${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml")
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-protocol.h
COMMAND ${WAYLAND_SCANNER} client-header ${XDG_PROT_DEF} xdg-shell-protocol.h)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-protocol.c
COMMAND ${WAYLAND_SCANNER} private-code ${XDG_PROT_DEF} xdg-shell-protocol.c
DEPENDS xdg-shell-protocol.h)
target_include_directories(feynman PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_sources(feynman PRIVATE xdg-shell-protocol.c)
find_package(Threads REQUIRED)
target_link_libraries(feynman PRIVATE Threads::Threads)
include_directories(SYSTEM ${WLROOTS_INCLUDE_DIRS})