forked from TheFoundryVisionmongers/nuke-ML-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (40 loc) · 1.26 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
# CMakeLists.txt for Machine Learning Plug-in: MLClient
# Setting up MLClient sources and dependencies
set (ML_CLIENT_SOURCES
MLClient.cpp
MLClientComms.cpp
MLClientModelManager.cpp
)
find_package(Protobuf REQUIRED)
if (WIN32)
find_library(PROTOBUF_LIBRARY NAME libprotobuf PATHS ${Protobuf_LIBRARIES})
endif()
# Compile protobuf .cpp and .h files out of message.proto
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS message.proto)
list(APPEND ML_CLIENT_SOURCES ${PROTO_SRCS}) # add message.pb.cc
if(NOT NUKE_INSTALL_PATH)
message(FATAL_ERROR "Nuke install path not set.")
endif()
find_library(DDIMAGE_LIBRARY NAME DDImage libDDImage PATHS ${NUKE_INSTALL_PATH})
if(NOT DDIMAGE_LIBRARY)
message(FATAL_ERROR "DDImage library not found.")
endif()
# Create MLClient.so shared library
add_library(MLClient SHARED
${ML_CLIENT_SOURCES}
)
set_target_properties (MLClient PROPERTIES PREFIX "")
target_include_directories(MLClient PRIVATE
${NUKE_INSTALL_PATH}/include
${CMAKE_CURRENT_BINARY_DIR} # include message.pb.h
${Protobuf_INCLUDE_DIR}
)
target_link_libraries(MLClient
${PROTOBUF_LIBRARY}
${DDIMAGE_LIBRARY}
)
if (WIN32)
target_link_libraries(MLClient
ws2_32.lib # include windows socket library
)
endif (WIN32)