[Orxonox-commit 1194] r5915 - in code/branches/core5: cmake src

rgrieder at orxonox.net rgrieder at orxonox.net
Fri Oct 9 13:12:47 CEST 2009


Author: rgrieder
Date: 2009-10-09 13:12:47 +0200 (Fri, 09 Oct 2009)
New Revision: 5915

Modified:
   code/branches/core5/cmake/SourceFileUtilities.cmake
   code/branches/core5/src/OrxonoxConfig.cmake
Log:
Added CMake switch to disable multi-file compilations: DISABLE_COMPILATIONS

Modified: code/branches/core5/cmake/SourceFileUtilities.cmake
===================================================================
--- code/branches/core5/cmake/SourceFileUtilities.cmake	2009-10-09 11:12:16 UTC (rev 5914)
+++ code/branches/core5/cmake/SourceFileUtilities.cmake	2009-10-09 11:12:47 UTC (rev 5915)
@@ -46,17 +46,19 @@
       IF(NOT _compilation_name)
         MESSAGE(FATAL_ERROR "No name provided for source file compilation")
       ENDIF()
-      SET(_include_string)
-      FOREACH(_file2 ${_compilation})
-        SET(_include_string "${_include_string}#include \"${_file2}\"\n")
-      ENDFOREACH(_file2)
-      IF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name})
-        FILE(READ ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name} _include_string_file)
+      IF(NOT DISABLE_COMPILATIONS)
+        SET(_include_string)
+        FOREACH(_file2 ${_compilation})
+          SET(_include_string "${_include_string}#include \"${_file2}\"\n")
+        ENDFOREACH(_file2)
+        IF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name})
+          FILE(READ ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name} _include_string_file)
+        ENDIF()
+        IF(NOT _include_string STREQUAL "${_include_string_file}")
+          FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name} "${_include_string}")
+        ENDIF()
+        LIST(APPEND _fullpath_sources ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name})
       ENDIF()
-      IF(NOT _include_string STREQUAL "${_include_string_file}")
-        FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name} "${_include_string}")
-      ENDIF()
-      LIST(APPEND _fullpath_sources ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name})
       SET(_compilation_name)
       SET(_compilation)
       SET(_compile FALSE)
@@ -64,7 +66,7 @@
       # Prefix the full path
       GET_SOURCE_FILE_PROPERTY(_filepath ${_file} LOCATION)
       LIST(APPEND _fullpath_sources ${_filepath})
-      IF(_compile)
+      IF(_compile AND NOT DISABLE_COMPILATIONS)
         LIST(APPEND _compilation ${_filepath})
 	LIST(APPEND _fullpath_sources "H")
       ENDIF()

Modified: code/branches/core5/src/OrxonoxConfig.cmake
===================================================================
--- code/branches/core5/src/OrxonoxConfig.cmake	2009-10-09 11:12:16 UTC (rev 5914)
+++ code/branches/core5/src/OrxonoxConfig.cmake	2009-10-09 11:12:47 UTC (rev 5915)
@@ -38,6 +38,9 @@
   OPTION(PCH_ENABLE "Global PCH switch" TRUE)
 ENDIF()
 
+# Global switch to disable multiple file compilations
+OPTION(DISABLE_COMPILATIONS "Global multi-file compilation switch" FALSE)
+
 # Use WinMain() or main()?
 IF(WIN32)
   OPTION(ORXONOX_USE_WINMAIN "Use WinMain (doesn't show console) or main" FALSE)




More information about the Orxonox-commit mailing list