cmake now generates studio filters for spark_lib project

This commit is contained in:
Kevin Darby committed 2017-09-08 13:17:00 -04:00
1 parent eb671ea2f9
commit a1ebf2b779
2 files changed
+28

No files matched your search

+4
View File
@@ -223,4 +223,8 @@ else ()
-pthread)
endif()
if (WIN32)
include(${CMAKE_SOURCE_DIR}/tools/vs_filters.cmake)
endif()
+24
View File
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.5)
#add protos to the library to facilitate source_group
target_sources(spark_lib PUBLIC
${Config_Protos}
${NonConfig_Protos}
${Service_Protos}
)
function(assign_source_group)
foreach(_source IN ITEMS ${ARGN})
if (IS_ABSOLUTE "${_source}")
file(RELATIVE_PATH _source_rel "${CMAKE_CURRENT_SOURCE_DIR}" "${_source}")
else()
set(_source_rel "${_source}")
endif()
get_filename_component(_source_path "${_source_rel}" PATH)
string(REPLACE "/" "\\" _source_path_msvc "${_source_path}")
source_group("${_source_path_msvc}" FILES "${_source}")
set(SOURCE_FILES "${_source}")
endforeach()
endfunction(assign_source_group)
assign_source_group(${SparkLib_Sources} ${Config_Protos} ${NonConfig_Protos} ${Service_Protos})