@@ -18,9 +18,7 @@ endif( )
1818
1919# message( fixedTestLocation ": ${fixedTestLocation}" )
2020# Get the directory that the test executable resides in; this helps get_prerequisites( ) find dependent libraries
21- get_filename_component ( testName "${fixedTestLocation} " NAME )
22- string ( REPLACE ${testName} "" testDir ${fixedTestLocation} )
23- string ( REGEX REPLACE "/+$" "" testDir ${testDir} )
21+ get_filename_component ( testDir "${fixedTestLocation} " DIRECTORY )
2422# message( testDir ": ${testDir}" )
2523
2624set ( installPath "" )
@@ -33,27 +31,49 @@ endif( )
3331# Only search for dependencies that have ROOT defined
3432set ( depList "" )
3533
36- if ( EXISTS "@FFTW_ROOT@" )
37- list ( APPEND depList "@FFTW_ROOT@/lib@SUFFIX_LIB@" )
34+ #This logic assumes that FindFFTW.cmake has been called
35+ get_filename_component ( fftwDirSingle "@FFTW_SINGLE_PRECISION_LIBRARIES@" DIRECTORY )
36+ get_filename_component ( fftwDirDouble "@FFTW_DOUBLE_PRECISION_LIBRARIES@" DIRECTORY )
37+
38+ if ( EXISTS "${fftwDirSingle} " )
39+ list ( APPEND depList "${fftwDirSingle} " )
40+ # message( "fftwDirSingle: ${fftwDirSingle}" )
41+ endif ( )
42+
43+ string ( COMPARE NOTEQUAL "${fftwDirSingle} " "${fftwDirDouble} " fftwDiffDirs )
44+ if ( ${fftwDiffDirs} AND EXISTS "${fftwDirDouble} " )
45+ list ( APPEND depList "${fftwDirDouble} " )
46+ # message( "fftwDirDouble: ${fftwDirDouble}" )
47+ endif ( )
48+
49+ #This logic assumes that FindGTest.cmake has been called
50+ get_filename_component ( gtestDir "@GTEST_LIBRARY@" DIRECTORY )
51+ get_filename_component ( gtestDirDebug "@GTEST_LIBRARY_DEBUG@" DIRECTORY )
52+
53+ if ( EXISTS "${gtestDir} " )
54+ list ( APPEND depList "${gtestDir} " )
55+ # message( "gtestDir: ${gtestDir}" )
3856endif ( )
3957
40- if ( EXISTS "@GTEST_ROOT@" )
41- list ( APPEND depList "@GTEST_ROOT@/lib@SUFFIX_LIB@" )
58+ string ( COMPARE NOTEQUAL "${gtestDir} " "${gtestDirDebug} " gtestDiffDirs )
59+ if ( ${gtestDiffDirs} AND EXISTS "${gtestDirDebug} " )
60+ list ( APPEND depList "${gtestDirDebug} " )
61+ # message( "gtestDirDebug: ${gtestDirDebug}" )
4262endif ( )
4363
44- if ( EXISTS "@OPENCL_LIBRARIES@" )
45- get_filename_component ( clLibName "@OPENCL_LIBRARIES@" NAME )
46- string ( REPLACE ${clLibName} "" clLibDir "@OPENCL_LIBRARIES@" )
47- string ( REGEX REPLACE "/+$" "" clLibDir ${clLibDir} )
64+ #This logic assumes that FindOpenCL.cmake has been called
65+ get_filename_component ( openclDir "@OPENCL_LIBRARIES@" DIRECTORY )
4866
49- list ( APPEND depList "${clLibDir} " )
67+ if ( EXISTS "${openclDir} " )
68+ list ( APPEND depList "${openclDir} " )
69+ # message( "openclDir: ${openclDir}" )
5070endif ( )
5171
5272if ( EXISTS "${testDir} " )
5373 list ( APPEND depList "${testDir} " )
5474endif ( )
5575
56- # message( STATUS "depList: ${depList}" )
76+ # message( "depList: ${depList}" )
5777
5878# This retrieves a list of shared library dependencies from the target; they are not full path names
5979# Skip system dependencies and skip recursion
0 commit comments