mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[CMAKE/VS]
* Introduce the support for organizing the solution into a hierarchy of folders that matches our codebase layout. * You can enable this feature by adding -DUSE_FOLDER_STRUCTURE=1 to your configure phase (the VSSolution one). * Based on a patch by Yuntian Zhang with my improvements. CORE-7412 svn path=/trunk/; revision=59860
This commit is contained in:
parent
bf493b93af
commit
e3f48f8607
2 changed files with 29 additions and 0 deletions
|
@ -345,6 +345,32 @@ if(NOT MSVC_IDE)
|
|||
_add_executable(${name} ${ARGN})
|
||||
add_clean_target(${name})
|
||||
endfunction()
|
||||
elseif(USE_FOLDER_STRUCTURE)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
string(LENGTH ${CMAKE_SOURCE_DIR} CMAKE_SOURCE_DIR_LENGTH)
|
||||
|
||||
function(add_custom_target name)
|
||||
_add_custom_target(${name} ${ARGN})
|
||||
string(SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR_LENGTH} -1 CMAKE_CURRENT_SOURCE_DIR_RELATIVE)
|
||||
set_property(TARGET "${name}" PROPERTY FOLDER "${CMAKE_CURRENT_SOURCE_DIR_RELATIVE}")
|
||||
endfunction()
|
||||
|
||||
function(add_library name)
|
||||
_add_library(${name} ${ARGN})
|
||||
get_target_property(_target_excluded ${name} EXCLUDE_FROM_ALL)
|
||||
if(_target_excluded AND ${name} MATCHES "^lib.*")
|
||||
set_property(TARGET "${name}" PROPERTY FOLDER "Importlibs")
|
||||
else()
|
||||
string(SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR_LENGTH} -1 CMAKE_CURRENT_SOURCE_DIR_RELATIVE)
|
||||
set_property(TARGET "${name}" PROPERTY FOLDER "${CMAKE_CURRENT_SOURCE_DIR_RELATIVE}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(add_executable name)
|
||||
_add_executable(${name} ${ARGN})
|
||||
string(SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR_LENGTH} -1 CMAKE_CURRENT_SOURCE_DIR_RELATIVE)
|
||||
set_property(TARGET "${name}" PROPERTY FOLDER "${CMAKE_CURRENT_SOURCE_DIR_RELATIVE}")
|
||||
endfunction()
|
||||
endif()
|
||||
|
||||
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
||||
|
|
|
@ -45,6 +45,9 @@ endif()
|
|||
|
||||
if(MSVC_IDE)
|
||||
add_compile_flags("/MP")
|
||||
if(NOT DEFINED USE_FOLDER_STRUCTURE)
|
||||
set(USE_FOLDER_STRUCTURE FALSE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${_MACHINE_ARCH_FLAG} MATCHES X86)
|
||||
|
|
Loading…
Reference in a new issue