Przeglądaj źródła

Added run target

Thomas Buck 10 lat temu
rodzic
commit
331d5edd97
3 zmienionych plików z 17 dodań i 13 usunięć
  1. 13
    12
      README.md
  2. 3
    0
      src/CMakeLists.txt
  3. 1
    1
      src/SDLSystem.cpp

+ 13
- 12
README.md Wyświetl plik

4
 
4
 
5
 This project aims to get OpenRaider in a more usable state, maybe one day even being able to play the old Tomb Raider games flawlessly...
5
 This project aims to get OpenRaider in a more usable state, maybe one day even being able to play the old Tomb Raider games flawlessly...
6
 
6
 
7
-Currently, my focus is on building and running under Mac OS X.
8
-However, my changes should not break the Linux "buildability" :)
9
-
10
-If you just want to see OpenRaider doing something on your Mac, without installing any of the dependencies needed to build OpenRaider, install [XQuartz](http://xquartz.macosforge.org/trac) (if you don't have it already) and grab the Mac App Bundle from the [most recent release](https://github.com/xythobuz/OpenRaider/releases).
11
-If you don't install XQuartz, Mac OS X should prompt you to do so on the first launch of OpenRaider.
7
+If you just want to see OpenRaider doing something on your Mac, without installing any of the dependencies needed to build OpenRaider, grab the Mac App Bundle from the [most recent release](https://github.com/xythobuz/OpenRaider/releases).
12
 
8
 
13
 It seems as if OpenRaider will currently only work on Little-Endian platforms. This is not nice and will hopefully be fixed in the future!
9
 It seems as if OpenRaider will currently only work on Little-Endian platforms. This is not nice and will hopefully be fixed in the future!
14
 
10
 
15
 ## Configuration
11
 ## Configuration
16
 
12
 
17
 OpenRaider needs some configuration files, and level data and assets from custom levels or the Tomb Raider games.
13
 OpenRaider needs some configuration files, and level data and assets from custom levels or the Tomb Raider games.
18
-These are stored in `~/.OpenRaider`. Running the included `setup.sh` will create/copy the necessary files and directories. The Mac App Bundle will do this for you automatically.
14
+These are stored in `~/.OpenRaider`. Running the included `setup.sh` will create/copy the necessary files and directories.
19
 
15
 
20
 You still need to add level files in `~/.OpenRaider/paks/` and add them to `~/.OpenRaider/OpenRaider.init`.
16
 You still need to add level files in `~/.OpenRaider/paks/` and add them to `~/.OpenRaider/OpenRaider.init`.
21
 Dust off your old Tomb Raider CDs or grab some [custom levels](http://www.aspidetr.com/levels/yvel-woods-v1-5/) from the interwebs.
17
 Dust off your old Tomb Raider CDs or grab some [custom levels](http://www.aspidetr.com/levels/yvel-woods-v1-5/) from the interwebs.
36
 * OpenAL & ALUT
32
 * OpenAL & ALUT
37
 * Posix Threads
33
 * Posix Threads
38
 * zlib
34
 * zlib
35
+* cmake as build system
39
 
36
 
40
 On Mac OS X 10.9 with [XCode](https://developer.apple.com/xcode/) and [MacPorts](http://www.macports.org) installed, the following should be enough to get all dependencies that are available as port:
37
 On Mac OS X 10.9 with [XCode](https://developer.apple.com/xcode/) and [MacPorts](http://www.macports.org) installed, the following should be enough to get all dependencies that are available as port:
41
 
38
 
42
-    sudo port install zlib libsdl2 libsdl2_ttf cmake
39
+    sudo port install cmake zlib libsdl2 libsdl2_ttf
43
 
40
 
44
 A similar command for the package manager of your favorite Linux Distribution should do the trick.
41
 A similar command for the package manager of your favorite Linux Distribution should do the trick.
45
 
42
 
57
 
54
 
58
 ## Building
55
 ## Building
59
 
56
 
60
-Do a standard cmake build and then run the resulting executable:
57
+Do a standard cmake out-of-source build and then run the resulting executable:
61
 
58
 
62
     mkdir build
59
     mkdir build
63
     cd build
60
     cd build
65
     make
62
     make
66
     ./src/OpenRaider
63
     ./src/OpenRaider
67
 
64
 
68
-On Mac OS X, running `make install` will produce a distributable OpenRaider.app bundle.
65
+On Mac OS X, running `make install` will produce a (more or less) distributable OpenRaider.app bundle.
66
+
67
+To build all Unit Tests run `make tests`, to build and run most of them use `make testRun`.
68
+
69
+To run a TombRaider level loader regression test use `make testReg`. The results will be put into log files in your build folder.
69
 
70
 
70
-To build all Unit Tests, run `make tests`, to run most of them use `make testRun`.
71
-To run a TombRaider level loader regression test, use `make testReg`. The results will be put into log files in your build folder.
72
 You can run a static analysis with cppcheck using `make check`, `make checkFull` or `make checkConfig`.
71
 You can run a static analysis with cppcheck using `make check`, `make checkFull` or `make checkConfig`.
73
-A Doxygen API documentation can be created with `make doc`. `make docLocal` will not create additional graphs for the documentation and tries to copy the result into a directory called apache on the parent level of the OpenRaider project directory.
72
+
73
+A Doxygen API documentation can be created with `make doc`.
74
+
74
 `make clean` should remove all intermediary files.
75
 `make clean` should remove all intermediary files.
75
 
76
 
76
 ## Usage
77
 ## Usage

+ 3
- 0
src/CMakeLists.txt Wyświetl plik

114
 
114
 
115
 # Link to all found libs
115
 # Link to all found libs
116
 target_link_libraries (OpenRaider ${LIBS})
116
 target_link_libraries (OpenRaider ${LIBS})
117
+
118
+# Add target to run executable
119
+add_custom_target(run COMMAND OpenRaider DEPENDS OpenRaider WORKING_DIRECTORY ${CMAKE_PROJECT_DIR})

+ 1
- 1
src/SDLSystem.cpp Wyświetl plik

84
     if (mFullscreen)
84
     if (mFullscreen)
85
         flags |= SDL_WINDOW_FULLSCREEN;
85
         flags |= SDL_WINDOW_FULLSCREEN;
86
 
86
 
87
-    //setGrabMouse(true); // Always grab mouse!
87
+    setGrabMouse(true); // Always grab mouse!
88
 
88
 
89
     SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
89
     SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
90
     SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
90
     SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);

Ładowanie…
Anuluj
Zapisz