-# Tests are organized to mirror the clitk directory tree.
-# Eacho subdirectory has its own CMakeLists.txt with the compiling directives
+macro(ADD_GOOGLE_TESTS executable)
+ foreach ( source ${ARGN} )
+ file(READ "${source}" contents)
+ string(REGEX MATCHALL "TEST_?F?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
+ foreach(hit ${found_tests})
+ string(REGEX REPLACE ".*\\(([A-Za-z_0-9]+)[, ]*([A-Za-z_0-9]+)\\).*" "\\1.\\2" test_name ${hit})
+ add_test(${test_name} ${executable} --gtest_filter=${test_name})
+ endforeach(hit)
+ endforeach()
+endmacro()
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/tests/bin)
+SET(BUILDNAME ${CMAKE_SYSTEM_NAME}${CMAKE_OSX_ARCHITECTURES} CACHE INTERNAL DOCSTRING)
+SET(CLITK_DATA_PATH ${PROJECT_BINARY_DIR}/tests/data/ CACHE STRING "dataTest path")
+#todo test if data test path exists