Commits

Alexey Petruchik committed c662af6

tiny fixes in Xcode project generation

Comments (0)

Files changed (1)

src/engine/SCons/Tool/xcodeproj.py

         if not executable:
             self.fileEncoding = 4
             self.name = self._name
-            self.path = path
+            self.path = os.path.relpath(path, context.project_dir)
             self.sourceTree = '"<group>"'
 
             _, filetype = os.path.splitext(self._name)
 def XcodeProjectAction(target, source, env):
     project_name = str(target[0].srcnode())
     print 'Generating Xcode project \"%s\"' % project_name
-    os.mkdir(project_name)
+
+    # Create folder hierarchy
+    path = ''
+    for p in project_name.split(os.path.sep):
+        path = os.path.join(path, p)
+        try:
+            os.mkdir(path)
+        except:
+            pass
 
     # Generate xxx.xcodeproj/project/project.xcworkspace/contents.xcworkspacedata
     os.mkdir(os.path.join(project_name, 'project.xcworkspace'))
 
     context = XcodeProjectBuildContext()
     context.generate_codenav_targets = env.get('generate_codenav_targets', 1)
+    context.project_dir = os.path.dirname(project_name)
 
     include_search_path = map(os.path.abspath, env.get('CPPPATH', []))
 
     buildSettings = {
-        'BUILT_PRODUCTS_DIR': os.getcwd(),#'"/Users/stopiccot/code/other/scons-xcode"', 
+        'BUILT_PRODUCTS_DIR': os.getcwd(),
         'ARCHS': '"$(ARCHS_STANDARD_64_BIT)"',
         'HEADER_SEARCH_PATHS': include_search_path,
         'USER_HEADER_SEARCH_PATHS': include_search_path,