d4495ecaff
update gencode
186 lines
7.6 KiB
CMake
186 lines
7.6 KiB
CMake
cmake_minimum_required(VERSION 3.5)
|
|
|
|
project(kb3_sil LANGUAGES C CXX)
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
|
set(CMAKE_AUTOMOC ON)
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# QtCreator supports the following variables for Android, which are identical to qmake Android variables.
|
|
# Check http://doc.qt.io/qt-5/deployment-android.html for more information.
|
|
# They need to be set before the find_package(Qt5 ...) call.
|
|
|
|
#if(ANDROID)
|
|
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
|
|
# if (ANDROID_ABI STREQUAL "armeabi-v7a")
|
|
# set(ANDROID_EXTRA_LIBS
|
|
# ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libcrypto.so
|
|
# ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libssl.so)
|
|
# endif()
|
|
#endif()
|
|
|
|
find_package(Qt5 COMPONENTS Core Widgets Network REQUIRED)
|
|
|
|
include_directories( SIL/work/SIL_ert_shrlib_rtw
|
|
SIL/work/slprj
|
|
SIL/work/slprj/ert_shrlib/_sharedutils
|
|
SIL/R2018b/rtw/c/src
|
|
SIL/R2018b/simulink/include
|
|
SIL/otherFiles
|
|
)
|
|
|
|
set(SIL_SRC
|
|
SIL/otherFiles/hal_serial_cmdline_wrapper.c
|
|
SIL/otherFiles/hal_serial_echoline_wrapper.c
|
|
SIL/otherFiles/mav_serial_control_decode_wrapper.c
|
|
SIL/otherFiles/mav_serial_control_encode_wrapper.c
|
|
SIL/otherFiles/bmu_state_enc_wrapper.c
|
|
SIL/otherFiles/ccm_state_enc_wrapper.c
|
|
SIL/otherFiles/CRC_CheckSum_wrapper.c
|
|
SIL/otherFiles/find_param_idx_wrapper.c
|
|
SIL/otherFiles/find_param_val_wrapper.c
|
|
SIL/otherFiles/mav_attitude_encode_wrapper.c
|
|
SIL/otherFiles/mav_autopilot_version_encode_wrapper.c
|
|
SIL/otherFiles/mav_command_ack_encode_wrapper.c
|
|
SIL/otherFiles/mav_command_long_decode_wrapper.c
|
|
SIL/otherFiles/mav_emb_atmo_com_encode_wrapper.c
|
|
SIL/otherFiles/mav_ext_sys_stat_encode_wrapper.c
|
|
SIL/otherFiles/mav_global_position_int_encode_wrapper.c
|
|
SIL/otherFiles/mav_gps_raw_int_encode_wrapper.c
|
|
SIL/otherFiles/mav_gps_rtcm_data_decode_wrapper.c
|
|
SIL/otherFiles/mav_heartbeat_encode_wrapper.c
|
|
SIL/otherFiles/mav_ins1_encode_wrapper.c
|
|
SIL/otherFiles/mav_ins2_encode_wrapper.c
|
|
SIL/otherFiles/mav_mission_ack_encode_wrapper.c
|
|
SIL/otherFiles/mav_mission_clear_all_decode_wrapper.c
|
|
SIL/otherFiles/mav_mission_count_decode_wrapper.c
|
|
SIL/otherFiles/mav_mission_count_encode_wrapper.c
|
|
SIL/otherFiles/mav_mission_current_encode_wrapper.c
|
|
SIL/otherFiles/mav_mission_item_int_decode_wrapper.c
|
|
SIL/otherFiles/mav_mission_item_int_encode_wrapper.c
|
|
SIL/otherFiles/mav_mission_request_decode_wrapper.c
|
|
SIL/otherFiles/mav_mission_request_int_encode_wrapper.c
|
|
SIL/otherFiles/mav_mission_request_list_decode_wrapper.c
|
|
SIL/otherFiles/mav_mission_set_current_decode_wrapper.c
|
|
SIL/otherFiles/mav_msg2buff_wrapper.c
|
|
SIL/otherFiles/mav_nav_controller_output_encode_wrapper.c
|
|
SIL/otherFiles/mav_param_request_list_decode_wrapper.c
|
|
SIL/otherFiles/mav_param_request_read_decode_wrapper.c
|
|
SIL/otherFiles/mav_param_set_decode_wrapper.c
|
|
SIL/otherFiles/mav_param_value_encode_wrapper.c
|
|
SIL/otherFiles/mav_parser_wrapper.c
|
|
SIL/otherFiles/mav_rc_channels_override_decode_wrapper.c
|
|
SIL/otherFiles/mav_scaled_pressure_encode_wrapper.c
|
|
SIL/otherFiles/mav_servo_output_raw_encode_wrapper.c
|
|
SIL/otherFiles/mav_set_mode_decode_wrapper.c
|
|
SIL/otherFiles/mav_sys_status_encode_wrapper.c
|
|
SIL/otherFiles/mav_vfr_hud_encode_wrapper.c
|
|
SIL/otherFiles/param_mgr.c
|
|
SIL/otherFiles/set_param_val_wrapper.c
|
|
SIL/otherFiles/turbine_state_enc_wrapper.c
|
|
SIL/otherFiles/unpack_ecu2ap_wrapper.c
|
|
SIL/work/SIL_ert_shrlib_rtw/SIL.c
|
|
SIL/work/SIL_ert_shrlib_rtw/SIL_capi.c
|
|
SIL/work/SIL_ert_shrlib_rtw/SIL_data.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/BINARYSEARCH_real32_T.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/binsearch_u32d.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/CalcAtmosCOESA.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/CalcPAltCOESA.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/const_params.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/InitCalcAtmosCOESA.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/intrp3d_l_pw.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/look1_binlcpw.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/look1_binlxpw.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/look1_iflf_binlcpw.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/look1_iflf_binlxpw.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/look1_iflf_pbinlcapw.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/look2_binlcpw.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/look2_binlxpw.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/LookUpEven_real_T_real_T.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/LookUp_real32_T_real32_T.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/plook_binx.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/power_4TBdBPK2.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/Quat2Tbn_XRdqRR86.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rtGetInf.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rtGetNaN.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rt_atan2d_snf.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rt_atan2f_snf.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rt_backsubrr_dbl.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rt_forwardsubrr_dbl.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rt_invd3x3_snf.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rt_lu_real.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rt_matrixlib_dbl.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rt_modd_snf.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rt_mrdivide_U1d1x3_U2d3x3_Yd1x3_snf.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rt_nonfinite.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rt_powd_snf.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/rt_roundd_snf.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/binsearch_u32f.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/intrp3d_fu32fl_pw.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/look2_iflf_binlxpw.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/plook_u32ff_binx.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/look1_pbinlcapw.c
|
|
SIL/work/slprj/ert_shrlib/_sharedutils/wgs84_taylor_series.c)
|
|
|
|
add_definitions(-DWITH_CAPI)
|
|
add_definitions(-DCAPI_MDL=SIL)
|
|
add_definitions(-DHDR_MDL=SIL.h)
|
|
add_definitions(-DMAVLINK_USE_MESSAGE_INFO)
|
|
|
|
if(ANDROID)
|
|
add_library(kb3_sil SHARED
|
|
main.cpp
|
|
mainwindow.cpp
|
|
mainwindow.h
|
|
mainwindow.ui
|
|
${SIL_SRC}
|
|
)
|
|
else()
|
|
add_executable(kb3_sil WIN32
|
|
mainwindow.cpp
|
|
mainwindow.h
|
|
mainwindow.ui
|
|
main.cpp
|
|
${SIL_SRC}
|
|
)
|
|
endif()
|
|
|
|
add_executable(kb3_batsil
|
|
mainc.cpp
|
|
task.h
|
|
task.cpp
|
|
${SIL_SRC}
|
|
)
|
|
|
|
target_link_libraries(kb3_batsil PRIVATE Qt5::Core)
|
|
|
|
target_link_libraries(kb3_sil PRIVATE Qt5::Widgets Qt5::Network)
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
message("CMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}")
|
|
install(TARGETS kb3_sil kb3_batsil RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
|
install(FILES SIL/work/SIL_win64.dll DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
|
|
|
set(CPACK_GENERATOR ZIP)
|
|
set(CPACK_PACKAGE_VERSION_MAJOR 0)
|
|
set(CPACK_PACKAGE_VERSION_MINOR 1)
|
|
set(CPACK_PACKAGE_VERSION_PATCH 2)
|
|
set(CPACK_INSTALL_COMMANDS
|
|
"/bin/bash -c \\\"mkdir -p $CMAKE_INSTALL_PREFIX/bin\\\""
|
|
"/bin/bash -c \\\"mkdir -p $CMAKE_INSTALL_PREFIX/lib\\\""
|
|
"/bin/bash -c \\\"cp /opt/win64/bin/*.dll $CMAKE_INSTALL_PREFIX/bin\\\""
|
|
"/bin/bash -c \\\"cp /opt/win64/qt.conf $CMAKE_INSTALL_PREFIX/bin\\\""
|
|
"/bin/bash -c \\\"cp -r /opt/win64/plugins $CMAKE_INSTALL_PREFIX/lib\\\""
|
|
"/bin/bash -c \\\"cp -r /opt/win64/qml $CMAKE_INSTALL_PREFIX/lib\\\""
|
|
"/bin/bash -c \\\"cp -r /opt/win64/lib/grantlee $CMAKE_INSTALL_PREFIX/lib\\\""
|
|
"/bin/bash -c \\\"cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll $CMAKE_INSTALL_PREFIX/bin\\\""
|
|
"/bin/bash -c \\\"cp /usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/*.dll $CMAKE_INSTALL_PREFIX/bin\\\""
|
|
)
|
|
include(CPack)
|