Browse Source

new try compile module

Ken Martin 23 years ago
parent
commit
32b398e55b
2 changed files with 26 additions and 0 deletions
  1. 20 0
      Modules/TestForANSIStreamHeaders.cmake
  2. 6 0
      Modules/TestForANSIStreamHeaders.cxx

+ 20 - 0
Modules/TestForANSIStreamHeaders.cmake

@@ -0,0 +1,20 @@
+#
+# check if we they have the standard ansi stream files (without the .h)
+#
+# CMAKE_NO_ANSI_STREAM_HEADERS - defined accoreding to the results
+#
+
+MESSAGE(${CMAKE_MAKE_PROGRAM})
+MESSAGE(${PROJECT_BINARY_DIR})
+TRY_COMPILE(CMAKE_ANSI_STREAM_HEADERS ${CMAKE_ROOT}/MOdules/TestForANSIStreamHeaders.cxx ${PROJECT_BINARY_DIR})
+IF (CMAKE_ANSI_STREAM_HEADERS)
+  SET (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL 
+       "Does the compiler support headers like iostream.")
+  MESSAGE("We have ANSI HEADER support")      
+ELSE (CMAKE_ANSI_STREAM_HEADERS)
+  SET (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL 
+     "Does the compiler support headers like iostream.")
+  MESSAGE("We do not have ANSI HEADER support")      
+ENDIF (CMAKE_ANSI_STREAM_HEADERS)
+
+

+ 6 - 0
Modules/TestForANSIStreamHeaders.cxx

@@ -0,0 +1,6 @@
+#include <iostream>
+
+int main(int,char *[])
+{
+  return 0;
+}