mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
CMake Changes
This is the changes made by Patrick Plenefisch converting the native code to use CMake and the CMake Maven Plugin, as opposed to the native Maven plugin. This is to allow for compatibility with newer versions of the GCC toolchain. All the cpp sources were moved from maven style directories to cpp style directories for CMake. Change-Id: I67f5e3608948f37c83b0990d232105a3784f8593
This commit is contained in:
23
wpilibj/wpilibJavaJNI/CMakeLists.txt
Normal file
23
wpilibj/wpilibJavaJNI/CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(WPILibJavaJNI)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=2 -Wextra")
|
||||
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
|
||||
file(GLOB_RECURSE NI_LIBS ../../ni-libraries/*.so)
|
||||
get_filename_component(HAL_API_INCLUDES ../../hal/include REALPATH)
|
||||
## depends on libFRC_NetComm, halAthena Hal incl, wpilibJava (jar)
|
||||
# this file requires embeddedJDKHome to be set
|
||||
# all the h files must be generated, in target/include
|
||||
|
||||
file(GLOB_RECURSE SRC_FILES lib/*.cpp)
|
||||
include_directories(target/include ${embeddedJDKHome}/include ${embeddedJDKHome}/include/linux ${HAL_API_INCLUDES})
|
||||
add_library(wpilibJavaJNI SHARED ${SRC_FILES})
|
||||
find_library(HAL_LIB libHALAthena.so target/lib)
|
||||
add_library(HALAthena UNKNOWN IMPORTED)
|
||||
set_property(TARGET HALAthena PROPERTY IMPORTED_LOCATION ${HAL_LIB})
|
||||
target_link_libraries(wpilibJavaJNI HALAthena ${NI_LIBS})
|
||||
INSTALL(TARGETS wpilibJavaJNI LIBRARY DESTINATION target)
|
||||
# lib/ c m gcc_s ld-linux
|
||||
# usr/lib stdc++
|
||||
# FRC_NetworkCommunication NiFpgaLv RoboRIO_FRC_ChipObject
|
||||
|
||||
Reference in New Issue
Block a user