From 202009dbdaa878ea8282953c08accd03e2d43a38 Mon Sep 17 00:00:00 2001 From: HackyHuang Date: Thu, 21 Mar 2019 20:03:44 +0800 Subject: [PATCH] update CMake --- CMakeLists.txt | 15 +++++++++++++++ variable.cpp => include/tensor.tpp | 2 +- variable.hpp => include/variable.h | 2 ++ src/test.cpp | 13 +++++++++++++ test.cpp | 10 ---------- 5 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 CMakeLists.txt rename variable.cpp => include/tensor.tpp (96%) rename variable.hpp => include/variable.h (95%) create mode 100644 src/test.cpp delete mode 100644 test.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..de47d8f --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.2) + +PROJECT(ts) + +INCLUDE_DIRECTORIES( +include +) + +AUX_SOURCE_DIRECTORY(src DIR_SRCS) + +SET(TMP +${DIR_SRCS} +) + +ADD_EXECUTABLE(${PROJECT_NAME} ${TMP}) \ No newline at end of file diff --git a/variable.cpp b/include/tensor.tpp similarity index 96% rename from variable.cpp rename to include/tensor.tpp index 4ad0b7a..e16317f 100644 --- a/variable.cpp +++ b/include/tensor.tpp @@ -1,4 +1,4 @@ -#include "variable.hpp" +#include "variable.h" namespace dlframework{ diff --git a/variable.hpp b/include/variable.h similarity index 95% rename from variable.hpp rename to include/variable.h index 8746c6b..f70efae 100644 --- a/variable.hpp +++ b/include/variable.h @@ -36,4 +36,6 @@ namespace dlframework{ }// end dlframework +#include + #endif \ No newline at end of file diff --git a/src/test.cpp b/src/test.cpp new file mode 100644 index 0000000..ef993f9 --- /dev/null +++ b/src/test.cpp @@ -0,0 +1,13 @@ +#include "variable.h" +#include + +using namespace std; +using namespace dlframework; + +int main() +{ + Tensor a({2,3,5}); + cout< - -using namespace std; -using namespace dlframework; - -int main() -{ - Tensor a({1,3}); -} \ No newline at end of file