forked from ptran/siamese-network-ex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
executable file
·39 lines (33 loc) · 1.25 KB
/
Copy pathCMakeLists.txt
File metadata and controls
executable file
·39 lines (33 loc) · 1.25 KB
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
cmake_minimum_required(VERSION 2.6)
project(siamese_network_ex)
# Find and build the dlib directory
if (DEFINED DLIB_DIR)
find_path(DLIB_DIR
dlib/cmake
PATHS ${DLIB_DIR} $ENV{DLIB_DIR})
if (EXISTS ${DLIB_DIR})
include(${DLIB_DIR}/dlib/cmake)
else()
message(FATAL_ERROR "DLIB_DIR must contain 'dlib/cmake'.")
endif()
else()
message(FATAL_ERROR "DLIB_DIR must be defined as the path to dlib's root directory.")
endif()
# Check the version of dlib
if (${DLIB_VERSION} VERSION_GREATER 19.0.0)
# If the version is greater than 19.2.0, define a flag that the code will use
# to implement the new loss layer interface.
if (${DLIB_VERSION} VERSION_GREATER 19.2.0)
add_definitions(-DNEW_DLIB_LOSS)
endif()
# If the version is less than 19.4.0, make an ALIAS target dlib::dlib with the
# target produced by dlib's in-project build.
if (${DLIB_VERSION} VERSION_LESS 19.4.0)
add_library(dlib::dlib ALIAS dlib)
endif()
else()
message(FATAL_ERROR "dlib must be at least version 19.0.0. ${DLIB_VERSION} found.")
endif()
add_executable(${PROJECT_NAME} siamese_network_ex.cpp)
target_link_libraries(${PROJECT_NAME} dlib::dlib)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin)