-
-
Notifications
You must be signed in to change notification settings - Fork 266
/
Copy pathCMakeLists.txt
39 lines (30 loc) · 1.34 KB
/
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
38
39
cmake_minimum_required(VERSION 3.28.6 FATAL_ERROR)
project(language-model VERSION 1.0.0 LANGUAGES CXX)
set(EXECUTABLE_NAME language-model)
add_executable(${EXECUTABLE_NAME})
target_sources(${EXECUTABLE_NAME} PRIVATE src/main.cpp
src/rnn_lm.cpp
src/corpus.cpp
src/dictionary.cpp
include/rnn_lm.h
include/corpus.h
include/dictionary.h
)
target_include_directories(${EXECUTABLE_NAME} PRIVATE include)
target_link_libraries(${EXECUTABLE_NAME} ${TORCH_LIBRARIES})
set_target_properties(${EXECUTABLE_NAME} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
)
if(DOWNLOAD_DATASETS)
add_dependencies(${EXECUTABLE_NAME} penntreebank)
endif()
add_custom_command(TARGET ${EXECUTABLE_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory output)
if(MSVC)
set_target_properties(${EXECUTABLE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR})
set_target_properties(${EXECUTABLE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR})
include(copy_torch_dlls)
copy_torch_dlls(${EXECUTABLE_NAME})
endif(MSVC)