# # Singe 2 # Copyright (C) 2006-2024 Scott Duensing # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public Licens # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # cmake_minimum_required(VERSION 3.26) set(CMAKE_CXX_STANDARD 17) project(singe2) set(SINGE_SOURCE src/main.h src/singe.c src/singe.h src/util.h src/embedded.h src/frameFile.h src/main.c src/common.h src/videoPlayer.c src/stddclmr.h src/frameFile.c src/videoPlayer.h src/util.c src/embedded.c ) set(ARG_PARSER_SOURCE thirdparty/arg_parser/carg_parser.c thirdparty/arg_parser/carg_parser.h ) set(LUA_SOURCE thirdparty/lua/src/lmem.h thirdparty/lua/src/ltm.h thirdparty/lua/src/lutf8lib.c thirdparty/lua/src/ldo.h thirdparty/lua/src/ldump.c thirdparty/lua/src/lstring.h thirdparty/lua/src/lparser.h thirdparty/lua/src/lcorolib.c thirdparty/lua/src/loslib.c thirdparty/lua/src/lparser.c thirdparty/lua/src/ltablib.c thirdparty/lua/src/ltable.c thirdparty/lua/src/ljumptab.h thirdparty/lua/src/luaconf.h thirdparty/lua/src/lstate.c thirdparty/lua/src/lobject.h thirdparty/lua/src/lstate.h thirdparty/lua/src/ldo.c thirdparty/lua/src/lfunc.c thirdparty/lua/src/lmathlib.c thirdparty/lua/src/lua.h thirdparty/lua/src/lauxlib.h thirdparty/lua/src/ltm.c thirdparty/lua/src/lstrlib.c thirdparty/lua/src/lapi.h thirdparty/lua/src/lopcodes.c thirdparty/lua/src/lvm.h thirdparty/lua/src/linit.c thirdparty/lua/src/lobject.c thirdparty/lua/src/ldebug.c thirdparty/lua/src/lctype.c thirdparty/lua/src/lgc.c thirdparty/lua/src/lzio.h thirdparty/lua/src/lgc.h thirdparty/lua/src/lctype.h thirdparty/lua/src/lopcodes.h thirdparty/lua/src/llimits.h thirdparty/lua/src/lprefix.h thirdparty/lua/src/llex.h thirdparty/lua/src/lundump.c thirdparty/lua/src/lbaselib.c thirdparty/lua/src/loadlib.c thirdparty/lua/src/ldblib.c thirdparty/lua/src/ldebug.h thirdparty/lua/src/lundump.h thirdparty/lua/src/lopnames.h thirdparty/lua/src/ltable.h thirdparty/lua/src/lmem.c thirdparty/lua/src/lcode.h thirdparty/lua/src/lua.hpp thirdparty/lua/src/lauxlib.c thirdparty/lua/src/liolib.c thirdparty/lua/src/lapi.c thirdparty/lua/src/lcode.c thirdparty/lua/src/llex.c thirdparty/lua/src/lstring.c thirdparty/lua/src/lvm.c thirdparty/lua/src/lualib.h thirdparty/lua/src/lfunc.h thirdparty/lua/src/lzio.c ) set(LUA_FILESYSTEM_SOURCE thirdparty/luafilesystem/src/lfs.c thirdparty/luafilesystem/src/lfs.h ) set(LUA_SOCKET_SOURCE thirdparty/luasocket/src/udp.h thirdparty/luasocket/src/unix.c thirdparty/luasocket/src/options.c thirdparty/luasocket/src/socket.h thirdparty/luasocket/src/except.c thirdparty/luasocket/src/compat.c thirdparty/luasocket/src/inet.c thirdparty/luasocket/src/options.h thirdparty/luasocket/src/tcp.h thirdparty/luasocket/src/luasocket.c thirdparty/luasocket/src/tcp.c thirdparty/luasocket/src/compat.h thirdparty/luasocket/src/timeout.h thirdparty/luasocket/src/udp.c thirdparty/luasocket/src/inet.h thirdparty/luasocket/src/timeout.c thirdparty/luasocket/src/buffer.h thirdparty/luasocket/src/io.h thirdparty/luasocket/src/unixdgram.h thirdparty/luasocket/src/unixdgram.c thirdparty/luasocket/src/unix.h thirdparty/luasocket/src/unixstream.c thirdparty/luasocket/src/io.c thirdparty/luasocket/src/select.c thirdparty/luasocket/src/except.h thirdparty/luasocket/src/luasocket.h thirdparty/luasocket/src/auxiliar.c thirdparty/luasocket/src/mime.c thirdparty/luasocket/src/auxiliar.h thirdparty/luasocket/src/buffer.c thirdparty/luasocket/src/mime.h thirdparty/luasocket/src/serial.c thirdparty/luasocket/src/unixstream.h thirdparty/luasocket/src/select.h thirdparty/luasocket/src/pierror.h ) if(WIN32) set(LUA_SOCKET_SOURCE ${LUA_SOCKET_SOURCE} thirdparty/luasocket/src/wsocket.h thirdparty/luasocket/src/wsocket.c ) ELSE() set(LUA_SOCKET_SOURCE ${LUA_SOCKET_SOURCE} thirdparty/luasocket/src/usocket.h thirdparty/luasocket/src/usocket.c ) ENDIF() set(LUA_RS232_SOURCE thirdparty/librs232/bindings/lua/luars232.c thirdparty/librs232/src/rs232.c ) if(WIN32) set(LUA_RS232_SOURCE ${LUA_RS232_SOURCE} thirdparty/librs232/src/rs232_windows.c ) ELSE() set(LUA_RS232_SOURCE ${LUA_RS232_SOURCE} thirdparty/librs232/src/rs232_posix.c ) ENDIF() set(UTHASH_SOURCE thirdparty/uthash/src/uthash.h thirdparty/uthash/src/utlist.h ) set(MANYMOUSE_SOURCE thirdparty/manymouse/linux_evdev.c thirdparty/manymouse/macosx_hidmanager.c thirdparty/manymouse/macosx_hidutilities.c thirdparty/manymouse/manymouse.c thirdparty/manymouse/manymouse.h thirdparty/manymouse/windows_wminput.c thirdparty/manymouse/x11_xinput2.c ) add_executable(${CMAKE_PROJECT_NAME} ${SINGE_SOURCE} ${ARG_PARSER_SOURCE} ${LUA_SOURCE} ${LUA_FILESYSTEM_SOURCE} ${LUA_SOCKET_SOURCE} ${LUA_RS232_SOURCE} ${UTHASH_SOURCE} ${MANYMOUSE_SOURCE} ) # Perform pre-build operations. #add_custom_target(BUILD_PREREQS # COMMAND ${CMAKE_SOURCE_DIR}/build-deps.sh "${CMAKE_SOURCE_DIR}" # BYPRODUCTS # ${CMAKE_SOURCE_DIR}/thirdparty-installed/lib/libarchive.a #) #add_dependencies(${CMAKE_PROJECT_NAME} BUILD_PREREQS) target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC build/${KANGAROO_OS}/${KANGAROO_ARCH} thirdparty/lua/src thirdparty/librs232/include ) target_link_directories(${CMAKE_PROJECT_NAME} PUBLIC build/lib ) target_link_libraries(${CMAKE_PROJECT_NAME} -Wl,--start-group ${CMAKE_SOURCE_DIR}/build/lib/libz.a ${CMAKE_SOURCE_DIR}/build/lib/libbrotlicommon-static.a ${CMAKE_SOURCE_DIR}/build/lib/libbrotlidec-static.a ${CMAKE_SOURCE_DIR}/build/lib/libbz2_static.a ${CMAKE_SOURCE_DIR}/build/lib/libdav1d.a ${CMAKE_SOURCE_DIR}/build/lib/libffms2.a ${CMAKE_SOURCE_DIR}/build/lib/libfreetype.a ${CMAKE_SOURCE_DIR}/build/lib/libharfbuzz.a ${CMAKE_SOURCE_DIR}/build/lib/libhwy.a ${CMAKE_SOURCE_DIR}/build/lib/libjxl_dec.a ${CMAKE_SOURCE_DIR}/build/lib/liblzma.a ${CMAKE_SOURCE_DIR}/build/lib/libogg.a ${CMAKE_SOURCE_DIR}/build/lib/libopus.a ${CMAKE_SOURCE_DIR}/build/lib/libopusfile.a ${CMAKE_SOURCE_DIR}/build/lib/libpostproc.a ${CMAKE_SOURCE_DIR}/build/lib/libswresample.a ${CMAKE_SOURCE_DIR}/build/lib/libswscale.a ${CMAKE_SOURCE_DIR}/build/lib/libwavpack.a ${CMAKE_SOURCE_DIR}/build/lib/libwebp.a ${CMAKE_SOURCE_DIR}/build/lib/libwebpdemux.a ${CMAKE_SOURCE_DIR}/build/lib/libxmp.a ${CMAKE_SOURCE_DIR}/build/lib/libSDL2.a ${CMAKE_SOURCE_DIR}/build/lib/libSDL2_image.a ${CMAKE_SOURCE_DIR}/build/lib/libSDL2_mixer.a ${CMAKE_SOURCE_DIR}/build/lib/libSDL2_ttf.a ${CMAKE_SOURCE_DIR}/build/lib/libSDL2main.a ${CMAKE_SOURCE_DIR}/build/lib/libavcodec.a ${CMAKE_SOURCE_DIR}/build/lib/libavdevice.a ${CMAKE_SOURCE_DIR}/build/lib/libavfilter.a ${CMAKE_SOURCE_DIR}/build/lib/libavformat.a ${CMAKE_SOURCE_DIR}/build/lib/libavif.a ${CMAKE_SOURCE_DIR}/build/lib/libavutil.a -Wl,--end-group -ldl -pthread -lm -lstdc++ ) install(TARGETS ${CMAKE_PROJECT_NAME})