Skip to content

Commit

Permalink
updated the CMakeLists to auto copy files to build folder, seems to w…
Browse files Browse the repository at this point in the history
…ork for some IDEs but need to test on windows
  • Loading branch information
jmacey committed Oct 11, 2023
1 parent 9e16ec0 commit 86c922d
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,33 @@ if(NOT DEFINED PYNGL_ONLY)
target_link_libraries(NGLTests PRIVATE --coverage)
endif()
# gtest_discover_tests(NGLTests)
add_custom_target(CopyTestfiles ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/tests/files
${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/files
COMMENT "Copy Test files to build directory"
# Now create a post build command to copy the test directories
add_custom_command(
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/tests/files
${CMAKE_BINARY_DIR}/files
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT ${CMAKE_BINARY_DIR}/files/
COMMENT "copying test files"
)
# Now a custom target to copy the files which check to see if the files exist
add_custom_target(
CopyTestfiles ALL
DEPENDS ${CMAKE_BINARY_DIR}/files/
)
# now add this a dependency for NGLTests so it gets run.
add_dependencies(NGLTests CopyTestfiles )



# add_custom_target(CopyTestfiles ALL
# COMMAND ${CMAKE_COMMAND} -E copy_directory
# ${CMAKE_SOURCE_DIR}/tests/files
# ${CMAKE_BINARY_DIR}/files
# COMMENT "Copy Test files to build directory"
# )

endif() # PYNGL_ONLY

# PyNGL
Expand Down

0 comments on commit 86c922d

Please sign in to comment.