-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
75 lines (60 loc) · 2.68 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
# cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.0.2)
if(DEFINED ENV{WSL_DISTRO_NAME})
option(RAW_CYBER_BUILD "build with raw cyber." ON)
endif()
# 设置其他变量
set(CMAKE_INSTALL_PREFIX "/home/gsk/install/" CACHE PATH "CMAKE_INSTALL_PREFIX" FORCE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "CMAKE_BUILD_TYPE" FORCE)
set(CMAKE_CXX_FLAGS " -std=c++17 -Wno-attributes -Wregister" CACHE STRING "CMAKE_CXX_FLAGS" FORCE)
set(CMAKE_PREFIX_PATH "/opt/zhito/sysroot;/project/thirdparty/X86_64;/opt/ros/melodic;" CACHE PATH "CMAKE_PREFIX_PATH" FORCE)
set(CMAKE_C_COMPILER gcc-9 CACHE STRING "CMAKE_C_COMPILER" FORCE)
set(CMAKE_CXX_COMPILER g++-9 CACHE STRING "CMAKE_CXX_COMPILER" FORCE)
#
set(CMAKE_CXX_EXTENSIONS OFF) # 不知道有什么用
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
# 查找cyber
if(RAW_CYBER_BUILD)
list(APPEND CMAKE_PREFIX_PATH "/home/gsk/install")
endif()
if (POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif (POLICY CMP0091)
# set(ADS_VERSION)
# By default, the version information is extracted from the git index. However,
# we can override this behavior by explicitly setting ADS_VERSION and
# skipping the git checks. This is useful for cases where this project is being
# used independently of its original git repo (e.g. vendored in another project)
# if(NOT ADS_VERSION)
# set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
# include(GetGitRevisionDescription)
# git_describe(GitTagVersion --tags)
# string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" VERSION_MAJOR "${GitTagVersion}")
# string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${GitTagVersion}")
# string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" VERSION_PATCH "${GitTagVersion}")
# set(VERSION_SHORT "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
# else()
# string(REGEX MATCHALL "[\.]" VERSION_DOT_MATCHES ${ADS_VERSION})
# list(LENGTH VERSION_DOT_MATCHES VERSION_DOT_COUNT)
# if(VERSION_DOT_COUNT EQUAL 2)
# set(VERSION_SHORT ${ADS_VERSION})
# else()
# message(FATAL_ERROR "ADS_VERSION must be in major.minor.patch format, e.g. 3.8.1. Got ${ADS_VERSION}")
# endif()
# endif()
set(VERSION_SHORT "4.2.1")
project(qtads LANGUAGES CXX VERSION ${VERSION_SHORT})
# catkin_package()
option(BUILD_STATIC "Build the static library" OFF)
option(BUILD_EXAMPLES "Build the examples" OFF)
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(ads_PlatformDir "x86")
else()
set(ads_PlatformDir "x64")
endif()
add_subdirectory(src)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
add_subdirectory(demo)
endif()