Merge pull request #3949 from lrineau/Installation-fix_ctest_for_Andreas-GF

Fix CTest CGAL tests when binary dir is a sub-directory
This commit is contained in:
Laurent Rineau 2019-05-23 08:31:44 +02:00
commit c1a13a0a1e
1 changed files with 6 additions and 1 deletions

View File

@ -105,7 +105,12 @@ function(cgal_setup_test_properties test_name)
APPEND PROPERTY DEPENDS "compilation_of__${exe_name}")
endif()
if(POLICY CMP0066) # CMake 3.7 or later
get_filename_component(_source_dir_abs ${CMAKE_CURRENT_SOURCE_DIR} ABSOLUTE)
get_filename_component(_binary_dir_abs ${CMAKE_CURRENT_BINARY_DIR} ABSOLUTE)
string(FIND "${_binary_dir_abs}" "${_source_dir_abs}" _search_binary_in_source)
if(_search_binary_in_source EQUAL "-1"
AND POLICY CMP0066) # CMake 3.7 or later
if(NOT TEST ${PROJECT_NAME}_SetupFixture)
if(ANDROID)
add_test(NAME ${PROJECT_NAME}_SetupFixture