fixed issue with Linux and CMake not finding resource files when launching executable and edited README for Linux more precise building instructions

This commit is contained in:
zmertens
2015-04-08 14:20:44 -07:00
parent c9e0b5bdb8
commit 2193cb3fc4
2 changed files with 4 additions and 7 deletions

View File

@@ -115,6 +115,8 @@ foreach(CHAPTER ${CHAPTERS})
target_link_libraries(${DEMO} ${LIBS})
if(WIN32)
set_target_properties(${DEMO} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/${CHAPTER}")
elseif(UNIX)
set_target_properties(${DEMO} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin/${CHAPTER}")
endif(WIN32)
# copy shader files to build directory
file(GLOB SHADERS
@@ -127,7 +129,7 @@ foreach(CHAPTER ${CHAPTERS})
# configure_file(${SHADER} "test")
add_custom_command(TARGET ${DEMO} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${SHADER} $<TARGET_FILE_DIR:${DEMO}>)
elseif(UNIX)
file(COPY ${SHADER} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${SHADER} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bin/${CHAPTER})
endif(WIN32)
endforeach(SHADER)
@@ -139,8 +141,3 @@ foreach(CHAPTER ${CHAPTERS})
endforeach(CHAPTER)
include_directories(${CMAKE_SOURCE_DIR}/includes)
if(UNIX)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif(UNIX)