--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,8 +31,8 @@
 
 project(ITPP)
 
-#allows to compile IT++ on MacOsX 10.9
-if (APPLE)
+#allows to compile IT++ on MacOsX 10.9 (for clang only)
+if (APPLE AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")
 endif()