-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
43 lines (38 loc) · 1.63 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
40
41
42
43
cmake_minimum_required(VERSION 3.18)
project(Sightsing)
set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_BUILD_TYPE Debug CACHE STRING "set build type to debug")
# if (${CMAKE_BUILD_TYPE} "Debug")
# message("当前调试模式")
# set(CMAKE_CXX_FLAGS "-g")
# endif()
IF(CMAKE_BUILD_TYPE MATCHES Debug)
message("Debug build.")
ELSEIF(CMAKE_BUILD_TYPE MATCHES Release)
message("Release build.")
ELSE()
message("Some other build type.")
ENDIF()
set(Torch_DIR /home/data/ywm_data/libtorch/share/cmake/Torch)
# set(OpenCV_DIR /usr/local/share/OpenCV)
find_package(Torch REQUIRED)
# find_package(OpenCV REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-O3 -fopenmp -pthread -fpermissive")
add_subdirectory(MusicLoader)
add_subdirectory(MFSHS)
add_subdirectory(utility)
add_subdirectory(SpecTransform)
add_subdirectory(Model)
include_directories(SpecTransform/include)
link_directories(SpecTransform )
add_executable(${PROJECT_NAME} main.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC SpecTransform MusicLoader MFSHS utility)
target_include_directories(${PROJECT_NAME} PUBLIC Model/include)
target_include_directories(${PROJECT_NAME} PUBLIC /usr/local/include/opencv2)
target_link_libraries(${PROJECT_NAME} PUBLIC "${TORCH_LIBRARIES}")
# target_link_libraries(${PROJECT_NAME} PUBLIC "${OPENCV_LIBRARIES}")
target_link_directories(${PROJECT_NAME} PUBLIC /usr/local/lib64)
# target_link_libraries(${PROJECT_NAME} PUBLIC opencv_highgui)
target_link_libraries(${PROJECT_NAME} PUBLIC Model)
target_link_libraries(${PROJECT_NAME} PUBLIC MusicLoader MFSHS utility libfftw3.a)