-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (29 loc) · 1003 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
cmake_minimum_required(VERSION 3.0)
project(nlp_based_compression)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_PREFIX_PATH "venv/lib/python3.8/site-packages/torch/share/cmake")
#set(CMAKE_PREFIX_PATH "/libtorch/")
find_package(Torch REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
add_executable(${PROJECT_NAME}
nlohmann/json.hpp
src/rans.cpp
src/tokenizer.cpp
src/predictor.cpp
src/main.cpp
)
target_link_libraries(${PROJECT_NAME} "${TORCH_LIBRARIES}")
#cmake -Wno-dev -DCMAKE_PREFIX_PATH=/libtorch/ ..
#cmake --build . --config Release
# TESTS
add_subdirectory(googletest)
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
add_executable(${PROJECT_NAME}_tests
nlohmann/json.hpp
src/rans.cpp
src/tokenizer.cpp
src/predictor.cpp
tests/rans_tests.cpp
)
target_link_libraries(${PROJECT_NAME}_tests "${TORCH_LIBRARIES}")
target_link_libraries(${PROJECT_NAME}_tests gtest gtest_main)