[Orxonox-commit 2916] r7619 - code/branches/ois_update/cmake/tools

rgrieder at orxonox.net rgrieder at orxonox.net
Sat Nov 6 14:12:08 CET 2010


Author: rgrieder
Date: 2010-11-06 14:12:07 +0100 (Sat, 06 Nov 2010)
New Revision: 7619

Modified:
   code/branches/ois_update/cmake/tools/GenerateToluaBindings.cmake
   code/branches/ois_update/cmake/tools/TargetUtilities.cmake
Log:
Create directories for each build configuration with CMake if the folder would only be created at build time.
This should only concern tolua bind files (*.h and *.cc).

Modified: code/branches/ois_update/cmake/tools/GenerateToluaBindings.cmake
===================================================================
--- code/branches/ois_update/cmake/tools/GenerateToluaBindings.cmake	2010-11-05 22:08:51 UTC (rev 7618)
+++ code/branches/ois_update/cmake/tools/GenerateToluaBindings.cmake	2010-11-06 13:12:07 UTC (rev 7619)
@@ -32,6 +32,16 @@
  #    RUNTIME_LIBRARY_DIRECTORY - Working directory
  #
 
+# Workaround for XCode: The folder where the bind files are written to has
+# to be present beforehand.
+# We have to do this here because the header files are all stored in a single
+# location per configuration.
+IF(CMAKE_CONFIGURATION_TYPES)
+  FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES})
+    FILE(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/src/toluabind/${_dir}")
+  ENDFOREACH(_dir)
+ENDIF()
+
 FUNCTION(GENERATE_TOLUA_BINDINGS _tolua_package _target_source_files)
   SET(_tolua_inputfiles ${ARGN})
   LIST(REMOVE_ITEM _tolua_inputfiles "INPUTFILES")

Modified: code/branches/ois_update/cmake/tools/TargetUtilities.cmake
===================================================================
--- code/branches/ois_update/cmake/tools/TargetUtilities.cmake	2010-11-05 22:08:51 UTC (rev 7618)
+++ code/branches/ois_update/cmake/tools/TargetUtilities.cmake	2010-11-06 13:12:07 UTC (rev 7619)
@@ -118,6 +118,13 @@
   IF(_arg_TOLUA_FILES)
     GENERATE_TOLUA_BINDINGS(${_target_name_capitalised} _${_target_name}_files
                             INPUTFILES ${_arg_TOLUA_FILES})
+    # Workaround for XCode: The folder where the bind files are written to has
+    # to be present beforehand.
+    IF(CMAKE_CONFIGURATION_TYPES)
+      FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES})
+        FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_dir})
+      ENDFOREACH(_dir)
+    ENDIF()
   ENDIF()
 
   # First part (pre target) of precompiled header files




More information about the Orxonox-commit mailing list