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

Update project layout #267

Merged
merged 24 commits into from
Feb 3, 2016
Merged

Update project layout #267

merged 24 commits into from
Feb 3, 2016

Conversation

niosHD
Copy link
Contributor

@niosHD niosHD commented Jan 31, 2016

This PR implements the change which has been discussed in #264.

It basically moves the source files into a cppformat subdirectory and performs a major update on the cmake scripts. This was necessary in order to properly test if the includes and defines are properly propagated with the library targets. I think that I could considerably simplify the build system which should also benefit the future development.

Please have a look at my changes and tell me what you think. :)

@vitaut
Copy link
Contributor

vitaut commented Jan 31, 2016

Thanks for your work on improving the build system! I'll look into this in more details, but for now just a quick comment that Appveyor build is failing: https://ci.appveyor.com/project/vitaut/cppformat/build/1.0.1521

@niosHD
Copy link
Contributor Author

niosHD commented Feb 1, 2016

I know, but fixing the windows build is non trivial on a Linux machine without any usable hints from the build log. Anyway, I think I figured it out now. ;)

@vitaut
Copy link
Contributor

vitaut commented Feb 1, 2016

I know, but fixing the windows build is non trivial on a Linux machine without any usable hints from the build log. Anyway, I think I figured it out now. ;)

Thanks! I often break Windows build myself, and then have to fix it based on CI logs =). I've started looking at the commits and everything looks fine so far (nice job), just a few minor comments.

@niosHD
Copy link
Contributor Author

niosHD commented Feb 1, 2016

Thank you for the detailed review and the great support! It is very much appreciated! I will address your comments as soon as possible.

@vitaut
Copy link
Contributor

vitaut commented Feb 2, 2016

I've finally finished reviewing the PR (that was a lot of changes =)) and I should say your CMake-fu is much better than mine. Hope the amount of comments is not intimidating, these are mostly minor things. In general I think this is a great improvement and thanks again for working on it.

@niosHD
Copy link
Contributor Author

niosHD commented Feb 3, 2016

Not at all, you are welcome! I think I addressed most of your comments now. The only thing I have seen just now is that Travis finds some warnings which are not reported by my local compiler. I need to have a look at those next.

vitaut added a commit that referenced this pull request Feb 3, 2016
@vitaut vitaut merged commit 0598d84 into fmtlib:master Feb 3, 2016
@vitaut
Copy link
Contributor

vitaut commented Feb 3, 2016

Merged, thanks!

@niosHD
Copy link
Contributor Author

niosHD commented Feb 4, 2016

Nice. Thank you!

@niosHD niosHD deleted the update-project-layout branch February 4, 2016 13:03
@daveisfera
Copy link

Is there a reason that the cppformat.cc is installed? Usually, only header files are installed.

Also, should the .cmake files be included in the packaging for Fedora? If so where?

One last thing is that in the .zip file, the .cmake files are in the the build directory, but that conflicts with the build instructions.

@niosHD
Copy link
Contributor Author

niosHD commented Apr 5, 2016

The cppformat.cc file is installed to make it possible to use the library in header-only mode (see FMT_HEADER_ONLY in the README). In this mode the code of the cc file is directly included into the h file (see code).

Yes, including the generated cmake files into the packaging would be important. Otherwise the find "magic" does not work. Note that you have to install the cmake files which are installed when you call make install, or those that are part of the generated archive when you call make package. The files in the build directory can not be used for installation!

According to the cmake documentation the following paths are searched by cmake on unix:

<prefix>/(lib/<arch>|lib|share)/cmake/<name>*/          (U)
<prefix>/(lib/<arch>|lib|share)/<name>*/                (U)
<prefix>/(lib/<arch>|lib|share)/<name>*/(cmake|CMake)/  (U)

I currently install to <prefix>/lib/cppformat/ which corresponds to the second pattern. However, it would be possible to make this configurable if this path contradicts which some packaging guidelines of Fedora.

Could you elaborate on your last point? Exactly what .zip file are you talking about?

@daveisfera
Copy link

Ok, header-only mode sounds like an interesting feature, but it's akin to static linking, which is prohibited in Fedora (and many distributions), so I won't package the files to support it.

I'll include the .cmake files, but in Fedora, the path is /usr/share//cmake/, so can that be made configurable?

I was referring to the .zip file for the release. In the .zip, there's a directory called build that has the .cmake files in it and so when you try to follow the build instructions, the mkdir fails.

@niosHD
Copy link
Contributor Author

niosHD commented Apr 6, 2016

Fair enough.

Making it configurable is no big deal, I'll follow up with a PR.

I have no idea why the build directory with the cmake files is in the release zip file but I am sure @vitaut can shed some light here.

@vitaut
Copy link
Contributor

vitaut commented Apr 7, 2016

The build directory got into 2.x by mistake when I merged the new CMake config. Fixed in 8019387.

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.

3 participants