Skip to content
Snippets Groups Projects
Commit b49b7091 authored by Nils Petter Skålerud's avatar Nils Petter Skålerud
Browse files

Fixed building on Windows

Resources should now be copied into executable folder correctly again.

Signed-off-by: default avatarNils Petter Skålerud <np_skalerud@hotmail.com>
parent ccf5f2be
Branches
No related tags found
No related merge requests found
[submodule "external/DMath"]
[submodule "DMath"]
path = external/DMath
url = https://github.com/Didgy74/DMath.git
shallow = true
[submodule "external/fx-gltf"]
branch = master
[submodule "fx-gltf"]
path = external/fx-gltf
url = https://github.com/jessey-git/fx-gltf.git
shallow = true
[submodule "external/nlohmann-json"]
branch = master
[submodule "nlohmann-json"]
path = external/nlohmann-json
url = https://github.com/nlohmann/json.git
shallow = true
branch = master
......@@ -13,15 +13,18 @@ target_link_libraries(${PROJECT_NAME} external::external)
# Add custom command to copy Data directory to build directory
# Remove Data directory in build directory if present
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Data
$<TARGET_FILE_DIR:${PROJECT_NAME}>/Data
)
# Copy directory from source folder to build folder
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/Data
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Data
$<TARGET_FILE_DIR:${PROJECT_NAME}>/Data
)
# GLEW
......
......@@ -24,10 +24,12 @@ if (WIN32)
set(GLEW_BINARY "${GLEW_BINDIR}/${GLEW_BINNAME}")
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD # Adds a post-build event to MyTest
COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
${GLEW_BINARY} # <--this is in-file
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${GLEW_BINNAME}) # <--this is out-file path
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${GLEW_BINARY}"
"$<TARGET_FILE_DIR:${PROJECT_NAME}>/${GLEW_BINNAME}"
)
endif()
......
......@@ -24,10 +24,12 @@ if (WIN32)
set(GLFW3_BINARY "${GLFW3_BINDIR}/${GLFW3_BINNAME}")
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD # Adds a post-build event to MyTest
COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
${GLFW3_BINARY} # <--this is in-file
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${GLFW3_BINNAME}) # <--this is out-file path
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${GLFW3_BINARY}"
"$<TARGET_FILE_DIR:${PROJECT_NAME}>/${GLFW3_BINNAME}"
)
endif()
......
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment