-
Notifications
You must be signed in to change notification settings - Fork 34
/
CMakeLists.txt
87 lines (61 loc) · 2.88 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Copyright [2017] [taurus.ai]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
CMAKE_MINIMUM_REQUIRED(VERSION 3.7)
PROJECT(yijinjing-lite)
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
INCLUDE(GetGitRevisionDescription)
GET_GIT_HEAD_REVISION(GIT_REFSPEC GIT_HASH)
string(REPLACE "refs/heads/" "" GIT_BRANCH ${GIT_REFSPEC})
string(SUBSTRING ${GIT_HASH} 0 8 GIT_COMMIT)
message(STATUS "GIT_BRANCH:" ${GIT_BRANCH})
message(STATUS "GIT_COMMIT:" ${GIT_COMMIT})
SET(Boost_USE_MULTITHREADED ON)
SET(Boost_USE_STATIC_LIBS OFF)
SET(Boost_USE_STATIC_RUNTIME OFF)
FIND_PACKAGE(Boost 1.57.0 COMPONENTS filesystem system thread regex REQUIRED)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
MESSAGE(STATUS "Boost_INCLUDE_DIR: " ${Boost_INCLUDE_DIR})
MESSAGE(STATUS "BOOST_LIBRARY_DIR: " ${BOOST_LIBRARY_DIR})
MESSAGE(STATUS "Boost_LIBRARIES: " ${Boost_LIBRARIES})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -Wall")
OPTION(BUILD_SHARED_LIBS "turn OFF for .a libs" ON)
#OPTION(USE_SERVICE "use memory service" ON)
OPTION(USE_HASH_CODE "use hash code when writing" OFF)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Yijinjing-lite in-process Communicate System")
SET(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "0")
SET(CPACK_PACKAGE_VERSION_PATCH "3")
SET(CPACK_GENERATOR "ZIP;TGZ")
SET(CPACK_RPM_PACKAGE_RELEASE "${BUILDTIME}")
#SET(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
SET(CPACK_RPM_PACKAGE_GROUP "${PROJECT_NAME}")
SET(CPACK_PACKAGE_DEFAULT_LOCATION "/yijinjing-lite")
SET(CPACK_PACKAGING_INSTALL_PREFIX "/yijinjing-lite")
ADD_SUBDIRECTORY(include/yijinjing/journal)
ADD_SUBDIRECTORY(include/yijinjing/paged)
ADD_SUBDIRECTORY(include/yijinjing/utils)
ADD_SUBDIRECTORY(test)
#SET(CPACK_RPM_PACKAGE_AUTOREQ " no")
INCLUDE(CPack)