2018-05-02 21:15:30 -07:00
|
|
|
project(hal)
|
|
|
|
|
|
2019-06-23 12:44:28 -07:00
|
|
|
include(CompileWarnings)
|
|
|
|
|
include(AddTest)
|
2018-05-02 21:15:30 -07:00
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
file(
|
|
|
|
|
GLOB hal_shared_native_src
|
|
|
|
|
src/main/native/cpp/*.cpp
|
|
|
|
|
src/main/native/cpp/cpp/*.cpp
|
|
|
|
|
src/main/native/cpp/handles/*.cpp
|
|
|
|
|
)
|
2024-07-05 20:49:31 -04:00
|
|
|
file(GLOB_RECURSE hal_sim_native_src src/main/native/sim/*.cpp)
|
|
|
|
|
add_library(hal ${hal_shared_native_src} ${hal_sim_native_src})
|
2019-06-23 12:44:28 -07:00
|
|
|
wpilib_target_warnings(hal)
|
2018-10-27 00:19:38 -07:00
|
|
|
set_target_properties(hal PROPERTIES DEBUG_POSTFIX "d")
|
|
|
|
|
set_target_properties(hal PROPERTIES OUTPUT_NAME "wpiHal")
|
|
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
target_include_directories(
|
|
|
|
|
hal
|
|
|
|
|
PUBLIC
|
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include>
|
|
|
|
|
$<INSTALL_INTERFACE:${include_dest}/hal>
|
|
|
|
|
)
|
2025-01-16 09:49:40 -08:00
|
|
|
target_link_libraries(hal PUBLIC ntcore wpiutil)
|
2018-10-27 00:19:38 -07:00
|
|
|
|
|
|
|
|
set_property(TARGET hal PROPERTY FOLDER "libraries")
|
|
|
|
|
|
2023-09-18 01:17:32 +02:00
|
|
|
install(TARGETS hal EXPORT hal)
|
2024-04-10 22:04:22 -07:00
|
|
|
export(TARGETS hal FILE hal.cmake NAMESPACE hal::)
|
2018-10-27 00:19:38 -07:00
|
|
|
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/hal")
|
|
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
configure_file(hal-config.cmake.in ${WPILIB_BINARY_DIR}/hal-config.cmake)
|
2023-11-21 14:48:32 -05:00
|
|
|
install(FILES ${WPILIB_BINARY_DIR}/hal-config.cmake DESTINATION share/hal)
|
|
|
|
|
install(EXPORT hal DESTINATION share/hal)
|
2018-09-19 21:57:58 -07:00
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
if(WITH_TESTS)
|
2019-06-23 12:44:28 -07:00
|
|
|
wpilib_add_test(hal src/test/native/cpp)
|
2024-07-19 00:10:26 -04:00
|
|
|
target_link_libraries(hal_test hal googletest)
|
2019-06-23 12:44:28 -07:00
|
|
|
endif()
|