Xcode needs special testdata folder handling
This commit is contained in:
parent
6059e68c4f
commit
747c2a8b6d
@ -70,12 +70,24 @@ target_link_libraries( ${PROJECT_NAME}
|
|||||||
ycm_core
|
ycm_core
|
||||||
gmock_main )
|
gmock_main )
|
||||||
|
|
||||||
# The test executable expects a "testdata" dir in its working directory. Why?
|
|
||||||
# Because there's NO reliable, cross-platform way of getting the directory in
|
if ( NOT CMAKE_GENERATOR_IS_XCODE )
|
||||||
# which the executable is located.
|
# The test executable expects a "testdata" dir in its working directory. Why?
|
||||||
add_custom_target( copy_testdata
|
# Because there's NO reliable, cross-platform way of getting the directory in
|
||||||
|
# which the executable is located.
|
||||||
|
add_custom_target( copy_testdata
|
||||||
COMMAND cmake -E copy_directory
|
COMMAND cmake -E copy_directory
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/testdata
|
${CMAKE_CURRENT_SOURCE_DIR}/testdata
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/testdata )
|
${CMAKE_CURRENT_BINARY_DIR}/testdata )
|
||||||
|
else()
|
||||||
|
add_custom_target( copy_testdata
|
||||||
|
COMMAND cmake -E copy_directory
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/testdata
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/Debug/testdata
|
||||||
|
COMMAND cmake -E copy_directory
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/testdata
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/Release/testdata )
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
add_dependencies( ${PROJECT_NAME} copy_testdata )
|
add_dependencies( ${PROJECT_NAME} copy_testdata )
|
||||||
|
Loading…
Reference in New Issue
Block a user