Skip to content

Commit

Permalink
Merge PR #55 from utk-robotics-2017/anthony/make_outputs
Browse files Browse the repository at this point in the history
Changed a few CMakeLists to use make_outputs
  • Loading branch information
Parker Mitchell authored Feb 22, 2018
2 parents 074c239 + 3c7e6ec commit 9871b68
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 52 deletions.
16 changes: 3 additions & 13 deletions core/motor_controllers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,11 @@ if(ENABLE_TESTING)
file(GLOB_RECURSE ${PROJECT_NAME}_TEST_DATA "test/data/*")

# Copy test data to outdir/test
set(copiedTestData "")
foreach(TestDataFile ${${PROJECT_NAME}_TEST_DATA})
file(RELATIVE_PATH name ${CMAKE_CURRENT_SOURCE_DIR} ${TestDataFile})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${TestDataFile} ${CMAKE_CURRENT_BINARY_DIR}/${name}
DEPENDS ${TestDataFile}
COMMENT "Copying ${name}"
VERBATIM
)
list(APPEND copiedTestData ${CMAKE_CURRENT_BINARY_DIR}/${name})
endforeach()
include(FileOutputs)
make_outputs(${CMAKE_CURRENT_SOURCE_DIR} "${${PROJECT_NAME}_TEST_DATA}" ${CMAKE_CURRENT_BINARY_DIR} testDataOutputs)

# Create cmd_messneger_test executable, set to c++11, link cmd_messenger library and google test libraries
add_executable(${PROJECT_NAME}_test ${${PROJECT_NAME}_TEST_SOURCES} ${copiedTestData})
add_executable(${PROJECT_NAME}_test ${${PROJECT_NAME}_TEST_SOURCES} ${testDataOutputs})
set_property(TARGET ${PROJECT_NAME}_test PROPERTY CXX_STANDARD 11)
target_link_libraries(${PROJECT_NAME}_test ${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME}_test gmock gtest)
Expand Down
16 changes: 3 additions & 13 deletions core/navigation/navx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,11 @@ if(ENABLE_TESTING)
file(GLOB_RECURSE ${PROJECT_NAME}_TEST_DATA "test/data/*")

# Copy test data to outdir/test
set(copiedTestData "")
foreach(TestDataFile ${${PROJECT_NAME}_TEST_DATA})
file(RELATIVE_PATH name ${CMAKE_CURRENT_SOURCE_DIR} ${TestDataFile})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${TestDataFile} ${CMAKE_CURRENT_BINARY_DIR}/${name}
DEPENDS ${TestDataFile}
COMMENT "Copying ${name}"
VERBATIM
)
list(APPEND copiedTestData ${CMAKE_CURRENT_BINARY_DIR}/${name})
endforeach()
include(FileOutputs)
make_outputs(${CMAKE_CURRENT_SOURCE_DIR} "${${PROJECT_NAME}_TEST_DATA}" ${CMAKE_CURRENT_BINARY_DIR} testDataOutputs)

# Create arduino_gen_test executable, set to c++11, link navx library and google test libraries
add_executable(${PROJECT_NAME}_test ${${PROJECT_NAME}_TEST_SOURCES} ${copiedTestData})
add_executable(${PROJECT_NAME}_test ${${PROJECT_NAME}_TEST_SOURCES} ${testDataOutputs})
set_property(TARGET ${PROJECT_NAME}_test PROPERTY CXX_STANDARD 11)
target_link_libraries(${PROJECT_NAME}_test ${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME}_test gmock gtest googletest_rip_macros)
Expand Down
16 changes: 3 additions & 13 deletions core/utilities/cmd_messenger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,11 @@ if(ENABLE_TESTING)
file(GLOB_RECURSE ${PROJECT_NAME}_TEST_DATA "test/data/*")

# Copy test data to outdir/test
set(copiedTestData "")
foreach(TestDataFile ${${PROJECT_NAME}_TEST_DATA})
file(RELATIVE_PATH name ${CMAKE_CURRENT_SOURCE_DIR} ${TestDataFile})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${TestDataFile} ${CMAKE_CURRENT_BINARY_DIR}/${name}
DEPENDS ${TestDataFile}
COMMENT "Copying ${name}"
VERBATIM
)
list(APPEND copiedTestData ${CMAKE_CURRENT_BINARY_DIR}/${name})
endforeach()
include(FileOutputs)
make_outputs(${CMAKE_CURRENT_SOURCE_DIR} "${${PROJECT_NAME}_TEST_DATA}" ${CMAKE_CURRENT_BINARY_DIR} testDataOutputs)

# Create cmd_messneger_test executable, set to c++11, link cmd_messenger library and google test libraries
add_executable(${PROJECT_NAME}_test ${${PROJECT_NAME}_TEST_SOURCES} ${copiedTestData})
add_executable(${PROJECT_NAME}_test ${${PROJECT_NAME}_TEST_SOURCES} ${testDataOutputs})
set_property(TARGET ${PROJECT_NAME}_test PROPERTY CXX_STANDARD 11)
target_link_libraries(${PROJECT_NAME}_test ${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME}_test gmock gtest)
Expand Down
16 changes: 3 additions & 13 deletions core/utilities/peripherycpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,11 @@ if(ENABLE_TESTING)
file(GLOB_RECURSE ${PROJECT_NAME}_TEST_DATA "test/data/*")

# Copy test data to outdir/test
set(copiedTestData "")
foreach(TestDataFile ${${PROJECT_NAME}_TEST_DATA})
file(RELATIVE_PATH name ${CMAKE_CURRENT_SOURCE_DIR} ${TestDataFile})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${TestDataFile} ${CMAKE_CURRENT_BINARY_DIR}/${name}
DEPENDS ${TestDataFile}
COMMENT "Copying ${name}"
VERBATIM
)
list(APPEND copiedTestData ${CMAKE_CURRENT_BINARY_DIR}/${name})
endforeach()
include(FileOutputs)
make_outputs(${CMAKE_CURRENT_SOURCE_DIR} "${${PROJECT_NAME}_TEST_DATA}" ${CMAKE_CURRENT_BINARY_DIR} testDataOutputs)

# Create cmd_messneger_test executable, set to c++11, link cmd_messenger library and google test libraries
add_executable(${PROJECT_NAME}_test ${${PROJECT_NAME}_TEST_SOURCES} ${copiedTestData})
add_executable(${PROJECT_NAME}_test ${${PROJECT_NAME}_TEST_SOURCES} ${testDataOutputs})
set_property(TARGET ${PROJECT_NAME}_test PROPERTY CXX_STANDARD 11)
target_link_libraries(${PROJECT_NAME}_test ${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME}_test gmock gtest googletest_rip_macros)
Expand Down

0 comments on commit 9871b68

Please sign in to comment.