-
Notifications
You must be signed in to change notification settings - Fork 19
/
CMakeLists.txt
53 lines (48 loc) · 1.62 KB
/
CMakeLists.txt
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
project( ${TARGET_NAME} )
set( ${PROJECT_NAME}_VERSION_MAJOR 0 )
set( ${PROJECT_NAME}_VERSION_MINOR 1 )
set( ${PROJECT_NAME}_VERSION_BUILD 0 )
file( GLOB SOURCE_FILES
Src/*.cpp
)
file( GLOB HEADER_FILES
Src/*.hpp
Src/*.inl
)
file( GLOB GLSL_SHADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/Shaders/*.vert
${CMAKE_CURRENT_SOURCE_DIR}/Shaders/*.frag
)
file( GLOB SHADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/Shaders/*.*
)
source_group( "Shader Files" FILES ${GLSL_SHADER_FILES} )
add_executable( ${PROJECT_NAME} WIN32
${SOURCE_FILES}
${HEADER_FILES}
${GLSL_SHADER_FILES}
)
target_link_libraries( ${PROJECT_NAME} PRIVATE
ashes::sample::Common
${Ashes_BINARY_LIBRARIES}
)
add_target_precompiled_header( ${PROJECT_NAME}
${CMAKE_CURRENT_SOURCE_DIR}/Src/PrecompiledHeader.hpp
${CMAKE_CURRENT_SOURCE_DIR}/Src/PrecompiledHeader.cpp
"${CMAKE_CXX_FLAGS}"
${SOURCE_FILES}
)
foreach( SHADER ${SHADER_FILES} )
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
$<$<CONFIG:Debug>:${PROJECTS_BINARIES_OUTPUT_DIR_DEBUG}/share/${FOLDER_NAME}/Shaders>
$<$<CONFIG:Release>:${PROJECTS_BINARIES_OUTPUT_DIR_RELEASE}/share/${FOLDER_NAME}/Shaders>
$<$<CONFIG:RelWithDebInfo>:${PROJECTS_BINARIES_OUTPUT_DIR_RELWITHDEBINFO}/share/${FOLDER_NAME}/Shaders>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SHADER}
$<$<CONFIG:Debug>:${PROJECTS_BINARIES_OUTPUT_DIR_DEBUG}/share/${FOLDER_NAME}/Shaders>
$<$<CONFIG:Release>:${PROJECTS_BINARIES_OUTPUT_DIR_RELEASE}/share/${FOLDER_NAME}/Shaders>
$<$<CONFIG:RelWithDebInfo>:${PROJECTS_BINARIES_OUTPUT_DIR_RELWITHDEBINFO}/share/${FOLDER_NAME}/Shaders>
)
endforeach()