Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
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
Core Modules
dune-common
Commits
17470efb
Commit
17470efb
authored
11 years ago
by
Christoph Grüninger
Browse files
Options
Downloads
Patches
Plain Diff
[CMake] Code beautification.
Avoid upper case commands.
parent
5b8232d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmake/modules/CheckCXX11Features.cmake
+17
-16
17 additions, 16 deletions
cmake/modules/CheckCXX11Features.cmake
cmake/modules/CheckSharedPtr.cmake
+8
-8
8 additions, 8 deletions
cmake/modules/CheckSharedPtr.cmake
with
25 additions
and
24 deletions
cmake/modules/CheckCXX11Features.cmake
+
17
−
16
View file @
17470efb
...
...
@@ -24,7 +24,7 @@ include(TestCXXAcceptsFlag)
if
(
NOT DISABLE_GXX0XCHECK
)
# try to use compiler flag -std=c++11
CHECK_CXX_ACCEPTS_FLAG
(
"-std=c++11"
CXX_FLAG_CXX11
)
check_cxx_accepts_flag
(
"-std=c++11"
CXX_FLAG_CXX11
)
endif
(
NOT DISABLE_GXX0XCHECK
)
if
(
CXX_FLAG_CXX11
)
...
...
@@ -38,7 +38,7 @@ if(CXX_FLAG_CXX11)
else
()
if
(
NOT DISABLE_GXX0XCHECK
)
# try to use compiler flag -std=c++0x for older compilers
CHECK_CXX_ACCEPTS_FLAG
(
"-std=c++0x"
CXX_FLAG_CXX0X
)
check_cxx_accepts_flag
(
"-std=c++0x"
CXX_FLAG_CXX0X
)
endif
(
NOT DISABLE_GXX0XCHECK
)
if
(
CXX_FLAG_CXX0X
)
set
(
CMAKE_REQUIRED_FLAGS
"
${
CMAKE_REQUIRED_FLAGS
}
-std=c++0x"
)
...
...
@@ -54,7 +54,7 @@ endif(CXX_FLAG_CXX11)
include
(
CheckCXXSourceCompiles
)
# nullptr
CHECK_CXX_SOURCE_COMPILES
(
"
check_cxx_source_compiles
(
"
int main(void)
{
char* ch = nullptr;
...
...
@@ -67,7 +67,7 @@ include(CheckIncludeFileCXX)
if
(
NOT DISABLE_TR1_HEADERS
)
# array and fill
CHECK_CXX_SOURCE_COMPILES
(
"
check_cxx_source_compiles
(
"
#include <array>
int main(void)
...
...
@@ -103,14 +103,15 @@ endif(NOT HAVE_FUNCTIONAL)
if
(
_functional_header
)
check_cxx_source_compiles
(
"
#include <
${
_functional_header
}
>
int main(void){
${
_hash_type
}
<int> hasher; hasher(42);
}"
${
_hash_variable
}
)
#include <
${
_functional_header
}
>
int main(void){
${
_hash_type
}
<int> hasher; hasher(42);
}
"
${
_hash_variable
}
)
endif
(
_functional_header
)
# Check whether if std::integral_constant< T, v > is supported and casts into T
CHECK_CXX_SOURCE_COMPILES
(
"
check_cxx_source_compiles
(
"
#include <type_traits>
void f( int ){}
...
...
@@ -123,7 +124,7 @@ CHECK_CXX_SOURCE_COMPILES("
endif
(
NOT DISABLE_TR1_HEADERS
)
# __attribute__((unused))
CHECK_CXX_SOURCE_COMPILES
(
"
check_cxx_source_compiles
(
"
int main(void)
{
int __attribute__((unused)) foo;
...
...
@@ -133,7 +134,7 @@ CHECK_CXX_SOURCE_COMPILES("
)
# __attribute__((deprecated))
CHECK_CXX_SOURCE_COMPILES
(
"
check_cxx_source_compiles
(
"
#define DEP __attribute__((deprecated))
class bar
{
...
...
@@ -165,7 +166,7 @@ CHECK_CXX_SOURCE_COMPILES("
)
# __attribute__((deprecated("msg")))
CHECK_CXX_SOURCE_COMPILES
(
"
check_cxx_source_compiles
(
"
#define DEP __attribute__((deprecated(
\"
message
\"
)))
class bar {
bar() DEP;
...
...
@@ -197,7 +198,7 @@ CHECK_CXX_SOURCE_COMPILES("
)
# static assert
CHECK_CXX_SOURCE_COMPILES
(
"
check_cxx_source_compiles
(
"
int main(void)
{
static_assert(true,
\"
MSG
\"
);
...
...
@@ -207,7 +208,7 @@ CHECK_CXX_SOURCE_COMPILES("
)
# variadic template support
CHECK_CXX_SOURCE_COMPILES
(
"
check_cxx_source_compiles
(
"
#include <cassert>
template<typename... T>
...
...
@@ -233,7 +234,7 @@ CHECK_CXX_SOURCE_COMPILES("
)
# SFINAE on variadic template constructors within template classes
CHECK_CXX_SOURCE_COMPILES
(
"
check_cxx_source_compiles
(
"
#include <functional>
template<typename... U>
...
...
@@ -269,7 +270,7 @@ CHECK_CXX_SOURCE_COMPILES("
)
# rvalue references
CHECK_CXX_SOURCE_COMPILES
(
"
check_cxx_source_compiles
(
"
#include <cassert>
#include <utility>
int foo(int&& x) { return 1; }
...
...
This diff is collapsed.
Click to expand it.
cmake/modules/CheckSharedPtr.cmake
+
8
−
8
View file @
17470efb
...
...
@@ -7,16 +7,16 @@
# SHARED_PTR_HEADER: The name of header file supplying shared_ptr
#
# check if make_shared works
macro
(
CHECK_MAKE_SHARED
)
macro
(
check_make_shared
)
include
(
CheckIncludeFileCXX
)
if
(
SHARED_PTR_NAMESPACE EQUAL
"boost"
)
CHECK_INCLUDE_FILE_CXX
(
"boost/make_shared.hpp"
HAVE_BOOST_MAKE_SHARED_HPP
)
check_include_file_cxx
(
"boost/make_shared.hpp"
HAVE_BOOST_MAKE_SHARED_HPP
)
endif
(
SHARED_PTR_NAMESPACE EQUAL
"boost"
)
CHECK_INCLUDE_FILE_CXX
(
"boost/shared_ptr.hpp"
HAVE_BOOST_SHARED_PTR_HPP
)
check_include_file_cxx
(
"boost/shared_ptr.hpp"
HAVE_BOOST_SHARED_PTR_HPP
)
CHECK_CXX_SOURCE_COMPILES
(
"
check_cxx_source_compiles
(
"
#if defined(HAVE_MEMORY)
# include <memory>
#endif
...
...
@@ -34,14 +34,14 @@ macro(CHECK_MAKE_SHARED)
return 0;
}
"
HAVE_MAKE_SHARED
)
endmacro
(
CHECK_MAKE_SHARED
)
endmacro
(
check_make_shared
)
# check location of shared_ptr header file and the necessary namespace
include
(
CheckCXXSourceCompiles
)
# search namespace
foreach
(
SHARED_PTR_NAMESPACE_
"std"
"tr1"
"std::tr1"
"boost"
)
CHECK_CXX_SOURCE_COMPILES
(
"
check_cxx_source_compiles
(
"
#include <memory>
#include <string>
...
...
@@ -58,7 +58,7 @@ foreach(SHARED_PTR_NAMESPACE_ "std" "tr1" "std::tr1" "boost")
if
(
SHARED_PTR_NAMESPACE_FOUND
)
#search header name
foreach
(
SHARED_PTR_HEADER_
"<memory>"
"<tr1/memory>"
"<boost/shared_ptr.hpp>"
)
CHECK_CXX_SOURCE_COMPILES
(
"
check_cxx_source_compiles
(
"
# include
${
SHARED_PTR_HEADER_
}
#include <string>
...
...
@@ -76,7 +76,7 @@ foreach(SHARED_PTR_NAMESPACE_ "std" "tr1" "std::tr1" "boost")
# save result
set
(
SHARED_PTR_NAMESPACE
${
SHARED_PTR_NAMESPACE_
}
)
set
(
SHARED_PTR_HEADER
${
SHARED_PTR_HEADER_
}
)
CHECK_MAKE_SHARED
()
check_make_shared
()
return
()
endif
(
SHARED_PTR_HEADER_FOUND
)
endforeach
(
SHARED_PTR_HEADER_
)
...
...
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