forked from kingsoft-wps/KSAI-Toolkits
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·40 lines (33 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
macro(source_group_by_dir source_files)
if(MSVC)
set(sgbd_cur_dir ${CMAKE_CURRENT_SOURCE_DIR})
foreach(sgbd_file ${${source_files}})
string(REGEX REPLACE ${sgbd_cur_dir}/\(.*\) \\1 sgbd_fpath ${sgbd_file})
string(REGEX REPLACE "\(.*\)/.*" \\1 sgbd_group_name ${sgbd_fpath})
string(COMPARE EQUAL ${sgbd_fpath} ${sgbd_group_name} sgbd_nogroup)
string(REPLACE "/" "\\" sgbd_group_name ${sgbd_group_name})
if(sgbd_nogroup)
set(sgbd_group_name "\\")
endif(sgbd_nogroup)
source_group(${sgbd_group_name} FILES ${sgbd_file})
endforeach(sgbd_file)
endif(MSVC)
endmacro(source_group_by_dir)
PROJECT(KSAI-Toolkits)
MESSAGE(STATUS "Project Directory: ${PROJECT_SOURCE_DIR}")
option(BUILD_TARGET_LINUX "Set the build target is Linux" OFF)
option(BUILD_TARGET_WINDOWS "Set the build target is Windows" OFF)
option(BUILD_TARGET_ARM "Set the build target is Arm" OFF)
option(BUILD_TARGET_MIPS "Set the build target is MIPS" OFF)
add_compile_options(-std=c++11)
option(WITH_OCR "enable OCR module" ON)
option(WITH_TEST "enable test" ON)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
SET(INCLUDE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/include)
SET(PROJECT_SOURCE_PATH ${PROJECT_SOURCE_DIR})
ADD_SUBDIRECTORY(src)
if(WITH_TEST)
ADD_SUBDIRECTORY(test)
endif()