aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2017-10-22 02:30:34 +0300
committerWohlstand <admin@wohlnet.ru>2017-10-22 02:30:34 +0300
commit74b4ee66e3b5775f41526d76e7a16433b52f2627 (patch)
tree2ad5c219fdf6e6cc047dc8934e88ff856fa45450 /CMakeLists.txt
parent490bac7421b5345e5b9035f1430520c751935534 (diff)
downloadlibADLMIDI-74b4ee66e3b5775f41526d76e7a16433b52f2627.tar.gz
libADLMIDI-74b4ee66e3b5775f41526d76e7a16433b52f2627.tar.bz2
libADLMIDI-74b4ee66e3b5775f41526d76e7a16433b52f2627.zip
Fixed CMake build on macOS
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 10 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4728a30..d22212d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,7 +42,9 @@ option(USE_DOSBOX_EMULATOR "Use DosBox emulator" OFF)
option(libADLMIDI_STATIC "Build static library of libADLMIDI" ON)
option(libADLMIDI_SHARED "Build shared library of libADLMIDI" OFF)
-
+if(CMAKE_VERSION VERSION_EQUAL "3.1" OR CMAKE_VERSION VERSION_GREATER "3.1")
+ set(CMAKE_CXX_STANDARD 11)
+endif()
set(libADLMIDI_INSTALLS)
@@ -77,9 +79,14 @@ if(WITH_EMBEDDED_BANKS)
if(NOT MSVC)
target_link_libraries(gen_adldata pthread)
endif()
- if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- message("Turned on C++11 on GCC")
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
+ CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
+ message("Turned on C++11 on GCC/CLang/Intel")
target_compile_options(gen_adldata PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-std=c++11>)
+ else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ message("Turned on C++11 on MSVC")
+ target_compile_options(gen_adldata PUBLIC $<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>)
endif()
add_custom_target(