|
|
1.1 root 1: set(SOURCES
2: cart.c cfgopts.c
3: configuration.c options.c change.c
4: control.c cycInt.c cycles.c dialog.c file.c
5: ioMem.c ioMemTabNEXT.c memorySnapShot.c keymap.c
6: m68000.c main.c
7: paths.c resolution.c reset.c
8: scandir.c nextMemory.c screen.c screenSnapShot.c shortcut.c
9: statusbar.c str.c zip.c unzip.c utils.c
10: video.c )
11:
12: # When building for OSX, define specific sources for gui and ressources
13: if(ENABLE_OSX_BUNDLE)
14: set(GUIOSX_SOURCES
15: gui-osx/AlertHooks.m gui-osx/PrefsController.m gui-osx/Shared.m
16: gui-osx/CreateFloppyController.m gui-osx/SDLMain.m)
17: set_source_files_properties(${GUIOSX_SOURCES} PROPERTIES LANGUAGE C)
18: set(GUIOSX_RSRCS
19: gui-osx/Previous.icns gui-osx/English.lproj gui-osx/French.lproj)
20: endif(ENABLE_OSX_BUNDLE)
21:
22:
23: # When building for Windows, define specific sources for gui and ressources
24: if(WIN32)
25: set(GUIWIN_SOURCES gui-win/opencon.c)
26: set(GUIWIN_RES gui-win/hatari-winicon.rc)
27: endif(WIN32)
28:
29: include_directories(${CMAKE_BINARY_DIR} includes debug falcon uae-cpu
30: ${SDL_INCLUDE_DIR})
31:
32: if(ZLIB_FOUND)
33: include_directories(${ZLIB_INCLUDE_DIR})
34: endif(ZLIB_FOUND)
35:
36: if(PNG_FOUND)
37: include_directories(${PNG_INCLUDE_DIR})
38: endif(PNG_FOUND)
39:
40: if(X11_FOUND)
41: include_directories(${X11_INCLUDE_DIR})
42: endif(X11_FOUND)
43:
44:
45: link_directories(${CMAKE_CURRENT_BINARY_DIR}/debug ${CMAKE_CURRENT_BINARY_DIR}/gui-sdl ${CMAKE_CURRENT_BINARY_DIR}/uae-cpu)
46:
47: add_subdirectory(debug)
48: add_subdirectory(gui-sdl)
49: add_subdirectory(uae-cpu)
50:
51: # When building for OSX, add specific sources
52: if(ENABLE_OSX_BUNDLE)
53: add_executable(previous MACOSX_BUNDLE ${GUIOSX_RSRCS} ${SOURCES} ${GUIOSX_SOURCES})
54: set_target_properties(previous PROPERTIES MACOSX_BUNDLE_INFO_PLIST
55: ${CMAKE_CURRENT_SOURCE_DIR}/gui-osx/Info-Previous.plist)
56: set(MACOSX_BUNDLE_ICON_FILE Previous.icns)
57: # Create Previous.app bundle
58: add_custom_target(osx_bundle_dirs
59: COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/Previous.app/Contents/Resources
60: COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/Previous.app/Contents/MacOS
61: COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/gui-osx/${MACOSX_BUNDLE_ICON_FILE}
62: ${CMAKE_CURRENT_BINARY_DIR}/Previous.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE}
63: # Copy Localized .nib to Bundle
64: COMMAND cp -R ${CMAKE_CURRENT_SOURCE_DIR}/gui-osx/*.lproj ${CMAKE_CURRENT_BINARY_DIR}/Previous.app/Contents/Resources/
65: )
66: add_dependencies(previous osx_bundle_dirs)
67: set_source_files_properties(${GUIOSX_RSRCS}
68: PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
69:
70: # When building for Windows, add specific sources + method to compile .rc files
71: elseif(WIN32)
72: # Set a default rc compiler if it was not defined yet
73: if(NOT CMAKE_RC_COMPILER)
74: set(CMAKE_RC_COMPILER windres)
75: endif(NOT CMAKE_RC_COMPILER)
76: ENABLE_LANGUAGE(RC)
77: set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -Ocoff -o <OBJECT> <SOURCE>")
78: set_source_files_properties(${GUIWIN_RES} PROPERTIES LANGUAGE RC)
79: add_executable(previous ${GUIWIN_RES} ${SOURCES} ${GUIWIN_SOURCES})
80:
81: # Other targets, use default sources
82: else()
83: add_executable(previous ${SOURCES})
84: endif(ENABLE_OSX_BUNDLE)
85:
86: target_link_libraries(previous Debug GuiSdl UaeCpu ${SDL_LIBRARY})
87:
88: if(MATH_FOUND AND NOT APPLE)
89: target_link_libraries(previous ${MATH_LIBRARY})
90: endif()
91:
92: if(SDLMAIN_LIBRARY)
93: target_link_libraries(previous ${SDLMAIN_LIBRARY})
94: endif(SDLMAIN_LIBRARY)
95:
96: if(READLINE_FOUND)
97: target_link_libraries(previous ${READLINE_LIBRARY})
98: endif(READLINE_FOUND)
99:
100: if(ZLIB_FOUND)
101: target_link_libraries(previous ${ZLIB_LIBRARY})
102: endif(ZLIB_FOUND)
103:
104: if(PNG_FOUND)
105: target_link_libraries(previous ${PNG_LIBRARY})
106: endif(PNG_FOUND)
107:
108: if(X11_FOUND)
109: target_link_libraries(previous ${X11_X11_LIB})
110: endif(X11_FOUND)
111:
112: if(PORTAUDIO_FOUND)
113: target_link_libraries(previous ${PORTAUDIO_LIBRARY})
114: endif(PORTAUDIO_FOUND)
115:
116: if(WIN32)
117: # Needed for socket() on Windows
118: target_link_libraries(hatari ws2_32)
119: endif(WIN32)
120:
121: if(ENABLE_OSX_BUNDLE)
122: install(TARGETS previous BUNDLE DESTINATION /Applications)
123: else()
124: install(TARGETS previous RUNTIME DESTINATION ${BINDIR})
125: install(FILES previous-icon.bmp DESTINATION ${DATADIR})
126: file(GLOB TOS_IMG_FILE tos.img)
127: if(TOS_IMG_FILE)
128: install(FILES tos.img DESTINATION ${DATADIR})
129: endif(TOS_IMG_FILE)
130: endif(ENABLE_OSX_BUNDLE)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.