代码拉取完成,页面将自动刷新
同步操作将从 heelong/path_planning 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
project(path_planning)
cmake_minimum_required(VERSION 3.5)
add_definitions(-std=c++11)
if(NOT WIN32)
string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(Yellow "${Esc}[33m")
set(Blue "${Esc}[34m")
set(White "${Esc}[37m")
endif()
set( CXX_FLAGS "-w" )
set( CMAKE_CXX_FLAGS "${CXX_FLAGS} -std=c++11 -pthread" )
include_directories( ${CMAKE_SOURCE_DIR}/inc )
file( GLOB LIB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp )
file( GLOB LIB_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/inc/*.hpp )
file( GLOB LIB_TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp )
# Building utils.cpp as a library as common to multiple files
add_library( utils SHARED ${CMAKE_CURRENT_SOURCE_DIR}/src/utils.cpp ${LIB_HEADERS} )
add_library( test_utils SHARED ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_utils.cpp ${LIB_HEADERS} )
list( REMOVE_ITEM LIB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/utils.cpp )
list( REMOVE_ITEM LIB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp )
list( REMOVE_ITEM LIB_TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_utils.cpp )
# If building each file with it's own output, set to ON
# If buiding single file (main.cpp) to test any/all protocols, set to OFF
option( BUILD_INDIVIDUAL "BUILD_INDIVIDUAL" OFF)
option( TEST "TEST" ON)
if(BUILD_INDIVIDUAL)
add_definitions(-DBUILD_INDIVIDUAL)
message("${Blue} Individual files being built ${ColourReset}")
foreach(test_source_file ${LIB_SOURCES})
string( REPLACE ".cpp" "" test_output_file ${test_source_file} )
string( REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/src/" "" test_output_file ${test_output_file} )
message( ${test_output_file} )
add_executable( ${test_output_file} ${test_source_file} ${LIB_HEADERS})
target_link_libraries( ${test_output_file} utils )
endforeach(test_source_file ${LIB_SOURCES})
message( "${Blue}End of list ${ColourReset}" )
else (BUILD_INDIVIDUAL)
add_library( algos SHARED ${LIB_SOURCES} ${LIB_HEADERS} )
add_executable( main ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp ${LIB_HEADERS} )
target_link_libraries( main utils algos)
if (TEST)
find_package(GTest REQUIRED)
enable_testing()
add_definitions(-DTEST)
include_directories(${GTEST_INCLUDE_DIRS})
foreach(test_source_file ${LIB_TESTS_SOURCES})
string( REPLACE ".cpp" "" test_output_file ${test_source_file} )
string( REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/tests/" "" test_output_file ${test_output_file} )
add_executable( ${test_output_file} ${test_source_file} ${LIB_HEADERS})
target_link_libraries( ${test_output_file} ${GTEST_LIBRARIES} pthread utils algos test_utils)
add_test(${test_output_file} ${test_output_file})
add_dependencies(main ${test_output_file}) # ensure main is built after the test grids.
endforeach(test_source_file ${LIB_SOURCES})
add_custom_command(
TARGET main # Ensures tests run only after main
POST_BUILD
COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> -R "^${UNIT_TEST}$" --output-on-failures)
endif (TEST)
endif (BUILD_INDIVIDUAL)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。