2012-04-24 01:22:36 +00:00
|
|
|
# Copyright 2012 Wolfgang Thaller.
|
|
|
|
#
|
|
|
|
# This file is part of Retro68.
|
|
|
|
#
|
|
|
|
# Retro68 is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# Retro68 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 Retro68. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2012-04-05 22:45:04 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2012-04-05 23:43:44 +00:00
|
|
|
project(Retro)
|
2012-04-06 18:54:45 +00:00
|
|
|
|
2014-09-30 09:21:08 +00:00
|
|
|
include(CMakeParseArguments)
|
|
|
|
|
|
|
|
function(add_application name)
|
|
|
|
set(options DEBUGBREAK CONSOLE)
|
|
|
|
set(oneValueArgs TYPE CREATOR)
|
|
|
|
set(multiValueArgs FILES MAKEAPPL_ARGS)
|
|
|
|
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
|
|
|
|
|
|
|
list(APPEND ARGS_FILES ${ARGS_UNPARSED_ARGUMENTS})
|
|
|
|
|
|
|
|
set(files)
|
|
|
|
foreach(f ${ARGS_FILES})
|
|
|
|
list(APPEND files "${CMAKE_CURRENT_SOURCE_DIR}/${f}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_executable(${name} ${files})
|
|
|
|
|
|
|
|
if(${ARGS_DEBUGBREAK})
|
|
|
|
list(APPEND ARGS_MAKEAPPL_ARGS -b)
|
|
|
|
endif()
|
|
|
|
if(${ARGS_CONSOLE})
|
|
|
|
target_link_libraries(${name} RetroConsole)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if(TARGET libretro)
|
|
|
|
set_target_properties(${name} PROPERTIES LINK_DEPENDS libretro)
|
|
|
|
endif(TARGET libretro)
|
|
|
|
|
|
|
|
set_target_properties(${name} PROPERTIES OUTPUT_NAME ${name}.flt)
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${name}.bin ${name} ${name}.dsk
|
|
|
|
COMMAND ${MAKE_APPL} ${ARGS_MAKEAPPL_ARGS} -c "${name}.flt" -o "${name}"
|
|
|
|
DEPENDS ${name})
|
|
|
|
add_custom_target(${name}_APPL ALL DEPENDS ${name}.bin)
|
|
|
|
endfunction()
|
|
|
|
|
2012-04-06 18:54:45 +00:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES Retro68)
|
2012-04-05 22:45:04 +00:00
|
|
|
add_subdirectory(libretro)
|
2014-09-30 09:21:08 +00:00
|
|
|
|
|
|
|
# add library path so that GCC picks up the freshly-built libretro
|
|
|
|
link_directories(${CMAKE_CURRENT_BINARY_DIR}/libretro)
|
|
|
|
|
2014-09-27 15:21:03 +00:00
|
|
|
add_subdirectory(Console)
|
|
|
|
add_subdirectory(TestApps)
|
2012-04-07 22:29:54 +00:00
|
|
|
add_subdirectory(Raytracer)
|
2014-09-20 00:18:58 +00:00
|
|
|
add_subdirectory(Launcher)
|
2012-04-06 18:54:45 +00:00
|
|
|
else()
|
|
|
|
add_subdirectory(MakeAPPL)
|
2012-04-13 18:43:27 +00:00
|
|
|
add_subdirectory(ASFilter)
|
2014-10-05 21:52:34 +00:00
|
|
|
add_subdirectory(Rez)
|
2012-04-07 22:29:54 +00:00
|
|
|
endif()
|