SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -Wall -Werror")
ENDFOREACH(flag)
-SET (${this_target}_SOURCE_FILES
- alarm-manager-registry.c
- alarm-manager-schedule.c
- alarm-manager-timer.c
- alarm-manager.c
- )
+AUX_SOURCE_DIRECTORY(./ SRCS)
ADD_CUSTOM_COMMAND(
WORKING_DIRECTORY
./alarm_mgr.xml
COMMENT "Generating Server GDBus .c/.h")
-ADD_EXECUTABLE (${this_target} ${${this_target}_SOURCE_FILES} alarm-mgr-stub.c)
+ADD_EXECUTABLE (${this_target} ${SRCS} alarm-mgr-stub.c)
ADD_DEPENDENCIES(${this_target} alarm)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fpie")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
-SET(${this_target}_SOURCE_FILES
- alarm-lib.c
- alarm-lib-stub.c
-)
+AUX_SOURCE_DIRECTORY(./ LIB_SRCS)
ADD_CUSTOM_COMMAND(
WORKING_DIRECTORY
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Wno-unused -fvisibility=hidden")
-ADD_LIBRARY(${this_target} SHARED ${${this_target}_SOURCE_FILES} alarm-mgr-stub.c)
+ADD_LIBRARY(${this_target} SHARED ${LIB_SRCS} alarm-mgr-stub.c)
SET_TARGET_PROPERTIES(${this_target} PROPERTIES COMPILE_FLAGS "${EXTRA_CFLAGS}")
SET_TARGET_PROPERTIES(${this_target} PROPERTIES LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both")
# pkgconfig file
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/alarm-service.pc.in ${CMAKE_SOURCE_DIR}/alarm-service.pc @ONLY)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/alarm-service.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
-INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include/ FILES_MATCHING PATTERN "alarm.h")
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include/
+ FILES_MATCHING
+ PATTERN "*-internal.h" EXCLUDE
+ PATTERN "*.h"
+ )
INSTALL(TARGETS ${this_target} DESTINATION ${CMAKE_INSTALL_LIBDIR})