diff options
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6efa4677..e4ca3439 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,28 +1,30 @@ -cmake_minimum_required(VERSION 2.8.12) -set (SERVICE_LIB "ayatanaindicatorkeyboardservice") -set (SERVICE_EXEC "ayatana-indicator-keyboard-service") +cmake_minimum_required(VERSION 3.13) -add_definitions(-DG_LOG_DOMAIN="ayatana-indicator-keyboard") +# libayatana-keyboard-backend-x11.so -# handwritten sources -set(SERVICE_MANUAL_SOURCES keyboard.c service.c) +add_library("ayatana-keyboard-x11" SHARED keyboard-x11.c) +target_link_libraries("ayatana-keyboard-x11" ${SERVICE_DEPS_LIBRARIES} ${X11_DEPS_LIBRARIES}) +set_target_properties("ayatana-keyboard-x11" PROPERTIES VERSION 0.0.0 SOVERSION 0) +install(TARGETS "ayatana-keyboard-x11" DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}) -# generated sources -set(SERVICE_GENERATED_SOURCES) +# libayatana-keyboard-backend-lomiri.so -# add the bin dir to our include path so the code can find the generated header files -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +add_library("ayatana-keyboard-lomiri" SHARED keyboard-lomiri.c) +target_link_libraries("ayatana-keyboard-lomiri" ${SERVICE_DEPS_LIBRARIES}) +set_target_properties("ayatana-keyboard-lomiri" PROPERTIES VERSION 0.0.0 SOVERSION 0) +install(TARGETS "ayatana-keyboard-lomiri" DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}) -# add warnings/coverage info on handwritten files but not the autogenerated ones... -set_source_files_properties(${SERVICE_MANUAL_SOURCES} PROPERTIES COMPILE_FLAGS "${C_WARNING_ARGS} -g -std=c99") +# libayatanaindicatorkeyboardservice.a -# the service library for tests to link against (basically, everything except main()) -add_library(${SERVICE_LIB} STATIC ${SERVICE_MANUAL_SOURCES} ${SERVICE_GENERATED_SOURCES}) +add_definitions(-DG_LOG_DOMAIN="ayatana-indicator-keyboard") +set_source_files_properties(service.c PROPERTIES COMPILE_FLAGS "-std=c99") +add_library("ayatanaindicatorkeyboardservice" STATIC service.c) include_directories(${CMAKE_SOURCE_DIR}) link_directories(${SERVICE_DEPS_LIBRARY_DIRS}) -# the executable: lib + main() -add_executable (${SERVICE_EXEC} main.c) -set_source_files_properties(${SERVICE_SOURCES} main.c PROPERTIES COMPILE_FLAGS "${C_WARNING_ARGS} -std=c99") -target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES}) -install (TARGETS ${SERVICE_EXEC} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}) +# ayatana-indicator-keyboard-service + +add_executable("ayatana-indicator-keyboard-service" main.c) +set_source_files_properties(service.c main.c PROPERTIES COMPILE_FLAGS "-std=c99") +target_link_libraries("ayatana-indicator-keyboard-service" "ayatanaindicatorkeyboardservice" "${SERVICE_DEPS_LIBRARIES} -ldl") +install(TARGETS "ayatana-indicator-keyboard-service" RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}") |