forked from wjwwood/serial
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert package to a pure CMake package
- Loading branch information
Showing
5 changed files
with
34 additions
and
31 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
get_filename_component(SERIAL_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) | ||
set(SERIAL_INCLUDE_DIRS "${SERIAL_CMAKE_DIR}/../../../include") | ||
find_library(SERIAL_LIBRARIES serial PATHS ${SERIAL_CMAKE_DIR}/../../../lib/serial) |
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 |
---|---|---|
|
@@ -19,8 +19,12 @@ | |
<author email="[email protected]">William Woodall</author> | ||
<author email="[email protected]">John Harrison</author> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
<buildtool_depend>cmake</buildtool_depend> | ||
|
||
<test_depend>boost</test_depend> | ||
<test_depend>gtest</test_depend> | ||
|
||
<export> | ||
<build_type>cmake</build_type> | ||
</export> | ||
</package> |
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,12 +1,18 @@ | ||
if(UNIX) | ||
catkin_add_gtest(${PROJECT_NAME}-test unix_serial_tests.cc) | ||
target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME} ${Boost_LIBRARIES}) | ||
find_package(Boost REQUIRED) | ||
find_package(GTest REQUIRED) | ||
include_directories(${GTEST_INCLUDE_DIRS}) | ||
|
||
add_executable(${PROJECT_NAME}-test unix_serial_tests.cc) | ||
target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME} ${Boost_LIBRARIES} ${GTEST_LIBRARIES}) | ||
if(NOT APPLE) | ||
target_link_libraries(${PROJECT_NAME}-test util) | ||
endif() | ||
add_test("${PROJECT_NAME}-test-gtest" ${PROJECT_NAME}-test) | ||
|
||
if(NOT APPLE) # these tests are unreliable on macOS | ||
catkin_add_gtest(${PROJECT_NAME}-test-timer unit/unix_timer_tests.cc) | ||
target_link_libraries(${PROJECT_NAME}-test-timer ${PROJECT_NAME}) | ||
add_executable(${PROJECT_NAME}-test-timer unit/unix_timer_tests.cc) | ||
target_link_libraries(${PROJECT_NAME}-test-timer ${PROJECT_NAME} ${GTEST_LIBRARIES}) | ||
add_test("${PROJECT_NAME}-test-timer-gtest" ${PROJECT_NAME}-test-timer) | ||
endif() | ||
endif() |