Permalink
Browse files

Skip over translation files with .git in the path when building pcsx2…

… with cmake. Fixes an intermittant cmake build error about duplicate rules.
  • Loading branch information...
arcum42 committed Jan 1, 2019
1 parent d55e9cb commit 43fa7cd6c62c94fc21521bb6bcc162eded569a1f
Showing with 4 additions and 0 deletions.
  1. +4 −0 cmake/Translation.cmake
@@ -53,6 +53,10 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS_PCSX2 _potFile _firstPoFileArg)
GET_FILENAME_COMPONENT(_lang ${_abs_PATH} NAME_WE)
SET(_gmoFile ${CMAKE_BINARY_DIR}/${_lang}__${_gmoBase}.gmo)

IF (_currentPoFile MATCHES ".git")
continue()
ENDIF (_currentPoFile MATCHES ".git")

IF (CMAKE_BUILD_PO)
ADD_CUSTOM_COMMAND( OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile}

7 comments on commit 43fa7cd

@gregory38

This comment has been minimized.

Copy link
Contributor

gregory38 replied Jan 2, 2019

@gregory38

This comment has been minimized.

Copy link
Contributor

gregory38 replied Jan 2, 2019

Or could be unrelated

@arcum42

This comment has been minimized.

Copy link
Contributor

arcum42 replied Jan 2, 2019

Ok, I think I see the problem. MATCHES is regex, so the . needs to be escaped, and it happens to be using a folder with git in the name.

@arcum42

This comment has been minimized.

Copy link
Contributor

arcum42 replied Jan 2, 2019

Let me know if the last change I made took care of it...

@arcum42

This comment has been minimized.

Copy link
Contributor

arcum42 replied Jan 2, 2019

What this is specifically about is I've had the following two paths exist on occasion:
/home/arcum42/Projects/pcsx2-dev/arcum42/pcsx2/.git/logs/refs/remotes/upstream/locales
/home/arcum42/Projects/pcsx2-dev/arcum42/pcsx2/.git/refs/remotes/upstream/locales

or the equivalent (I've got multiple copies of pcsx2 around), and that results in cmake erroring out with this message:
CMake Error: Attempt to add a custom rule to output "/home/arcum42/Projects/pcsx2-dev/arcum42/pcsx2/build/upstream__locales.gmo.rule" which already has a custom rule.

I'm just basically having it skip those two paths in the loop...

@gregory38

This comment has been minimized.

Copy link
Contributor

gregory38 replied Jan 2, 2019

Thanks you. Ppa builds are done everyday, I will give you the status tomorrow.

@gregory38

This comment has been minimized.

Copy link
Contributor

gregory38 replied Jan 2, 2019

Oh btw, endif part can remain empty (as you want).

Please sign in to comment.