Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QMEAN
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
QMEAN
Commits
5e3b5a39
Commit
5e3b5a39
authored
4 years ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
add cmake macro to setup compiler flags
In particular: we want to set -std=c++11 for older gcc versions
parent
7f02cba0
No related branches found
Branches containing commit
Tags
3.1.0-rc
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+2
-0
2 additions, 0 deletions
CMakeLists.txt
cmake_support/QMEAN2.cmake
+33
-0
33 additions, 0 deletions
cmake_support/QMEAN2.cmake
with
35 additions
and
0 deletions
CMakeLists.txt
+
2
−
0
View file @
5e3b5a39
...
...
@@ -61,6 +61,8 @@ endif()
file
(
MAKE_DIRECTORY
${
STAGE_DIR
}
${
HEADER_STAGE_PATH
}
${
LIB_STAGE_PATH
}
)
setup_compiler_flags
()
# Python needed before Boost
find_package
(
Python 3.6.0 REQUIRED
)
# Split version string
...
...
This diff is collapsed.
Click to expand it.
cmake_support/QMEAN2.cmake
+
33
−
0
View file @
5e3b5a39
...
...
@@ -899,3 +899,36 @@ macro(find_path_recursive VARIABLE)
set
(
_fst_subs
${
_tmp_dlist
}
)
endwhile
(
_fst_subs
)
endmacro
(
find_path_recursive
)
function
(
get_compiler_version _OUTPUT_VERSION
)
exec_program
(
${
CMAKE_CXX_COMPILER
}
ARGS
${
CMAKE_CXX_COMPILER_ARG1
}
-dumpversion
OUTPUT_VARIABLE _COMPILER_VERSION
)
string
(
REGEX REPLACE
"([0-9])
\\
.([0-9])(
\\
.[0-9])?"
"
\\
1
\\
2"
_COMPILER_VERSION
${
_COMPILER_VERSION
}
)
set
(
${
_OUTPUT_VERSION
}
${
_COMPILER_VERSION
}
PARENT_SCOPE
)
endfunction
(
get_compiler_version
)
macro
(
setup_compiler_flags
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
get_compiler_version
(
_GCC_VERSION
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wall"
)
if
(
_GCC_VERSION MATCHES
"44"
)
# gcc 4.4. is very strict about aliasing rules. the shared_count
# implementation that is used boost's shared_ptr violates these rules. To
# silence the warnings and prevent miscompiles, enable
# -fno-strict-aliasing
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fno-strict-aliasing"
)
endif
()
#message(STATUS "GCC VERSION " ${_GCC_VERSION})
if
(
_GCC_VERSION LESS
"60"
)
# for older compilers we need to enable C++11
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++11"
)
endif
()
endif
()
endmacro
(
setup_compiler_flags
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment