Skip to content

Replace current install variables with GNUInstallDirs #562

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

Merged
merged 2 commits into from
Dec 14, 2016
Merged

Replace current install variables with GNUInstallDirs #562

merged 2 commits into from
Dec 14, 2016

Conversation

SoapGentoo
Copy link
Contributor

@SoapGentoo SoapGentoo commented Dec 10, 2016

  • The GNUInstallDirs module is more idiomatic and supported by
    Kitware upstream, whereas the current directories are not
    standardised across CMake-using packages. Using CMake native
    mechanisms is better than reinventing the wheel, as it makes
    using the build system more uniform across the ecosystem
  • Use CMAKE_CXX_STANDARD to force C++11
  • Require CMake 3.1.0 at a minimum
  • Fixed lower/UPPERcase format for function/macro calls
  • Fixed indents by replacing tabs with 4 spaces

This PR is in response to #560


# Require C++11 support, prefer ISO C++ over GNU variants,
# as relying solely on ISO C++ is more portable.
SET(CMAKE_CXX_STANDARD 11)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feature requires at least cmake 3.1:

You should change line 3 to:
cmake_minimum_required(VERSION 3.1)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@cdunn2001
Copy link
Contributor

Can't merge if Travis fails. Maybe there is a way to load the right cmake?

* The GNUInstallDirs module is more idiomatic and supported by
  Kitware upstream, whereas the current directories are not
  standardised across CMake-using packages. Using CMake native
  mechanisms is better than reinventing the wheel, as it makes
  using the build system more uniform across the ecosystem
* Use CMAKE_CXX_STANDARD to force C++11
* Require CMake 3.1.0 at a minimum
* Fixed lower/UPPERcase format for function/macro calls
* Fixed indents by replacing tabs with 4 spaces
@SoapGentoo
Copy link
Contributor Author

@cdunn2001 I've fixed the CMake error by switching to a newer CMake version, using travis-ci/travis-ci#4631 (comment)
Would you consider merging now? 😄

@cdunn2001 cdunn2001 merged commit d167a09 into open-source-parsers:master Dec 14, 2016
@cdunn2001
Copy link
Contributor

This looks like a lot of work. Thanks!

@cdunn2001
Copy link
Contributor

I have this error:

$ cmake -DCMAKE_BUILD_TYPE=debug -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DARCHIVE_INSTALL_DIR=. -G "Unix Makefiles" ../..
CMake Error at CMakeLists.txt:4 (PROJECT):
  The CMAKE_C_COMPILER:
    /Library/Developer/CommandLineTools/usr/bin/cc

  is not a full path to an existing compiler tool.

I'll try setting CC in my environment. I guess we need to update the README. Would you do that?

@cdunn2001
Copy link
Contributor

Oh, it worked after removing the cmake cache. (Actually, I removed the whole build directory and started over.) No problems!

@cdunn2001
Copy link
Contributor

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