Skip to content

Commit

Permalink
Unity CMakeLists.txt fixes, add Boost detection
Browse files Browse the repository at this point in the history
Fix incorrect compiler warning flag
  • Loading branch information
rajat2004 committed Feb 25, 2020
1 parent ff37ace commit 67f5789
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
15 changes: 13 additions & 2 deletions Unity/AirLibWrapper/AirsimWrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,23 @@ IncludeEigen()

project(AirsimWrapper VERSION 0)

find_package(Boost REQUIRED COMPONENTS filesystem)
if(Boost_FOUND)
MESSAGE("Boost information:")
MESSAGE(" Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
MESSAGE(" Boost_LIBRARIES: ${Boost_LIBRARIES}")
MESSAGE(" Boost_LIBRARY_DIRS: ${Boost_LIBRARY_DIRS}")
MESSAGE(" Boost_FILESYSTEM_LIBRARY: ${boost_filesystem_DIR}")
endif()

include_directories(${Boost_INCLUDE_DIRS})

# RPC includes & source files
BuildRpc()
# MavLink source files
BuildMavLink()
#AirLib source files
BuildAirlib()
BuildAirLib()
#AirsimWrapper source files
BuildAirsimWrapper()

Expand All @@ -53,7 +64,7 @@ else ()
)
endif ()

target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} -lstdc++ -lpthread -lboost_filesystem)
target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} -lstdc++ -lpthread ${Boost_LIBRARIES})



Expand Down
3 changes: 1 addition & 2 deletions Unity/AirLibWrapper/AirsimWrapper/cmake/airlib-setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ file(GLOB_RECURSE AIRLIB_LIBRARY_SOURCE_FILES
${AIRSIM_ROOT}/AirLib/src/api/*.cpp
${AIRSIM_ROOT}/AirLib/src/common/common_utils/*.cpp
${AIRSIM_ROOT}/AirLib/src/safety/*.cpp
${AIRSIM_ROOT}/AirLib/src/vehicles/car/api/*.cpp
${AIRSIM_ROOT}/AirLib/src/vehicles/multirotor/api/*.cpp
${AIRSIM_ROOT}/AirLib/src/vehicles/car/*.cpp
${AIRSIM_ROOT}/AirLib/src/vehicles/multirotor/*.cpp
)

Expand Down
2 changes: 1 addition & 1 deletion Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(UNUSED_LAMBDA_CAPTURE_WARN_SUPPORTED)
check_warning_flag("unused-lambda-capture" UNUSED_LAMBDA_CAPTURE_WARN_SUPPORTED)
if(${UNUSED_LAMBDA_CAPTURE_WARN_SUPPORTED})
list(APPEND RPCLIB_BUILD_FLAGS -Wno-no-unused-lambda-capture)
list(APPEND RPCLIB_BUILD_FLAGS -Wno-unused-lambda-capture)
endif()

check_warning_flag("zero-as-null-pointer-constant" ZERO_AS_NULL_POINTER_CONSTANT_WARN_SUPPORTED)
Expand Down

0 comments on commit 67f5789

Please sign in to comment.