-
Notifications
You must be signed in to change notification settings - Fork 53
/
AddCXXFiles.cmake
67 lines (53 loc) · 1.45 KB
/
AddCXXFiles.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
function(add_cxx_files TARGET)
file(GLOB_RECURSE INCLUDE_FILES
LIST_DIRECTORIES false
CONFIGURE_DEPENDS
"include/*.h"
"include/*.hpp"
"include/*.hxx"
"include/*.inl"
)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include
PREFIX "Header Files"
FILES ${INCLUDE_FILES})
target_sources("${TARGET}" PUBLIC ${INCLUDE_FILES})
file(GLOB_RECURSE HEADER_FILES
LIST_DIRECTORIES false
CONFIGURE_DEPENDS
"src/*.h"
"src/*.hpp"
"src/*.hxx"
"src/*.inl"
)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src
PREFIX "Header Files"
FILES ${HEADER_FILES})
target_sources("${TARGET}" PRIVATE ${HEADER_FILES})
file(GLOB_RECURSE SOURCE_FILES
LIST_DIRECTORIES false
CONFIGURE_DEPENDS
"src/*.cpp"
"src/*.cxx"
)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src
PREFIX "Source Files"
FILES ${SOURCE_FILES})
target_sources("${TARGET}" PRIVATE ${SOURCE_FILES})
file(GLOB_RECURSE HLSL_FILES
LIST_DIRECTORIES false
CONFIGURE_DEPENDS
"Features/**/*.hlsl"
"Features/**/*.hlsli"
"Package/**/*.hlsl"
"Package/**/*.hlsli"
)
set(HLSL_FILES ${HLSL_FILES} PARENT_SCOPE)
list(APPEND CPP_SOURCES ${HEADER_FILES})
list(APPEND CPP_SOURCES ${SOURCE_FILES})
set(CPP_SOURCES ${CPP_SOURCES} PARENT_SCOPE)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/
PREFIX "HLSL Files"
FILES ${HLSL_FILES})
set_source_files_properties(${HLSL_FILES} PROPERTIES VS_TOOL_OVERRIDE "None")
target_sources("${TARGET}" PRIVATE ${HLSL_FILES})
endfunction()