-
Notifications
You must be signed in to change notification settings - Fork 357
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
[cmake] allow to override the cxx standard #120
base: master
Are you sure you want to change the base?
[cmake] allow to override the cxx standard #120
Conversation
from cmake command line
@@ -181,8 +184,6 @@ add_library( random_generators test/random_generators.cpp test/random_generators | |||
set_target_properties( opengv random_generators PROPERTIES | |||
SOVERSION ${PROJECT_VERSION} | |||
VERSION ${PROJECT_VERSION} | |||
CXX_STANDARD 11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same thing at line 333 below for the tests
@@ -181,8 +184,6 @@ add_library( random_generators test/random_generators.cpp test/random_generators | |||
set_target_properties( opengv random_generators PROPERTIES | |||
SOVERSION ${PROJECT_VERSION} | |||
VERSION ${PROJECT_VERSION} | |||
CXX_STANDARD 11 | |||
CXX_STANDARD_REQUIRED ON | |||
DEBUG_POSTFIX d ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEBUG_POSTFIX d ) | |
) |
For DEBUG_POSTFIX
we can just set a cache variable that initialize CMAKE_DEBUG_POSTFIX
that will automatically set it for all targets, without doing it explicitly:
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "The postfix to use for the debug version of the target names")
from gcc documentation: "-march=cpu-type allows GCC to generate code that may not run at all on processors other than the one indicated."
When using multiple libraries using eigen, they all need to agree on the way we use memory alignment in eigen.
See https://eigen.tuxfamily.org/dox/group__TopicStlContainers.html
As we have moved to C++17, we need all libraries using eigen to be compatible with that.
The solution is simple: define a cmake cached variable, so it can be overriden.
This PR also add some missing includes, needed to build with g++ 10.