Skip to content

Commit

Permalink
fix: Update CMakeLists.txt of example
Browse files Browse the repository at this point in the history
  • Loading branch information
J. K. Lee committed Oct 25, 2021
1 parent 20c118a commit ef05a87
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,28 @@ PROJECT(${PROJECT_NAME})
# Define character set as Unicode
add_definitions(-DUNICODE -D_UNICODE)

# Collect shader files
FILE( GLOB VS_SHD ${CMAKE_SOURCE_DIR}/../shader/vertexShader.hlsl )
FILE( GLOB PS_SHD ${CMAKE_SOURCE_DIR}/../shader/fragShader.hlsl )

# Set the shader type of files
set_property(SOURCE ${VS_SHD} PROPERTY VS_SHADER_TYPE Vertex)
set_property(SOURCE ${PS_SHD} PROPERTY VS_SHADER_TYPE Pixel)
# Set configuration types
Set(CMAKE_CONFIGURATION_TYPES Debug Release)

# Set the header directory
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/../DXViewer-2.0.0/include)
LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/../DXViewer-2.0.0/lib)

# Copy DLLs
FILE(GLOB DLL ${CMAKE_SOURCE_DIR}/../DXViewer-2.0.0/bin/*.dll)
FILE(COPY ${DLL} DESTINATION ${CMAKE_BINARY_DIR})

# Copy CSOs
FILE(GLOB CSO ${CMAKE_SOURCE_DIR}/../DXViewer-2.0.0/*.cso)
FILE(COPY ${CSO} DESTINATION ${CMAKE_BINARY_DIR})

# Collect source files
FILE( GLOB SRC ${CMAKE_SOURCE_DIR}/../src/*.cpp ${CMAKE_SOURCE_DIR}/*.cpp)
FILE( GLOB HDR ${CMAKE_SOURCE_DIR}/../DXViewer-2.0.0/include/*.h ${CMAKE_SOURCE_DIR}/*.h)
FILE( GLOB SHD ${VS_SHD} ${PS_SHD} )
FILE( GLOB SRC ${CMAKE_SOURCE_DIR}/*.cpp)
FILE( GLOB HDR ${CMAKE_SOURCE_DIR}/*.h)

# Link Source files ('WIN32' keyword is used for win32 project)
ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${SRC} ${HDR} ${SHD} )
ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${SRC} ${HDR} )

# Set 'Additional Dependencies'
SET(LIB $<$<CONFIG:DEBUG>:DXViewer.lib> $<$<CONFIG:RELEASE>:DXViewerRel.lib>)
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${LIB})

0 comments on commit ef05a87

Please sign in to comment.