-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
41 lines (34 loc) · 1.38 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
project(ToPS)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost 1.50 COMPONENTS regex REQUIRED)
find_package(Boost 1.50 COMPONENTS program_options REQUIRED)
find_package(Boost 1.50 COMPONENTS date_time REQUIRED)
find_package(Boost 1.50 COMPONENTS system REQUIRED)
find_package(Boost 1.50 COMPONENTS filesystem REQUIRED)
# LIBTORCH package
set(CMAKE_PREFIX_PATH "/home/waldir/libtorch")
find_package(Torch REQUIRED)
include_directories(${TORCH_INCLUDE_DIRS})
# Set Linker flags
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
IF(LINUX)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
ENDIF()
# Find_package(PerlLibs)
# ADD_DEFINITIONS("-O0 -Wall -gdwarf-2")
add_definitions("-Ofast -funroll-loops -ffast-math")
if(UNIX)
set(BOOST_REGEX_LIBRARY ${Boost_REGEX_LIBRARY})
set(BOOST_PROGRAM_OPTIONS_LIBRARY ${Boost_PROGRAM_OPTIONS_LIBRARY})
set(BOOST_DATE_TIME_LIBRARY ${Boost_DATE_TIME_LIBRARY})
find_library(BOOST_REGEX_LIBRARY boost_regex-mt PATHS ${Boost_LIBRARY_DIRS} )
find_library(BOOST_DATE_TIME_LIBRARY boost_date_time-mt PATHS ${Boost_LIBRARY_DIRS} )
find_library(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt PATHS ${Boost_LIBRARY_DIRS} )
endif(UNIX)
# DEBUG
set(CMAKE_BUILD_TYPE RelWithDebInfo)
add_subdirectory(src)
add_subdirectory(app)
add_subdirectory(lang)