Add libsoup to CMakeLists

This commit is contained in:
Markus Koch 2019-07-24 19:07:14 +02:00
parent 4aaf1ef0f8
commit 61bc233dde

View File

@ -9,10 +9,11 @@ pkg_check_modules(GLIB2 REQUIRED glib-2.0)
pkg_check_modules(GOBJECT2 REQUIRED gobject-2.0) pkg_check_modules(GOBJECT2 REQUIRED gobject-2.0)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0) pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
pkg_check_modules(NFC REQUIRED libnfc) pkg_check_modules(NFC REQUIRED libnfc)
pkg_check_modules(SOUP REQUIRED libsoup-2.4)
INCLUDE_DIRECTORIES (${GLIB2_INCLUDE_DIRS} ${GOBJECT2_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS} ${NFC_INCLUDE_DIRS}) INCLUDE_DIRECTORIES (${GLIB2_INCLUDE_DIRS} ${GOBJECT2_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS} ${NFC_INCLUDE_DIRS} ${SOUP_INCLUDE_DIRS})
LINK_DIRECTORIES (${GLIB2_LIBRARY_DIRS} ${GOBJECT2_LIBRARY_DIRS} ${GTK3_LIBRARY_DIRS} ${NFC_LIBRARY_DIRS}) LINK_DIRECTORIES (${GLIB2_LIBRARY_DIRS} ${GOBJECT2_LIBRARY_DIRS} ${GTK3_LIBRARY_DIRS} ${NFC_LIBRARY_DIRS} ${SOUP_LIBRARY_DIRS})
add_definitions(${GLIB2_CFLAGS_OTHER} ${GOBJECT2_CFLAGS_OTHER} ${GTK3_CFLAGS_OTHER} ${NFC_CFLAGS_OTHER}) add_definitions(${GLIB2_CFLAGS_OTHER} ${GOBJECT2_CFLAGS_OTHER} ${GTK3_CFLAGS_OTHER} ${NFC_CFLAGS_OTHER} ${SOUP_CFLAGS_OTHER})
add_custom_target(glib-resources DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources.c) add_custom_target(glib-resources DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources.c)
add_custom_command(DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/glade/*.glade "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.gresource.xml" add_custom_command(DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/glade/*.glade "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.gresource.xml"
@ -24,6 +25,6 @@ aux_source_directory(./src SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST} "${CMAKE_CURRENT_BINARY_DIR}/resources.c" "${HEADERS}") add_executable(${PROJECT_NAME} ${SRC_LIST} "${CMAKE_CURRENT_BINARY_DIR}/resources.c" "${HEADERS}")
add_dependencies(${PROJECT_NAME} glib-resources) add_dependencies(${PROJECT_NAME} glib-resources)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/resources.c PROPERTIES GENERATED 1) SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/resources.c PROPERTIES GENERATED 1)
target_link_libraries(${PROJECT_NAME} ${GTK3_LIBRARIES} ${NFC_LIBRARIES}) target_link_libraries(${PROJECT_NAME} ${GTK3_LIBRARIES} ${NFC_LIBRARIES} ${SOUP_LIBRARIES})
install (TARGETS ${PROJECT_NAME} DESTINATION bin) install (TARGETS ${PROJECT_NAME} DESTINATION bin)