summaryrefslogtreecommitdiff
path: root/core/CMakeLists.txt
diff options
context:
space:
mode:
authorChristian Dywan <christian@twotoasts.de>2018-10-06 17:49:49 +0200
committerGitHub <noreply@github.com>2018-10-06 17:49:49 +0200
commitf6f7dcde23407bd61a4568dbd5012fc0221ebfe7 (patch)
treeba4f3dea97a8f5293e77cd4de218fffb46a9c588 /core/CMakeLists.txt
parent8a94c0824715343567811b49378692c113062c42 (diff)
downloadmidori-git-f6f7dcde23407bd61a4568dbd5012fc0221ebfe7.tar.gz
Fix intltool, gresource and gir targets (#77)
add_custom_command should be used to generate files rather than add_custom_target which builds unconditionally. DEPENDS needs to specify all source files. For gresource.xml all ui files are dependencies.
Diffstat (limited to 'core/CMakeLists.txt')
-rw-r--r--core/CMakeLists.txt17
1 files changed, 10 insertions, 7 deletions
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index ff30f54e..74c24fd1 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -38,13 +38,16 @@ CUSTOM_VAPIS
${EXTRA_VAPIS}
)
+file(GLOB UI_FILES ${CMAKE_SOURCE_DIR}/ui/*.ui)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/resources.c
- COMMENT "Built resource"
COMMAND glib-compile-resources
--sourcedir ${CMAKE_SOURCE_DIR}
--generate-source
--target ${CMAKE_CURRENT_BINARY_DIR}/resources.c
- ${CMAKE_SOURCE_DIR}/gresource.xml)
+ ${CMAKE_SOURCE_DIR}/gresource.xml
+ DEPENDS ${CMAKE_SOURCE_DIR}/gresource.xml
+ DEPENDS ${UI_FILES}
+)
add_library("${LIBCORE}" SHARED ${LIBCORE_SOURCE_C} ${CMAKE_CURRENT_BINARY_DIR}/resources.c)
target_link_libraries("${LIBCORE}"
@@ -60,11 +63,11 @@ set_target_properties("${LIBCORE}" PROPERTIES
)
find_program (GIR_COMPILER_BIN g-ir-compiler)
-add_custom_target("g-ir-compiler_${LIBCORE}" ALL
- ${GIR_COMPILER_BIN} ${CMAKE_CURRENT_BINARY_DIR}/${LIBCORE_GIR}.gir
- --output ${CMAKE_CURRENT_BINARY_DIR}/${LIBCORE_GIR}.typelib
- WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
- DEPENDS ${LIBCORE_GIR}.gir)
+add_custom_command(OUTPUT "g-ir-compiler_${LIBCORE}"
+ COMMAND ${GIR_COMPILER_BIN} ${CMAKE_CURRENT_BINARY_DIR}/${LIBCORE_GIR}.gir
+ --output ${CMAKE_CURRENT_BINARY_DIR}/${LIBCORE_GIR}.typelib
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ DEPENDS ${LIBCORE_GIR}.gir)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LIBCORE_GIR}.gir"
DESTINATION "${CMAKE_INSTALL_DATADIR}/gir-1.0/")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LIBCORE_GIR}.typelib"