Skip to content

Commit

Permalink
增加了wsl的适配
Browse files Browse the repository at this point in the history
  • Loading branch information
guanshoukui committed Apr 11, 2024
1 parent abd55a5 commit 4f0a349
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 4f0a349

Please sign in to comment.