Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
iwr
amdis
Commits
7e699189
Commit
7e699189
authored
Feb 18, 2016
by
Praetorius, Simon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMakeLists updated to detect compiler-features
parent
65729524
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
30 deletions
+39
-30
AMDiS/CMakeLists.txt
AMDiS/CMakeLists.txt
+8
-0
AMDiS/cmake/enable_cxx11.cmake
AMDiS/cmake/enable_cxx11.cmake
+31
-30
No files found.
AMDiS/CMakeLists.txt
View file @
7e699189
...
@@ -267,6 +267,14 @@ else()
...
@@ -267,6 +267,14 @@ else()
add_library
(
muparser SHARED
${
MUPARSER_SRC
}
)
add_library
(
muparser SHARED
${
MUPARSER_SRC
}
)
endif
()
endif
()
if
(
${
CMAKE_VERSION
}
VERSION_GREATER
"3.0"
)
foreach
(
feature in
${
REQUIRED_CXX_FEATURES
}
)
target_compile_features
(
amdis INTERFACE feature
)
target_compile_features
(
muparser INTERFACE feature
)
endforeach
(
feature
)
endif
()
list
(
APPEND AMDIS_LIBS amdis
${
Boost_LIBRARIES
}
)
list
(
APPEND AMDIS_LIBS amdis
${
Boost_LIBRARIES
}
)
# some special treatements for Windows systems
# some special treatements for Windows systems
...
...
AMDiS/cmake/enable_cxx11.cmake
View file @
7e699189
# enable the c++11 features. From cmake version 3.0 this is simply done by setting
# enable the c++11 features. From cmake version 3.0 this is simply done by setting
# the cxx_standard variables. For older cmake version the compile-flags must be added manually.
# the cxx_standard variables. For older cmake version the compile-flags must be added manually.
if
(
ENABLE_CXX11
)
if
(
ENABLE_CXX11
)
list
(
APPEND COMPILEFLAGS
"-DHAS_CXX11=1"
)
list
(
APPEND COMPILEFLAGS
"-DHAS_CXX11=1"
)
if
(
${
CMAKE_VERSION
}
VERSION_GREATER
"3.0"
)
if
(
${
CMAKE_VERSION
}
VERSION_GREATER
"3.0"
)
set
(
CMAKE_CXX_STANDARD 11
)
set
(
CMAKE_CXX_STANDARD 11
)
set
(
CMAKE_CXX_STANDARD_REQUIRED ON
)
set
(
CMAKE_CXX_STANDARD_REQUIRED ON
)
else
()
set
(
REQUIRED_CXX_FEATURES
"cxx_alias_templates"
"cxx_auto_type"
"cxx_lambdas"
"cxx_override"
"cxx_range_for"
"cxx_static_assert"
"cxx_variadic_templates"
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
else
()
set
(
GXX_MIN_VER
"4.8"
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS GXX_MIN_VER
)
set
(
GXX_MIN_VER
"4.8"
)
message
(
FATAL_ERROR
"For C++11-Features the G++ Compiler must be at least version $GXX_MIN_VER"
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS GXX_MIN_VER
)
message
(
FATAL_ERROR
"For C++11-Features the G++ Compiler must be at least version $GXX_MIN_VER"
)
endif
()
list
(
APPEND COMPILEFLAGS
"-std=gnu++11"
)
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"Clang"
)
set
(
CLANG_MIN_VER
"3.0"
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS CLANG_MIN_VER
)
message
(
FATAL_ERROR
"For C++11-Features the Clang Compiler must be at least version $CLANG_MIN_VER"
)
endif
()
list
(
APPEND COMPILEFLAGS
"-std=c++11"
)
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"Intel"
)
set
(
INTEL_MIN_VER
"12.1"
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS INTEL_MIN_VER
)
message
(
FATAL_ERROR
"For C++11-Features the Intel C++ Compiler must be at least version $INTEL_MIN_VER"
)
endif
()
list
(
APPEND COMPILEFLAGS
"-std=c++11"
)
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"MSVC"
)
set
(
MSVC_MIN_VER
"12.0"
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS MSVC_MIN_VER
)
message
(
FATAL_ERROR
"For C++11-Features the MSVC C++ Compiler must be at least version $MSVC_MIN_VER"
)
endif
()
endif
()
endif
()
list
(
APPEND COMPILEFLAGS
"-std=gnu++11"
)
endif
()
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"Clang"
)
set
(
CLANG_MIN_VER
"3.0"
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS CLANG_MIN_VER
)
message
(
FATAL_ERROR
"For C++11-Features the Clang Compiler must be at least version $CLANG_MIN_VER"
)
endif
()
list
(
APPEND COMPILEFLAGS
"-std=c++11"
)
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"Intel"
)
set
(
INTEL_MIN_VER
"12.1"
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS INTEL_MIN_VER
)
message
(
FATAL_ERROR
"For C++11-Features the Intel C++ Compiler must be at least version $INTEL_MIN_VER"
)
endif
()
list
(
APPEND COMPILEFLAGS
"-std=c++11"
)
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"MSVC"
)
set
(
MSVC_MIN_VER
"12.0"
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS MSVC_MIN_VER
)
message
(
FATAL_ERROR
"For C++11-Features the MSVC C++ Compiler must be at least version $MSVC_MIN_VER"
)
endif
()
endif
()
endif
()
else
()
else
()
list
(
APPEND COMPILEFLAGS
"-DHAS_CXX11=0"
)
list
(
APPEND COMPILEFLAGS
"-DHAS_CXX11=0"
)
endif
(
ENABLE_CXX11
)
endif
(
ENABLE_CXX11
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment