Enerccio / ewlc

Wayland compositor library - extended
MIT License
20 stars 3 forks source link

build fails except `wayland-protocols` is installed system-wide #89

Open WLCIssuesBot opened 7 years ago

WLCIssuesBot commented 7 years ago

Issue by snoack Thursday Mar 16, 2017 at 20:17 GMT Originally opened as https://github.com/Cloudef/wlc/issues/240


If I don't have wayland-protocols installed system-wide, cmake fails with following output, despite using -DSOURCE_WLPROTO=ON:

$ cmake -DSOURCE_WLPROTO=ON ..
-- The C compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") 
-- Could NOT find chck (missing:  CHCK_LIBRARIES CHCK_INCLUDE_DIRS) 
Adding chck as subdirectory
-- Performing Test has_fstack_protector_strong
-- Performing Test has_fstack_protector_strong - Success
-- Performing Test ok
-- Performing Test ok - Success
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Could NOT find valgrind (missing:  VALGRIND_INCLUDE_DIRS) 
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- Found MATH: /usr/lib/x86_64-linux-gnu/libm.so  
-- Found WAYLAND_CLIENT: /usr/lib/x86_64-linux-gnu/libwayland-client.so  
-- Found WAYLAND_SERVER: /usr/lib/x86_64-linux-gnu/libwayland-server.so  
-- Found WAYLAND_EGL: /usr/lib/x86_64-linux-gnu/libwayland-egl.so  
-- Found WAYLAND: /usr/lib/x86_64-linux-gnu/libwayland-client.so;/usr/lib/x86_64-linux-gnu/libwayland-server.so;/usr/lib/x86_64-linux-gnu/libwayland-egl.so  
-- Found PIXMAN: /usr/lib/x86_64-linux-gnu/libpixman-1.so  
-- Found XKBCOMMON: /usr/lib/x86_64-linux-gnu/libxkbcommon.so  
-- Found UDEV: /usr/include  
-- Found LIBINPUT: /usr/include  
Package wayland-protocols was not found in the pkg-config search path.
Perhaps you should add the directory containing `wayland-protocols.pc'
to the PKG_CONFIG_PATH environment variable
No package 'wayland-protocols' found
CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
  Could NOT find WaylandProtocols (missing: WAYLANDPROTOCOLS_PATH)
Call Stack (most recent call first):
  /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  CMake/FindWaylandProtocols.cmake:38 (find_package_handle_standard_args)
  CMakeLists.txt:42 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/sebastian/src/sway-debian-packager/wlc/target/CMakeFiles/CMakeOutput.log".
See also "/home/sebastian/src/sway-debian-packager/wlc/target/CMakeFiles/CMakeError.log".

I'm just guessing, but if I understand the build scripts correctly, the Could NOT find WaylandProtocols line is to be expected, but instead of failing, following code should fall back to the submodule?

if (WAYLANDPROTOCOLS_FOUND AND NOT SOURCE_WLPROTO)
   set(prefix "${WAYLANDPROTOCOLS_PATH}")
else ()
   set(prefix "wayland-protocols")
endif ()

Could this be a regression of 51e7e15 which made WaylandProtocols required?

find_package(WaylandProtocols REQUIRED)
msl-kabo commented 7 years ago

I'm experiencing the same issue.

Enerccio commented 7 years ago

try now, removed the required dependency and left it as optional, should work both with system-wide installed wayland protocols and not installed