Skip to content

Update project layout - #267

Merged
vitaut merged 24 commits into
fmtlib:masterfrom
niosHD:update-project-layout
Feb 3, 2016
Merged

Update project layout#267
vitaut merged 24 commits into
fmtlib:masterfrom
niosHD:update-project-layout

Conversation

@niosHD

@niosHD niosHD commented Jan 31, 2016

Copy link
Copy Markdown
Contributor

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

vitaut commented Jan 31, 2016

Copy link
Copy Markdown
Contributor

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

niosHD commented Feb 1, 2016

Copy link
Copy Markdown
Contributor Author

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

vitaut commented Feb 1, 2016

Copy link
Copy Markdown
Contributor

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

niosHD commented Feb 1, 2016

Copy link
Copy Markdown
Contributor Author

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

vitaut commented Feb 2, 2016

Copy link
Copy Markdown
Contributor

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

niosHD commented Feb 3, 2016

Copy link
Copy Markdown
Contributor Author

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

vitaut commented Feb 3, 2016

Copy link
Copy Markdown
Contributor

Merged, thanks!

@niosHD

niosHD commented Feb 4, 2016

Copy link
Copy Markdown
Contributor Author

Nice. Thank you!

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

Copy link
Copy Markdown

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

niosHD commented Apr 5, 2016

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown

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

niosHD commented Apr 6, 2016

Copy link
Copy Markdown
Contributor Author

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

vitaut commented Apr 7, 2016

Copy link
Copy Markdown
Contributor

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