Put targets on folders, if the IDE supports the feature.

Requires CMake 2.8.3 or newer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126092 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Oscar Fuentes 2011-02-20 22:06:10 +00:00
parent f7ad048f1e
commit 0b85d07d46
11 changed files with 26 additions and 6 deletions

View File

@ -12,6 +12,8 @@ set(CMAKE_MODULE_PATH
set(PACKAGE_VERSION "2.9")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(VersionFromVCS)
option(LLVM_APPEND_VC_REV

View File

@ -25,6 +25,7 @@ macro(add_llvm_library name)
if( CURRENT_LLVM_TARGET )
add_dependencies(${name} ${CURRENT_LLVM_TARGET})
endif()
set_target_properties(${name} PROPERTIES FOLDER "Libraries")
endmacro(add_llvm_library name)
@ -55,6 +56,8 @@ ${name} ignored.")
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
endif()
set_target_properties(${name} PROPERTIES FOLDER "Loadable modules")
endmacro(add_llvm_loadable_module name)
@ -95,6 +98,7 @@ macro(add_llvm_tool name)
if( LLVM_BUILD_TOOLS )
install(TARGETS ${name} RUNTIME DESTINATION bin)
endif()
set_target_properties(${name} PROPERTIES FOLDER "Tools")
endmacro(add_llvm_tool name)
@ -107,9 +111,16 @@ macro(add_llvm_example name)
if( LLVM_BUILD_EXAMPLES )
install(TARGETS ${name} RUNTIME DESTINATION examples)
endif()
set_target_properties(${name} PROPERTIES FOLDER "Examples")
endmacro(add_llvm_example name)
macro(add_llvm_utility name)
add_llvm_executable(${name} ${ARGN})
set_target_properties(${name} PROPERTIES FOLDER "Utils")
endmacro(add_llvm_utility name)
macro(add_llvm_target target_name)
if( TABLEGEN_OUTPUT )
add_custom_target(${target_name}Table_gen
@ -120,6 +131,7 @@ macro(add_llvm_target target_name)
add_llvm_library(LLVM${target_name} ${ARGN} ${TABLEGEN_OUTPUT})
if ( TABLEGEN_OUTPUT )
add_dependencies(LLVM${target_name} ${target_name}Table_gen)
set_target_properties(${target_name}Table_gen PROPERTIES FOLDER "Tablegenning")
endif (TABLEGEN_OUTPUT)
set( CURRENT_LLVM_TARGET LLVM${target_name} )
endmacro(add_llvm_target)

View File

@ -4,6 +4,7 @@ tablegen(Intrinsics.gen -gen-intrinsic)
add_custom_target(intrinsics_gen ALL
DEPENDS ${llvm_builded_incs_dir}/Intrinsics.gen)
set_target_properties(intrinsics_gen PROPERTIES FOLDER "Tablegenning")
set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} intrinsics_gen PARENT_SCOPE)
@ -16,4 +17,5 @@ if( MSVC_IDE OR XCODE )
# We need at least one source file:
${LLVM_MAIN_SRC_DIR}/lib/Transforms/Hello/Hello.cpp
${headers})
set_target_properties(llvm_headers_do_not_build PROPERTIES FOLDER "Misc")
endif()

View File

@ -82,6 +82,7 @@ if(PYTHONINTERP_FOUND)
${LIT_ARGS}
${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Running LLVM regression tests")
set_target_properties(check PROPERTIES FOLDER "Tests")
add_custom_target(check.deps)
add_dependencies(check check.deps)
@ -91,5 +92,6 @@ if(PYTHONINTERP_FOUND)
llc lli llvm-ar llvm-as llvm-dis llvm-extract
llvm-ld llvm-link llvm-mc llvm-nm macho-dump opt
FileCheck count not)
set_target_properties(check.deps PROPERTIES FOLDER "Tests")
endif()

View File

@ -12,9 +12,11 @@ function(add_llvm_unittest test_dirname)
endif()
add_llvm_executable(${test_name}Tests ${ARGN})
add_dependencies(UnitTests ${test_name}Tests)
set_target_properties(${test_name}Tests PROPERTIES FOLDER "Tests")
endfunction()
add_custom_target(UnitTests)
set_target_properties(UnitTests PROPERTIES FOLDER "Tests")
include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
add_definitions(-DGTEST_HAS_RTTI=0)

View File

@ -1,4 +1,4 @@
add_executable(FileCheck
add_llvm_utility(FileCheck
FileCheck.cpp
)

View File

@ -1,4 +1,4 @@
add_executable(FileUpdate
add_llvm_utility(FileUpdate
FileUpdate.cpp
)

View File

@ -1,4 +1,4 @@
add_executable(KillTheDoctor
add_llvm_utility(KillTheDoctor
KillTheDoctor.cpp
)

View File

@ -3,7 +3,7 @@ set(LLVM_REQUIRES_RTTI 1)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR})
add_executable(tblgen
add_llvm_utility(tblgen
ARMDecoderEmitter.cpp
AsmMatcherEmitter.cpp
AsmWriterEmitter.cpp

View File

@ -1,3 +1,3 @@
add_executable(count
add_llvm_utility(count
count.c
)

View File

@ -1,4 +1,4 @@
add_executable(not
add_llvm_utility(not
not.cpp
)