Skip to content

Commit

Permalink
Fix c++11 compilation on cmake < 3.1
Browse files Browse the repository at this point in the history
The compiler-agnostic CXX_STANDARD feature was added in cmake 3.1.
  • Loading branch information
coldfix committed Aug 1, 2018
1 parent 8162356 commit e2d51eb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Expand Up @@ -57,8 +57,12 @@ set_target_properties(madx PROPERTIES LINKER_LANGUAGE Fortran)

# set library version:
set_target_properties(madx PROPERTIES VERSION ${MADX_VERSION})
set_target_properties(madx PROPERTIES CXX_STANDARD 11)

if (${CMAKE_VERSION} VERSION_LESS "3.1")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
set_target_properties(madx PROPERTIES CXX_STANDARD 11)
endif()

# adding an executable:
if(MADX_BUNDLE)
Expand Down

0 comments on commit e2d51eb

Please sign in to comment.