8000 Revamped CMakeLists.txt by GamePad64 · Pull Request #32 · docopt/docopt.cpp · GitHub
[go: up one dir, main page]

Skip to content

Revamped CMakeLists.txt #32

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 1 commit into from
Nov 27, 2015
Merged

Revamped CMakeLists.txt #32

merged 1 commit into from
Nov 27, 2015

Conversation

GamePad64
Copy link
Contributor

Bumped CMake version to 3.1
Removed WITH_CPP** options, in favor of -DCMAKE_CXX_STANDARD=11
Added public includes to both dynamic and static targets, enabling CMake-idiomatic way to link these libraries with link_library and without include_directory
Fixed "#pragma mark" warnings on GCC


option(WITH_TESTS "Build tests." OFF)
option(WITH_EXAMPLE "Build example." OFF)
option(WITH_STATIC "Build static libs." ON)
option(WITH_CPP11 "Build with C++11." ON)
option(WITH_CPP14 "Build with C++14." OFF)
Copy link
Member

Choose a reason for hiding this comment

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

Why were these removed? These broke the Travis setup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, Travis has only CMake 2.8.
CMake 3.1 supports setting C++ version using CMAKE_CXX_STANDARD variable. It is better, because you can set this variable in parent project, and then include "docopt" directory in it (and link it using link_library()).

Please, do not close this pull request, I will rewrite travis.yml to update CMake version (to version 3.2.2 for example, as used in Ubuntu Wily) before building the code.

Copy link
Member

Choose a reason for hiding this comment

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

Oh ok that makes sense. I'm still new to both cmake and Travis, so any help you offer is greatly appreciated!

@GamePad64
Copy link
Contributor Author

Well, I have a little question: Why is there an option WITH_CPP11 in the first place? The library depends on C++11 and it will not build with WITH_CPP11=OFF.

Removed WITH_CPP** options, in favor of -DCMAKE_CXX_STANDARD=11
Added public includes to both dynamic and static targets, enabling CMake-idiomatic way to link these libraries with link_library and without include_directory
Fixed "#pragma mark" warnings
@GamePad64
Copy link
Contributor Author

Okay, it is ready to be merged.

@jaredgrubb
Copy link
Member

You're right about not needing the C++11 option. I cant recall why I thought it was needed!

Thanks for your help on getting this all put together!

jaredgrubb added a commit that referenced this pull request Nov 27, 2015
@jaredgrubb jaredgrubb merged commit 4e6eae5 into docopt:master Nov 27, 2015
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
0