diff --git a/CMakeLists.txt b/CMakeLists.txt
index abcb8d4a5696477bd3bb2b67bed9a0a2ff9c9e10..76ef2ca6ae0f588b061088aea26601b309f3f0a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -587,7 +587,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
             endforeach()
             string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
             set(CMAKE_REQUIRED_LIBRARIES "${STARPU_SHM_LIBRARIES}")
-            set(CMAKE_REQUIRED_FLAGS "-include starpu_simgrid_wrap.h")
+            list(APPEND CMAKE_REQUIRED_FLAGS "-include starpu_simgrid_wrap.h")
             check_function_exists(starpu_data_idle_prefetch_on_node STARPU_IDLE_PREFETCH_FOUND)
             if ( STARPU_IDLE_PREFETCH_FOUND )
                 add_definitions(-DCHAMELEON_USE_STARPU_IDLE_PREFETCH)