using std::cout;
using std::endl;
+#ifdef CMAKE_BUILD
+ #include <cmake_test_defines.hpp.gen.cmake>
+#else
+ #define CUDA_TEST_DEVICE -1
+ #define CMAKE_SOURCE_DIR "src/"
+ #define Examples_SOURCE_DIR "examples/"
+ #define CMAKE_EXT ""
+#endif
+
int main(int argc, char** argv);
namespace caffe {
# Set CUDA Device number and CMAKE_SOURCE_DIR
add_definitions(-DCMAKE_BUILD)
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/cmake_test_defines.hpp.in
- ${CMAKE_CURRENT_SOURCE_DIR}/cmake_test_defines.hpp.gen.cmake
-)
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/test_data/sample_data_list.txt.in
- ${CMAKE_CURRENT_SOURCE_DIR}/test_data/sample_data_list.txt.gen.cmake
+# Generate config files
+set(IN_EXT .in)
+set(GEN_EXT .gen.cmake)
+set(TEST_DEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake_test_defines.hpp)
+set(TEST_DATA_FILE ${CMAKE_CURRENT_SOURCE_DIR}/test_data/sample_data_list.txt)
+
+set(IN_FILES
+ ${TEST_DEFINES_FILE}
+ ${TEST_DATA_FILE}
)
+foreach(in_file ${IN_FILES})
+
+ configure_file(
+ ${in_file}${IN_EXT}
+ ${in_file}${GEN_EXT}
+ )
+
+endforeach()
+
+
+#configure_file(
+# ${CMAKE_CURRENT_SOURCE_DIR}/cmake_test_defines.hpp.in
+# ${CMAKE_CURRENT_SOURCE_DIR}/cmake_test_defines.hpp.gen.cmake
+#)
+#
+#configure_file(
+# ${CMAKE_CURRENT_SOURCE_DIR}/test_data/sample_data_list.txt.in
+# ${CMAKE_CURRENT_SOURCE_DIR}/test_data/sample_data_list.txt.gen.cmake
+#)
+
include_directories(
${Caffe_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
)
set(TEST_MAIN test_caffe_main.cpp)
+++ /dev/null
-// Copyright 2014 BVLC and contributors.
-
-// The main caffe test code. Your test cpp code should include this hpp
-// to allow a main function to be compiled into the binary.
-#ifndef CAFFE_TEST_TEST_CAFFE_MAIN_HPP_
-#define CAFFE_TEST_TEST_CAFFE_MAIN_HPP_
-
-#include <cuda_runtime.h>
-#include <glog/logging.h>
-#include <gtest/gtest.h>
-
-#include <cstdlib>
-#include <cstdio>
-
-using std::cout;
-using std::endl;
-
-#ifdef CMAKE_BUILD
- #include "cmake_test_defines.hpp.gen.cmake"
-#else
- #define CUDA_TEST_DEVICE -1
- #define CMAKE_SOURCE_DIR "src/"
- #define Examples_SOURCE_DIR "examples/"
- #define CMAKE_EXT ""
-#endif
-
-int main(int argc, char** argv);
-
-#endif // CAFFE_TEST_TEST_CAFFE_MAIN_HPP_