Xcode needs special testdata folder handling

This commit is contained in:
Strahinja Val Markovic 2013-05-26 11:59:27 -07:00
parent 6059e68c4f
commit 747c2a8b6d

View File

@ -70,6 +70,8 @@ target_link_libraries( ${PROJECT_NAME}
ycm_core ycm_core
gmock_main ) gmock_main )
if ( NOT CMAKE_GENERATOR_IS_XCODE )
# The test executable expects a "testdata" dir in its working directory. Why? # 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 # Because there's NO reliable, cross-platform way of getting the directory in
# which the executable is located. # which the executable is located.
@ -77,5 +79,15 @@ 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 )