summaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/GrTest.cmake18
1 files changed, 11 insertions, 7 deletions
diff --git a/cmake/Modules/GrTest.cmake b/cmake/Modules/GrTest.cmake
index 7be65492ee..9d75ece646 100644
--- a/cmake/Modules/GrTest.cmake
+++ b/cmake/Modules/GrTest.cmake
@@ -98,11 +98,13 @@ function(GR_ADD_TEST test_name)
endif(CMAKE_CROSSCOMPILING)
set(sh_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.sh)
file(WRITE ${sh_file} "#!${SHELL}\n")
- #each line sets an environment variable
- foreach(environ ${environs})
- file(APPEND ${sh_file} "export ${environ}\n")
- endforeach(environ)
- #load the command to run with its arguments
+ if (NOT CMAKE_CROSSCOMPILING)
+ #each line sets an environment variable
+ foreach(environ ${environs})
+ file(APPEND ${sh_file} "export ${environ}\n")
+ endforeach(environ)
+ #load the command to run with its arguments
+ endif(CMAKE_CROSSCOMPILING)
foreach(arg ${ARGN})
file(APPEND ${sh_file} "${arg} ")
endforeach(arg)
@@ -111,7 +113,7 @@ function(GR_ADD_TEST test_name)
#make the shell file executable
execute_process(COMMAND chmod +x ${sh_file})
- add_test(${test_name} ${SHELL} ${sh_file})
+ add_test(${test_name} ${SHELL} ${test_name}_test.sh)
endif(UNIX)
if(WIN32)
@@ -161,5 +163,7 @@ function(GR_ADD_CPP_TEST test_name test_source)
set_target_properties(${test_name}
PROPERTIES COMPILE_DEFINITIONS "BOOST_TEST_DYN_LINK;BOOST_TEST_MAIN"
)
- GR_ADD_TEST(${test_name} ${test_name})
+ IF (NOT CMAKE_CROSSCOMPILING)
+ GR_ADD_TEST(${test_name} ${test_name})
+ ENDIF(CMAKE_CROSSCOMPILING)
endfunction(GR_ADD_CPP_TEST)