diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f10d604fd7b9c26899e74d33efa27eec26cb27d..909a167daff35d3c96bcbb5978a5dcbf21ca4a07 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,7 +87,7 @@ include (corsikaDefines)
 # check if compiler is C++17 compliant
 #
 include (CheckCXXCompilerFlag)
-check_CXX_compiler_flag ("--std=c++17" COMPILER_SUPPORTS_CXX17)
+check_CXX_compiler_flag ("-std=c++17" COMPILER_SUPPORTS_CXX17)
 if (NOT COMPILER_SUPPORTS_CXX17)
  message (FATAL "| CORSIKA8 > The compiler ${CMAKE_CXX_COMPILER} has no C++17 support. Please use a different C++ compiler.")
 endif ()