150 ELSE() |
150 ELSE() |
151 SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING |
151 SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING |
152 "Default MIP solver backend (GLPK, CPLEX or CBC)") |
152 "Default MIP solver backend (GLPK, CPLEX or CBC)") |
153 ENDIF() |
153 ENDIF() |
154 |
154 |
|
155 IF( ( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") AND |
|
156 ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER_EQUAL "4.8") ) |
|
157 OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
|
158 OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") |
|
159 ) |
|
160 SET(LEMON_NO_UNUSED_LOCAL_TYPEDEF_WARNINGS TRUE) |
|
161 ENDIF() |
155 |
162 |
156 IF(DEFINED ENV{LEMON_CXX_WARNING}) |
163 IF(DEFINED ENV{LEMON_CXX_WARNING}) |
157 SET(CXX_WARNING $ENV{LEMON_CXX_WARNING}) |
164 SET(CXX_WARNING $ENV{LEMON_CXX_WARNING}) |
158 ELSE() |
165 ELSE() |
159 IF(CMAKE_COMPILER_IS_GNUCXX) |
166 IF( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
|
167 OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
|
168 ) |
160 SET(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas") |
169 SET(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas") |
|
170 SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb") |
|
171 SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb") |
|
172 ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") |
|
173 SET(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wsign-promo -Woverloaded-virtual -fno-strict-aliasing -Wno-unknown-pragmas") |
161 SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb") |
174 SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb") |
162 SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb") |
175 SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb") |
163 ELSEIF(MSVC) |
176 ELSEIF(MSVC) |
164 # This part is unnecessary 'casue the same is set by the lemon/core.h. |
177 # This part is unnecessary 'casue the same is set by the lemon/core.h. |
165 # Still kept as an example. |
178 # Still kept as an example. |