diff --git a/CMakeLists.txt b/CMakeLists.txt index 73eecd9..084626c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,25 @@ # 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/pro/CyberRT/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/pro/CyberRT/install") +endif() if (POLICY CMP0091) @@ -35,10 +53,12 @@ endif (POLICY CMP0091) 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" ON) +option(BUILD_EXAMPLES "Build the examples" OFF) if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") set(ads_PlatformDir "x86")