Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various small improvements #698

Merged
merged 8 commits into from
May 17, 2015
Merged

Conversation

UniqMartin
Copy link
Contributor

This is a set of various small improvements, best viewed commit by commit. I was not feeling like creating a bunch of different pull requests for these, but could of course do this, if this is preferred.

Tested on my Mac running OS X 10.10 and everything still worked as it should (or improved, namely plug-in support). I cannot verify these changes on Windows/Linux, but hopefully someone else can.

I'm not entirely sure about commit UniqMartin/texworks@0e5759e. For me, the file trans/TeXworks_trans.pro was always regenerated when running cmake, but with different contents (files referenced therein in a different order), so I wanted to get rid of this distraction. But maybe its presence in the repository serves a purpose. :)

A bunch of minor changes:
* Anchor existing ignore rules at repository root for less ambiguity.
* Also ignore 'TeXworks.plist' that is auto-generated on OS X.
* Also ignore build directory suggested by documentation.
* Also ignore files downloaded/extracted by 'package' target on OS X.
* Group ignores logically and add comments.
The commit date substituted by Git can contain a plus sign in case of
positive time zone offsets, e.g. "1970-01-01 12:00:00 +0200". Those were
not detected as valid by the replacement pattern, making the replacement
fail (i.e. not stripping "#define GIT_COMMIT_DATE" and the quotes).
Plug-ins need special linker flags on OS X to be built successfully.
CMake already distinguishes between plug-ins (called "modules") and
ordinary shared libraries, so use that.
Not clear why we should be picking up "LDFLAGS" from the environment and
why we should overwrite "CMAKE_MODULE_LINKER_FLAGS" with the contents of
"CMAKE_MODULE_LINKER_FLAGS_INIT". Now extend "CMAKE_MODULE_LINKER_FLAGS"
instead.
@stloeffler
Copy link
Member

Most of the commits look good. I'm not sure if using MODULE has any side-effects on Linux or Windows (default seems to be SHARED), I'll have to test before merging when I have time.

trans/TeXworks_trans.pro is there for a reason, namely so that people can translate TeXworks without having to build it. Qt's lupdate utility needs to know about all sources, and the easiest way of doing this is to give it a .pro file. Maybe we can simply sort the list of files (in CMake) before generating the file? That way we should have a robust order and the file content should no longer change...

The file 'trans/TeXworks_trans.pro' is auto-generated, but kept under
version control to ease the work of translators. Make sure that the
order of the entries in the generated file is not affected by globbing
order which depends on the file and operating system. This should
prevent future spurious changes to this file.

Also updates 'trans/TeXworks_trans.pro' according to the above logic.
These project files are unmaintained and (at least on OS X) completely
broken. CMake is now the only supported build system.
@UniqMartin
Copy link
Contributor Author

Regarding MODULE: The default is either STATIC or SHARED, depending on the contents of BUILD_SHARED_LIBS. I compared the CMake variables affecting shared library/module compilation by looking at the output of cmake --system-information. On Linux (Debian Wheezy, x86_64, CMake 2.8.9) there is no difference at all. On Windows (Windows 7, 32-bit, CMake 3.2.2) the only difference is whether an import library is built or not. Thus I'm pretty confident there won't be side-effects on these platforms. But a proper test would be better, of course. (See this gist for details.)

Regarding trans/TeXworks_trans.pro: Thanks for confirming my suspicion! I replaced my original commit with one that sorts the list of files before writing them to trans/TeXworks_trans.pro, as you suggested. I also updated the file with the pre-sorted generated version.

One more thing: I also noticed, that while being obsoleted by CMake, there still existed project files for qmake. I removed them in an additional commit.

stloeffler added a commit that referenced this pull request May 17, 2015
@stloeffler stloeffler merged commit 046b6bb into TeXworks:master May 17, 2015
@stloeffler
Copy link
Member

Thanks for the work - merged.

@UniqMartin UniqMartin deleted the general-stuff branch May 17, 2015 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants