2019-11-02 19:19:18 +00:00
|
|
|
include(FindPkgConfig)
|
2021-12-31 14:06:34 +00:00
|
|
|
include(FindZLIB)
|
2019-11-02 19:19:18 +00:00
|
|
|
|
2021-12-31 14:06:34 +00:00
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
pkg_search_module(YAML REQUIRED yaml-0.1)
|
|
|
|
pkg_search_module(MINIZIP REQUIRED minizip)
|
|
|
|
pkg_search_module(SLIRP slirp)
|
2021-05-17 19:26:11 +01:00
|
|
|
|
|
|
|
if ("${SLIRP_FOUND}" STREQUAL "")
|
|
|
|
message(WARNING "'libslirp' not found. Will use 'libpcap' instead")
|
|
|
|
endif()
|
|
|
|
|
2021-12-31 14:06:34 +00:00
|
|
|
pkg_search_module(PCAP libpcap)
|
2021-05-17 19:26:11 +01:00
|
|
|
if ("${PCAP_FOUND}" STREQUAL "")
|
|
|
|
# old versions of pcap do not work with pkg-config
|
|
|
|
# this is necessary on Rapsberri Pi OS
|
|
|
|
execute_process(COMMAND pcap-config --cflags
|
|
|
|
OUTPUT_VARIABLE PCAP_INCLUDE_DIRS
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
RESULT_VARIABLE STATUS)
|
|
|
|
if ("${STATUS}" STREQUAL "0")
|
|
|
|
message("Found 'libpcap' via pcap-config")
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Cannot locate 'libpcap-dev'")
|
|
|
|
endif()
|
|
|
|
execute_process(COMMAND pcap-config --libs
|
|
|
|
OUTPUT_VARIABLE PCAP_LIBRARIES
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(Boost REQUIRED)
|
|
|
|
|
2021-01-12 12:52:26 +00:00
|
|
|
set(SOURCE_FILES
|
2021-04-17 19:07:21 +01:00
|
|
|
Tfe/tfearch.cpp
|
|
|
|
Tfe/tfesupp.cpp
|
2022-02-27 20:42:40 +00:00
|
|
|
Tfe/NetworkBackend.cpp
|
|
|
|
Tfe/PCapBackend.cpp
|
2022-03-23 11:44:53 +00:00
|
|
|
Tfe/IPRaw.cpp
|
2021-04-17 19:07:21 +01:00
|
|
|
|
2021-05-06 15:22:14 +01:00
|
|
|
Debugger/Debug.cpp
|
|
|
|
Debugger/Debugger_Help.cpp
|
2021-03-20 10:23:53 +00:00
|
|
|
Debugger/Debugger_Color.cpp
|
2021-03-07 20:32:24 +00:00
|
|
|
Debugger/Debugger_Disassembler.cpp
|
|
|
|
Debugger/Debugger_Symbols.cpp
|
|
|
|
Debugger/Debugger_DisassemblerData.cpp
|
|
|
|
Debugger/Debugger_Console.cpp
|
|
|
|
Debugger/Debugger_Assembler.cpp
|
|
|
|
Debugger/Debugger_Parser.cpp
|
|
|
|
Debugger/Debugger_Range.cpp
|
2021-05-06 15:22:14 +01:00
|
|
|
Debugger/Debugger_Commands.cpp
|
|
|
|
Debugger/Util_MemoryTextFile.cpp
|
2021-03-07 20:32:24 +00:00
|
|
|
|
2022-02-27 20:42:40 +00:00
|
|
|
Uthernet1.cpp
|
|
|
|
Uthernet2.cpp
|
2022-02-14 08:29:08 +00:00
|
|
|
StrFormat.cpp
|
2022-02-06 11:44:56 +00:00
|
|
|
6522.cpp
|
2021-12-03 18:46:23 +00:00
|
|
|
VidHD.cpp
|
2021-03-24 18:56:50 +00:00
|
|
|
SSI263.cpp
|
2020-07-08 16:52:00 +01:00
|
|
|
Speaker.cpp
|
2020-07-01 18:27:40 +01:00
|
|
|
SoundCore.cpp
|
2020-06-30 15:43:06 +01:00
|
|
|
AY8910.cpp
|
|
|
|
Mockingboard.cpp
|
2017-10-10 09:26:08 +01:00
|
|
|
Pravets.cpp
|
|
|
|
YamlHelper.cpp
|
|
|
|
Log.cpp
|
|
|
|
Disk.cpp
|
2018-02-03 20:35:04 +00:00
|
|
|
DiskFormatTrack.cpp
|
2017-10-10 09:26:08 +01:00
|
|
|
DiskImage.cpp
|
|
|
|
DiskImageHelper.cpp
|
|
|
|
Harddisk.cpp
|
|
|
|
Memory.cpp
|
|
|
|
CPU.cpp
|
|
|
|
6821.cpp
|
|
|
|
NoSlotClock.cpp
|
|
|
|
SAM.cpp
|
|
|
|
z80emu.cpp
|
|
|
|
ParallelPrinter.cpp
|
|
|
|
MouseInterface.cpp
|
2018-11-03 19:20:08 +00:00
|
|
|
LanguageCard.cpp
|
2019-04-19 20:55:23 +01:00
|
|
|
RGBMonitor.cpp
|
2019-11-17 13:57:34 +00:00
|
|
|
NTSC.cpp
|
|
|
|
NTSC_CharSet.cpp
|
2021-11-13 09:31:43 +00:00
|
|
|
Card.cpp
|
2019-12-31 18:19:45 +00:00
|
|
|
CardManager.cpp
|
|
|
|
Disk2CardManager.cpp
|
2020-06-30 15:43:06 +01:00
|
|
|
Riff.cpp
|
2020-10-12 20:58:32 +01:00
|
|
|
SaveState.cpp
|
|
|
|
SynchronousEventManager.cpp
|
2020-11-22 09:36:28 +00:00
|
|
|
Video.cpp
|
2020-11-27 13:48:53 +00:00
|
|
|
Core.cpp
|
|
|
|
Utilities.cpp
|
2020-12-27 20:25:42 +00:00
|
|
|
FrameBase.cpp
|
2021-10-19 09:27:40 +01:00
|
|
|
CmdLine.cpp
|
2017-10-10 09:26:08 +01:00
|
|
|
|
2020-07-06 19:29:18 +01:00
|
|
|
Configuration/PropertySheetHelper.cpp
|
2017-10-10 09:26:08 +01:00
|
|
|
|
2021-01-20 18:17:34 +00:00
|
|
|
linux/resources.cpp
|
2017-10-10 09:26:08 +01:00
|
|
|
linux/benchmark.cpp
|
|
|
|
linux/paddle.cpp
|
2018-02-06 16:50:50 +00:00
|
|
|
linux/version.cpp
|
2019-08-26 10:27:38 +01:00
|
|
|
linux/registry.cpp
|
2019-12-07 11:20:37 +00:00
|
|
|
linux/keyboard.cpp
|
2020-12-27 20:25:42 +00:00
|
|
|
linux/linuxframe.cpp
|
2021-01-10 11:47:44 +00:00
|
|
|
linux/context.cpp
|
2021-05-28 18:10:09 +01:00
|
|
|
linux/tape.cpp
|
2021-04-30 20:10:30 +01:00
|
|
|
linux/network/slirp2.cpp
|
2017-10-10 09:26:08 +01:00
|
|
|
|
2021-05-06 15:22:14 +01:00
|
|
|
linux/duplicates/Debugger_Display.cpp
|
|
|
|
linux/duplicates/Debugger_Win32.cpp
|
2019-11-16 17:01:11 +00:00
|
|
|
linux/duplicates/Joystick.cpp
|
|
|
|
linux/duplicates/SerialComms.cpp
|
2020-12-20 16:35:44 +00:00
|
|
|
linux/duplicates/PropertySheet.cpp
|
2021-10-17 09:05:32 +01:00
|
|
|
linux/duplicates/Registry.cpp
|
|
|
|
linux/duplicates/FourPlay.cpp
|
|
|
|
linux/duplicates/SNESMAX.cpp
|
2021-10-19 09:27:40 +01:00
|
|
|
linux/duplicates/Keyboard.cpp
|
2019-11-16 17:01:11 +00:00
|
|
|
|
2017-10-10 09:26:08 +01:00
|
|
|
Z80VICE/z80.cpp
|
|
|
|
Z80VICE/z80mem.cpp
|
|
|
|
Z80VICE/daa.cpp
|
|
|
|
)
|
|
|
|
|
2021-01-12 12:52:26 +00:00
|
|
|
set(HEADER_FILES
|
2022-02-27 20:42:40 +00:00
|
|
|
Tfe/tfearch.h
|
|
|
|
Tfe/tfesupp.h
|
|
|
|
Tfe/NetworkBackend.h
|
|
|
|
Tfe/PCapBackend.h
|
2022-03-23 11:44:53 +00:00
|
|
|
Tfe/IPRaw.h
|
2022-02-27 20:42:40 +00:00
|
|
|
|
|
|
|
Uthernet1.h
|
|
|
|
Uthernet2.h
|
|
|
|
W5100.h
|
2022-02-06 11:44:56 +00:00
|
|
|
6522.h
|
|
|
|
VidHD.h
|
2021-03-24 18:56:50 +00:00
|
|
|
SSI263.h
|
|
|
|
SSI263Phonemes.h
|
2021-01-12 12:52:26 +00:00
|
|
|
Speaker.h
|
|
|
|
SoundCore.h
|
|
|
|
AY8910.h
|
|
|
|
Mockingboard.h
|
|
|
|
Pravets.h
|
|
|
|
Tape.h
|
|
|
|
YamlHelper.h
|
|
|
|
Log.h
|
|
|
|
Disk.h
|
|
|
|
DiskFormatTrack.h
|
|
|
|
DiskImage.h
|
|
|
|
DiskImageHelper.h
|
|
|
|
Harddisk.h
|
|
|
|
Memory.h
|
|
|
|
CPU.h
|
|
|
|
6821.h
|
|
|
|
NoSlotClock.h
|
|
|
|
SAM.h
|
|
|
|
z80emu.h
|
|
|
|
ParallelPrinter.h
|
|
|
|
MouseInterface.h
|
|
|
|
LanguageCard.h
|
|
|
|
RGBMonitor.h
|
|
|
|
NTSC.h
|
|
|
|
NTSC_CharSet.h
|
2021-11-13 09:31:43 +00:00
|
|
|
Card.h
|
2021-01-12 12:52:26 +00:00
|
|
|
CardManager.h
|
|
|
|
Disk2CardManager.h
|
|
|
|
Riff.h
|
|
|
|
SaveState.h
|
|
|
|
SynchronousEventManager.h
|
|
|
|
Video.h
|
|
|
|
Core.h
|
|
|
|
Utilities.h
|
|
|
|
FrameBase.h
|
2021-10-17 09:05:32 +01:00
|
|
|
FourPlay.h
|
|
|
|
SNESMAX.h
|
2021-01-12 12:52:26 +00:00
|
|
|
|
|
|
|
Common.h
|
|
|
|
DiskDefs.h
|
|
|
|
DiskLog.h
|
|
|
|
Interface.h
|
|
|
|
SaveState_Structs_common.h
|
|
|
|
SaveState_Structs_v1.h
|
|
|
|
|
2021-01-20 18:17:34 +00:00
|
|
|
Debugger/Debug.h
|
2021-05-06 15:22:14 +01:00
|
|
|
Debugger/DebugDefs.h
|
|
|
|
Debugger/Debugger_Color.h
|
|
|
|
Debugger/Debugger_Console.h
|
|
|
|
Debugger/Debugger_Disassembler.h
|
|
|
|
Debugger/Debugger_DisassemblerData.h
|
|
|
|
Debugger/Debugger_Display.h
|
|
|
|
Debugger/Debugger_Help.h
|
|
|
|
Debugger/Debugger_Parser.h
|
|
|
|
Debugger/Debugger_Range.h
|
|
|
|
Debugger/Debugger_Symbols.h
|
|
|
|
Debugger/Debugger_Types.h
|
|
|
|
Debugger/Debugger_Win32.h
|
|
|
|
Debugger/Util_MemoryTextFile.h
|
|
|
|
Debugger/Util_Text.h
|
2021-01-20 18:17:34 +00:00
|
|
|
|
2021-01-12 12:52:26 +00:00
|
|
|
Configuration/PropertySheetHelper.h
|
|
|
|
|
2021-01-20 18:17:34 +00:00
|
|
|
linux/resources.h
|
2021-10-16 19:24:03 +01:00
|
|
|
linux/linuxinterface.h
|
2021-01-12 12:52:26 +00:00
|
|
|
linux/benchmark.h
|
|
|
|
linux/paddle.h
|
|
|
|
linux/version.h
|
|
|
|
linux/registry.h
|
|
|
|
linux/keyboard.h
|
|
|
|
linux/linuxframe.h
|
2021-05-28 18:10:09 +01:00
|
|
|
linux/tape.h
|
2021-04-30 20:10:30 +01:00
|
|
|
linux/network/slirp2.h
|
2021-01-12 12:52:26 +00:00
|
|
|
|
|
|
|
Z80VICE/z80.h
|
|
|
|
Z80VICE/z80mem.h
|
|
|
|
Z80VICE/z80regs.h
|
|
|
|
Z80VICE/daa.h
|
|
|
|
)
|
|
|
|
|
2021-11-29 09:59:34 +00:00
|
|
|
# we used to generate a shared object, but it turns out there are more cons than pros
|
|
|
|
add_library(appleii STATIC
|
2021-01-12 12:52:26 +00:00
|
|
|
${SOURCE_FILES}
|
|
|
|
${HEADER_FILES}
|
|
|
|
)
|
|
|
|
|
2019-11-02 19:19:18 +00:00
|
|
|
target_include_directories(appleii PRIVATE
|
2021-05-17 19:26:11 +01:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR} # for config.h
|
2019-11-02 19:19:18 +00:00
|
|
|
${YAML_INCLUDE_DIRS}
|
2021-04-17 19:07:21 +01:00
|
|
|
${PCAP_INCLUDE_DIRS}
|
2019-11-02 19:19:18 +00:00
|
|
|
${Boost_INCLUDE_DIRS}
|
2021-04-30 20:10:30 +01:00
|
|
|
${SLIRP_INCLUDE_DIRS}
|
2019-12-31 18:34:16 +00:00
|
|
|
Debugger
|
2019-11-02 19:19:18 +00:00
|
|
|
)
|
|
|
|
|
2020-11-12 18:43:04 +00:00
|
|
|
# this one appears in header files
|
|
|
|
target_include_directories(appleii PUBLIC
|
|
|
|
${MINIZIP_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
2019-12-01 15:22:17 +00:00
|
|
|
target_link_libraries(appleii PRIVATE
|
2019-11-02 19:19:18 +00:00
|
|
|
${YAML_LIBRARIES}
|
|
|
|
${MINIZIP_LIBRARIES}
|
2021-04-17 19:07:21 +01:00
|
|
|
${PCAP_LIBRARIES}
|
2021-04-30 20:10:30 +01:00
|
|
|
${SLIRP_LIBRARIES}
|
2021-12-31 14:06:34 +00:00
|
|
|
ZLIB::ZLIB
|
2017-10-10 09:26:08 +01:00
|
|
|
)
|
2020-07-12 15:53:53 +01:00
|
|
|
|
2021-11-28 18:49:17 +00:00
|
|
|
target_link_libraries(appleii PUBLIC
|
|
|
|
windows
|
|
|
|
)
|
|
|
|
|
2021-10-16 16:27:36 +01:00
|
|
|
target_link_directories(appleii PRIVATE
|
2021-10-17 17:45:17 +01:00
|
|
|
${YAML_LIBRARY_DIRS}
|
|
|
|
${MINIZIP_LIBRARY_DIRS}
|
|
|
|
${PCAP_LIBRARY_DIRS}
|
|
|
|
${SLIRP_LIBRARY_DIRS}
|
2021-10-16 16:27:36 +01:00
|
|
|
)
|
|
|
|
|
2021-02-07 13:46:21 +00:00
|
|
|
target_compile_options(appleii PUBLIC
|
|
|
|
-Wno-multichar
|
|
|
|
)
|
|
|
|
|
2021-03-13 20:56:19 +00:00
|
|
|
add_custom_command(
|
|
|
|
TARGET appleii POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/bin/*.SYM ${CMAKE_BINARY_DIR}
|
|
|
|
)
|
|
|
|
|
2021-05-17 19:26:11 +01:00
|
|
|
configure_file(linux/config.h.in linux/config.h)
|