cmake: make sure we can find i3/ipc.h

There's no pkg-config file shipped with i3, so our only option is to
manually look for the file (and assume it can be found in the "normal"
include paths).
This commit is contained in:
Daniel Eklöf 2019-01-26 12:30:14 +01:00
parent 969d51037f
commit a827cc80d4

View file

@ -34,6 +34,10 @@ add_library(clock ${lib_type} clock.c)
target_link_libraries(clock module-sdk) target_link_libraries(clock module-sdk)
pkg_check_modules(JSON REQUIRED json-c) pkg_check_modules(JSON REQUIRED json-c)
find_file(I3_IPC_H i3/ipc.h)
if (NOT I3_IPC_H)
message(FATAL_ERROR "cannot find header file: i3/ipc.h")
endif ()
add_library(i3 ${lib_type} i3.c) add_library(i3 ${lib_type} i3.c)
target_compile_options(i3 PRIVATE ${JSON_CFLAGS_OTHER}) target_compile_options(i3 PRIVATE ${JSON_CFLAGS_OTHER})
target_include_directories(i3 PRIVATE ${JSON_INCLUDE_DIRS}) target_include_directories(i3 PRIVATE ${JSON_INCLUDE_DIRS})