CMakeLists.txt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #
  2. # TI-NES CMake
  3. #
  4. # Created by Manoel TRAPIER.
  5. # Copyright (c) 2003-2016 986-Studio. All rights reserved.
  6. #
  7. # $LastChangedDate$
  8. # $Author$
  9. # $HeadURL$
  10. # $Revision$
  11. ##########################
  12. # Configurations variables
  13. ##########################
  14. set(PPU_ISPAL OFF CACHE BOOL "When switch to ON the PPU is in PAL mode, else it will act as a NTSC one.")
  15. set(Q6502_DEBUGGER OFF CACHE BOOL "Activate the Quick6502 debugger?")
  16. set(USE_SOUND OFF CACHE BOOL "Activate the sound?")
  17. set(DETECT_BUS_CONFLICT OFF CACHE BOOL "Activate the bus conflit detector? (Could slow down the emulator a lot.)")
  18. set(USE_EFENCE OFF CACHE BOOL "Use electricfence memory debugger?")
  19. set(USE_PROFILING OFF CACHE BOOL "Use profiling tools? (Will slow down a lot.)")
  20. set(USE_ALLEGRO ON CACHE BOOL "Use Allegro backend")
  21. option(COVERALLS "Generate coveralls data" OFF)
  22. ##########################
  23. # Link & Compile flags
  24. ##########################
  25. set (CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused-parameter -Werror ${PLATFORM_FLAGS}")
  26. set (CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Werror ${PLATFORM_FLAGS}")
  27. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/external/coveralls-cmake/cmake)
  28. add_definitions (-DNO_DECIMAL)
  29. if (PPU_ISPAL)
  30. add_definitions (-DISPAL)
  31. else (PPU_ISPAL)
  32. add_definitions (-DISNTSC)
  33. endif (PPU_ISPAL)
  34. if (Q6502_DEBUGGER)
  35. add_definitions (-DDEBUG)
  36. endif (Q6502_DEBUGGER)
  37. if (USE_SOUND)
  38. add_definitions (-DUSE_SOUND)
  39. endif (USE_SOUND)
  40. if (DETECT_BUS_CONFLICT)
  41. add_definitions (-DDETECT_BUS_CONFLICT)
  42. endif (DETECT_BUS_CONFLICT)
  43. if (USE_PROFILING)
  44. if (CMAKE_BUILD_TYPE MATCHES Rel)
  45. SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Debug info is forced" FORCE)
  46. else(CMAKE_BUILD_TYPE MATCHES Rel)
  47. SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Debug info is forced" FORCE)
  48. endif(CMAKE_BUILD_TYPE MATCHES Rel)
  49. set(CMAKE_C_FLAGS -pg)
  50. endif (USE_PROFILING)
  51. if (COVERALLS)
  52. include(Coveralls)
  53. coveralls_turn_on_coverage()
  54. endif()
  55. include_directories(include)
  56. add_subdirectory(apu)
  57. add_subdirectory(corecpu)
  58. add_subdirectory(mappersmanager)
  59. add_subdirectory(memorymanager)
  60. add_subdirectory(pluginsmanager)
  61. add_subdirectory(ppu)
  62. if (TARGET_TI68k)
  63. add_subdirectory(os/ti68k)
  64. elseif (WIN32)
  65. add_subdirectory(os/win32)
  66. else (TARGET_TI68k)
  67. add_subdirectory(os/unix)
  68. endif (TARGET_TI68k)
  69. find_library(PTHREADLIB pthread)
  70. if (COVERALLS)
  71. set(COVERAGE_SRCS src/main.c src/paddle.c src/NESCarts.c ${COVERAGE_SRCS})
  72. # Create the coveralls target.
  73. coveralls_setup(
  74. "${COVERAGE_SRCS}" # The source files.
  75. ON # If we should upload.
  76. ) # (Optional) Alternate project cmake module path.
  77. endif()
  78. add_executable(tines main.c paddle.c NESCarts.c)
  79. target_link_libraries(tines apu corecpu mappermanager memorymanager pluginsmanager ppu oslib ${PTHREADLIB})