diff options
Diffstat (limited to 'bin/gui/CMakeLists.txt')
-rw-r--r-- | bin/gui/CMakeLists.txt | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/bin/gui/CMakeLists.txt b/bin/gui/CMakeLists.txt index e722ab0..a8869dd 100644 --- a/bin/gui/CMakeLists.txt +++ b/bin/gui/CMakeLists.txt @@ -1,44 +1,55 @@ cmake_minimum_required(VERSION 2.6) -#{{{ Variables -set(CMAKE_INSTALL_GLADEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/libuca") -#}}} -#{{{ Configure find_package(PkgConfig) +find_program(GLIB_COMPILE_RESOURCES glib-compile-resources REQUIRED) pkg_check_modules(GTK2 gtk+-2.0>=2.22) pkg_check_modules(GTHREAD2 gthread-2.0) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in - ${CMAKE_CURRENT_BINARY_DIR}/config.h) - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/control.glade - ${CMAKE_CURRENT_BINARY_DIR}) -#}}} -#{{{ Target if (GTK2_FOUND) + set(GRESOURCES_XML "${CMAKE_CURRENT_SOURCE_DIR}/uca-camera-control.gresource.xml") + set(GRESOURCES_H "${CMAKE_CURRENT_BINARY_DIR}/resources.h") + set(GRESOURCES_C "${CMAKE_CURRENT_BINARY_DIR}/resources.c") + + add_custom_command( + OUTPUT ${GRESOURCES_H} + COMMAND ${GLIB_COMPILE_RESOURCES} + --target ${GRESOURCES_H} + --generate-header ${GRESOURCES_XML} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/uca-camera-control.glade" ${GRESOURCES_XML} + ) + + add_custom_command( + OUTPUT ${GRESOURCES_C} + COMMAND ${GLIB_COMPILE_RESOURCES} + --target ${GRESOURCES_C} + --generate-source ${GRESOURCES_XML} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/uca-camera-control.glade" ${GRESOURCES_XML} + ) + include_directories(${GTK2_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) - set(BINARY "uca-camera-control") - add_executable(${BINARY} + add_executable(uca-camera-control uca-camera-control.c egg-property-cell-renderer.c egg-property-tree-view.c - egg-histogram-view.c) + egg-histogram-view.c + ${GRESOURCES_C} + ) + + add_custom_target(resources DEPENDS ${GRESOURCES_C} ${GRESOURCES_H}) + add_dependencies(uca-camera-control resources) - target_link_libraries(${BINARY} + target_link_libraries(uca-camera-control m uca ${GTK2_LIBRARIES} ${GTHREAD2_LIBRARIES}) - install(TARGETS ${BINARY} + install(TARGETS uca-camera-control RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT executables) - - install(FILES control.glade - DESTINATION ${CMAKE_INSTALL_GLADEDIR} - COMPONENT executables) endif() -#}}} |