-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[update][框架优化]这是第一个稳定版本,版本号v3.1.1,更新点为:
该SDK将支持在windos和linux系统下使用,目前支持与乐动激光雷达的串口进行通信和数据解析操作,已完成所支持产品的SDK功能测试和说明文档更新。
- Loading branch information
1 parent
9b5e122
commit cbe9b1b
Showing
10 changed files
with
110 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,61 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(ldlidar) | ||
|
||
message(STATUS "operation system is ${CMAKE_SYSTEM}") | ||
if(CMAKE_SYSTEM_NAME MATCHES "Linux") | ||
message(STATUS "current platform: Linux ") | ||
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows") | ||
message(STATUS "current platform: Windows") | ||
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") | ||
message(STATUS "current platform: FreeBSD") | ||
else() | ||
message(STATUS "other platform: ${CMAKE_SYSTEM_NAME}") | ||
endif (CMAKE_SYSTEM_NAME MATCHES "Linux") | ||
|
||
|
||
if(${CMAKE_BUILD_TYPE} MATCHES "Release") | ||
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -std=c++11 -Wall") | ||
message(STATUS "Mode: Release") | ||
message(STATUS "optional:-std=c++11 -Wall") | ||
elseif(${CMAKE_BUILD_TYPE} MATCHES "Debug") | ||
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -std=c++11 -Wall -Wextra -g2 -ggdb") | ||
message(STATUS "Mode: Debug") | ||
message(STATUS "optional:-std=c++11 -Wall -Wextra -g2 -ggdb") | ||
else() | ||
set(CMAKE_BUILD_TYPE "Debug") | ||
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -std=c++11 -Wall -Wextra -g2 -ggdb") | ||
message(STATUS "Mode: Debug") | ||
message(STATUS "optional:-std=c++11 -Wall -Wextra -g2 -ggdb") | ||
endif() | ||
|
||
########### | ||
## Build ## | ||
########### | ||
|
||
## Specify additional locations of header files | ||
## Your package locations should be listed before other locations | ||
include_directories( | ||
${CMAKE_CURRENT_SOURCE_DIR}/include/ | ||
) | ||
|
||
file(GLOB LDLIDAR_DRIVER_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/ldlidar_driver/*.cpp) | ||
|
||
add_executable(${PROJECT_NAME} | ||
${CMAKE_CURRENT_SOURCE_DIR}/sample/linux/demo.cpp | ||
) | ||
|
||
add_library(ldlidar_driver_static STATIC | ||
${LDLIDAR_DRIVER_SOURCE} | ||
) | ||
|
||
add_library(ldlidar_driver_shared SHARED | ||
${LDLIDAR_DRIVER_SOURCE} | ||
) | ||
|
||
# rename library name | ||
set_target_properties (ldlidar_driver_static PROPERTIES OUTPUT_NAME "ldlidar_driver") | ||
set_target_properties (ldlidar_driver_shared PROPERTIES OUTPUT_NAME "ldlidar_driver") | ||
|
||
# binary file link to library | ||
target_link_libraries(${PROJECT_NAME} ldlidar_driver_static pthread) | ||
|
||
########### | ||
## Install ## | ||
########### | ||
|
||
INSTALL(TARGETS ldlidar_driver_static ldlidar_driver_shared | ||
ARCHIVE DESTINATION lib/ldlidar_driver | ||
LIBRARY DESTINATION share/ldlidar_driver | ||
) | ||
|
||
INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/include | ||
DESTINATION include | ||
) | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(ldlidar) | ||
|
||
if(${CMAKE_BUILD_TYPE} MATCHES "Release") | ||
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -std=c++11 -Wall") | ||
message(STATUS "Mode: Release") | ||
message(STATUS "optional:-std=c++11 -Wall") | ||
elseif(${CMAKE_BUILD_TYPE} MATCHES "Debug") | ||
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -std=c++11 -Wall -Wextra -g2 -ggdb") | ||
message(STATUS "Mode: Debug") | ||
message(STATUS "optional:-std=c++11 -Wall -Wextra -g2 -ggdb") | ||
else() | ||
set(CMAKE_BUILD_TYPE "Debug") | ||
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -std=c++11 -Wall -Wextra -g2 -ggdb") | ||
message(STATUS "Mode: Debug") | ||
message(STATUS "optional:-std=c++11 -Wall -Wextra -g2 -ggdb") | ||
endif() | ||
|
||
########### | ||
## Build ## | ||
########### | ||
|
||
## Specify additional locations of header files | ||
## Your package locations should be listed before other locations | ||
include_directories( | ||
${CMAKE_CURRENT_SOURCE_DIR}/../../include/ | ||
) | ||
|
||
file(GLOB LDLIDAR_DRIVER_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../../src/ldlidar_driver/*.cpp) | ||
|
||
add_executable(${PROJECT_NAME} | ||
demo.cpp | ||
) | ||
|
||
add_library(ldlidar_driver_static STATIC | ||
${LDLIDAR_DRIVER_SOURCE} | ||
) | ||
|
||
add_library(ldlidar_driver_shared SHARED | ||
${LDLIDAR_DRIVER_SOURCE} | ||
) | ||
|
||
# rename library name | ||
set_target_properties (ldlidar_driver_static PROPERTIES OUTPUT_NAME "ldlidar_driver") | ||
set_target_properties (ldlidar_driver_shared PROPERTIES OUTPUT_NAME "ldlidar_driver") | ||
|
||
# binary file link to library | ||
target_link_libraries(${PROJECT_NAME} ldlidar_driver_static pthread) | ||
|
||
########### | ||
## Install ## | ||
########### | ||
|
||
INSTALL(TARGETS ldlidar_driver_static ldlidar_driver_shared | ||
ARCHIVE DESTINATION lib/ldlidar_driver | ||
LIBRARY DESTINATION share/ldlidar_driver | ||
) | ||
|
||
INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/include | ||
DESTINATION include | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Use CMake to generate visual studio C++ projects | ||
> Prerequisites The visual studio IDE and CMake Tool must be installed on the PC. | ||
## Method 1: Command line mode | ||
- Open the powershell terminal in the 'sample/windows' directory and run the following command to create a C++ project in the' Visual Studio 15 2017 Win64 'environment as an example. | ||
```ps1 | ||
mkdir build | ||
cd build | ||
cmake -G "Visual Studio 15 2017 Win64" .. / | ||
` ` ` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters