Skip to content

Commit

Permalink
Avoid set c++11 flag if not needed in Config.cmake
Browse files Browse the repository at this point in the history
Add entry to ChangeLog.
  • Loading branch information
phcerdan committed Dec 18, 2016
1 parent a5a2437 commit 2a00f00
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## New Features / Critical Changes

- *Configuration/General*
- Set flag -std=c++11 only if needed. Modern compilers set compatible flags
by default (gnu++14, etc).
(Pablo H Cerdan,
[#1222](https:/DGtal-team/DGtal/pull/1222))

- *Geometry Package*
- VoronoiMap, PowerMap, (Reverse)DistanceTransformation and ReducedMedialAxis
now work on toric domains (with per-dimension periodicity specification).
Expand Down
1 change: 0 additions & 1 deletion cmake/CheckCPP11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ IF (NOT CPP11_COMPATIBLE_BY_DEFAULT)
COMPILE_DEFINITIONS "-std=c++11"
OUTPUT_VARIABLE OUTPUT
)
SET(CPP11_COMPATIBLE_AFTER_FLAG CPP11_COMPATIBLE_AFTER_FLAG PARENT_SCOPE)
ENDIF()

SET(CPP11_COMPATIBLE CPP11_COMPATIBLE_BY_DEFAULT OR CPP11_COMPATIBLE_AFTER_FLAG)
Expand Down
9 changes: 5 additions & 4 deletions cmake/DGtalConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@ IF (@COLOR_WITH_ALPHA_ARITH_DGTAL@)
ADD_DEFINITIONS(-DCOLOR_WITH_ALPHA_ARITH)
ENDIF(@COLOR_WITH_ALPHA_ARITH_DGTAL@)


IF(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# Set c++11 flag only if needed.
IF (NOT @CPP11_COMPATIBLE_BY_DEFAULT@)
IF (NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
ENDIF()
ENDIF()


IF(@GMP_FOUND_DGTAL@)
ADD_DEFINITIONS("-DWITH_GMP ")
SET(WITH_GMP 1)
Expand Down

0 comments on commit 2a00f00

Please sign in to comment.