forked from pytorch/ELF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (44 loc) · 1.36 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
44
45
46
47
48
49
50
51
52
53
54
55
cmake_minimum_required(VERSION 3.3)
# These projects all have CMakeLists by default, thank you devs!
add_subdirectory(googletest)
set_target_properties(gtest
PROPERTIES
DEBUG_POSTFIX "")
add_subdirectory(json)
add_subdirectory(pybind11)
add_subdirectory(spdlog)
# concurrent queue library
add_library(concurrentqueue INTERFACE)
target_include_directories(concurrentqueue SYSTEM INTERFACE
concurrentqueue
)
target_link_libraries(concurrentqueue INTERFACE
${CMAKE_THREAD_LIBS_INIT}
)
# TBB
set(TBB_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/tbb/)
set(TBB_ROOT ${TBB_ROOT} PARENT_SCOPE)
include(${TBB_ROOT}/cmake/TBBBuild.cmake)
tbb_build(
TBB_ROOT ${TBB_ROOT}
MAKE_ARGS tbb_build_dir=${CMAKE_CURRENT_BINARY_DIR}/tbb/
CONFIG_DIR TBB_DIR)
set(TBB_DIR ${TBB_DIR} PARENT_SCOPE)
# Find ZMQ in system. TODO(maj): maybe use submodule?
find_path(ZMQ_ROOT_DIR
NAMES include/zmq.h)
find_library(ZeroMQ_LIBRARY
NAMES zmq libzmq
HINTS ${ZMQ_ROOT_DIR}/lib
)
find_path(ZeroMQ_INCLUDE_DIR
NAMES zmq.h
HINTS ${ZMQ_ROOT_DIR}/include
)
add_library(zmq INTERFACE)
target_include_directories(zmq SYSTEM INTERFACE ${ZeroMQ_INCLUDE_DIR})
target_link_libraries(zmq INTERFACE ${ZeroMQ_LIBRARY})
# C++ ZMQ
add_library(cppzmq INTERFACE)
target_include_directories(cppzmq SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/cppzmq/)
target_link_libraries(cppzmq INTERFACE zmq)