Skip to content

Commit

Permalink
Jayatana: use CMake 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
rilian-la-te committed Mar 11, 2018
1 parent 58f4c34 commit eaa6a36
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
10 changes: 6 additions & 4 deletions subprojects/jayatana/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 2.8)
cmake_policy (VERSION 2.8)
cmake_minimum_required (VERSION 3.6 FATAL_ERROR)
cmake_policy (VERSION 3.6)
project (jayatana C)
cmake_policy(SET CMP0054 NEW)
enable_testing ()
Expand All @@ -9,9 +9,11 @@ find_package (PkgConfig QUIET)
find_package(Java)
find_package(JNI)
pkg_check_modules(XKBCOMMON
xkbcommon)
xkbcommon
IMPORTED_TARGET)
pkg_check_modules(DBUSMENU
dbusmenu-glib-0.4>=16.04.0)
dbusmenu-glib-0.4>=16.04.0
IMPORTED_TARGET)

cmake_dependent_option(STANDALONE "Build jayatana STANDALONE" ON
"NOT CORE_FOUND;JAVA_FOUND;JNI_FOUND;XKBCOMMON_FOUND;DBUSMENU_FOUND" OFF)
Expand Down
13 changes: 6 additions & 7 deletions subprojects/jayatana/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON)
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
add_library(jayatanaag SHARED
com_jarego_jayatana_Agent.h
com_jarego_jayatana_Agent.c)
target_include_directories(jayatanaag PRIVATE ${JNI_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(jayatanaag PRIVATE ${JNI_INCLUDE_DIRS})
target_link_libraries(jayatanaag PRIVATE ${JAVA_JVM_LIBRARY})
pkg_check_modules(LINK REQUIRED QUIET
pkg_check_modules(GLIB REQUIRED QUIET
glib-2.0
gio-2.0
xkbcommon)
pkg_check_modules(TEMP REQUIRED QUIET
dbusmenu-glib-0.4)
IMPORTED_TARGET)
include(UseJava)
add_library(jayatana SHARED
com_jarego_jayatana_basic_GlobalMenu.c
Expand All @@ -22,6 +21,6 @@ add_library(jayatana SHARED
com_jarego_jayatana_jni.h
dbusmenu-definitions.h)
add_dependencies(jayatana java-headers)
target_include_directories(jayatana PRIVATE ${JNI_INCLUDE_DIRS} ${LINK_INCLUDE_DIRS} ${TEMP_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/../java)
target_link_libraries(jayatana PRIVATE ${JNI_LIBRARIES} ${LINK_LIBRARIES} ${TEMP_LIBRARIES})
target_include_directories(jayatana PRIVATE ${JNI_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/../java)
target_link_libraries(jayatana PRIVATE ${JNI_LIBRARIES} PkgConfig::GLIB PkgConfig::XKBCOMMON PkgConfig::DBUSMENU)
install(TARGETS jayatana jayatanaag DESTINATION ${CMAKE_INSTALL_LIBDIR}/jayatana)

0 comments on commit eaa6a36

Please sign in to comment.