2021-10-16 16:27:36 +01:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
2017-05-16 09:07:55 +01:00
|
|
|
|
2021-10-30 13:41:42 +01:00
|
|
|
project(applewin HOMEPAGE_URL "https://github.com/audetto/AppleWin")
|
2017-05-16 09:07:55 +01:00
|
|
|
|
2021-11-21 20:09:57 +00:00
|
|
|
option(BUILD_APPLEN "build ncurses frontend")
|
|
|
|
option(BUILD_QAPPLE "build Qt5 frontend")
|
|
|
|
option(BUILD_SA2 "build SDL2 frontend")
|
|
|
|
option(BUILD_LIBRETRO "build libretro core")
|
|
|
|
|
|
|
|
if (NOT (BUILD_APPLEN OR BUILD_QAPPLE OR BUILD_SA2 OR BUILD_LIBRETRO))
|
|
|
|
message(NOTICE "Building everything by default")
|
|
|
|
set(BUILD_APPLEN ON)
|
|
|
|
set(BUILD_QAPPLE ON)
|
|
|
|
set(BUILD_SA2 ON)
|
|
|
|
set(BUILD_LIBRETRO ON)
|
|
|
|
endif()
|
|
|
|
|
2021-10-16 16:01:27 +01:00
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2021-10-24 20:37:41 +01:00
|
|
|
add_compile_options(-Werror=return-type)
|
|
|
|
|
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
2021-12-18 17:58:19 +00:00
|
|
|
add_compile_options(-Werror=format -Wno-error=format-overflow -Wno-error=format-truncation -Wno-psabi)
|
2021-10-24 20:37:41 +01:00
|
|
|
endif()
|
2017-05-16 09:07:55 +01:00
|
|
|
|
|
|
|
MESSAGE("CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
|
|
|
|
MESSAGE("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
|
|
|
|
MESSAGE("CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
|
|
|
|
MESSAGE("CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}")
|
2019-12-01 18:40:50 +00:00
|
|
|
MESSAGE("CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
2017-10-10 09:26:08 +01:00
|
|
|
|
2020-12-11 08:16:12 +00:00
|
|
|
# this only affects common2, the others are already build with fPIC by default
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
2017-10-10 09:26:08 +01:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
|
|
|
2020-10-06 20:05:48 +01:00
|
|
|
execute_process(COMMAND uname -n
|
|
|
|
OUTPUT_VARIABLE UNAME
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
|
|
|
|
if(${UNAME} STREQUAL raspberrypi)
|
|
|
|
# it is too slow and might cause out of memory issues
|
|
|
|
# more forensic is required
|
2021-11-21 20:09:57 +00:00
|
|
|
MESSAGE(NOTICE "Raspberry Pi detected: IPO disabled")
|
2020-10-06 20:05:48 +01:00
|
|
|
else()
|
|
|
|
include(CheckIPOSupported)
|
|
|
|
check_ipo_supported()
|
|
|
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
|
|
|
|
endif()
|
2019-11-03 10:21:02 +00:00
|
|
|
|
2017-10-10 09:26:08 +01:00
|
|
|
include_directories(source)
|
|
|
|
|
|
|
|
add_subdirectory(source)
|
2021-11-28 18:49:17 +00:00
|
|
|
add_subdirectory(source/linux/libwindows)
|
2018-02-11 20:43:26 +00:00
|
|
|
add_subdirectory(test/TestCPU6502)
|
2021-10-10 20:56:19 +01:00
|
|
|
|
2021-11-21 20:09:57 +00:00
|
|
|
if (BUILD_LIBRETRO OR BUILD_APPLEN OR BUILD_SA2)
|
|
|
|
add_subdirectory(source/frontends/common2)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (BUILD_APPLEN)
|
|
|
|
add_subdirectory(source/frontends/ncurses)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (BUILD_QAPPLE)
|
|
|
|
add_subdirectory(source/frontends/qt)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (BUILD_SA2)
|
|
|
|
add_subdirectory(source/frontends/sdl)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (BUILD_LIBRETRO)
|
|
|
|
add_subdirectory(source/frontends/libretro)
|
|
|
|
endif()
|
|
|
|
|
2022-01-10 12:00:18 +00:00
|
|
|
file(STRINGS resource/version.h VERSION_FILE LIMIT_COUNT 1)
|
|
|
|
string(REGEX MATCH "#define APPLEWIN_VERSION (.*)" _ ${VERSION_FILE})
|
|
|
|
string(REPLACE "," "." VERSION ${CMAKE_MATCH_1})
|
|
|
|
|
|
|
|
set(CPACK_PACKAGE_VERSION ${VERSION})
|
2021-10-30 13:41:42 +01:00
|
|
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Apple ][ emulator for Linux")
|
|
|
|
set(CPACK_PACKAGE_CONTACT "audetto <mariofutire@gmail.com>")
|
2021-10-30 11:25:00 +01:00
|
|
|
|
|
|
|
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
|
2022-03-27 22:12:13 +02:00
|
|
|
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON")
|
|
|
|
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON")
|
2021-10-30 11:25:00 +01:00
|
|
|
|
2021-10-30 13:41:42 +01:00
|
|
|
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
|
|
|
|
set(CPACK_RPM_PACKAGE_GROUP "Applications/Emulators")
|
|
|
|
# RPM dependencies are automatic
|
2021-10-30 11:25:00 +01:00
|
|
|
|
2021-10-10 20:56:19 +01:00
|
|
|
include(CPack)
|