diff options
author | Robert Tari <robert@tari.in> | 2020-11-08 13:50:13 +0100 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2020-11-10 12:10:27 +0100 |
commit | f9a39b44803e6347c72c1edd8ba46f633e99dd57 (patch) | |
tree | 558d0879ddc9318f7e9c0bb7362fd7f086fa29f0 /src/CMakeLists.txt | |
parent | f872e9097ff373a172119bd3f7e9d0ef84b31ce1 (diff) | |
download | ayatana-indicator-notifications-f9a39b44803e6347c72c1edd8ba46f633e99dd57.tar.gz ayatana-indicator-notifications-f9a39b44803e6347c72c1edd8ba46f633e99dd57.tar.bz2 ayatana-indicator-notifications-f9a39b44803e6347c72c1edd8ba46f633e99dd57.zip |
Rewrite to indicator-ng, simplify, drop all GTK references, move to CMake
fixes #9, fixes #12
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..eaebc58 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,41 @@ +set (SERVICE_LIB "ayatanaindicatornotificationsservice") +set (SERVICE_EXEC "ayatana-indicator-notifications-service") + +add_definitions(-DG_LOG_DOMAIN="ayatana-indicator-notifications") + +if(URLDISPATCHER_FOUND) + add_definitions( -DHAS_URLDISPATCHER ) +endif() + +# handwritten sources +set(SERVICE_MANUAL_SOURCES + urlregex.c + notification.c + dbus-spy.c + service.c) + +# generated sources +include(GdbusCodegen) +set(SERVICE_GENERATED_SOURCES) + +# add the bin dir to our include path so the code can find the generated header files +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + + +# add warnings/coverage info on handwritten files +# but not the autogenerated ones... +set(C_WARNING_ARGS "${C_WARNING_ARGS} -Wno-bad-function-cast") # g_clear_object() +set(C_WARNING_ARGS "${C_WARNING_ARGS} -Wno-switch-enum") +set_source_files_properties(${SERVICE_MANUAL_SOURCES} + PROPERTIES COMPILE_FLAGS "${C_WARNING_ARGS} -g -std=c99") + +# the service library for tests to link against (basically, everything except main()) +add_library(${SERVICE_LIB} STATIC ${SERVICE_MANUAL_SOURCES} ${SERVICE_GENERATED_SOURCES}) +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} ${URLDISPATCHER_LIBRARIES}) +install (TARGETS ${SERVICE_EXEC} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}) |