-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
56 lines (35 loc) · 1.21 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
cmake_minimum_required(VERSION 3.16.3)
project(joker)
################################################
#Basic setup
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
#defaukt to Release build (instead of debug)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
message(STATUS "Defaulting to Release build")
endif()
################################################
#############################################
#create joker library
add_library(joker STATIC src/imgvect.cpp src/model.cpp src/ocr.cpp src/trainer.cpp src/timer.cpp)
set_target_properties(joker PROPERTIES PUBLIC_HEADER "src/joker.h")
INSTALL(TARGETS joker
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include/joker
)
#############################################
#################################################
#Add joker executable and link libs
set(EXE_NAME jk)
#set sources
add_executable(${EXE_NAME} src/main.cpp)
add_dependencies(${EXE_NAME} joker)
include_directories(src)
target_link_libraries(${EXE_NAME} joker jpeg pthread )
INSTALL(TARGETS ${EXE_NAME}
DESTINATION bin
)
##################################################