cmake: Fixup FOLDER properties

This commit is contained in:
Karl Schultz 2018-06-14 16:53:01 -06:00
parent cb4603dd79
commit ff7d761579
4 changed files with 11 additions and 8 deletions

View File

@ -38,9 +38,10 @@ if(APPLE)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})
endif()
# Enable cmake folders
# Enable IDE GUI folders
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(LVL_TARGET_FOLDER lvl_cmake_targets)
# "Helper" targets that don't have interesting source code should set their FOLDER property to this
set(LOADER_HELPER_FOLDER "Helper Targets")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(FALLBACK_CONFIG_DIRS "/etc/xdg" CACHE STRING
@ -146,7 +147,7 @@ add_custom_target(generate_helper_files DEPENDS
vk_extension_helper.h
vk_typemap_helper.h
)
set_target_properties(generate_helper_files PROPERTIES FOLDER ${LVL_TARGET_FOLDER})
set_target_properties(generate_helper_files PROPERTIES FOLDER ${LOADER_HELPER_FOLDER})
# Rules to build generated helper files
run_vk_xml_generate(loader_extension_generator.py vk_layer_dispatch_table.h)
@ -179,6 +180,7 @@ if(NOT TARGET uninstall)
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
set_target_properties(uninstall PROPERTIES FOLDER ${LOADER_HELPER_FOLDER})
endif()
add_definitions(-DAPI_NAME="Vulkan")

View File

@ -104,7 +104,7 @@ if (WIN32)
add_dependencies(asm_offset generate_helper_files loader_gen_files)
add_custom_command(OUTPUT gen_defines.asm DEPENDS asm_offset COMMAND asm_offset MASM)
add_custom_target(loader_asm_gen_files DEPENDS gen_defines.asm)
set_target_properties(loader_asm_gen_files PROPERTIES FOLDER ${LVL_TARGET_FOLDER})
set_target_properties(loader_asm_gen_files PROPERTIES FOLDER ${LOADER_HELPER_FOLDER})
else()
message(WARNING "Could not find working MASM assebler\n${ASM_FAILURE_MSG}")
set(OPT_LOADER_SRCS ${OPT_LOADER_SRCS} unknown_ext_chain.c)
@ -143,7 +143,7 @@ add_custom_target(loader_gen_files DEPENDS
vk_loader_extensions.h
vk_loader_extensions.c
)
set_target_properties(loader_gen_files PROPERTIES FOLDER ${LVL_TARGET_FOLDER})
set_target_properties(loader_gen_files PROPERTIES FOLDER ${LOADER_HELPER_FOLDER})
if (WIN32)
# Use static MSVCRT libraries

View File

@ -85,7 +85,7 @@ if(TARGET gtest_main)
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${RUN_ALL} run_all_tests.ps1
VERBATIM
)
set_target_properties(binary-dir-symlinks PROPERTIES FOLDER ${LVL_TARGET_FOLDER})
set_target_properties(binary-dir-symlinks PROPERTIES FOLDER ${LOADER_HELPER_FOLDER})
endif()
endif()

View File

@ -12,6 +12,7 @@ set(CMAKE_INSTALL_RPATH ${VK_LAYER_RPATH})
if (WIN32)
if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR))
add_custom_target(mk_test_layer_config_dir ALL COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
set_target_properties(mk_test_layer_config_dir PROPERTIES FOLDER ${LOADER_HELPER_FOLDER})
foreach (config_file ${LAYER_JSON_FILES})
FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/windows/${config_file}.json src_json)
if (CMAKE_GENERATOR MATCHES "^Visual Studio.*")
@ -24,7 +25,7 @@ if (WIN32)
VERBATIM
)
add_dependencies(${config_file}-json mk_test_layer_config_dir)
set_target_properties(${config_file}-json PROPERTIES FOLDER ${LVL_TARGET_FOLDER})
set_target_properties(${config_file}-json PROPERTIES FOLDER ${LOADER_HELPER_FOLDER})
endforeach(config_file)
endif()
elseif(APPLE)
@ -67,7 +68,7 @@ if (WIN32)
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DEF_FILE} VkLayer_${target}.def
VERBATIM
)
set_target_properties(copy-${target}-def-file PROPERTIES FOLDER ${LVL_TARGET_FOLDER})
set_target_properties(copy-${target}-def-file PROPERTIES FOLDER ${LOADER_HELPER_FOLDER})
add_library(VkLayer_${target} SHARED ${ARGN} VkLayer_${target}.def)
add_dependencies(VkLayer_${target} generate_helper_files)
endmacro()