Files
gui/windows/CMakeLists.txt
Neo-DesktopandClaude Opus 5.5 22d7b4d2cd Find the modem automatically in Line Settings
Line Settings searches the serial ports (windows/src/ports.cpp) and
has a "Look for a modem" button. When it finds a modem, it selects the
serial port line, the port and hardware flow control.

- Windows: the installed modems (the Modem class in the registry, for
  9x and NT), the MultiTech USB modems (Enum\USB), and the ports of
  SERIALCOMM, else COM1 to COM16.
- Linux: /sys/class/tty (ttyUSB, ttyACM) with the USB maker and
  product. A MultiTech MT9234MU with no port gets the firmware advice
  of the old GTK app.
- macOS: /dev/cu.* (cu.usbmodem is a modem).

The COM port line now opens a device path (/dev/ttyUSB0) as it is on
Linux and macOS. The port name holds 64 characters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUx6MjNXmAFKULZu3U
Signed-off-by: Neo-Desktop <321592+Neo-Desktop@users.noreply.github.com>
2026-11-28 13:36:36 +00:00

35 lines
1.5 KiB
CMake

# The Windows app with MinGW, MSVC or clang-retro (the Windows 95 build:
# cmake/clang-retro.cmake). ANSI, for the same code to build with all.
enable_language(CXX)
enable_language(RC)
include(sources.cmake)
# (the target dmodem-app, its file dmodem.exe: D-Modem's libdmodem is
# the target dmodem, with the modem built in)
add_executable(dmodem-app WIN32 ${DMODEM_WIN_SOURCES} res/app.rc)
set_target_properties(dmodem-app PROPERTIES OUTPUT_NAME dmodem)
target_include_directories(dmodem-app PRIVATE src)
target_link_libraries(dmodem-app PRIVATE dmodemctl comctl32 wsock32 comdlg32 gdi32 winmm msacm32 shell32 advapi32)
# the Remote page's SSH: libdmodemssh (libssh, built in)
if(TARGET dmodemssh)
target_link_libraries(dmodem-app PRIVATE dmodemssh)
target_compile_definitions(dmodem-app PRIVATE DMODEM_HAVE_SSH)
endif()
if(MSVC)
target_compile_definitions(dmodem-app PRIVATE _CRT_SECURE_NO_WARNINGS)
# (a manifest of our own in app.rc)
target_link_options(dmodem-app PRIVATE /MANIFEST:NO)
else()
target_compile_options(dmodem-app PRIVATE -Wall -Wextra -Wno-unused-parameter)
target_link_options(dmodem-app PRIVATE -static)
endif()
# (picolibc starts main, unless the entry point is WinMain's)
if(CLANG_RETRO_CONFIG MATCHES "picolibc")
target_link_options(dmodem-app PRIVATE -Wl,-e,WinMainCRTStartup)
endif()
# the modem built in (libdmodem_embed, DMODEM_GUI_EMBED): Windows 98 SE
# and later
if(DMODEM_GUI_EMBED AND TARGET dmodem_embed)
target_link_libraries(dmodem-app PRIVATE dmodem_embed)
target_compile_definitions(dmodem-app PRIVATE DMODEM_GUI_EMBED)
endif()