mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-03-23 12:38:53 -04:00
Merge branch 'feat-map65-integration' of bitbucket.org:k1jt/wsjtx into feat-map65-integration
This commit is contained in:
commit
17b0fd4974
@ -1,45 +1,25 @@
|
||||
# - Try to find hamlib
|
||||
#
|
||||
# Once done, this will define:
|
||||
# Find the hamlib library
|
||||
#
|
||||
# hamlib_FOUND - system has Hamlib
|
||||
# hamlib_INCLUDE_DIRS - the Hamlib include directories
|
||||
# hamlib_LIBRARIES - link these to use Hamlib
|
||||
# hamlib_LIBRARY_DIRS - required shared/dynamic libraries are here
|
||||
# This will define the following variables::
|
||||
#
|
||||
# If hamlib_STATIC is TRUE then static linking will be assumed
|
||||
# hamlib_FOUND - True if the system has the usb library
|
||||
# hamlib_VERSION - The verion of the usb library which was found
|
||||
#
|
||||
# and the following imported targets::
|
||||
#
|
||||
# hamlib::hamlib - The hamlib library
|
||||
#
|
||||
|
||||
# function(dump_cmake_variables)
|
||||
# get_cmake_property(_variableNames VARIABLES)
|
||||
# list (SORT _variableNames)
|
||||
# foreach (_variableName ${_variableNames})
|
||||
# if (ARGV0)
|
||||
# unset(MATCHED)
|
||||
# string(REGEX MATCH ${ARGV0} MATCHED ${_variableName})
|
||||
# if (NOT MATCHED)
|
||||
# continue()
|
||||
# endif()
|
||||
# endif()
|
||||
# message(STATUS "${_variableName}=${${_variableName}}")
|
||||
# endforeach()
|
||||
# endfunction()
|
||||
|
||||
include (LibFindMacros)
|
||||
|
||||
libfind_pkg_detect (hamlib hamlib FIND_PATH hamlib/rig.h PATH_SUFFIXES hamlib FIND_LIBRARY hamlib)
|
||||
libfind_pkg_detect (hamlib hamlib
|
||||
FIND_PATH hamlib/rig.h PATH_SUFFIXES hamlib
|
||||
FIND_LIBRARY hamlib
|
||||
)
|
||||
|
||||
libfind_package (hamlib libusb)
|
||||
if (hamlib_STATIC)
|
||||
if (hamlib_PKGCONF_FOUND)
|
||||
set (hamlib_PROCESS_LIBS hamlib_PKGCONF_STATIC_LIBRARY)
|
||||
else ()
|
||||
endif ()
|
||||
else ()
|
||||
if (hamlib_PKGCONF_FOUND)
|
||||
set (hamlib_PROCESS_LIBS hamlib_PKGCONF_LIBRARY)
|
||||
else ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
libfind_process (hamlib)
|
||||
|
||||
if (NOT hamlib_PKGCONF_FOUND)
|
||||
@ -48,4 +28,22 @@ if (NOT hamlib_PKGCONF_FOUND)
|
||||
else ()
|
||||
set (hamlib_LIBRARIES ${hamlib_LIBRARIES};m;dl)
|
||||
endif ()
|
||||
elseif (UNIX AND NOT APPLE)
|
||||
set (hamlib_LIBRARIES ${hamlib_PKGCONF_STATIC_LDFLAGS})
|
||||
endif ()
|
||||
|
||||
if (hamlib_FOUND AND NOT TARGET hamlib::hamlib)
|
||||
add_library (hamlib::hamlib UNKNOWN IMPORTED)
|
||||
set_target_properties (hamlib::hamlib PROPERTIES
|
||||
IMPORTED_LOCATION "${hamlib_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${hamlib_PKGCONF_STATIC_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${hamlib_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES "${hamlib_LIBRARIES}"
|
||||
)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced (
|
||||
hamlib_INCLUDE_DIR
|
||||
hamlib_LIBRARY
|
||||
hamlib_LIBRARIES
|
||||
)
|
||||
|
@ -1,86 +1,44 @@
|
||||
# Findlibusb
|
||||
# =======
|
||||
# ==========
|
||||
#
|
||||
# Find the usb library
|
||||
#
|
||||
# This will define the following variables::
|
||||
#
|
||||
# libusb_FOUND - True if the system has the usb library
|
||||
# libusb_FOUND - True if the system has the usb library
|
||||
# libusb_VERSION - The verion of the usb library which was found
|
||||
#
|
||||
# and the following imported targets::
|
||||
#
|
||||
# libusb::libusb - The libusb library
|
||||
#
|
||||
# If libusb_STATIC is TRUE then static linking will be assumed
|
||||
#
|
||||
|
||||
function(dump_cmake_variables)
|
||||
get_cmake_property(_variableNames VARIABLES)
|
||||
list (SORT _variableNames)
|
||||
foreach (_variableName ${_variableNames})
|
||||
if (ARGV0)
|
||||
unset(MATCHED)
|
||||
string(REGEX MATCH ${ARGV0} MATCHED ${_variableName})
|
||||
if (NOT MATCHED)
|
||||
continue()
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "${_variableName}=${${_variableName}}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
include (LibFindMacros)
|
||||
libfind_pkg_detect (libusb libusb-1.0 FIND_PATH libusb.h PATH_SUFFIXES libusb-1.0 FIND_LIBRARY libusb-1.0)
|
||||
set (libusb_LIBRARY C:/Tools/libusb-1.0.24/MinGW64/dll/libusb-1.0.dll.a)
|
||||
# # Use pkg-config to get hints about paths, libs and, flags
|
||||
# libfind_pkg_check_modules (libusb_PC libusb-1.0)
|
||||
|
||||
# # Include dir
|
||||
# find_path (libusb_INCLUDE_DIR
|
||||
# libusb.h
|
||||
# PATHS ${libusb_PC_INCLUDE_DIRS}
|
||||
# PATH_SUFFIXES libusb-1.0
|
||||
# )
|
||||
if (WIN32)
|
||||
# Use path suffixes on MS Windows as we probably shouldn't
|
||||
# trust the PATH envvar. PATH will still be searched to find the
|
||||
# library as last resort.
|
||||
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
|
||||
set (_library_options PATH_SUFFIXES MinGW64/dll MinGW64/static)
|
||||
else ()
|
||||
set (_library_options PATH_SUFFIXES MinGW32/dll MinGW32/static)
|
||||
endif ()
|
||||
endif ()
|
||||
libfind_pkg_detect (libusb libusb-1.0
|
||||
FIND_PATH libusb.h PATH_SUFFIXES libusb-1.0
|
||||
FIND_LIBRARY usb-1.0 ${_library_options}
|
||||
)
|
||||
|
||||
# # Library
|
||||
# if (libusb_STATIC)
|
||||
# find_library (libusb_LIBRARY
|
||||
# NAMES usb-1.0
|
||||
# PATHS ${libusb_PC_STATIC_LIBRARY_DIRS}
|
||||
# PATH_SUFFIXES static
|
||||
# )
|
||||
# else ()
|
||||
# find_library (libusb_LIBRARY
|
||||
# NAMES usb-1.0
|
||||
# PATHS ${libusb_PC_LIBRARY_DIRS}
|
||||
# )
|
||||
# endif ()
|
||||
# set (libusb_PROCESS_INCLUDES libusb_INCLUDE_DIR)
|
||||
# set (libusb_PROCESS_LIBS libusb_LIBRARY)
|
||||
libfind_process (libusb)
|
||||
|
||||
# include (FindPackageHandleStandardArgs)
|
||||
# find_package_handle_standard_args (libusb
|
||||
# REQUIRED_VARS
|
||||
# libusb_LIBRARY
|
||||
# libusb_INCLUDE_DIR
|
||||
# VERSION_VAR libusb_VERSION
|
||||
# )
|
||||
|
||||
# if (libusb_FOUND)
|
||||
# set (libusb_LIBRARIES ${libusb_LIBRARY})
|
||||
# set (libusb_INCLUDE_DIRS ${libusb_INCLUDE_DIR})
|
||||
# set (libusb_DEFINITIONS ${libusb_CFLAGS_OTHER})
|
||||
# endif ()
|
||||
|
||||
if (libusb_FOUND AND NOT TARGET libusb::libusb)
|
||||
add_library (libusb::libusb UNKNOWN IMPORTED)
|
||||
set_target_properties (libusb::libusb PROPERTIES
|
||||
IMPORTED_LOCATION "${libusb_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${libusb_CFLAGS_OTHER}"
|
||||
INTERFACE_COMPILE_OPTIONS "${libusb_PKGCONF_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${libusb_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARAIES "${libusb_LIBRARIES}"
|
||||
INTERFACE_LINK_LIBRARIES "${libusb_LIBRARIES}"
|
||||
)
|
||||
endif ()
|
||||
|
||||
|
@ -9,42 +9,98 @@
|
||||
#
|
||||
# portaudio::portaudio - The portaudio library
|
||||
#
|
||||
# If portaudio_STATIC is TRUE then static linking will be assumed
|
||||
#
|
||||
|
||||
# function(dump_cmake_variables)
|
||||
# get_cmake_property(_variableNames VARIABLES)
|
||||
# list (SORT _variableNames)
|
||||
# foreach (_variableName ${_variableNames})
|
||||
# if (ARGV0)
|
||||
# unset(MATCHED)
|
||||
# string(REGEX MATCH ${ARGV0} MATCHED ${_variableName})
|
||||
# if (NOT MATCHED)
|
||||
# continue()
|
||||
# endif()
|
||||
# endif()
|
||||
# message(STATUS "${_variableName}=${${_variableName}}")
|
||||
# endforeach()
|
||||
# endfunction()
|
||||
function(dump_cmake_variables)
|
||||
get_cmake_property(_variableNames VARIABLES)
|
||||
list (SORT _variableNames)
|
||||
foreach (_variableName ${_variableNames})
|
||||
if (ARGV0)
|
||||
unset(MATCHED)
|
||||
string(REGEX MATCH ${ARGV0} MATCHED ${_variableName})
|
||||
if (NOT MATCHED)
|
||||
continue()
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "${_variableName}=${${_variableName}}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# Get all propreties that cmake supports
|
||||
execute_process(COMMAND cmake --help-property-list OUTPUT_VARIABLE CMAKE_PROPERTY_LIST)
|
||||
|
||||
# Convert command output into a CMake list
|
||||
STRING(REGEX REPLACE ";" "\\\\;" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}")
|
||||
STRING(REGEX REPLACE "\n" ";" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}")
|
||||
# Fix https://stackoverflow.com/questions/32197663/how-can-i-remove-the-the-location-property-may-not-be-read-from-target-error-i
|
||||
#list(FILTER CMAKE_PROPERTY_LIST EXCLUDE REGEX "^LOCATION$|^LOCATION_|_LOCATION$")
|
||||
# For some reason, "TYPE" shows up twice - others might too?
|
||||
list(REMOVE_DUPLICATES CMAKE_PROPERTY_LIST)
|
||||
|
||||
# build whitelist by filtering down from CMAKE_PROPERTY_LIST in case cmake is
|
||||
# a different version, and one of our hardcoded whitelisted properties
|
||||
# doesn't exist!
|
||||
unset(CMAKE_WHITELISTED_PROPERTY_LIST)
|
||||
foreach(prop ${CMAKE_PROPERTY_LIST})
|
||||
if(prop MATCHES "^(INTERFACE|[_a-z]|IMPORTED_LIBNAME_|MAP_IMPORTED_CONFIG_)|^(COMPATIBLE_INTERFACE_(BOOL|NUMBER_MAX|NUMBER_MIN|STRING)|EXPORT_NAME|IMPORTED(_GLOBAL|_CONFIGURATIONS|_LIBNAME)?|NAME|TYPE|NO_SYSTEM_FROM_IMPORTED)$")
|
||||
list(APPEND CMAKE_WHITELISTED_PROPERTY_LIST ${prop})
|
||||
endif()
|
||||
endforeach(prop)
|
||||
|
||||
function(print_properties)
|
||||
message ("CMAKE_PROPERTY_LIST = ${CMAKE_PROPERTY_LIST}")
|
||||
endfunction(print_properties)
|
||||
|
||||
function(print_whitelisted_properties)
|
||||
message ("CMAKE_WHITELISTED_PROPERTY_LIST = ${CMAKE_WHITELISTED_PROPERTY_LIST}")
|
||||
endfunction(print_whitelisted_properties)
|
||||
|
||||
function(print_target_properties tgt)
|
||||
if(NOT TARGET ${tgt})
|
||||
message("There is no target named '${tgt}'")
|
||||
return()
|
||||
endif()
|
||||
|
||||
get_target_property(target_type ${tgt} TYPE)
|
||||
if(target_type STREQUAL "INTERFACE_LIBRARY")
|
||||
set(PROP_LIST ${CMAKE_WHITELISTED_PROPERTY_LIST})
|
||||
else()
|
||||
set(PROP_LIST ${CMAKE_PROPERTY_LIST})
|
||||
endif()
|
||||
|
||||
foreach (prop ${PROP_LIST})
|
||||
string(REPLACE "<CONFIG>" "${CMAKE_BUILD_TYPE}" prop ${prop})
|
||||
# message ("Checking ${prop}")
|
||||
get_property(propval TARGET ${tgt} PROPERTY ${prop} SET)
|
||||
if (propval)
|
||||
get_target_property(propval ${tgt} ${prop})
|
||||
message ("${tgt} ${prop} = ${propval}")
|
||||
endif()
|
||||
endforeach(prop)
|
||||
endfunction(print_target_properties)
|
||||
|
||||
include (LibFindMacros)
|
||||
|
||||
libfind_pkg_detect (portaudio portaudio-2.0 FIND_PATH portaudio.h FIND_LIBRARY portaudio)
|
||||
set (portaudio_PROCESS_LIBS portaudio_PKGCONF_LDFLAGS)
|
||||
libfind_pkg_detect (portaudio portaudio-2.0
|
||||
FIND_PATH portaudio.h
|
||||
FIND_LIBRARY portaudio
|
||||
)
|
||||
|
||||
libfind_process (portaudio)
|
||||
|
||||
#dump_cmake_variables ("^portaudio_")
|
||||
|
||||
dump_cmake_variables ("portaudio")
|
||||
if (portaudio_FOUND AND NOT TARGET portaudio::portaudio)
|
||||
add_library (portaudio::portaudio UNKNOWN IMPORTED)
|
||||
set_target_properties (portaudio::portaudio PROPERTIES
|
||||
IMPORTED_LOCATION "${portaudio_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${portaudio_CFLAGS_OTHERS}"
|
||||
INTERFACE_COMPILE_OPTIONS "${portaudio_PKGCONF_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${portaudio_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${portaudio_LIBRARIES}"
|
||||
INTERFACE_LINK_OPTIONS "${portaudio_PKGCONF_LDFLAGS_OTHER}"
|
||||
INTERFACE_LINK_DIRECTORIES "${portaudio_PKGCONF_LIBDIR}"
|
||||
INTERFACE_LINK_LIBRARIES "${portaudio_PKGCONF_LIBRARIES}"
|
||||
)
|
||||
endif ()
|
||||
|
||||
print_target_properties (portaudio::portaudio)
|
||||
|
||||
mark_as_advanced (
|
||||
portaudio_INCLUDE_DIR
|
||||
portaudio_LIBRARY
|
||||
|
@ -872,19 +872,11 @@ find_package (FFTW3 COMPONENTS single threads REQUIRED)
|
||||
#
|
||||
# libhamlib setup
|
||||
#
|
||||
set (hamlib_STATIC 1)
|
||||
find_package (hamlib REQUIRED)
|
||||
find_program (RIGCTL_EXE rigctl)
|
||||
find_program (RIGCTLD_EXE rigctld)
|
||||
find_program (RIGCTLCOM_EXE rigctlcom)
|
||||
|
||||
message (STATUS "hamlib_INCLUDE_DIRS: ${hamlib_INCLUDE_DIRS}")
|
||||
message (STATUS "hamlib_LIBRARIES: ${hamlib_LIBRARIES}")
|
||||
message (STATUS "hamlib_LIBRARY_DIRS: ${hamlib_LIBRARY_DIRS}")
|
||||
|
||||
set (CMAKE_REQUIRED_INCLUDES "${hamlib_INCLUDE_DIRS}")
|
||||
set (CMAKE_REQUIRED_LIBRARIES "${hamlib_LIBRARIES}")
|
||||
set (CMAKE_EXTRA_INCLUDE_FILES "hamlib/rig.h")
|
||||
check_type_size (CACHE_ALL HAMLIB_OLD_CACHING)
|
||||
check_symbol_exists (rig_set_cache_timeout_ms "hamlib/rig.h" HAVE_HAMLIB_CACHING)
|
||||
|
||||
@ -1332,8 +1324,7 @@ target_link_libraries (qcp Qt5::Widgets Qt5::PrintSupport)
|
||||
add_library (wsjt_qt STATIC ${wsjt_qt_CXXSRCS} ${wsjt_qt_GENUISRCS} ${GENAXSRCS})
|
||||
# set wsjtx_udp exports to static variants
|
||||
target_compile_definitions (wsjt_qt PUBLIC UDP_STATIC_DEFINE)
|
||||
target_link_libraries (wsjt_qt Boost::log qcp Qt5::Widgets Qt5::Network Qt5::Sql)
|
||||
target_include_directories (wsjt_qt BEFORE PRIVATE ${hamlib_INCLUDE_DIRS})
|
||||
target_link_libraries (wsjt_qt hamlib::hamlib Boost::log qcp Qt5::Widgets Qt5::Network Qt5::Sql)
|
||||
if (WIN32)
|
||||
target_link_libraries (wsjt_qt Qt5::AxContainer Qt5::AxBase)
|
||||
endif (WIN32)
|
||||
@ -1450,7 +1441,7 @@ else ()
|
||||
)
|
||||
endif ()
|
||||
endif ()
|
||||
target_link_libraries (wsjtx Qt5::SerialPort wsjt_cxx wsjt_qt wsjt_qtmm ${hamlib_LIBRARIES} ${FFTW3_LIBRARIES} ${LIBM_LIBRARIES})
|
||||
target_link_libraries (wsjtx Qt5::SerialPort wsjt_cxx wsjt_qt wsjt_qtmm ${FFTW3_LIBRARIES} ${LIBM_LIBRARIES})
|
||||
|
||||
# make a library for WSJT-X UDP servers
|
||||
# add_library (wsjtx_udp SHARED ${UDP_library_CXXSRCS})
|
||||
|
@ -26,7 +26,6 @@ void Astro::astroUpdate(QDateTime t, QString mygrid, QString hisgrid,
|
||||
int fQSO, int nsetftx, int ntxFreq, QString azelDir)
|
||||
{
|
||||
static int ntxFreq0=-99;
|
||||
static bool astroBusy=false;
|
||||
char cc[300];
|
||||
double azsun,elsun,azmoon,elmoon,azmoondx,elmoondx;
|
||||
double ramoon,decmoon,dgrd,poloffset,xnr;
|
||||
@ -44,14 +43,10 @@ void Astro::astroUpdate(QDateTime t, QString mygrid, QString hisgrid,
|
||||
int nfreq=(int)datcom_.fcenter;
|
||||
if(nfreq<10 or nfreq > 50000) nfreq=144;
|
||||
|
||||
if(!astroBusy) {
|
||||
astroBusy=true;
|
||||
astrosub_(&nyear, &month, &nday, &uth, &nfreq, mygrid.toLatin1(),
|
||||
astrosub_(&nyear, &month, &nday, &uth, &nfreq, mygrid.toLatin1(),
|
||||
hisgrid.toLatin1(), &azsun, &elsun, &azmoon, &elmoon,
|
||||
&azmoondx, &elmoondx, &ntsky, &ndop, &ndop00,&ramoon, &decmoon,
|
||||
&dgrd, &poloffset, &xnr, 6, 6);
|
||||
astroBusy=false;
|
||||
}
|
||||
|
||||
sprintf(cc,
|
||||
"Az: %6.1f\n"
|
||||
|
Loading…
Reference in New Issue
Block a user