gnucash maint: Fix building based on unix makefiles

Geert Janssens gjanssens at code.gnucash.org
Tue Mar 23 11:34:01 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/0c15dc17 (commit)
	from  https://github.com/Gnucash/gnucash/commit/09ff2e54 (commit)



commit 0c15dc175c5aac583015f93cc39604b744fd6e76
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Mar 23 16:33:56 2021 +0100

    Fix building based on unix makefiles
    
    There are a few subtle differences between unix makefiles and ninja
    that sometimes go uncaught as the core devs usually use ninja.
    This commit fixes two:
    - don't depend directly on files in other source/binary directories.
      Use a custom target to depend on instead
    - recursively create target directories, as make doesn't automatically

diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 91104cdf1..0e9423516 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -38,7 +38,7 @@ install(FILES ${DATADIR_BUILD}/gnucash/tip_of_the_day.list DESTINATION ${CMAKE_I
 
 foreach (manpage gnucash gnucash-cli)
     add_custom_command(OUTPUT ${DATADIR_BUILD}/gnucash/${manpage}.1
-        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${manpage}.1.in ${VCS_INFO_FILE}
+        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${manpage}.1.in gnc-vcs-info
         COMMAND ${CMAKE_COMMAND}
             -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/${manpage}.1.in
             -D DST=${manpage}.1
diff --git a/gnucash/gnome/CMakeLists.txt b/gnucash/gnome/CMakeLists.txt
index e6c54adef..f5e2481a9 100644
--- a/gnucash/gnome/CMakeLists.txt
+++ b/gnucash/gnome/CMakeLists.txt
@@ -196,7 +196,7 @@ endif()
 
 add_custom_command(
     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gnucash.appdata.xml
-    DEPENDS ${GNC_APPDATA_IN} ${VCS_INFO_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/gnucash.releases.xml
+    DEPENDS ${GNC_APPDATA_IN} gnc-vcs-info ${CMAKE_CURRENT_SOURCE_DIR}/gnucash.releases.xml
     COMMAND ${CMAKE_COMMAND} -D SRC=${GNC_APPDATA_IN}
                              -D DST=${CMAKE_CURRENT_BINARY_DIR}/gnucash.appdata.xml
                              -D VCS_INFO_FILE=${VCS_INFO_FILE}
@@ -223,7 +223,7 @@ add_custom_command (
 
 add_custom_command (
     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gnucash.desktop
-    DEPENDS ${GNC_DESKTOP_IN} ${VCS_INFO_FILE}
+    DEPENDS ${GNC_DESKTOP_IN} gnc-vcs-info
     COMMAND ${CMAKE_COMMAND} -D SRC=${GNC_DESKTOP_IN}
                              -D DST=${CMAKE_CURRENT_BINARY_DIR}/gnucash.desktop
                              -D VCS_INFO_FILE=${VCS_INFO_FILE}
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index 1d72c9f4f..97b0e703c 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -21,6 +21,7 @@ foreach (lingua ${ALL_LINGUAS})
   list (APPEND po_SOURCES ${lingua}.po)
 
   set (_LOCALE_DIR ${DATADIR_BUILD}/locale/${lingua}/LC_MESSAGES)
+  file (MAKE_DIRECTORY "${_LOCALE_DIR}") # Unix Makefiles won't do this automatically, ninja does
   set (_MO_FILE ${_LOCALE_DIR}/gnucash.mo)
   list (APPEND CATALOGS ${_MO_FILE})
 



Summary of changes:
 doc/CMakeLists.txt           | 2 +-
 gnucash/gnome/CMakeLists.txt | 4 ++--
 po/CMakeLists.txt            | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)



More information about the gnucash-changes mailing list