Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
labrobotica
drivers
LidarLite
Commits
212cbbaa
Commit
212cbbaa
authored
Mar 05, 2019
by
Fernando Herrero
Browse files
Update find cmake. Add dependencies to comm and iriutils
parent
faff90c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Findlidar_lite.cmake
View file @
212cbbaa
#edit the following line to add the librarie's header files
FIND_PATH
(
lidar_lite_INCLUDE_DIR lidar_lite.h /usr/include/iri
drivers
/usr/local/include/iri
drivers
)
FIND_PATH
(
lidar_lite_INCLUDE_DIR lidar_lite.h /usr/include/iri
/lidar_lite
/usr/local/include/iri
/lidar_lite
)
FIND_LIBRARY
(
lidar_lite_LIBRARY
NAMES lidar_lite
PATHS /usr/lib /usr/local/lib /usr/local/lib/iridrivers
)
PATHS /usr/lib /usr/lib/iri/lidar_lite /usr/local/lib /usr/local/lib/iri/lidar_lite
)
SET
(
lidar_lite_INCLUDE_DIRS
${
lidar_lite_INCLUDE_DIR
}
)
SET
(
lidar_lite_LIBRARIES
${
lidar_lite_LIBRARY
}
)
IF
(
lidar_lite_INCLUDE_DIR AND lidar_lite_LIBRARY
)
SET
(
lidar_lite_FOUND TRUE
)
...
...
src/CMakeLists.txt
View file @
212cbbaa
...
...
@@ -6,15 +6,23 @@ SET(headers lidar_lite.h exceptions/exceptions.h exceptions/lidar_lite_exception
# locate the necessary dependencies
FIND_PACKAGE
(
usb_i2c_adapter REQUIRED
)
FIND_PACKAGE
(
comm REQUIRED
)
FIND_PACKAGE
(
iriutils REQUIRED
)
# add the necessary include directories
INCLUDE_DIRECTORIES
(
.
${
usb_i2c_adapter_INCLUDE_DIR
}
)
INCLUDE_DIRECTORIES
(
.
)
INCLUDE_DIRECTORIES
(
${
usb_i2c_adapter_INCLUDE_DIR
}
)
INCLUDE_DIRECTORIES
(
${
comm_INCLUDE_DIRS
}
)
INCLUDE_DIRECTORIES
(
${
iriutils_INCLUDE_DIR
}
)
# create the shared library
ADD_LIBRARY
(
lidar_lite SHARED
${
sources
}
)
# link necessary libraries
TARGET_LINK_LIBRARIES
(
lidar_lite
${
usb_i2c_adapter_LIBRARY
}
)
TARGET_LINK_LIBRARIES
(
lidar_lite
${
comm_LIBRARY
}
)
TARGET_LINK_LIBRARIES
(
lidar_lite
${
iriutils_LIBRARY
}
)
# Check G++ compiler version
include
(
CheckCXXCompilerFlag
)
...
...
@@ -31,9 +39,9 @@ endif()
# install
INSTALL
(
TARGETS lidar_lite
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib/iri
drivers
ARCHIVE DESTINATION lib/iri
drivers
)
INSTALL
(
FILES
${
headers
}
DESTINATION include/iri
drivers
)
LIBRARY DESTINATION lib/iri
/
${
PROJECT_NAME
}
ARCHIVE DESTINATION lib/iri
/
${
PROJECT_NAME
}
)
INSTALL
(
FILES
${
headers
}
DESTINATION include/iri
/
${
PROJECT_NAME
}
)
INSTALL
(
FILES ../Findlidar_lite.cmake DESTINATION
${
CMAKE_ROOT
}
/Modules/
)
INSTALL
(
FILES ../99-lidar_lite.rules DESTINATION /etc/udev/rules.d/
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment