Skip to content

Commit

Permalink
Extract test files so that we can track changes with upcoming commits. (
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardLefebvre authored and hodoulp committed Mar 11, 2019
1 parent 67cb724 commit ed0c9ef
Show file tree
Hide file tree
Showing 117 changed files with 820,177 additions and 15 deletions.
21 changes: 6 additions & 15 deletions tests/data/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
include(ExternalProject)

# Slightly hacky method to force unittest data extraction to be a target
set(UNITTEST_EXTRACT_DIR "${CMAKE_BINARY_DIR}/testdata/dist")
ExternalProject_Add(UNITTEST_DATA
URL "${CMAKE_CURRENT_SOURCE_DIR}/unittestsfiles.tar.gz"
SOURCE_DIR "${CMAKE_BINARY_DIR}/testdata/build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
BUILD_IN_SOURCE 1
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${UNITTEST_EXTRACT_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/testdata/build ${UNITTEST_EXTRACT_DIR}
EXCLUDE_FROM_ALL TRUE
)
set(UNITTEST_DEST_DIR "${CMAKE_BINARY_DIR}/testdata")

# Need to add this superfluous file command to allow imported target to depend on ExternalProject
file(MAKE_DIRECTORY ${UNITTEST_EXTRACT_DIR})
file(MAKE_DIRECTORY ${UNITTEST_DEST_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/files/ DESTINATION ${UNITTEST_DEST_DIR})
add_library(unittest_data INTERFACE IMPORTED GLOBAL)
set_property(TARGET unittest_data PROPERTY INTERFACE_COMPILE_DEFINITIONS "OCIO_UNIT_TEST_FILES_DIR=${UNITTEST_EXTRACT_DIR}")
add_dependencies(unittest_data UNITTEST_DATA)
set_property(TARGET unittest_data PROPERTY INTERFACE_COMPILE_DEFINITIONS "OCIO_UNIT_TEST_FILES_DIR=${UNITTEST_DEST_DIR}")

Loading

0 comments on commit ed0c9ef

Please sign in to comment.