Xcode: support cmake options for grouping in folders
The Xcode IDE can also benefit from the options: - WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS - WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS So add suport to these options and also renames them as they are no longer limited to just Windows and Visual Studio. Reviewed By: brecht, ankitm Differential Revision: https://developer.blender.org/D12132
This commit is contained in:
committed by
Germano Cavalcante
parent
cf10eb54cc
commit
89014b51f1
@@ -612,12 +612,6 @@ if(WIN32)
|
|||||||
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
|
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
|
||||||
mark_as_advanced(WITH_WINDOWS_FIND_MODULES)
|
mark_as_advanced(WITH_WINDOWS_FIND_MODULES)
|
||||||
|
|
||||||
option(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS "Organize the visual studio projects according to source folder structure." ON)
|
|
||||||
mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS)
|
|
||||||
|
|
||||||
option(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS "Organize the source files in filters matching the source folders." ON)
|
|
||||||
mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS)
|
|
||||||
|
|
||||||
option(WINDOWS_PYTHON_DEBUG "Include the files needed for debugging python scripts with visual studio 2017+." OFF)
|
option(WINDOWS_PYTHON_DEBUG "Include the files needed for debugging python scripts with visual studio 2017+." OFF)
|
||||||
mark_as_advanced(WINDOWS_PYTHON_DEBUG)
|
mark_as_advanced(WINDOWS_PYTHON_DEBUG)
|
||||||
|
|
||||||
@@ -635,6 +629,18 @@ if(WIN32)
|
|||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WIN32 OR XCODE)
|
||||||
|
option(IDE_GROUP_SOURCES_IN_FOLDERS "Organize the source files in filters matching the source folders." ON)
|
||||||
|
mark_as_advanced(IDE_GROUP_SOURCES_IN_FOLDERS)
|
||||||
|
|
||||||
|
option(IDE_GROUP_PROJECTS_IN_FOLDERS "Organize the projects according to source folder structure." ON)
|
||||||
|
mark_as_advanced(IDE_GROUP_PROJECTS_IN_FOLDERS)
|
||||||
|
|
||||||
|
if (IDE_GROUP_PROJECTS_IN_FOLDERS)
|
||||||
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
# See WITH_WINDOWS_SCCACHE for Windows.
|
# See WITH_WINDOWS_SCCACHE for Windows.
|
||||||
option(WITH_COMPILER_CCACHE "Use ccache to improve rebuild times (Works with Ninja, Makefiles and Xcode)" OFF)
|
option(WITH_COMPILER_CCACHE "Use ccache to improve rebuild times (Works with Ninja, Makefiles and Xcode)" OFF)
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ function(blender_source_group
|
|||||||
)
|
)
|
||||||
|
|
||||||
# if enabled, use the sources directories as filters.
|
# if enabled, use the sources directories as filters.
|
||||||
if(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS)
|
if(IDE_GROUP_SOURCES_IN_FOLDERS)
|
||||||
foreach(_SRC ${sources})
|
foreach(_SRC ${sources})
|
||||||
# remove ../'s
|
# remove ../'s
|
||||||
get_filename_component(_SRC_DIR ${_SRC} REALPATH)
|
get_filename_component(_SRC_DIR ${_SRC} REALPATH)
|
||||||
@@ -240,8 +240,8 @@ function(blender_source_group
|
|||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# if enabled, set the FOLDER property for visual studio projects
|
# if enabled, set the FOLDER property for the projects
|
||||||
if(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS)
|
if(IDE_GROUP_PROJECTS_IN_FOLDERS)
|
||||||
get_filename_component(FolderDir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
|
get_filename_component(FolderDir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
|
||||||
string(REPLACE ${CMAKE_SOURCE_DIR} "" FolderDir ${FolderDir})
|
string(REPLACE ${CMAKE_SOURCE_DIR} "" FolderDir ${FolderDir})
|
||||||
set_target_properties(${name} PROPERTIES FOLDER ${FolderDir})
|
set_target_properties(${name} PROPERTIES FOLDER ${FolderDir})
|
||||||
|
|||||||
@@ -57,8 +57,6 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS})
|
|
||||||
|
|
||||||
if(NOT WITH_PYTHON_MODULE)
|
if(NOT WITH_PYTHON_MODULE)
|
||||||
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT blender)
|
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT blender)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
function(cycles_set_solution_folder target)
|
function(cycles_set_solution_folder target)
|
||||||
if(WINDOWS_USE_VISUAL_STUDIO_FOLDERS)
|
if(IDE_GROUP_PROJECTS_IN_FOLDERS)
|
||||||
get_filename_component(folderdir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
|
get_filename_component(folderdir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
|
||||||
string(REPLACE ${CMAKE_SOURCE_DIR} "" folderdir ${folderdir})
|
string(REPLACE ${CMAKE_SOURCE_DIR} "" folderdir ${folderdir})
|
||||||
set_target_properties(${target} PROPERTIES FOLDER ${folderdir})
|
set_target_properties(${target} PROPERTIES FOLDER ${folderdir})
|
||||||
|
|||||||
Reference in New Issue
Block a user