Skip to content

Commit 7642fc3

Browse files
committed
Set compiler mode to C++11 and add link dependency from gecodeflatzinc to gecodegist
1 parent 72baa55 commit 7642fc3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@ if (GECODE_DISABLE_WARNINGS)
5555
endif ()
5656
endif ()
5757

58+
if ( (CMAKE_VERSION VERSION_GREATER 3.1.0) OR (CMAKE_VERSION VERSION_EQUAL 3.1.0) )
59+
set (CMAKE_CXX_STANDARD 11)
60+
endif()
61+
check_cxx_compiler_flag(-std=c++11 HAS_STDCPP11)
62+
if (HAS_STDCPP11)
63+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
64+
else()
65+
check_cxx_compiler_flag(-std=c++0x HAS_STDCPP0X)
66+
if (HAS_STDCPP0X)
67+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
68+
else()
69+
message("Warning: Initial check for C++11 unsuccessful. This is fine if HAS_CPP11 test below succeeds.")
70+
endif()
71+
endif()
72+
5873
# The following part of config.h is hard to derive from configure.ac.
5974
file(READ gecode/support/config.hpp.in CONFIG)
6075
string(REGEX REPLACE "^/\\*([^*]|\\*[^/])*\\*/" "" CONFIG ${CONFIG})
@@ -387,6 +402,7 @@ if (GECODE_HAS_QT)
387402
if (Qt5_FOUND)
388403
qt5_use_modules(gecodegist Widgets Gui PrintSupport)
389404
qt5_use_modules(gecodeflatzinc Core)
405+
target_link_libraries(gecodeflatzinc gecodegist)
390406
else()
391407
target_link_libraries(gecodegist ${QT_LIBRARIES})
392408
target_link_libraries(gecodeflatzinc gecodegist ${QT_LIBRARIES})

0 commit comments

Comments
 (0)