diff --git a/.gitignore b/.gitignore index 055db60..47544ec 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,8 @@ **/build build_Debug build_Release +build_debug +build_release **/lcoverage .idea cmake-* diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bdd15c..9f35cce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,4 +6,6 @@ include_directories(${TORCH_INCLUDE_DIRS}) add_library(mdlp CPPFImdlp.cpp Metrics.cpp BinDisc.cpp Discretizer.cpp) target_link_libraries(mdlp "${TORCH_LIBRARIES}") add_subdirectory(sample) -add_subdirectory(tests) \ No newline at end of file +if (ENABLE_TESTING) + add_subdirectory(tests) +endif(ENABLE_TESTING) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..eb45104 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +SHELL := /bin/bash +.DEFAULT_GOAL := build +.PHONY: build test + +build: + @if [ -d build_release ]; then rm -fr build_release; fi + @mkdir build_release + @cmake -B build_release -S . -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF + @cmake --build build_release + +test: + @echo "Testing..." + @cd tests && ./test