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
This commit is contained in:
Geert Janssens 2021-03-23 16:33:56 +01:00
parent 09ff2e5483
commit 0c15dc175c
3 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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}

View File

@ -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})