-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
31 lines (24 loc) · 1.15 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
cmake_minimum_required (VERSION 3.5)
include(FindPackageHandleStandardArgs)
project (sannifa LANGUAGES CXX VERSION 0.0.1)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3")
# find packages
message(STATUS "Configured QNETS_ROOT: ${QNETS_ROOT}")
message(STATUS "Configured TORCH_ROOT: ${TORCH_ROOT}")
find_package(Torch REQUIRED HINTS "${TORCH_ROOT}")
find_path(QNETS_INCLUDE_DIR qnets/poly/FeedForwardNeuralNetwork.hpp HINTS "${QNETS_ROOT}/include")
find_library(QNETS_LIBRARY_DIR qnets HINTS "${QNETS_ROOT}/build/src")
find_package_handle_standard_args(libqnets DEFAULT_MSG QNETS_LIBRARY_DIR QNETS_INCLUDE_DIR)
message(STATUS "TORCH_INCLUDE_DIRS: ${TORCH_INCLUDE_DIRS}")
message(STATUS "TORCH_LIBRARIES: ${TORCH_LIBRARIES}")
message(STATUS "TORCH_CXX_FLAGS: ${TORCH_CXX_FLAGS}")
# set header / library paths
include_directories(include/ "${QNETS_INCLUDE_DIR}" "${TORCH_INCLUDE_DIRS}") # headers
link_libraries("${QNETS_LIBRARY_DIR}" "${TORCH_LIBRARIES}") # libs
# continue with subdirectories
add_subdirectory(src)
add_subdirectory(test)
add_subdirectory(benchmark)