2019-07-06 23:10:32 -07:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
|
|
|
project(dingusppc)
|
2019-12-16 16:31:33 +01:00
|
|
|
|
2019-07-06 23:10:32 -07:00
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
2019-12-14 12:56:43 -07:00
|
|
|
|
2019-07-06 23:10:32 -07:00
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
2019-12-15 16:24:14 -07:00
|
|
|
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
2020-02-27 21:03:01 -07:00
|
|
|
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
|
2020-03-22 20:15:12 -07:00
|
|
|
|
|
|
|
if (NOT WIN32)
|
2020-03-19 15:09:24 +01:00
|
|
|
find_package(SDL2 REQUIRED)
|
|
|
|
include_directories(${SDL2_INCLUDE_DIRS})
|
2020-03-22 20:15:12 -07:00
|
|
|
endif()
|
2020-03-19 15:09:24 +01:00
|
|
|
|
2020-02-03 14:36:30 +01:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/cpu/ppc/")
|
2020-04-20 20:32:09 +02:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/debugger/")
|
2020-02-03 14:36:30 +01:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/devices/")
|
2020-03-13 22:49:58 +01:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/machines/")
|
2020-03-22 20:15:12 -07:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/thirdparty/loguru/")
|
2020-02-03 14:36:30 +01:00
|
|
|
|
2019-12-16 16:31:33 +01:00
|
|
|
include_directories("${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/devices"
|
2020-02-03 14:36:30 +01:00
|
|
|
"${PROJECT_SOURCE_DIR}/cpu/ppc"
|
2020-02-27 21:03:01 -07:00
|
|
|
"${PROJECT_SOURCE_DIR}/debugger"
|
2020-03-22 20:15:12 -07:00
|
|
|
"${PROJECT_SOURCE_DIR}/thirdparty/loguru/"
|
|
|
|
"${PROJECT_SOURCE_DIR}/thirdparty/SDL2/")
|
2020-02-03 14:36:30 +01:00
|
|
|
|
|
|
|
file(GLOB SOURCES "${PROJECT_SOURCE_DIR}/*.cpp"
|
2020-03-22 20:15:12 -07:00
|
|
|
"${PROJECT_SOURCE_DIR}/*.c"
|
|
|
|
"${PROJECT_SOURCE_DIR}/*.hpp"
|
2020-04-20 20:32:09 +02:00
|
|
|
"${PROJECT_SOURCE_DIR}/*.h")
|
2019-12-16 16:31:33 +01:00
|
|
|
|
2020-02-03 14:36:30 +01:00
|
|
|
file(GLOB TEST_SOURCES "${PROJECT_SOURCE_DIR}/cpu/ppc/test/*.cpp")
|
2019-12-16 16:31:33 +01:00
|
|
|
|
2020-04-20 20:32:09 +02:00
|
|
|
add_executable(dingusppc ${SOURCES} $<TARGET_OBJECTS:debugger>
|
|
|
|
$<TARGET_OBJECTS:cpu_ppc>
|
2020-03-13 22:49:58 +01:00
|
|
|
$<TARGET_OBJECTS:devices>
|
|
|
|
$<TARGET_OBJECTS:machines>
|
2020-02-27 21:03:01 -07:00
|
|
|
$<TARGET_OBJECTS:loguru>)
|
2020-03-22 20:15:12 -07:00
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
target_link_libraries(dingusppc "${PROJECT_SOURCE_DIR}/thirdparty/SDL2/lib/x64/SDL2.lib"
|
|
|
|
"${PROJECT_SOURCE_DIR}/thirdparty/SDL2/lib/x64/SDL2main.lib")
|
|
|
|
else()
|
2020-03-19 15:09:24 +01:00
|
|
|
target_link_libraries(dingusppc ${SDL2_LIBRARIES})
|
2020-03-22 20:15:12 -07:00
|
|
|
endif()
|
|
|
|
|
2020-03-19 15:09:24 +01:00
|
|
|
|
2020-04-20 20:32:09 +02:00
|
|
|
add_executable(testppc ${TEST_SOURCES} $<TARGET_OBJECTS:debugger>
|
|
|
|
$<TARGET_OBJECTS:cpu_ppc>
|
2020-03-13 22:49:58 +01:00
|
|
|
$<TARGET_OBJECTS:devices>
|
2020-03-14 15:39:34 +01:00
|
|
|
$<TARGET_OBJECTS:machines>
|
2020-02-27 21:03:01 -07:00
|
|
|
$<TARGET_OBJECTS:loguru>)
|
2020-03-22 20:15:12 -07:00
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
target_link_libraries(testppc "${PROJECT_SOURCE_DIR}/thirdparty/SDL2/lib/x64/SDL2.lib"
|
|
|
|
"${PROJECT_SOURCE_DIR}/thirdparty/SDL2/lib/x64/SDL2main.lib")
|
|
|
|
else()
|
2020-03-19 15:09:24 +01:00
|
|
|
target_link_libraries(testppc ${SDL2_LIBRARIES})
|
2020-03-22 20:15:12 -07:00
|
|
|
endif()
|
2020-03-19 15:09:24 +01:00
|
|
|
|
2020-02-03 14:36:30 +01:00
|
|
|
add_custom_command(
|
2020-02-10 16:41:40 +01:00
|
|
|
TARGET testppc POST_BUILD
|
2020-02-03 14:36:30 +01:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy
|
|
|
|
"${PROJECT_SOURCE_DIR}/cpu/ppc/test/ppcinttests.csv"
|
2020-02-12 22:58:24 +01:00
|
|
|
"${PROJECT_SOURCE_DIR}/cpu/ppc/test/ppcdisasmtest.csv"
|
2020-02-03 14:36:30 +01:00
|
|
|
$<TARGET_FILE_DIR:${PROJECT_NAME}>)
|
2020-01-31 04:10:53 +01:00
|
|
|
|
2020-03-22 20:15:12 -07:00
|
|
|
install (TARGETS dingusppc DESTINATION ${EXECUTABLE_OUTPUT_PATH})
|