Compare commits
190 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 625a0ec5ec | |||
| 6b79ead016 | |||
| f2504649e9 | |||
| b4326d972d | |||
| 2f23974f81 | |||
| 26c4be927a | |||
| 87baa3cc79 | |||
| 189354b8e9 | |||
| 345c1c0d27 | |||
| c98ee8dbef | |||
| 6b2ab31824 | |||
| 31ad94a1ee | |||
| 33f71fa042 | |||
| 8e35b4dd35 | |||
| 47de02a172 | |||
| 256f1a99de | |||
| 1361276e1a | |||
| 54a996a989 | |||
| d13493e7fe | |||
| d1f3bd9938 | |||
| cb164a8236 | |||
| 88a9b6ce7b | |||
| 97b6d7e4cf | |||
| cf3250e11b | |||
| d1cf4fcf61 | |||
| afd99f6ec0 | |||
| fcfe75b906 | |||
| 17d955042f | |||
| 1a72165a2c | |||
| 834754b3a3 | |||
| 160bd243a6 | |||
| ba6c7353d9 | |||
| 90c1b7b5c1 | |||
| b83267d257 | |||
| c9915d2b0b | |||
| bb38735679 | |||
| 1f2ba5df16 | |||
| 04850d017f | |||
| ac04d717af | |||
| ddbb41e71a | |||
| 856e285427 | |||
| 3d0816a284 | |||
| c1d8ec0cd2 | |||
| dc817bf2b9 | |||
| 9452acb749 | |||
| c850ae3aea | |||
| 7e43f1bfbf | |||
| d0f8c7c6a9 | |||
| 1e3420aa8f | |||
| 62185ef48b | |||
| e851085b9b | |||
| 748a5ed5b5 | |||
| 4b62a06af9 | |||
| f191347e05 | |||
| a195028061 | |||
| 72ccb94cba | |||
| 53541e8e38 | |||
| 40d1691b40 | |||
| d38c685772 | |||
| b56181e59f | |||
| 8496a93690 | |||
| 3984f0197f | |||
| 73827b40c8 | |||
| 42e34087fc | |||
| 7292ac7b92 | |||
| 931236ec82 | |||
| d25a043958 | |||
| 8c2f5c109a | |||
| f2834c0079 | |||
| 487a686c9a | |||
| 5f8eb8d704 | |||
| 8ee5a039d9 | |||
| 6f62316525 | |||
| e86adb7b4a | |||
| bc139be5ac | |||
| 89606d54f1 | |||
| afaeab92a6 | |||
| e2a81e3626 | |||
| 80c519df6b | |||
| 85b70b1bef | |||
| 10c7b24130 | |||
| 725700952e | |||
| 386d664d2f | |||
| d17b905747 | |||
| f6d198b4fb | |||
| 5e81da6827 | |||
| 8c6b82564a | |||
| dd72f62e06 | |||
| 90dd579372 | |||
| c3c77d79ed | |||
| 128d69039e | |||
| 668ca4d4d5 | |||
| 33e7dc1b04 | |||
| 856b06a9d7 | |||
| 6a95b78584 | |||
| b5631470ad | |||
| 757e29b223 | |||
| 6e17b80cd2 | |||
| d9e8b3bb17 | |||
| 3889ef8d11 | |||
| 9d16ab056b | |||
| 339b665712 | |||
| 71c2f0acf9 | |||
| 6c79e7fb41 | |||
| 98220d224f | |||
| c57923f1a9 | |||
| 13beb3e0f4 | |||
| c5e612a48b | |||
| 14cd8db985 | |||
| 194c87c271 | |||
| d5478c5d26 | |||
| ffd16169a8 | |||
| 69321de26f | |||
| 2608758799 | |||
| 1d2f7bff6b | |||
| b7eb63e481 | |||
| c9efd9e07d | |||
| 2fbb555d1f | |||
| d05bb314c6 | |||
| a8202034ed | |||
| a072ef1ac8 | |||
| c779eaa368 | |||
| e252913a04 | |||
| a7a4b27974 | |||
| db309cab30 | |||
| 44eb59a505 | |||
| dedf57fac0 | |||
| e398f9bafd | |||
| 979b06b3d7 | |||
| 764717a692 | |||
| 955ddf5a68 | |||
| c11694c8f5 | |||
| 71c137cb7b | |||
| 236a8eaf2b | |||
| 11584605aa | |||
| 7ba6ddd36c | |||
| 1919ec2d1f | |||
| 4e0431a322 | |||
| 32dfe1835c | |||
| 39c70d5215 | |||
| 53f46d6cbc | |||
| cac6b77701 | |||
| 10a53e345e | |||
| 858cb2c70c | |||
| 55917f29ee | |||
| 8e298bf3c8 | |||
| 2cd7f3b231 | |||
| df8b9c496b | |||
| 26ed97b25e | |||
| 89b144fe69 | |||
| 7a090660f0 | |||
| 1b864a9a90 | |||
| f302db99fd | |||
| aa71c25eee | |||
| 8ddb42e3b7 | |||
| 3d3b660f35 | |||
| b648d80e52 | |||
| aa744bfc9d | |||
| 157c2f3ebc | |||
| 0277830d44 | |||
| 4478b07e9c | |||
| 9fbd2684e8 | |||
| ad69d1bbbe | |||
| c83d72ee59 | |||
| 079f0e3cbc | |||
| 6d26f077ca | |||
| 884582f056 | |||
| dc01a8cb0b | |||
| 843e548735 | |||
| 3f8605b480 | |||
| fb5597ecc2 | |||
| c0f9e865bd | |||
| c406d589a4 | |||
| 2ca266e1f2 | |||
| 0ed563b102 | |||
| 114c25454b | |||
| eedabd57c2 | |||
| 07b6f36115 | |||
| f87bf17412 | |||
| 877552c3a4 | |||
| 07fcf7d196 | |||
| dff69f7269 | |||
| 9654131119 | |||
| ff4619146e | |||
| 0e366475a3 | |||
| b420f16e3c | |||
| 2d50f82c1b | |||
| 7e99570f41 | |||
| 51f537e2fc | |||
| 6e566bb0dd |
@@ -1,30 +0,0 @@
|
||||
version: '{branch}.{build}'
|
||||
os: Windows
|
||||
clone_folder: C:\Projects\Cataclysm-DDA
|
||||
shallow_clone: true
|
||||
pull_requests:
|
||||
do_not_increment_build_number: false
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
PROJECT: /msvc-full-features/Cataclysm-vcpkg-static.sln
|
||||
COMPILER: msvc2017
|
||||
TOOLCHAIN: msvc15
|
||||
PLATFORM: x64
|
||||
CONFIGURATION: Release
|
||||
APPVEYOR_SAVE_CACHE_ON_ERROR: true
|
||||
matrix:
|
||||
fast_finish: false
|
||||
cache:
|
||||
- 'c:\tools\vcpkg\installed'
|
||||
install:
|
||||
# Install dependency packages
|
||||
- cmd: vcpkg --triplet %PLATFORM%-windows-static install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext lua
|
||||
# Add LUA binary folder to PATH
|
||||
- cmd: set PATH=c:\tools\vcpkg\installed\%PLATFORM%-windows-static\tools\lua;%PATH%
|
||||
# Report LUA binary version
|
||||
- cmd: lua.exe -v
|
||||
build:
|
||||
parallel: true
|
||||
project: /msvc-full-features/Cataclysm-vcpkg-static.sln
|
||||
verbosity: minimal
|
||||
@@ -1,51 +0,0 @@
|
||||
# These options are mirrored in .astylerc and doc/CODE_STYLE.txt
|
||||
|
||||
# "One True Brace Style"
|
||||
--style=1tbs
|
||||
|
||||
# Attach brackets to class and struct inline function definitions.
|
||||
--attach-inlines
|
||||
|
||||
# 4 spaces per indentation level and per tab stop
|
||||
--indent=spaces=4
|
||||
|
||||
# 'char *foo' instead of 'char* foo'
|
||||
--align-pointer=name
|
||||
|
||||
# maximum length for a single unbroken line
|
||||
--max-code-length=100
|
||||
|
||||
# 'foo ||\nbar' instead of 'foo\n|| bar'
|
||||
--break-after-logical
|
||||
|
||||
# indent 'public:' 'protected:' 'private:' deeper than 'class' or 'struct'
|
||||
--indent-classes
|
||||
|
||||
# indent 'case' lines deeper than 'switch'
|
||||
--indent-switches
|
||||
|
||||
# indent later lines of multi-line preprocessor directives
|
||||
# to be deprecated by --indent-preproc-define
|
||||
--indent-preprocessor
|
||||
|
||||
# indent comments on column 1 to match the code block they are in
|
||||
--indent-col1-comments
|
||||
|
||||
# indent multi-line control block headers like 'if (foo\nbar)'
|
||||
--min-conditional-indent=0
|
||||
|
||||
# add space around operators with two operands
|
||||
--pad-oper
|
||||
|
||||
# add brackets to unbracketed one line conditional statements
|
||||
--add-brackets
|
||||
|
||||
# replaces tabs with spaces in non-indent sections, except in strings
|
||||
--convert-tabs
|
||||
|
||||
# remove extra space padding around parentheses
|
||||
--unpad-paren
|
||||
|
||||
# insert space padding around parentheses on the inside only
|
||||
--pad-paren-in
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
# 4 space indentation
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
@@ -1,40 +0,0 @@
|
||||
# Automatically normalise line endings for all files
|
||||
# detected as text (Convert CRLF => LF).
|
||||
* text=auto
|
||||
|
||||
# Explicitly normalise files with these extensions in
|
||||
# case Git doesn't detect them as text for some reason.
|
||||
*.c text
|
||||
*.cbp text
|
||||
*.cpp text
|
||||
*.h text
|
||||
*.json text
|
||||
*.lua text
|
||||
*.md text
|
||||
*.py text
|
||||
*.rc text
|
||||
*.sh text
|
||||
*.txt text
|
||||
*.yml text
|
||||
|
||||
# Visual Studio project files, leave them alone.
|
||||
*.cmd -text
|
||||
*.filters -text
|
||||
*.sln -text
|
||||
*.user -text
|
||||
*.vcxproj -text
|
||||
|
||||
# Generated translation text, don't mess with them.
|
||||
*.mo -text
|
||||
*.po -text
|
||||
*.pot -text
|
||||
|
||||
# Treat images, archives, and font files as binary.
|
||||
# (binary is a macro for -text -diff)
|
||||
*.db binary
|
||||
*.fon binary
|
||||
*.gz binary
|
||||
*.ico binary
|
||||
*.png binary
|
||||
*.ttf binary
|
||||
|
||||
@@ -1,312 +0,0 @@
|
||||
# Contribute
|
||||
|
||||
**Opening new issue?** Please read [ISSUES.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/ISSUES.md) first.
|
||||
|
||||
Contributing to Cataclysm: Dark Days Ahead is easy — simply fork the repository here on GitHub, make your changes, and then send us a pull request.
|
||||
|
||||
Cataclysm:Dark Days Ahead is released under the Creative Commons Attribution ShareAlike 3.0 license. The code and content of the game is free to use, modify, and redistribute for any purpose whatsoever. See http://creativecommons.org/licenses/by-sa/3.0/ for details.
|
||||
This means any contribution you make to the project will also be covered by the same license, and this license is irrevocable.
|
||||
|
||||
## Guidelines
|
||||
|
||||
There are a couple of guidelines we suggest sticking to:
|
||||
|
||||
* Add this repository as an `upstream` remote.
|
||||
* Keep your `master` branch clean. This means you can easily pull changes made to this repository into yours.
|
||||
* Create a new branch for each new feature or set of related bug fixes.
|
||||
* Never merge from your local branches into your `master` branch. Only update that by pulling from `upstream/master`.
|
||||
|
||||
## Code Style
|
||||
|
||||
Current policy is to only update code to the standard style when changing a substantial portion of it, but **please** do this in a separate commit. See [CODE_STYLE](../doc/CODE_STYLE.md) for details.
|
||||
|
||||
## Translations
|
||||
|
||||
The translation of Cataclysm: DDA is done using Transifex.
|
||||
Look at the [translation project](https://www.transifex.com/cataclysm-dda-translators/cataclysm-dda/) for an up-to-date list of supported languages.
|
||||
|
||||
See [TRANSLATING](../doc/TRANSLATING.md) for more information:
|
||||
|
||||
* [For translators](../doc/TRANSLATING.md#translators)
|
||||
* [For developers](../doc/TRANSLATING.md#developers)
|
||||
* [For maintainers](../doc/TRANSLATING.md#maintainers)
|
||||
|
||||
## Doxygen Comments
|
||||
|
||||
Extensive documentation of classes and class members will make the code more readable to new contributors. New doxygen comments for existing classes are a welcomed contribution.
|
||||
|
||||
Use the following template for commenting classes:
|
||||
```c++
|
||||
/**
|
||||
* Brief description
|
||||
*
|
||||
* Lengthy description with many words. (optional)
|
||||
*/
|
||||
class foo {
|
||||
```
|
||||
|
||||
Use the following template for commenting functions:
|
||||
```c++
|
||||
/**
|
||||
* Brief description
|
||||
*
|
||||
* Lengthy description with many words. (optional)
|
||||
* @param param1 Description of param1 (optional)
|
||||
* @return Description of return (optional)
|
||||
*/
|
||||
int foo(int param1);
|
||||
```
|
||||
|
||||
Use the following template for commenting member variables:
|
||||
```c++
|
||||
/** Brief description **/
|
||||
int foo;
|
||||
```
|
||||
|
||||
Helpful pages:
|
||||
http://www.stack.nl/~dimitri/doxygen/manual/commands.html
|
||||
http://www.stack.nl/~dimitri/doxygen/manual/markdown.html#markdown_std
|
||||
http://www.stack.nl/~dimitri/doxygen/manual/faq.html
|
||||
|
||||
### Guidelines for adding documentation
|
||||
* Doxygen comments should describe behavior towards the outside, not implementation, but since many classes in Cataclysm are intertwined, it's often necessary to describe implementation.
|
||||
* Describe things that aren't obvious to newcomers just from the name.
|
||||
* Don't describe redundantly: `/** Map **/; map* map;` is not a helpful comment.
|
||||
* When documenting X, describe how X interacts with other components, not just what X itself does.
|
||||
|
||||
### Building the documentation for viewing it locally
|
||||
* Install doxygen
|
||||
* `doxygen doxygen_doc/doxygen_conf.txt `
|
||||
* `firefox doxygen_doc/html/index.html` (replace firefox with your browser of choice)
|
||||
|
||||
## Example Workflow
|
||||
|
||||
#### Setup your environment
|
||||
|
||||
*(This only needs to be done once.)*
|
||||
|
||||
1. Fork this repository here on GitHub.
|
||||
|
||||
2. Clone your fork locally.
|
||||
|
||||
$ git clone https://github.com/YOUR_USERNAME/Cataclysm-DDA.git
|
||||
# Clones your fork of the repository into the current directory in terminal
|
||||
|
||||
3. Set commit message template.
|
||||
|
||||
$ git config --local commit.template .gitmessage
|
||||
|
||||
4. Add this repository as a remote.
|
||||
|
||||
$ cd Cataclysm-DDA
|
||||
# Changes the active directory in the prompt to the newly cloned "Cataclysm-DDA" directory
|
||||
$ git remote add -f upstream https://github.com/CleverRaven/Cataclysm-DDA.git
|
||||
# Assigns the original repository to a remote called "upstream"
|
||||
|
||||
For further details about commit message guidelines please visit:
|
||||
- [codeinthehole.com](https://codeinthehole.com/tips/a-useful-template-for-commit-messages/)
|
||||
- [chris.beams.io](https://chris.beams.io/posts/git-commit/)
|
||||
- [help.github.com](https://help.github.com/articles/closing-issues-using-keywords/)
|
||||
|
||||
#### Update your `master` branch
|
||||
|
||||
1. Make sure you have your `master` branch checked out.
|
||||
|
||||
$ git checkout master
|
||||
|
||||
2. Pull the changes from the `upstream/master` branch.
|
||||
|
||||
$ git pull --ff-only upstream master
|
||||
# gets changes from "master" branch on the "upstream" remote
|
||||
|
||||
* Note: If this gives you an error, it means you have committed directly to your local `master` branch. [Click here for instructions on how to fix this issue](#why-does-git-pull---ff-only-result-in-an-error).
|
||||
|
||||
#### Make your changes
|
||||
|
||||
0. Update your `master` branch, if you haven't already.
|
||||
|
||||
1. For each new feature or bug fix, create a new branch.
|
||||
|
||||
$ git branch new_feature
|
||||
# Creates a new branch called "new_feature"
|
||||
$ git checkout new_feature
|
||||
# Makes "new_feature" the active branch
|
||||
|
||||
2. Once you've committed some changes locally, you need to push them to your fork here on GitHub.
|
||||
|
||||
$ git push origin new_feature
|
||||
# origin was automatically set to point to your fork when you cloned it
|
||||
|
||||
|
||||
3. Once you're finished working on your branch, and have committed and pushed all your changes, submit a pull request from your `new_feature` branch to this repository's `master` branch.
|
||||
|
||||
* Note: any new commits to the `new_feature` branch on GitHub will automatically be included in the pull request, so make sure to only commit related changes to the same branch.
|
||||
|
||||
## Pull Request Notes
|
||||
If you file a PR but you're still working on it, please add a [WIP] before the title text. This will tell the reviewers that you still intend to add more to the PR and we don't need to review it yet. When it's ready to be reviewed by a merger just edit the title text to remove the [WIP].
|
||||
|
||||
If you are also looking for suggestions then mark it with [CR] — "comments requested". You can use both [WIP] and [CR] to indicated that you need opinion/code review/suggestions to continue working (e.g. "[WIP] [CR] Super awesome big feature"). Feel free to remove [CR] when you feel you got enough information to proceed.
|
||||
|
||||
This can help speed up our review process by allowing us to only review the things that are ready for it, and will prevent anything that isn't completely ready from being merged in.
|
||||
|
||||
### All PRs should have a "Summary" line
|
||||
Summary is a one-line description of your change that will be extracted and added to the project changelog at https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/changelog.txt
|
||||
|
||||
The format is: ```SUMMARY: Category "description"```
|
||||
|
||||
The categories to choose from are: Features, Content, Interface, Mods, Balance, Bugfixes, Performance, Infrastructure, Build, I18N.
|
||||
|
||||
Example: ```SUMMARY: Content "Adds new mutation category 'Mouse'"```
|
||||
Or, if you want it treated as a minor tweak that doesn't appear in the changelog:
|
||||
```SUMMARY: None```
|
||||
|
||||
See the Changelog Guidelines at https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/CHANGELOG_GUIDELINES.md for explanations of the categories.
|
||||
|
||||
### Closing issues using keywords
|
||||
|
||||
One more thing: when marking your PR as closing, fixing, or resolving issues, please include "XXXX #???" somewhere in the description, where XXX is on this list:
|
||||
* close
|
||||
* closes
|
||||
* closed
|
||||
* fix
|
||||
* fixes
|
||||
* fixed
|
||||
* resolve
|
||||
* resolves
|
||||
* resolved
|
||||
|
||||
The "???" is the issue number. This automatically closes the issue when the PR is pulled in, and allows merges to work slightly faster. To close multiple issues format it as "XXXX #???, XXXX#???".
|
||||
|
||||
See https://help.github.com/articles/closing-issues-using-keywords/ for more.
|
||||
|
||||
## Tooling support
|
||||
|
||||
Various tools are available to help you keep your contributions conforming to the appropriate style. See [the relevant docs](../doc/DEVELOPER_TOOLING.md) for more details.
|
||||
|
||||
## Advanced Techniques
|
||||
|
||||
These guidelines aren't essential, but they can make keeping things in order much easier.
|
||||
|
||||
#### Using remote tracking branches
|
||||
|
||||
Remote tracking branches allow you to easily stay in touch with this repository's `master` branch, as they automatically know which remote branch to get changes from.
|
||||
|
||||
$ git branch -vv
|
||||
* master xxxx [origin/master] ....
|
||||
new_feature xxxx ....
|
||||
|
||||
Here you can see we have two branches; `master` which is tracking `origin/master`, and `new_feature` which isn't tracking any branch. In practice, what this means is that git won't know where to get changes from.
|
||||
|
||||
$ git checkout new_feature
|
||||
Switched to branch 'new_feature'
|
||||
$ git pull
|
||||
There is no tracking information for the current branch.
|
||||
Please specify which branch you want to merge with.
|
||||
|
||||
In order to easily pull changes from `upstream/master` into the `new_feature` branch, we can tell git which branch it should track. (You can even do this for your local master branch.)
|
||||
|
||||
$ git branch -u upstream/master new_feature
|
||||
Branch new_feature set up to track remote branch master from upstream.
|
||||
$ git pull
|
||||
Updating xxxx..xxxx
|
||||
....
|
||||
|
||||
You can also set the tracking information at the same time as creating the branch.
|
||||
|
||||
$ git branch new_feature_2 --track upstream/master
|
||||
Branch new_feature_2 set up to track remote branch master from upstream.
|
||||
|
||||
* Note: Although this makes it easier to pull from `upstream/master`, it doesn't change anything with regards to pushing. `git push` fails because you don't have permission to push to `upstream/master`.
|
||||
|
||||
$ git push
|
||||
error: The requested URL returned error: 403 while accessing https://github.com/CleverRaven/Cataclysm-DDA.git
|
||||
fatal: HTTP request failed
|
||||
$ git push origin
|
||||
....
|
||||
To https://github.com/YOUR_USERNAME/Cataclysm-DDA.git
|
||||
xxxx..xxxx new_feature -> new_feature
|
||||
|
||||
## Unit tests
|
||||
|
||||
There is a suite of tests built into the source tree at tests/
|
||||
You should run the test suite after ANY change to the game source.
|
||||
An ordinary invocation of ``make`` will build the test executable at tests/cata_test, and it can be invoked like any ordinary executable.
|
||||
With no arguments it will run the entire test suite.
|
||||
With ``--help`` it will print a number of invocation options you can use to adjust its operation.
|
||||
|
||||
$ make
|
||||
... compilation details ...
|
||||
$ tests/cata_test
|
||||
Starting the actual test at Fri Nov 9 04:37:03 2018
|
||||
===============================================================================
|
||||
All tests passed (1324684 assertions in 94 test cases)
|
||||
Ended test at Fri Nov 9 04:37:45 2018
|
||||
The test took 41.772 seconds
|
||||
|
||||
I recommend habitually invoking make like ``make YOUR BUILD OPTIONS && tests/cata_test``.
|
||||
|
||||
## In-game testing, test environment and the debug menu
|
||||
|
||||
Whether you are implementing a new feature or whether you are fixing a bug, it is always a good practice to test your changes in-game. It can be a hard task to create the exact conditions by playing a normal game to be able to test your changes, which is why there is a debug menu. There is no default key to bring up the menu so you will need to assign one first.
|
||||
|
||||
Bring up the keybindings menu (press `Escape` then `1`), scroll down almost to the bottom and press `+` to add a new key binding. Press the letter that corresponds to the *Debug menu* item, then press the key you want to use to bring up the debug menu. To test your changes, create a new world with a new character. Once you are in that world, press the key you just assigned for the debug menu and you should see something like this:
|
||||
|
||||
```
|
||||
┌────────────────────────────────────────────┐
|
||||
│ Debug Functions - Using these is CHEATING! │
|
||||
├────────────────────────────────────────────┤
|
||||
│ 1 Wish for an item │
|
||||
│ 2 Teleport - Short Range │
|
||||
│ 3 Teleport - Long Range │
|
||||
│ 4 Reveal map │
|
||||
│ 5 Spawn NPC │
|
||||
│ 6 Spawn Monster │
|
||||
│ 7 Check game state... │
|
||||
│ 8 Kill NPCs │
|
||||
│ 9 Mutate │
|
||||
│ 0 Spawn a vehicle │
|
||||
│ a Change all skills │
|
||||
│ b Learn all melee styles │
|
||||
│ c Unlock all recipes │
|
||||
│ d Edit player/NPC │
|
||||
│ e Spawn Artifact │
|
||||
│ f Spawn Clairvoyance Artifact │
|
||||
│ g Map editor │
|
||||
│ h Change weather │
|
||||
│ i Remove all monsters │
|
||||
│ j Display hordes │
|
||||
│ k Test Item Group │
|
||||
│ l Damage Self │
|
||||
│ m Show Sound Clustering │
|
||||
│ n Lua Command │
|
||||
│ o Display weather │
|
||||
│ p Change time │
|
||||
│ q Set automove route │
|
||||
│ r Show mutation category levels │
|
||||
│ s Cancel │
|
||||
└────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
With these commands, you should be able to recreate the proper conditions to test your changes. You can find some more information about the debug menu on [the official wiki](http://cddawiki.chezzo.com/cdda_wiki/index.php).
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
#### Why does `git pull --ff-only` result in an error?
|
||||
|
||||
If `git pull --ff-only` shows an error, it means that you've committed directly to your local `master` branch. To fix this, we create a new branch with these commits, find the point at which we diverged from `upstream/master`, and then reset `master` to that point.
|
||||
|
||||
$ git pull --ff-only upstream master
|
||||
From https://github.com/CleverRaven/Cataclysm-DDA
|
||||
* branch master -> FETCH_HEAD
|
||||
fatal: Not possible to fast-forward, aborting.
|
||||
$ git branch new_branch master # mark the current commit with a tmp branch
|
||||
$ git merge-base master upstream/master
|
||||
cc31d0... # the last commit before we committed directly to master
|
||||
$ git reset --hard cc31d0....
|
||||
HEAD is now at cc31d0... ...
|
||||
|
||||
Now that `master` has been cleaned up, we can easily pull from `upstream/master`, and then continue working on `new_branch`.
|
||||
|
||||
$ git pull --ff-only upstream master
|
||||
# gets changes from the "upstream" remote for the matching branch, in this case "master"
|
||||
$ git checkout new_branch
|
||||
@@ -1,13 +0,0 @@
|
||||
Game version:
|
||||
|
||||
Operating system:
|
||||
|
||||
Tiles or curses:
|
||||
|
||||
Mods active:
|
||||
|
||||
### Expected behavior
|
||||
|
||||
### Actual behavior
|
||||
|
||||
### Steps to reproduce the behavior
|
||||
@@ -1,31 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Make a player with a gun, magazine, and some ammo.
|
||||
2. Try to aim at a wall.
|
||||
3. There's no way to increase aim level.
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
Ideally also describe *why* you expect it to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Versions and configuration(please complete the following information):**
|
||||
- OS: [e.g. iOS 8 or Windows 10 or Ubuntu 18.04]
|
||||
- Game Version: [from the main menu, e.g. 0.C-29938-g90f5268437]
|
||||
- Graphics version: [Tiles or Terminal]
|
||||
- Mods loaded: [e.g.dda, boats, hacktheplanet, StatsThroughSkills]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
E.g. A link to a savegame that allows the issue to be reproduced.
|
||||
@@ -1,17 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context (such as mock-ups, proof of concepts or screenshots) about the feature request here.
|
||||
@@ -1,38 +0,0 @@
|
||||
<!--
|
||||
### How to use
|
||||
Leave the headings unless they don't apply to your PR, replace commented out text ( surrounded with <!-- and --> ) with text describing your PR.
|
||||
-->
|
||||
|
||||
#### Summary
|
||||
<!--
|
||||
A one-line description of your change that will be extracted and added to the project changelog at https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/changelog.txt
|
||||
The format is: ```SUMMARY: Category "description"```
|
||||
The categories to choose from are: Features, Content, Interface, Mods, Balance, Bugfixes, Performance, Infrastructure, Build, I18N
|
||||
Example: ```SUMMARY: Content "Adds new mutation category 'Mouse'"```
|
||||
See the Changelog Guidelines at https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/CHANGELOG_GUIDELINES.md for explanations of the categories.
|
||||
-->
|
||||
|
||||
#### Purpose of change
|
||||
<!--
|
||||
If there's an existing issue describing the problem this PR addresses or the feature it adds, please link it like: ```#1234```
|
||||
If it *fully* resolves an issue, link it like: ```Fixes #1234```
|
||||
Even if the issue describes the problem, please provide a few-sentence summary here.
|
||||
Example: ```Fixes #1234 - XL mutants cannot wear arm/leg splints due to missing OVERSIZE flag.```
|
||||
If there is no related issue, please describe the issue you are addressing, including how to trigger a bug if this is a bugfix.
|
||||
-->
|
||||
|
||||
#### Describe the solution
|
||||
<!--
|
||||
How does the feature work, or how does this fix a bug?
|
||||
The easier you make your solution to understand, the faster it can get merged.
|
||||
-->
|
||||
|
||||
#### Describe alternatives you've considered
|
||||
<!--
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
-->
|
||||
|
||||
#### Additional context
|
||||
<!--
|
||||
Add any other context (such as mock-ups, proof of concepts or screenshots) about the feature or bugfix here.
|
||||
-->
|
||||
@@ -7,24 +7,25 @@
|
||||
*.o
|
||||
*.tmp
|
||||
*.zip
|
||||
*.apk
|
||||
/WinDepend/
|
||||
/bindist/
|
||||
/build/
|
||||
/build-start-time
|
||||
/cmake-build-debug/
|
||||
/config/
|
||||
/data/*.template
|
||||
/data/font/
|
||||
/data/mods/user-default-mods.json
|
||||
/dep/
|
||||
/doxygen_doc/html/*
|
||||
/doxygen_doc/latex/*
|
||||
/font/
|
||||
/graveyard/
|
||||
/memorial/
|
||||
/mods/
|
||||
/obj/
|
||||
/objwin/
|
||||
/save/
|
||||
/src/lua/catabindings.cpp
|
||||
/src/version.h
|
||||
/sound/
|
||||
/templates/
|
||||
@@ -41,12 +42,15 @@ cataclysmdda-*
|
||||
chkjson*
|
||||
debug.log
|
||||
logg.txt
|
||||
json_formatter
|
||||
|
||||
# Visual Studio files
|
||||
*.code-workspace
|
||||
*.exp
|
||||
*.ilk
|
||||
*.opensdf
|
||||
*.pdb
|
||||
*.lib
|
||||
*.sdf
|
||||
*.suo
|
||||
*.user
|
||||
@@ -68,6 +72,10 @@ Cataclysm.exe.lastcodeanalysissucceeded
|
||||
#Visual Studio 2017
|
||||
/msvc-full-features/PredictedInputCache_Debug_x64.dat
|
||||
|
||||
#vcpkg
|
||||
/msvc-full-features/vcpkg_installed
|
||||
/msvc-object_creator/vcpkg_installed
|
||||
|
||||
# PVS Studio
|
||||
/msvc-full-features/*PVS-Studio*
|
||||
|
||||
@@ -86,6 +94,10 @@ Thumbs.db
|
||||
cscope.*
|
||||
tags
|
||||
|
||||
# Generated translation source
|
||||
/lang/po/cataclysm-dda.pot
|
||||
/lang/po/en.po
|
||||
|
||||
# Compiled binary translations
|
||||
/lang/mo/
|
||||
|
||||
@@ -103,6 +115,7 @@ nbproject/
|
||||
*.vim
|
||||
*.session
|
||||
.ycm_extra_conf.py
|
||||
.vimrc
|
||||
|
||||
# taskwarrior files
|
||||
*.task*
|
||||
@@ -115,18 +128,27 @@ nbproject/
|
||||
|
||||
# OSX
|
||||
Cataclysm.app
|
||||
data/osx/AppIcon.icns
|
||||
build-data/osx/AppIcon.icns
|
||||
Cataclysm.dmg
|
||||
|
||||
# Jetbrains CLion
|
||||
.idea/
|
||||
|
||||
# test executables and generated data
|
||||
/tests/obj
|
||||
/tests/cata_test
|
||||
/tests/line_test
|
||||
/tests/map_iterator_test
|
||||
/tests/shadowcasting_test
|
||||
/tests/data/jsionized_overmap.sav
|
||||
/test_user_dir
|
||||
monfactions.txt
|
||||
|
||||
# temporary files generated by tools/reduce_tests.sh
|
||||
/list_of_tests
|
||||
/list_of_tests.ok
|
||||
/log
|
||||
/multidelta.log
|
||||
|
||||
# static library used to link the test executable
|
||||
cataclysm.a
|
||||
@@ -143,6 +165,7 @@ cataclysm.a
|
||||
|
||||
# clang tooling
|
||||
compile_commands.json
|
||||
.clangd
|
||||
|
||||
# IDA database
|
||||
Cataclysm.i64
|
||||
@@ -150,9 +173,6 @@ Cataclysm.id*
|
||||
Cataclysm.til
|
||||
Cataclysm.nam
|
||||
|
||||
# Transifex Client
|
||||
.tx/
|
||||
|
||||
# Snapcraft build directories
|
||||
prime
|
||||
snap
|
||||
@@ -170,3 +190,27 @@ Xcode/
|
||||
|
||||
# gdb
|
||||
.gdb_history
|
||||
|
||||
# Flatpak build artifacts
|
||||
/.flatpak-builder/
|
||||
/repo/
|
||||
/build-dir/
|
||||
|
||||
# precompiled headers
|
||||
/pch/pch.hpp.pch
|
||||
/pch/main-pch.hpp.gch
|
||||
/pch/main-pch.hpp.pch
|
||||
/tests/pch/pch.hpp.pch
|
||||
/tests/pch/tests-pch.hpp.gch
|
||||
/tests/pch/tests-pch.hpp.pch
|
||||
/tests/catch/catch.hpp.gch
|
||||
/tests/catch/catch.hpp.pch
|
||||
weather.output
|
||||
|
||||
# bundler local directories and files for jekyll site
|
||||
/.bundle/
|
||||
/_site/
|
||||
/vendor/
|
||||
.sass-cache
|
||||
.jekyll-metadata
|
||||
Gemfile.lock
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# If this commit is applied, it will ....
|
||||
# |<-- Using around 50, Maximum 72 Characters -->|
|
||||
|
||||
# Explain why this change is being made
|
||||
# |<---- Limit Each Line to a Maximum Of 72 Characters ---->|
|
||||
|
||||
# Provide links or keys to any relevant tickets, articles or other resources
|
||||
# Example: fixes #1234, closes #2345, resolves #3456, references #4567
|
||||
@@ -1,182 +0,0 @@
|
||||
# this file is HEAVILY influenced by https://github.com/boostorg/hana/blob/master/.travis.yml
|
||||
|
||||
dist: xenial
|
||||
language: c++
|
||||
|
||||
cache: ccache
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
irc: "irc.freenode.org#Cataclysm-DDA"
|
||||
use_notice: true
|
||||
skip_join: true
|
||||
|
||||
git:
|
||||
depth: 5
|
||||
|
||||
addons:
|
||||
# these apt sources will be referenced later (by using *name)
|
||||
apt:
|
||||
sources: &apt_sources
|
||||
- ubuntu-toolchain-r-test
|
||||
config:
|
||||
retries: true
|
||||
|
||||
compiler: gcc
|
||||
os: linux
|
||||
|
||||
# We have branch builds disabled globally to prevent double-builds of PRs.
|
||||
# This re-enables just the master branch.
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- development
|
||||
|
||||
jobs:
|
||||
include:
|
||||
# Initial test stage, if this fails everything else is cancelled.
|
||||
- stage: test
|
||||
# GCC 5 is the pre-installed compiler on Xenial
|
||||
env: COMPILER=g++ MODS=--mods=RL_Classes
|
||||
|
||||
# Then build different configurations and targets in parallel.
|
||||
- stage: variants
|
||||
# Linux Tiles
|
||||
env: COMPILER=g++-8 CXXFLAGS='-Wno-implicit-fallthrough' TILES=1 SOUND=1 SANITIZE=address
|
||||
compiler: gcc
|
||||
addons: &gcc8
|
||||
apt:
|
||||
packages: ["g++-8", "g++-8-multilib", "libc6-dbg", "libc6-dbg:i386", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev"]
|
||||
sources: *apt_sources
|
||||
|
||||
# MXE variants using alternate repository http://mirror.mxe.cc/repos/apt
|
||||
# GCC MinGW
|
||||
- env: COMPILER='g++' LDFLAGS='-static-libgcc -static-libstdc++' MXE_TARGET='i686-w64-mingw32.static' WINE='wine'
|
||||
addons: &gcc
|
||||
apt:
|
||||
packages: ["wine"]
|
||||
|
||||
# Windows Tiles
|
||||
- env: COMPILER='g++' LDFLAGS='-static-libgcc -static-libstdc++' MXE_TARGET='i686-w64-mingw32.static' WINE='wine' TILES=1 SOUND=1
|
||||
compiler: gcc
|
||||
addons: &gcc
|
||||
apt:
|
||||
packages: ["wine"]
|
||||
|
||||
# CMake Clang 6.0 Tiles
|
||||
- env: CLANG=clang++-6.0 TILES=1 SOUND=1 CXXFLAGS=-Wno-error=unused-command-line-argument CMAKE=1
|
||||
dist: trusty
|
||||
compiler: clang
|
||||
addons: &clang60
|
||||
apt:
|
||||
packages: ["clang-6.0", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev"]
|
||||
sources: [*apt_sources, llvm-toolchain-trusty-6.0]
|
||||
|
||||
# macOS Tiles
|
||||
- env: CLANG=clang++ NATIVE=osx OSX_MIN=10.13 TILES=1 SOUND=1 LUA=1
|
||||
os: osx
|
||||
osx_image: xcode10.1
|
||||
compiler: clang
|
||||
|
||||
# Finally check the compiler variants
|
||||
- stage: compilers
|
||||
env: COMPILER=g++-4.8
|
||||
compiler: gcc
|
||||
addons: &gcc48
|
||||
apt:
|
||||
packages: ["g++-4.8", "g++-4.8-multilib", "libc6-dbg", "libc6-dbg:i386"]
|
||||
sources: *apt_sources
|
||||
|
||||
# GCC 4.9
|
||||
- env: COMPILER=g++-4.9
|
||||
if: type != pull_request
|
||||
compiler: gcc
|
||||
addons: &gcc49
|
||||
apt:
|
||||
packages: ["g++-4.9", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"]
|
||||
sources: *apt_sources
|
||||
|
||||
# GCC 6
|
||||
- env: COMPILER=g++-6
|
||||
if: type != pull_request
|
||||
compiler: gcc
|
||||
addons: &gcc6
|
||||
apt:
|
||||
packages: ["g++-6", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"]
|
||||
sources: *apt_sources
|
||||
|
||||
# GCC 7
|
||||
- env: COMPILER=g++-7 CXXFLAGS='-Wno-implicit-fallthrough' CODE_COVERAGE=true
|
||||
if: type != pull_request
|
||||
compiler: gcc
|
||||
dist: trusty
|
||||
addons: &gcc7
|
||||
apt:
|
||||
packages: ["g++-7", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386", "lcov"]
|
||||
sources: *apt_sources
|
||||
|
||||
# GCC 8
|
||||
- env: COMPILER=g++-8 CXXFLAGS='-Wno-implicit-fallthrough'
|
||||
compiler: gcc
|
||||
addons: &gcc8
|
||||
apt:
|
||||
packages: ["g++-8", "g++-8-multilib", "libc6-dbg", "libc6-dbg:i386"]
|
||||
sources: *apt_sources
|
||||
|
||||
# Clang 3.8
|
||||
- env: CLANG=clang++-3.8 CXXFLAGS='-Wno-error=unused-command-line-argument -D__extern_always_inline="extern __always_inline"'
|
||||
compiler: clang
|
||||
addons: &clang38
|
||||
apt:
|
||||
packages: ["clang-3.8", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
|
||||
sources: *apt_sources
|
||||
|
||||
# Clang 3.9
|
||||
- env: CLANG=clang++-3.9 CXXFLAGS='-Wno-error=unused-command-line-argument -D__extern_always_inline="extern __always_inline"'
|
||||
if: type != pull_request
|
||||
compiler: clang
|
||||
addons: &clang39
|
||||
apt:
|
||||
packages: ["clang-3.9", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
|
||||
sources: *apt_sources
|
||||
|
||||
# Clang 4.0
|
||||
- env: CLANG=clang++-4.0 CXXFLAGS=-Wno-error=unused-command-line-argument
|
||||
if: type != pull_request
|
||||
compiler: clang
|
||||
addons: &clang40
|
||||
apt:
|
||||
packages: ["clang-4.0", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
|
||||
sources: [*apt_sources, llvm-toolchain-trusty-4.0]
|
||||
|
||||
# Clang 5.0
|
||||
- env: CLANG=clang++-5.0 CXXFLAGS=-Wno-error=unused-command-line-argument
|
||||
if: type != pull_request
|
||||
dist: trusty
|
||||
compiler: clang
|
||||
addons: &clang50
|
||||
apt:
|
||||
packages: ["clang-5.0", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
|
||||
sources: [*apt_sources, llvm-toolchain-trusty-5.0]
|
||||
|
||||
# Clang 6.0
|
||||
- env: CLANG=clang++-6.0 CXXFLAGS=-Wno-error=unused-command-line-argument SANITIZE=address EXTRA_TEST_OPTS="~[.] ~vehicle_efficiency ~vehicle_drag ~starting_items"
|
||||
dist: trusty
|
||||
compiler: clang
|
||||
addons: &clang60
|
||||
apt:
|
||||
packages: ["clang-6.0", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
|
||||
sources: [*apt_sources, llvm-toolchain-trusty-6.0]
|
||||
|
||||
before_script:
|
||||
- if [ -n "${CLANG}" ]; then COMPILER="$CLANG"; fi
|
||||
- ${COMPILER} --version
|
||||
- CXX="$COMPILER"
|
||||
- source build-scripts/requirements.sh
|
||||
|
||||
script:
|
||||
- build-scripts/build.sh
|
||||
|
||||
after_success:
|
||||
- if [ -n "${CODE_COVERAGE}" ]; then coveralls -b . -i src -e tests --gcov /usr/bin/gcov-4.8; fi
|
||||
- if [ -n "${CODE_COVERAGE}" ]; then bash <(curl -s https://codecov.io/bash); fi
|
||||
@@ -0,0 +1 @@
|
||||
1e7d902c-02b7-4619-bf01-fe4b9c0ba8ca
|
||||
@@ -1,379 +0,0 @@
|
||||
# Main project build script
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
|
||||
PROJECT(CataclysmDDA)
|
||||
|
||||
SET(CMAKE_MODULE_PATH
|
||||
${CMAKE_MODULE_PATH}
|
||||
${CMAKE_SOURCE_DIR}/CMakeModules
|
||||
)
|
||||
|
||||
# Build options
|
||||
option(LUA "Lua support (required for some mods)." "OFF")
|
||||
option(TILES "Build graphical tileset version." "OFF")
|
||||
option(CURSES "Build curses version." "ON" )
|
||||
option(SOUND "Support for in-game sounds & music." "OFF")
|
||||
option(BACKTRACE "Support for printing stack backtraces on crash" "ON" )
|
||||
option(USE_HOME_DIR "Use user's home directory for save files." "ON" )
|
||||
option(LOCALIZE "Support for language localizations. Also enable UTF support." "ON" )
|
||||
option(LANGUAGES "Compile localization files for specified languages." "" )
|
||||
option(DYNAMIC_LINKING "Use dynamic linking. Or use static to remove MinGW dependency instead." "ON")
|
||||
option(LUA_BINARY "Lua binary name or path. You can try to use luajit for extra speed." "")
|
||||
option(GIT_BINARY "Git binary name or path." "")
|
||||
OPTION(PREFIX "Location of Data,GFX, & Lua directories" "")
|
||||
|
||||
include(CTest)
|
||||
|
||||
include(GetGitRevisionDescription)
|
||||
git_describe(GIT_VERSION)
|
||||
|
||||
MESSAGE("\n * Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world.")
|
||||
MESSAGE(" _________ __ .__ ")
|
||||
MESSAGE(" \\_ ___ \\ _____ _/ |_ _____ ____ | | ___.__ ______ _____ ")
|
||||
MESSAGE(" / \\ \\/ \\__ \\ \\ __\\\\__ \\ _/ ___\\ | | < | | / ___/ / \\ ")
|
||||
MESSAGE(" \\ \\____ / __ \\_ | | / __ \\_\\ \\___ | |__ \\___ | \\___ \\ | Y Y \\ ")
|
||||
MESSAGE(" \\______ /\(____ / |__| \(____ / \\___ >|____/ / ____|/____ >|__|_| / ")
|
||||
MESSAGE(" \\/ \\/ \\/ \\/ \\/ \\/ \\/ ")
|
||||
MESSAGE(" --= Dark Days Ahead =--")
|
||||
MESSAGE("\n * http://en.cataclysmdda.com/\n")
|
||||
|
||||
MESSAGE(STATUS "${PROJECT} build environment -- \n")
|
||||
|
||||
MESSAGE(STATUS "Build realm is : ${CMAKE_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Debug)
|
||||
ENDIF(NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
if (NOT ${GIT_VERSION} MATCHES GIT-NOTFOUND)
|
||||
string(REPLACE "-NOTFOUND" "" GIT_VERSION ${GIT_VERSION})
|
||||
FILE(WRITE ${CMAKE_SOURCE_DIR}/src/version.h "\#define VERSION \"${GIT_VERSION}\"\n")
|
||||
MESSAGE(STATUS "${PROJECT_NAME} build version is : ${GIT_VERSION}\n")
|
||||
ADD_DEFINITIONS(-DGIT_VERSION)
|
||||
ELSE (NOT ${GIT_VERSION} MATCHES GIT-NOTFOUND)
|
||||
MESSAGE("")
|
||||
ENDIF(NOT ${GIT_VERSION} MATCHES GIT-NOTFOUND)
|
||||
|
||||
#OS Check Placeholders. Will be used for BINDIST
|
||||
IF (${CMAKE_SYSTEM_NAME} MATCHES Linux)
|
||||
SET(_OS_LINUX_ 1)
|
||||
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES Linux)
|
||||
|
||||
IF (${CMAKE_SYSTEM_NAME} MATCHES FreeBSD)
|
||||
SET(_OS_FREEBSD_ 1)
|
||||
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES FreeBSD)
|
||||
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES Darwin)
|
||||
SET(_OS_DARWIN_ 1)
|
||||
SET(LOCALIZE OFF)
|
||||
MESSAGE(STATUS "Disable internationalization on Darwin as it is not supported")
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES Darwin)
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
#FIXME: Add dest build choice: m32 for 32 bit or m64 for 64 bit version
|
||||
#add_definitions("-m32")
|
||||
#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
|
||||
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
|
||||
#SET(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -m32")
|
||||
#SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -m32")
|
||||
|
||||
IF (NOT DYNAMIC_LINKING)
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.dll.a")
|
||||
SET(BUILD_SHARED_LIBRARIES OFF)
|
||||
check_cxx_compiler_flag (-static HAVE_STATIC_FLAG)
|
||||
IF(HAVE_STATIC_FLAG)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
||||
ENDIF(HAVE_STATIC_FLAG)
|
||||
# Workaround for cmake link library guesser
|
||||
SET(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS) # remove -Wl,-Bdynamic
|
||||
SET(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
|
||||
SET(CMAKE_SHARED_LIBRARY_C_FLAGS) # remove -fPIC
|
||||
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS)
|
||||
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # remove -rdynamic
|
||||
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
|
||||
ELSE (NOT DYNAMIC_LINKING)
|
||||
IF(MINGW AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# Avoid depending on MinGW runtime DLLs
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
|
||||
ENDIF(MINGW AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
ENDIF (NOT DYNAMIC_LINKING)
|
||||
|
||||
#Sysem specific actions
|
||||
IF (${CMAKE_SYSTEM_NAME} MATCHES Linux OR ${CMAKE_SYSTEM_NAME} MATCHES FreeBSD)
|
||||
IF(NOT DATA_PREFIX)
|
||||
SET( DATA_PREFIX ${CMAKE_INSTALL_PREFIX}/share/cataclysm-dda)
|
||||
ENDIF(NOT DATA_PREFIX)
|
||||
IF(NOT LOCALE_DIR)
|
||||
SET( LOCALE_DIR ${CMAKE_INSTALL_PREFIX}/share/locale)
|
||||
ENDIF(NOT LOCALE_DIR)
|
||||
IF(NOT BIN_PREFIX)
|
||||
SET( BIN_PREFIX ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
ENDIF(NOT BIN_PREFIX)
|
||||
IF(NOT DESKTOP_ENTRY_PATH)
|
||||
SET( DESKTOP_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/applications)
|
||||
ENDIF(NOT DESKTOP_ENTRY_PATH)
|
||||
IF(NOT PIXMAPS_ENTRY_PATH)
|
||||
SET( PIXMAPS_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor)
|
||||
ENDIF(NOT PIXMAPS_ENTRY_PATH)
|
||||
IF(NOT PIXMAPS_UNITY_ENTRY_PATH)
|
||||
SET( PIXMAPS_UNITY_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/icons/ubuntu-mono-dark)
|
||||
ENDIF(NOT PIXMAPS_UNITY_ENTRY_PATH)
|
||||
IF(NOT MANPAGE_ENTRY_PATH)
|
||||
SET( MANPAGE_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/man)
|
||||
ENDIF(NOT MANPAGE_ENTRY_PATH)
|
||||
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES Linux OR ${CMAKE_SYSTEM_NAME} MATCHES FreeBSD)
|
||||
|
||||
IF (${CMAKE_SYSTEM_NAME} MATCHES Windows)
|
||||
IF(NOT DATA_PREFIX)
|
||||
SET(DATA_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
ENDIF(NOT DATA_PREFIX)
|
||||
IF(NOT LOCALE_DIR)
|
||||
SET(LOCALE_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
ENDIF(NOT LOCALE_DIR)
|
||||
IF(NOT BIN_PREFIX)
|
||||
SET(BIN_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
ENDIF(NOT BIN_PREFIX)
|
||||
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES Windows)
|
||||
|
||||
|
||||
MESSAGE(STATUS "${PROJECT_NAME} build options --\n")
|
||||
|
||||
# Preset variables
|
||||
IF (NOT LUA_BINARY)
|
||||
SET (LUA_BINARY "lua")
|
||||
ENDIF (NOT LUA_BINARY)
|
||||
|
||||
IF(NOT LANGUAGES)
|
||||
SET (LANGUAGES de es_AR es_ES fr it_IT ja ko pt_BR ru zh_CN zh_TW)
|
||||
ENDIF(NOT LANGUAGES)
|
||||
|
||||
IF (GIT_BINARY)
|
||||
SET(GIT_EXECUTABLE ${GIT_BINARY})
|
||||
ELSE (GIT_BINARY)
|
||||
FIND_PACKAGE(Git)
|
||||
IF (NOT GIT_FOUND)
|
||||
MESSAGE(WARNING "Git binary not found. Build version will be set to NULL. Install Git package or use -DGIT_BINARY to set path to git binary.")
|
||||
ENDIF (NOT GIT_FOUND)
|
||||
ENDIF (GIT_BINARY)
|
||||
|
||||
IF (PREFIX)
|
||||
ADD_DEFINITIONS(-DPREFIX=${PREFIX})
|
||||
ENDIF (PREFIX)
|
||||
|
||||
# Can't compile curses and tiles build's at same time
|
||||
IF(TILES)
|
||||
SET(CURSES OFF)
|
||||
ENDIF(TILES)
|
||||
|
||||
# Set build types and display info
|
||||
IF(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
MESSAGE("\n")
|
||||
MESSAGE(STATUS "Build ${PROJECT} in development mode --\n")
|
||||
MESSAGE(STATUS "Binaries will be located in: " ${CMAKE_SOURCE_DIR})
|
||||
SET(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
# Since CataclusmDDA does not respect PREFIX for development builds
|
||||
# and has funny path handlers, we should create resulting Binaries
|
||||
# in the source redectory
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY
|
||||
${CMAKE_SOURCE_DIR}
|
||||
CACHE PATH "Single Directory for all Executables."
|
||||
)
|
||||
SET(BIN_PREFIX ${CMAKE_SOURCE_DIR})
|
||||
ELSE (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
MESSAGE(STATUS "CMAKE_INSTALL_PREFIX : ${CMAKE_INSTALL_PREFIX}")
|
||||
MESSAGE(STATUS "BIN_PREFIX : ${BIN_PREFIX}")
|
||||
MESSAGE(STATUS "DATA_PREFIX : ${DATA_PREFIX}")
|
||||
IF(LOCALIZE)
|
||||
MESSAGE(STATUS "LOCALE_PATH : ${LOCALE_DIR}")
|
||||
ENDIF(LOCALIZE)
|
||||
MESSAGE(STATUS "DESKTOP_ENTRY_PATH : ${DESKTOP_ENTRY_PATH}")
|
||||
MESSAGE(STATUS "PIXMAPS_ENTRY_PATH : ${PIXMAPS_ENTRY_PATH}")
|
||||
MESSAGE(STATUS "PIXMAPS_UNITY_ENTRY_PATH : ${PIXMAPS_UNITY_ENTRY_PATH}")
|
||||
MESSAGE(STATUS "MANPAGE_ENTRY_PATH : ${MANPAGE_ENTRY_PATH}\n")
|
||||
ADD_DEFINITIONS(-DRELEASE)
|
||||
# Use PREFIX as storage of data,gfx,lua etc.. Usefull only on *nix OS.
|
||||
IF (PREFIX AND NOT WIN32)
|
||||
ADD_DEFINITIONS(-DDATA_DIR_PREFIX)
|
||||
ENDIF (PREFIX AND NOT WIN32)
|
||||
ENDIF (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
|
||||
MESSAGE(STATUS "LUA : ${LUA}")
|
||||
IF (LUA)
|
||||
MESSAGE(STATUS "LUA_BINARY : ${LUA_BINARY}")
|
||||
ENDIF (LUA)
|
||||
MESSAGE(STATUS "GIT_BINARY : ${GIT_EXECUTABLE}")
|
||||
MESSAGE(STATUS "DYNAMIC_LINKING : ${DYNAMIC_LINKING}")
|
||||
MESSAGE(STATUS "TILES : ${TILES}")
|
||||
MESSAGE(STATUS "CURSES : ${CURSES}")
|
||||
MESSAGE(STATUS "SOUND : ${SOUND}")
|
||||
MESSAGE(STATUS "BACKTRACE : ${BACKTRACE}")
|
||||
MESSAGE(STATUS "LOCALIZE : ${LOCALIZE}")
|
||||
MESSAGE(STATUS "USE_HOME_DIR : ${USE_HOME_DIR}\n")
|
||||
|
||||
MESSAGE(STATUS "LANGUAGES : ${LANGUAGES}\n")
|
||||
|
||||
MESSAGE(STATUS "See INSTALL file for details and more info --\n")
|
||||
|
||||
IF(MSVC)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
add_definitions(-D_AMD64_)
|
||||
else()
|
||||
add_definitions(-D_X86_)
|
||||
endif()
|
||||
ELSE()
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wall -std=c++11")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "-Og -g -D_GLIBCXX_DEBUG")
|
||||
ENDIF()
|
||||
|
||||
# Force out-of-source build
|
||||
IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
MESSAGE(FATAL_ERROR
|
||||
"This project requires an out of source build. Remove the file 'CMakeCache.txt' found in this directory before continuing, create a separate build directory and run 'cmake [options] <srcs>' from there.\nSee INSTALL file for details and more info\n"
|
||||
)
|
||||
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
|
||||
#SET(THREADS_USE_PTHREADS_WIN32 True)
|
||||
SET(CMAKE_THREAD_PREFER_PTHREAD True)
|
||||
FIND_PACKAGE(Threads REQUIRED)
|
||||
|
||||
# Check for build types and libraries
|
||||
IF(TILES)
|
||||
# Find SDL, SDL_ttf & SDL_image for graphical install
|
||||
MESSAGE(STATUS "Searching for SDL2 library --")
|
||||
FIND_PACKAGE(SDL2)
|
||||
IF(NOT SDL2_FOUND)
|
||||
MESSAGE(FATAL_ERROR
|
||||
"This project requires SDL2 to be installed to be compiled in graphical mode. Please install the SDL2 development libraries, or try compiling without the -DTILES=1 for a text only compilation.\nSee INSTALL file for details and more info\n"
|
||||
)
|
||||
ENDIF(NOT SDL2_FOUND)
|
||||
|
||||
IF (NOT DYNAMIC_LINKING)
|
||||
# SDL, SDL_Image, SDL_ttf deps are required for static build
|
||||
MESSAGE(STATUS "Searching for SDL deps libraries --")
|
||||
FIND_PACKAGE(Freetype REQUIRED)
|
||||
FIND_PACKAGE(PNG REQUIRED)
|
||||
FIND_PACKAGE(JPEG REQUIRED)
|
||||
FIND_PACKAGE(ZLIB REQUIRED)
|
||||
FIND_PACKAGE(BZip2 REQUIRED)
|
||||
ENDIF (NOT DYNAMIC_LINKING)
|
||||
|
||||
MESSAGE(STATUS "Searching for SDL2_image library --")
|
||||
|
||||
MESSAGE(STATUS "Searching for SDL2_TTF library --")
|
||||
FIND_PACKAGE(SDL2_ttf)
|
||||
IF(NOT SDL2_TTF_FOUND)
|
||||
MESSAGE(FATAL_ERROR
|
||||
"This project requires SDL2_ttf to be installed to be compiled in graphical mode. Please install the SDL2_ttf development libraries, or try compiling without the -DTILES=1 for a text only compilation.\nSee INSTALL file for details and moreinfo\n"
|
||||
)
|
||||
ENDIF(NOT SDL2_TTF_FOUND)
|
||||
|
||||
MESSAGE(STATUS "Searching for SDL2_image library --\n")
|
||||
FIND_PACKAGE(SDL2_image)
|
||||
IF(NOT SDL2_IMAGE_FOUND)
|
||||
MESSAGE(FATAL_ERROR
|
||||
"This project requires SDL2_image to be installed to be compiled in graphical mode. Please install the SDL2_image development libraries, or try compiling without the -DTILES=1 for a text only compilation.\nSee INSTALL file for details and more info\n"
|
||||
)
|
||||
ENDIF(NOT SDL2_IMAGE_FOUND)
|
||||
ADD_DEFINITIONS(-DTILES)
|
||||
ENDIF(TILES)
|
||||
|
||||
IF(CURSES)
|
||||
# Find the ncurses library for a text based compile
|
||||
MESSAGE(STATUS "Searching for Curses library --\n")
|
||||
SET(CURSES_NEED_NCURSES TRUE)
|
||||
SET(CURSES_NEED_WIDE TRUE)
|
||||
FIND_PACKAGE(Curses)
|
||||
IF(NOT CURSES_FOUND)
|
||||
MESSAGE(FATAL_ERROR
|
||||
"This project requires ncurses to be installed to be compiled in text only mode. Please install the ncurses development libraries, or try compiling with the -DTILES=1 for a graphical compilation.\nSee INSTALL file for details and more info\n"
|
||||
)
|
||||
ENDIF(NOT CURSES_FOUND)
|
||||
ENDIF(CURSES)
|
||||
|
||||
IF(SOUND)
|
||||
# You need TILES to be able to use SOUND
|
||||
IF(NOT TILES)
|
||||
MESSAGE(FATAL_ERROR
|
||||
"You must enable graphical support with -DTILES=1 to be able to enable sound support.\nSee INSTALL file for details and more info\n"
|
||||
)
|
||||
ENDIF(NOT TILES)
|
||||
|
||||
# Sound requires SDL_mixer library
|
||||
MESSAGE(STATUS "Searching for SDL2_mixer library --\n")
|
||||
FIND_PACKAGE(SDL2_mixer)
|
||||
IF(NOT SDL2_MIXER_FOUND)
|
||||
MESSAGE(FATAL_ERROR
|
||||
"You need the SDL2_mixer development library to be able to compile with sound enabled.\nSee INSTALL file for details and more info\n"
|
||||
)
|
||||
ENDIF(NOT SDL2_MIXER_FOUND)
|
||||
ENDIF(SOUND)
|
||||
|
||||
IF(LUA)
|
||||
FIND_PACKAGE(Lua)
|
||||
IF(NOT LUA_FOUND)
|
||||
MESSAGE(FATAL_ERROR
|
||||
"You need the Lua development library to be able to compile with Lua support.\nSee INSTALL file for details and more info\n"
|
||||
)
|
||||
ENDIF(NOT LUA_FOUND)
|
||||
ADD_DEFINITIONS(-DLUA)
|
||||
ENDIF(LUA)
|
||||
|
||||
IF(BACKTRACE)
|
||||
ADD_DEFINITIONS(-DBACKTRACE)
|
||||
ENDIF(BACKTRACE)
|
||||
|
||||
# Ok. Now create build and install recipes
|
||||
IF(LOCALIZE)
|
||||
IF(WIN32)
|
||||
FIND_PACKAGE(Libintl)
|
||||
IF(NOT LIBINTL_FOUND)
|
||||
MESSAGE(FATAL_ERROR
|
||||
"You need the libintl development library to be able to compile with Localize support.\nSee INSTALL file for details and more info\n"
|
||||
)
|
||||
ENDIF(NOT LIBINTL_FOUND)
|
||||
FIND_PACKAGE(Iconv)
|
||||
IF(NOT ICONV_FOUND)
|
||||
MESSAGE(FATAL_ERROR
|
||||
"You need the iconv development library to be able to compile with Localize support.\nSee INSTALL file for details and more info\n"
|
||||
)
|
||||
ENDIF(NOT ICONV_FOUND)
|
||||
ENDIF(WIN32)
|
||||
add_subdirectory(lang)
|
||||
ADD_DEFINITIONS(-DLOCALIZE)
|
||||
ENDIF(LOCALIZE)
|
||||
|
||||
IF(USE_HOME_DIR)
|
||||
ADD_DEFINITIONS(-DUSE_HOME_DIR)
|
||||
ENDIF(USE_HOME_DIR)
|
||||
|
||||
IF(LUA)
|
||||
add_subdirectory(lua)
|
||||
add_subdirectory(src/lua)
|
||||
ENDIF(LUA)
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(data)
|
||||
if (NOT MSVC)
|
||||
add_subdirectory(src/chkjson)
|
||||
endif()
|
||||
add_subdirectory(tests)
|
||||
|
||||
CONFIGURE_FILE(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(uninstall
|
||||
"${CMAKE_COMMAND}"
|
||||
-P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
)
|
||||
|
||||
find_program(CCACHE_FOUND ccache)
|
||||
if(CCACHE_FOUND)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||
endif(CCACHE_FOUND)
|
||||
|
||||
# vim:noet
|
||||
@@ -1,160 +0,0 @@
|
||||
#.rst:
|
||||
# CMakeParseArguments
|
||||
# -------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords>
|
||||
# <multi_value_keywords> args...)
|
||||
#
|
||||
# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions
|
||||
# for parsing the arguments given to that macro or function. It
|
||||
# processes the arguments and defines a set of variables which hold the
|
||||
# values of the respective options.
|
||||
#
|
||||
# The <options> argument contains all options for the respective macro,
|
||||
# i.e. keywords which can be used when calling the macro without any
|
||||
# value following, like e.g. the OPTIONAL keyword of the install()
|
||||
# command.
|
||||
#
|
||||
# The <one_value_keywords> argument contains all keywords for this macro
|
||||
# which are followed by one value, like e.g. DESTINATION keyword of the
|
||||
# install() command.
|
||||
#
|
||||
# The <multi_value_keywords> argument contains all keywords for this
|
||||
# macro which can be followed by more than one value, like e.g. the
|
||||
# TARGETS or FILES keywords of the install() command.
|
||||
#
|
||||
# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
|
||||
# keywords listed in <options>, <one_value_keywords> and
|
||||
# <multi_value_keywords> a variable composed of the given <prefix>
|
||||
# followed by "_" and the name of the respective keyword. These
|
||||
# variables will then hold the respective value from the argument list.
|
||||
# For the <options> keywords this will be TRUE or FALSE.
|
||||
#
|
||||
# All remaining arguments are collected in a variable
|
||||
# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see
|
||||
# whether your macro was called with unrecognized parameters.
|
||||
#
|
||||
# As an example here a my_install() macro, which takes similar arguments
|
||||
# as the real install() command:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# function(MY_INSTALL)
|
||||
# set(options OPTIONAL FAST)
|
||||
# set(oneValueArgs DESTINATION RENAME)
|
||||
# set(multiValueArgs TARGETS CONFIGURATIONS)
|
||||
# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
# ...
|
||||
#
|
||||
#
|
||||
#
|
||||
# Assume my_install() has been called like this:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
|
||||
#
|
||||
#
|
||||
#
|
||||
# After the cmake_parse_arguments() call the macro will have set the
|
||||
# following variables:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# MY_INSTALL_OPTIONAL = TRUE
|
||||
# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
|
||||
# MY_INSTALL_DESTINATION = "bin"
|
||||
# MY_INSTALL_RENAME = "" (was not used)
|
||||
# MY_INSTALL_TARGETS = "foo;bar"
|
||||
# MY_INSTALL_CONFIGURATIONS = "" (was not used)
|
||||
# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
|
||||
#
|
||||
#
|
||||
#
|
||||
# You can then continue and process these variables.
|
||||
#
|
||||
# Keywords terminate lists of values, e.g. if directly after a
|
||||
# one_value_keyword another recognized keyword follows, this is
|
||||
# interpreted as the beginning of the new option. E.g.
|
||||
# my_install(TARGETS foo DESTINATION OPTIONAL) would result in
|
||||
# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION
|
||||
# would be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2010 Alexander Neundorf <neundorf@kde.org>
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
|
||||
if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
|
||||
|
||||
|
||||
function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
|
||||
# first set all result variables to empty/FALSE
|
||||
foreach(arg_name ${_singleArgNames} ${_multiArgNames})
|
||||
set(${prefix}_${arg_name})
|
||||
endforeach()
|
||||
|
||||
foreach(option ${_optionNames})
|
||||
set(${prefix}_${option} FALSE)
|
||||
endforeach()
|
||||
|
||||
set(${prefix}_UNPARSED_ARGUMENTS)
|
||||
|
||||
set(insideValues FALSE)
|
||||
set(currentArgName)
|
||||
|
||||
# now iterate over all arguments and fill the result variables
|
||||
foreach(currentArg ${ARGN})
|
||||
list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword
|
||||
list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword
|
||||
list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword
|
||||
|
||||
if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1)
|
||||
if(insideValues)
|
||||
if("${insideValues}" STREQUAL "SINGLE")
|
||||
set(${prefix}_${currentArgName} ${currentArg})
|
||||
set(insideValues FALSE)
|
||||
elseif("${insideValues}" STREQUAL "MULTI")
|
||||
list(APPEND ${prefix}_${currentArgName} ${currentArg})
|
||||
endif()
|
||||
else()
|
||||
list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
|
||||
endif()
|
||||
else()
|
||||
if(NOT ${optionIndex} EQUAL -1)
|
||||
set(${prefix}_${currentArg} TRUE)
|
||||
set(insideValues FALSE)
|
||||
elseif(NOT ${singleArgIndex} EQUAL -1)
|
||||
set(currentArgName ${currentArg})
|
||||
set(${prefix}_${currentArgName})
|
||||
set(insideValues "SINGLE")
|
||||
elseif(NOT ${multiArgIndex} EQUAL -1)
|
||||
set(currentArgName ${currentArg})
|
||||
set(${prefix}_${currentArgName})
|
||||
set(insideValues "MULTI")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endforeach()
|
||||
|
||||
# propagate the result variables to the caller:
|
||||
foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
|
||||
set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
|
||||
endforeach()
|
||||
set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
|
||||
|
||||
endfunction()
|
||||
@@ -1,78 +0,0 @@
|
||||
#.rst:
|
||||
# CheckLibraryExists
|
||||
# ------------------
|
||||
#
|
||||
# Check if the function exists.
|
||||
#
|
||||
# CHECK_LIBRARY_EXISTS (LIBRARY FUNCTION LOCATION VARIABLE)
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# LIBRARY - the name of the library you are looking for
|
||||
# FUNCTION - the name of the function
|
||||
# LOCATION - location where the library should be found
|
||||
# VARIABLE - variable to store the result
|
||||
#
|
||||
#
|
||||
#
|
||||
# The following variables may be set before calling this macro to modify
|
||||
# the way the check is run:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2002-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
|
||||
|
||||
macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
|
||||
if(${VARIABLE} MATCHES "^${VARIABLE}$")
|
||||
set(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
|
||||
"-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
|
||||
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
|
||||
set(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CHECK_LIBRARY_EXISTS_LIBRARIES
|
||||
${CHECK_LIBRARY_EXISTS_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES})
|
||||
endif()
|
||||
try_compile(${VARIABLE}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_ROOT}/Modules/CheckFunctionExists.c
|
||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
||||
LINK_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES}
|
||||
CMAKE_FLAGS
|
||||
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_LIBRARY_EXISTS_DEFINITION}
|
||||
-DLINK_DIRECTORIES:STRING=${LOCATION}
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
|
||||
if(${VARIABLE})
|
||||
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found")
|
||||
set(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
|
||||
"passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
else()
|
||||
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
|
||||
set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
|
||||
"failed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -1,198 +0,0 @@
|
||||
#.rst:
|
||||
# FindCurses
|
||||
# ----------
|
||||
#
|
||||
# Find the curses include file and library
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CURSES_FOUND - system has Curses
|
||||
# CURSES_INCLUDE_DIR - the Curses include directory
|
||||
# CURSES_LIBRARIES - The libraries needed to use Curses
|
||||
# CURSES_HAVE_CURSES_H - true if curses.h is available
|
||||
# CURSES_HAVE_NCURSES_H - true if ncurses.h is available
|
||||
# CURSES_HAVE_NCURSES_NCURSES_H - true if ncurses/ncurses.h is available
|
||||
# CURSES_HAVE_NCURSES_CURSES_H - true if ncurses/curses.h is available
|
||||
# CURSES_LIBRARY - set for backwards compatibility with 2.4 CMake
|
||||
#
|
||||
#
|
||||
#
|
||||
# Set CURSES_NEED_NCURSES to TRUE before the find_package() command if
|
||||
# NCurses functionality is required.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2001-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
find_library(CURSES_CURSES_LIBRARY NAMES curses )
|
||||
|
||||
find_library(CURSES_NCURSES_LIBRARY NAMES ncurses )
|
||||
set(CURSES_USE_NCURSES FALSE)
|
||||
|
||||
if(CURSES_NCURSES_LIBRARY AND ((NOT CURSES_CURSES_LIBRARY) OR CURSES_NEED_NCURSES))
|
||||
set(CURSES_USE_NCURSES TRUE)
|
||||
endif()
|
||||
# http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html
|
||||
# cygwin ncurses stopped providing curses.h symlinks see above
|
||||
# message. Cygwin is an ncurses package, so force ncurses on
|
||||
# cygwin if the curses.h is missing
|
||||
if(CYGWIN)
|
||||
if(NOT EXISTS /usr/include/curses.h)
|
||||
set(CURSES_USE_NCURSES TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# Not sure the logic is correct here.
|
||||
# If NCurses is required, use the function wsyncup() to check if the library
|
||||
# has NCurses functionality (at least this is where it breaks on NetBSD).
|
||||
# If wsyncup is in curses, use this one.
|
||||
# If not, try to find ncurses and check if this has the symbol.
|
||||
# Once the ncurses library is found, search the ncurses.h header first, but
|
||||
# some web pages also say that even with ncurses there is not always a ncurses.h:
|
||||
# http://osdir.com/ml/gnome.apps.mc.devel/2002-06/msg00029.html
|
||||
# So at first try ncurses.h, if not found, try to find curses.h under the same
|
||||
# prefix as the library was found, if still not found, try curses.h with the
|
||||
# default search paths.
|
||||
if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
|
||||
CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}"
|
||||
wsyncup "" CURSES_CURSES_HAS_WSYNCUP)
|
||||
|
||||
if(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_HAS_WSYNCUP)
|
||||
CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
|
||||
wsyncup "" CURSES_NCURSES_HAS_WSYNCUP)
|
||||
if( CURSES_NCURSES_HAS_WSYNCUP)
|
||||
set(CURSES_USE_NCURSES TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT CURSES_USE_NCURSES)
|
||||
find_file(CURSES_HAVE_CURSES_H curses.h )
|
||||
find_path(CURSES_CURSES_H_PATH curses.h )
|
||||
get_filename_component(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH)
|
||||
get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH)
|
||||
|
||||
# for compatibility with older FindCurses.cmake this has to be in the cache
|
||||
# FORCE must not be used since this would break builds which preload a cache wqith these variables set
|
||||
set(CURSES_INCLUDE_PATH "${CURSES_CURSES_H_PATH}"
|
||||
CACHE FILEPATH "The curses include path")
|
||||
set(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}"
|
||||
CACHE FILEPATH "The curses library")
|
||||
else()
|
||||
# we need to find ncurses
|
||||
get_filename_component(_cursesLibDir "${CURSES_NCURSES_LIBRARY}" PATH)
|
||||
get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH)
|
||||
|
||||
find_file(CURSES_HAVE_NCURSES_H ncurses.h)
|
||||
find_file(CURSES_HAVE_NCURSES_NCURSES_H ncurses/ncurses.h)
|
||||
find_file(CURSES_HAVE_NCURSES_CURSES_H ncurses/curses.h)
|
||||
find_file(CURSES_HAVE_CURSES_H curses.h
|
||||
HINTS "${_cursesParentDir}/include")
|
||||
|
||||
find_path(CURSES_NCURSES_INCLUDE_PATH ncurses.h ncurses/ncurses.h
|
||||
ncurses/curses.h)
|
||||
find_path(CURSES_NCURSES_INCLUDE_PATH curses.h
|
||||
HINTS "${_cursesParentDir}/include")
|
||||
|
||||
# for compatibility with older FindCurses.cmake this has to be in the cache
|
||||
# FORCE must not be used since this would break builds which preload
|
||||
# however if the value of the variable has NOTFOUND in it, then
|
||||
# it is OK to force, and we need to force in order to have it work.
|
||||
# a cache wqith these variables set
|
||||
# only put ncurses include and library into
|
||||
# variables if they are found
|
||||
if(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
|
||||
get_filename_component(CURSES_NCURSES_INCLUDE_PATH
|
||||
"${CURSES_HAVE_NCURSES_NCURSES_H}" PATH)
|
||||
endif()
|
||||
if(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
|
||||
set( FORCE_IT )
|
||||
if(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
|
||||
set(FORCE_IT FORCE)
|
||||
endif()
|
||||
set(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}"
|
||||
CACHE FILEPATH "The curses include path" ${FORCE_IT})
|
||||
set( FORCE_IT)
|
||||
if(CURSES_LIBRARY MATCHES NOTFOUND)
|
||||
set(FORCE_IT FORCE)
|
||||
endif()
|
||||
set(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}"
|
||||
CACHE FILEPATH "The curses library" ${FORCE_IT})
|
||||
endif()
|
||||
|
||||
CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
|
||||
cbreak "" CURSES_NCURSES_HAS_CBREAK)
|
||||
if(NOT CURSES_NCURSES_HAS_CBREAK)
|
||||
find_library(CURSES_EXTRA_LIBRARY tinfo HINTS "${_cursesLibDir}")
|
||||
find_library(CURSES_EXTRA_LIBRARY tinfo )
|
||||
CHECK_LIBRARY_EXISTS("${CURSES_EXTRA_LIBRARY}"
|
||||
cbreak "" CURSES_TINFO_HAS_CBREAK)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT CURSES_TINFO_HAS_CBREAK)
|
||||
find_library(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}")
|
||||
find_library(CURSES_EXTRA_LIBRARY cur_colr )
|
||||
endif()
|
||||
|
||||
find_library(CURSES_FORM_LIBRARY form HINTS "${_cursesLibDir}")
|
||||
find_library(CURSES_FORM_LIBRARY form )
|
||||
|
||||
# for compatibility with older FindCurses.cmake this has to be in the cache
|
||||
# FORCE must not be used since this would break builds which preload a cache
|
||||
# qith these variables set
|
||||
set(FORM_LIBRARY "${CURSES_FORM_LIBRARY}"
|
||||
CACHE FILEPATH "The curses form library")
|
||||
|
||||
# Need to provide the *_LIBRARIES
|
||||
set(CURSES_LIBRARIES ${CURSES_LIBRARY})
|
||||
|
||||
if(CURSES_EXTRA_LIBRARY)
|
||||
set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_EXTRA_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(CURSES_FORM_LIBRARY)
|
||||
set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_FORM_LIBRARY})
|
||||
endif()
|
||||
|
||||
# Proper name is *_INCLUDE_DIR
|
||||
set(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH})
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set CURSES_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curses DEFAULT_MSG
|
||||
CURSES_LIBRARY CURSES_INCLUDE_PATH)
|
||||
|
||||
mark_as_advanced(
|
||||
CURSES_INCLUDE_PATH
|
||||
CURSES_LIBRARY
|
||||
CURSES_CURSES_INCLUDE_PATH
|
||||
CURSES_CURSES_LIBRARY
|
||||
CURSES_NCURSES_INCLUDE_PATH
|
||||
CURSES_NCURSES_LIBRARY
|
||||
CURSES_EXTRA_LIBRARY
|
||||
FORM_LIBRARY
|
||||
CURSES_LIBRARIES
|
||||
CURSES_INCLUDE_DIR
|
||||
CURSES_CURSES_HAS_WSYNCUP
|
||||
CURSES_NCURSES_HAS_WSYNCUP
|
||||
CURSES_NCURSES_HAS_CBREAK
|
||||
CURSES_TINFO_HAS_CBREAK
|
||||
)
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
# - Try to find Iconv
|
||||
# Once done this will define
|
||||
#
|
||||
# ICONV_FOUND - system has Iconv
|
||||
# ICONV_INCLUDE_DIR - the Iconv include directory
|
||||
# ICONV_LIBRARIES - Link these to use Iconv
|
||||
# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
|
||||
#
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
|
||||
# Already in cache, be silent
|
||||
SET(ICONV_FIND_QUIETLY TRUE)
|
||||
ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
|
||||
|
||||
FIND_PATH(ICONV_INCLUDE_DIR iconv.h)
|
||||
|
||||
FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
|
||||
|
||||
IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
|
||||
SET(ICONV_FOUND TRUE)
|
||||
ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
|
||||
|
||||
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
|
||||
IF(ICONV_FOUND)
|
||||
check_cxx_source_compiles("
|
||||
#include <iconv.h>
|
||||
int main(){
|
||||
iconv_t conv = 0;
|
||||
const char* in = 0;
|
||||
size_t ilen = 0;
|
||||
char* out = 0;
|
||||
size_t olen = 0;
|
||||
iconv(conv, &in, &ilen, &out, &olen);
|
||||
return 0;
|
||||
}
|
||||
" ICONV_SECOND_ARGUMENT_IS_CONST )
|
||||
ENDIF(ICONV_FOUND)
|
||||
set(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set CURSES_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Iconv DEFAULT_MSG
|
||||
ICONV_LIBRARIES ICONV_INCLUDE_DIR)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
ICONV_INCLUDE_DIR
|
||||
ICONV_LIBRARIES
|
||||
ICONV_SECOND_ARGUMENT_IS_CONST
|
||||
)
|
||||
@@ -1,45 +0,0 @@
|
||||
# Try to find Libintl functionality
|
||||
# Once done this will define
|
||||
#
|
||||
# LIBINTL_FOUND - system has Libintl
|
||||
# LIBINTL_INCLUDE_DIR - Libintl include directory
|
||||
# LIBINTL_LIBRARIES - Libraries needed to use Libintl
|
||||
#
|
||||
# TODO: This will enable translations only if Gettext functionality is
|
||||
# present in libc. Must have more robust system for release, where Gettext
|
||||
# functionality can also reside in standalone Gettext library, or the one
|
||||
# embedded within kdelibs (cf. gettext.m4 from Gettext source).
|
||||
|
||||
# Copyright (c) 2006, Chusslove Illich, <caslav.ilic@gmx.net>
|
||||
# Copyright (c) 2007, Alexander Neundorf, <neundorf@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
if(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND)
|
||||
set(Libintl_FIND_QUIETLY TRUE)
|
||||
endif(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND)
|
||||
|
||||
find_path(LIBINTL_INCLUDE_DIR libintl.h)
|
||||
|
||||
set(LIBINTL_LIB_FOUND FALSE)
|
||||
|
||||
if(LIBINTL_INCLUDE_DIR)
|
||||
include(CheckFunctionExists)
|
||||
check_function_exists(dgettext LIBINTL_LIBC_HAS_DGETTEXT)
|
||||
|
||||
if (LIBINTL_LIBC_HAS_DGETTEXT)
|
||||
set(LIBINTL_LIBRARIES)
|
||||
set(LIBINTL_LIB_FOUND TRUE)
|
||||
else (LIBINTL_LIBC_HAS_DGETTEXT)
|
||||
find_library(LIBINTL_LIBRARIES intl libintl libintl-8)
|
||||
if(LIBINTL_LIBRARIES)
|
||||
set(LIBINTL_LIB_FOUND TRUE)
|
||||
endif(LIBINTL_LIBRARIES)
|
||||
endif (LIBINTL_LIBC_HAS_DGETTEXT)
|
||||
endif(LIBINTL_INCLUDE_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libintl DEFAULT_MSG LIBINTL_LIBRARIES LIBINTL_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARIES LIBINTL_LIBC_HAS_DGETTEXT LIBINTL_LIB_FOUND)
|
||||
@@ -1,117 +0,0 @@
|
||||
# Locate Lua library
|
||||
# This module defines
|
||||
# LUA_EXECUTABLE, if found
|
||||
# LUA_FOUND, if false, do not try to link to Lua
|
||||
# LUA_LIBRARIES
|
||||
# LUA_INCLUDE_DIR, where to find lua.h
|
||||
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
|
||||
#
|
||||
# Note that the expected include convention is
|
||||
# #include "lua.h"
|
||||
# and not
|
||||
# #include <lua/lua.h>
|
||||
# This is because, the lua location is not standardized and may exist
|
||||
# in locations other than lua/
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2007-2009 Kitware, Inc.
|
||||
# Modified to support Lua 5.2 by LuaDist 2012
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
#
|
||||
# The required version of Lua can be specified using the
|
||||
# standard syntax, e.g. FIND_PACKAGE(Lua 5.1)
|
||||
# Otherwise the module will search for any available Lua implementation
|
||||
|
||||
# Always search for non-versioned lua first (recommended)
|
||||
SET(_POSSIBLE_LUA_INCLUDE include include/lua)
|
||||
SET(_POSSIBLE_LUA_EXECUTABLE lua)
|
||||
SET(_POSSIBLE_LUA_LIBRARY lua)
|
||||
|
||||
# Determine possible naming suffixes (there is no standard for this)
|
||||
IF(Lua_FIND_VERSION_MAJOR AND Lua_FIND_VERSION_MINOR)
|
||||
SET(_POSSIBLE_SUFFIXES "${Lua_FIND_VERSION_MAJOR}${Lua_FIND_VERSION_MINOR}" "${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR}" "-${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR}")
|
||||
ELSE(Lua_FIND_VERSION_MAJOR AND Lua_FIND_VERSION_MINOR)
|
||||
SET(_POSSIBLE_SUFFIXES "52" "5.2" "-5.2" "51" "5.1" "-5.1")
|
||||
ENDIF(Lua_FIND_VERSION_MAJOR AND Lua_FIND_VERSION_MINOR)
|
||||
|
||||
# Set up possible search names and locations
|
||||
FOREACH(_SUFFIX ${_POSSIBLE_SUFFIXES})
|
||||
LIST(APPEND _POSSIBLE_LUA_INCLUDE "include/lua${_SUFFIX}")
|
||||
LIST(APPEND _POSSIBLE_LUA_EXECUTABLE "lua${_SUFFIX}")
|
||||
LIST(APPEND _POSSIBLE_LUA_LIBRARY "lua${_SUFFIX}")
|
||||
ENDFOREACH(_SUFFIX)
|
||||
|
||||
# Find the lua executable
|
||||
FIND_PROGRAM(LUA_EXECUTABLE
|
||||
NAMES ${_POSSIBLE_LUA_EXECUTABLE}
|
||||
)
|
||||
|
||||
# Find the lua header
|
||||
FIND_PATH(LUA_INCLUDE_DIR lua.h
|
||||
HINTS
|
||||
$ENV{LUA_DIR}
|
||||
PATH_SUFFIXES ${_POSSIBLE_LUA_INCLUDE}
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
)
|
||||
|
||||
# Find the lua library
|
||||
FIND_LIBRARY(LUA_LIBRARY
|
||||
NAMES ${_POSSIBLE_LUA_LIBRARY}
|
||||
HINTS
|
||||
$ENV{LUA_DIR}
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
)
|
||||
|
||||
IF(LUA_LIBRARY)
|
||||
# include the math library for Unix
|
||||
IF(UNIX AND NOT APPLE)
|
||||
FIND_LIBRARY(LUA_MATH_LIBRARY m)
|
||||
SET( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
# For Windows and Mac, don't need to explicitly include the math library
|
||||
ELSE(UNIX AND NOT APPLE)
|
||||
SET( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
ENDIF(UNIX AND NOT APPLE)
|
||||
ENDIF(LUA_LIBRARY)
|
||||
|
||||
# Determine Lua version
|
||||
IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
|
||||
FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
|
||||
|
||||
STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
|
||||
UNSET(lua_version_str)
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
|
||||
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
|
||||
VERSION_VAR LUA_VERSION_STRING)
|
||||
|
||||
MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY LUA_EXECUTABLE)
|
||||
@@ -1,351 +0,0 @@
|
||||
#.rst:
|
||||
# FindPackageHandleStandardArgs
|
||||
# -----------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
|
||||
#
|
||||
# This function is intended to be used in FindXXX.cmake modules files.
|
||||
# It handles the REQUIRED, QUIET and version-related arguments to
|
||||
# find_package(). It also sets the <packagename>_FOUND variable. The
|
||||
# package is considered found if all variables <var1>... listed contain
|
||||
# valid results, e.g. valid filepaths.
|
||||
#
|
||||
# There are two modes of this function. The first argument in both
|
||||
# modes is the name of the Find-module where it is called (in original
|
||||
# casing).
|
||||
#
|
||||
# The first simple mode looks like this:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
|
||||
#
|
||||
# If the variables <var1> to <varN> are all valid, then
|
||||
# <UPPERCASED_NAME>_FOUND will be set to TRUE. If DEFAULT_MSG is given
|
||||
# as second argument, then the function will generate itself useful
|
||||
# success and error messages. You can also supply a custom error
|
||||
# message for the failure case. This is not recommended.
|
||||
#
|
||||
# The second mode is more powerful and also supports version checking:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [FOUND_VAR <resultVar>]
|
||||
# [REQUIRED_VARS <var1>...<varN>]
|
||||
# [VERSION_VAR <versionvar>]
|
||||
# [HANDLE_COMPONENTS]
|
||||
# [CONFIG_MODE]
|
||||
# [FAIL_MESSAGE "Custom failure message"] )
|
||||
#
|
||||
#
|
||||
#
|
||||
# In this mode, the name of the result-variable can be set either to
|
||||
# either <UPPERCASED_NAME>_FOUND or <OriginalCase_Name>_FOUND using the
|
||||
# FOUND_VAR option. Other names for the result-variable are not
|
||||
# allowed. So for a Find-module named FindFooBar.cmake, the two
|
||||
# possible names are FooBar_FOUND and FOOBAR_FOUND. It is recommended
|
||||
# to use the original case version. If the FOUND_VAR option is not
|
||||
# used, the default is <UPPERCASED_NAME>_FOUND.
|
||||
#
|
||||
# As in the simple mode, if <var1> through <varN> are all valid,
|
||||
# <packagename>_FOUND will be set to TRUE. After REQUIRED_VARS the
|
||||
# variables which are required for this package are listed. Following
|
||||
# VERSION_VAR the name of the variable can be specified which holds the
|
||||
# version of the package which has been found. If this is done, this
|
||||
# version will be checked against the (potentially) specified required
|
||||
# version used in the find_package() call. The EXACT keyword is also
|
||||
# handled. The default messages include information about the required
|
||||
# version and the version which has been actually found, both if the
|
||||
# version is ok or not. If the package supports components, use the
|
||||
# HANDLE_COMPONENTS option to enable handling them. In this case,
|
||||
# find_package_handle_standard_args() will report which components have
|
||||
# been found and which are missing, and the <packagename>_FOUND variable
|
||||
# will be set to FALSE if any of the required components (i.e. not the
|
||||
# ones listed after OPTIONAL_COMPONENTS) are missing. Use the option
|
||||
# CONFIG_MODE if your FindXXX.cmake module is a wrapper for a
|
||||
# find_package(... NO_MODULE) call. In this case VERSION_VAR will be
|
||||
# set to <NAME>_VERSION and the macro will automatically check whether
|
||||
# the Config module was found. Via FAIL_MESSAGE a custom failure
|
||||
# message can be specified, if this is not used, the default message
|
||||
# will be displayed.
|
||||
#
|
||||
# Example for mode 1:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# find_package_handle_standard_args(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
|
||||
#
|
||||
#
|
||||
#
|
||||
# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
|
||||
# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to
|
||||
# TRUE. If it is not found and REQUIRED was used, it fails with
|
||||
# FATAL_ERROR, independent whether QUIET was used or not. If it is
|
||||
# found, success will be reported, including the content of <var1>. On
|
||||
# repeated Cmake runs, the same message won't be printed again.
|
||||
#
|
||||
# Example for mode 2:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# find_package_handle_standard_args(LibXslt FOUND_VAR LibXslt_FOUND
|
||||
# REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS
|
||||
# VERSION_VAR LibXslt_VERSION_STRING)
|
||||
#
|
||||
# In this case, LibXslt is considered to be found if the variable(s)
|
||||
# listed after REQUIRED_VAR are all valid, i.e. LibXslt_LIBRARIES and
|
||||
# LibXslt_INCLUDE_DIRS in this case. The result will then be stored in
|
||||
# LibXslt_FOUND . Also the version of LibXslt will be checked by using
|
||||
# the version contained in LibXslt_VERSION_STRING. Since no
|
||||
# FAIL_MESSAGE is given, the default messages will be printed.
|
||||
#
|
||||
# Another example for mode 2:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
|
||||
# find_package_handle_standard_args(Automoc4 CONFIG_MODE)
|
||||
#
|
||||
# In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4
|
||||
# NO_MODULE) and adds an additional search directory for automoc4. Here
|
||||
# the result will be stored in AUTOMOC4_FOUND. The following
|
||||
# FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
|
||||
# success/error message.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2007-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake)
|
||||
|
||||
# internal helper macro
|
||||
macro(_FPHSA_FAILURE_MESSAGE _msg)
|
||||
if (${_NAME}_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "${_msg}")
|
||||
else ()
|
||||
if (NOT ${_NAME}_FIND_QUIETLY)
|
||||
message(STATUS "${_msg}")
|
||||
endif ()
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
|
||||
# internal helper macro to generate the failure message when used in CONFIG_MODE:
|
||||
macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
|
||||
# <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
|
||||
if(${_NAME}_CONFIG)
|
||||
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
|
||||
else()
|
||||
# If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
|
||||
# List them all in the error message:
|
||||
if(${_NAME}_CONSIDERED_CONFIGS)
|
||||
set(configsText "")
|
||||
list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
|
||||
math(EXPR configsCount "${configsCount} - 1")
|
||||
foreach(currentConfigIndex RANGE ${configsCount})
|
||||
list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
|
||||
list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
|
||||
set(configsText "${configsText} ${filename} (version ${version})\n")
|
||||
endforeach()
|
||||
if (${_NAME}_NOT_FOUND_MESSAGE)
|
||||
set(configsText "${configsText} Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
|
||||
endif()
|
||||
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
|
||||
|
||||
else()
|
||||
# Simple case: No Config-file was found at all:
|
||||
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
|
||||
|
||||
# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
|
||||
# new extended or in the "old" mode:
|
||||
set(options CONFIG_MODE HANDLE_COMPONENTS)
|
||||
set(oneValueArgs FAIL_MESSAGE VERSION_VAR FOUND_VAR)
|
||||
set(multiValueArgs REQUIRED_VARS)
|
||||
set(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
|
||||
list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
|
||||
|
||||
if(${INDEX} EQUAL -1)
|
||||
set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
|
||||
set(FPHSA_REQUIRED_VARS ${ARGN})
|
||||
set(FPHSA_VERSION_VAR)
|
||||
else()
|
||||
|
||||
CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
|
||||
|
||||
if(FPHSA_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
|
||||
endif()
|
||||
|
||||
if(NOT FPHSA_FAIL_MESSAGE)
|
||||
set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# now that we collected all arguments, process them
|
||||
|
||||
if("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
|
||||
set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
|
||||
endif()
|
||||
|
||||
# In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
|
||||
# when it successfully found the config-file, including version checking:
|
||||
if(FPHSA_CONFIG_MODE)
|
||||
list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
|
||||
list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
|
||||
set(FPHSA_VERSION_VAR ${_NAME}_VERSION)
|
||||
endif()
|
||||
|
||||
if(NOT FPHSA_REQUIRED_VARS)
|
||||
message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
|
||||
endif()
|
||||
|
||||
list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
|
||||
|
||||
string(TOUPPER ${_NAME} _NAME_UPPER)
|
||||
string(TOLOWER ${_NAME} _NAME_LOWER)
|
||||
|
||||
if(FPHSA_FOUND_VAR)
|
||||
if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$" OR FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$")
|
||||
set(_FOUND_VAR ${FPHSA_FOUND_VAR})
|
||||
else()
|
||||
message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.")
|
||||
endif()
|
||||
else()
|
||||
set(_FOUND_VAR ${_NAME_UPPER}_FOUND)
|
||||
endif()
|
||||
|
||||
# collect all variables which were not found, so they can be printed, so the
|
||||
# user knows better what went wrong (#6375)
|
||||
set(MISSING_VARS "")
|
||||
set(DETAILS "")
|
||||
# check if all passed variables are valid
|
||||
unset(${_FOUND_VAR})
|
||||
foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
|
||||
if(NOT ${_CURRENT_VAR})
|
||||
set(${_FOUND_VAR} FALSE)
|
||||
set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
|
||||
else()
|
||||
set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
|
||||
endif()
|
||||
endforeach()
|
||||
if(NOT "${${_FOUND_VAR}}" STREQUAL "FALSE")
|
||||
set(${_FOUND_VAR} TRUE)
|
||||
endif()
|
||||
|
||||
# component handling
|
||||
unset(FOUND_COMPONENTS_MSG)
|
||||
unset(MISSING_COMPONENTS_MSG)
|
||||
|
||||
if(FPHSA_HANDLE_COMPONENTS)
|
||||
foreach(comp ${${_NAME}_FIND_COMPONENTS})
|
||||
if(${_NAME}_${comp}_FOUND)
|
||||
|
||||
if(NOT DEFINED FOUND_COMPONENTS_MSG)
|
||||
set(FOUND_COMPONENTS_MSG "found components: ")
|
||||
endif()
|
||||
set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}")
|
||||
|
||||
else()
|
||||
|
||||
if(NOT DEFINED MISSING_COMPONENTS_MSG)
|
||||
set(MISSING_COMPONENTS_MSG "missing components: ")
|
||||
endif()
|
||||
set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}")
|
||||
|
||||
if(${_NAME}_FIND_REQUIRED_${comp})
|
||||
set(${_FOUND_VAR} FALSE)
|
||||
set(MISSING_VARS "${MISSING_VARS} ${comp}")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endforeach()
|
||||
set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
|
||||
set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]")
|
||||
endif()
|
||||
|
||||
# version handling:
|
||||
set(VERSION_MSG "")
|
||||
set(VERSION_OK TRUE)
|
||||
set(VERSION ${${FPHSA_VERSION_VAR}} )
|
||||
if (${_NAME}_FIND_VERSION)
|
||||
|
||||
if(VERSION)
|
||||
|
||||
if(${_NAME}_FIND_VERSION_EXACT) # exact version required
|
||||
if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
|
||||
set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
|
||||
set(VERSION_OK FALSE)
|
||||
else ()
|
||||
set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
|
||||
endif ()
|
||||
|
||||
else() # minimum version specified:
|
||||
if ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
|
||||
set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
|
||||
set(VERSION_OK FALSE)
|
||||
else ()
|
||||
set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
else()
|
||||
|
||||
# if the package was not found, but a version was given, add that to the output:
|
||||
if(${_NAME}_FIND_VERSION_EXACT)
|
||||
set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
|
||||
else()
|
||||
set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
else ()
|
||||
if(VERSION)
|
||||
set(VERSION_MSG "(found version \"${VERSION}\")")
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if(VERSION_OK)
|
||||
set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
|
||||
else()
|
||||
set(${_FOUND_VAR} FALSE)
|
||||
endif()
|
||||
|
||||
|
||||
# print the result:
|
||||
if (${_FOUND_VAR})
|
||||
FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
|
||||
else ()
|
||||
|
||||
if(FPHSA_CONFIG_MODE)
|
||||
_FPHSA_HANDLE_FAILURE_CONFIG_MODE()
|
||||
else()
|
||||
if(NOT VERSION_OK)
|
||||
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
|
||||
else()
|
||||
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif ()
|
||||
|
||||
set(${_FOUND_VAR} ${${_FOUND_VAR}} PARENT_SCOPE)
|
||||
|
||||
endfunction()
|
||||
@@ -1,57 +0,0 @@
|
||||
#.rst:
|
||||
# FindPackageMessage
|
||||
# ------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# FIND_PACKAGE_MESSAGE(<name> "message for user" "find result details")
|
||||
#
|
||||
# This macro is intended to be used in FindXXX.cmake modules files. It
|
||||
# will print a message once for each unique find result. This is useful
|
||||
# for telling the user where a package was found. The first argument
|
||||
# specifies the name (XXX) of the package. The second argument
|
||||
# specifies the message to display. The third argument lists details
|
||||
# about the find result so that if they change the message will be
|
||||
# displayed again. The macro also obeys the QUIET argument to the
|
||||
# find_package command.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# if(X11_FOUND)
|
||||
# FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
|
||||
# "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
|
||||
# else()
|
||||
# ...
|
||||
# endif()
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2008-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
function(FIND_PACKAGE_MESSAGE pkg msg details)
|
||||
# Avoid printing a message repeatedly for the same find result.
|
||||
if(NOT ${pkg}_FIND_QUIETLY)
|
||||
string(REGEX REPLACE "[\n]" "" details "${details}")
|
||||
set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
|
||||
if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
|
||||
# The message has not yet been printed.
|
||||
message(STATUS "${msg}")
|
||||
|
||||
# Save the find details in the cache to avoid printing the same
|
||||
# message again.
|
||||
set("${DETAILS_VAR}" "${details}"
|
||||
CACHE INTERNAL "Details about finding ${pkg}")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -1,186 +0,0 @@
|
||||
#.rst:
|
||||
# FindSDL2
|
||||
# -------
|
||||
#
|
||||
# Locate SDL2 library
|
||||
#
|
||||
# This module defines
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# SDL2_LIBRARY, the name of the library to link against
|
||||
# SDL2_FOUND, if false, do not try to link to SDL
|
||||
# SDL2_INCLUDE_DIR, where to find SDL.h
|
||||
# SDL2_VERSION_STRING, human-readable string containing the version of SDL
|
||||
#
|
||||
#
|
||||
#
|
||||
# This module responds to the flag:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# SDL2_BUILDING_LIBRARY
|
||||
# If this is defined, then no SDL2_main will be linked in because
|
||||
# only applications need main().
|
||||
# Otherwise, it is assumed you are building an application and this
|
||||
# module will attempt to locate and set the proper link flags
|
||||
# as part of the returned SDL2_LIBRARY variable.
|
||||
#
|
||||
#
|
||||
#
|
||||
# Don't forget to include SDLmain.h and SDLmain.m your project for the
|
||||
# OS X framework based version. (Other versions link to -lSDLmain which
|
||||
# this module will try to find on your behalf.) Also for OS X, this
|
||||
# module will automatically add the -framework Cocoa on your behalf.
|
||||
#
|
||||
#
|
||||
#
|
||||
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your
|
||||
# configuration and no SDL2_LIBRARY, it means CMake did not find your SDL
|
||||
# library (SDL.dll, libsdl.so, SDL.framework, etc). Set
|
||||
# SDL2_LIBRARY_TEMP to point to your SDL library, and configure again.
|
||||
# Similarly, if you see an empty SDLMAIN_LIBRARY, you should set this
|
||||
# value as appropriate. These values are used to generate the final
|
||||
# SDL2_LIBRARY variable, but when these values are unset, SDL2_LIBRARY
|
||||
# does not get created.
|
||||
#
|
||||
#
|
||||
#
|
||||
# $SDLDIR is an environment variable that would correspond to the
|
||||
# ./configure --prefix=$SDLDIR used in building SDL. l.e.galup 9-20-02
|
||||
#
|
||||
# Modified by Eric Wing. Added code to assist with automated building
|
||||
# by using environmental variables and providing a more
|
||||
# controlled/consistent search behavior. Added new modifications to
|
||||
# recognize OS X frameworks and additional Unix paths (FreeBSD, etc).
|
||||
# Also corrected the header search path to follow "proper" SDL
|
||||
# guidelines. Added a search for SDLmain which is needed by some
|
||||
# platforms. Added a search for threads which is needed by some
|
||||
# platforms. Added needed compile switches for MinGW.
|
||||
#
|
||||
# On OSX, this will prefer the Framework version (if found) over others.
|
||||
# People will have to manually change the cache values of SDL2_LIBRARY to
|
||||
# override this selection or set the CMake environment
|
||||
# CMAKE_INCLUDE_PATH to modify the search paths.
|
||||
#
|
||||
# Note that the header path has changed from SDL/SDL.h to just SDL.h
|
||||
# This needed to change because "proper" SDL convention is #include
|
||||
# "SDL.h", not <SDL/SDL.h>. This is done for portability reasons
|
||||
# because not all systems place things in SDL/ (see FreeBSD).
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2003-2009 Kitware, Inc.
|
||||
# Copyright 2012 Benjamin Eikel
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
find_path(SDL2_INCLUDE_DIR SDL.h
|
||||
HINTS
|
||||
ENV SDL2DIR
|
||||
${CMAKE_SOURCE_DIR}/dep/
|
||||
PATH_SUFFIXES SDL2
|
||||
# path suffixes to search inside ENV{SDLDIR}
|
||||
include/SDL2 include
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(VC_LIB_PATH_SUFFIX lib/x64)
|
||||
else()
|
||||
set(VC_LIB_PATH_SUFFIX lib/x86)
|
||||
endif()
|
||||
|
||||
find_library(SDL2_LIBRARY_TEMP
|
||||
NAMES SDL2
|
||||
HINTS
|
||||
ENV SDL2DIR
|
||||
${CMAKE_SOURCE_DIR}/dep/
|
||||
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
|
||||
)
|
||||
|
||||
if(NOT SDL2_BUILDING_LIBRARY)
|
||||
if(NOT SDL2_INCLUDE_DIR MATCHES ".framework")
|
||||
# Non-OS X framework versions expect you to also dynamically link to
|
||||
# SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms
|
||||
# seem to provide SDLmain for compatibility even though they don't
|
||||
# necessarily need it.
|
||||
find_library(SDL2MAIN_LIBRARY
|
||||
NAMES SDL2main
|
||||
HINTS
|
||||
ENV SDL2DIR
|
||||
${CMAKE_SOURCE_DIR}/dep/
|
||||
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
|
||||
PATHS
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# SDL may require threads on your system.
|
||||
# The Apple build may not need an explicit flag because one of the
|
||||
# frameworks may already provide it.
|
||||
# But for non-OSX systems, I will use the CMake Threads package.
|
||||
if(NOT APPLE)
|
||||
find_package(Threads)
|
||||
endif()
|
||||
|
||||
# MinGW needs an additional library, mwindows
|
||||
# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows
|
||||
# (Actually on second look, I think it only needs one of the m* libraries.)
|
||||
if(MINGW)
|
||||
set(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
|
||||
endif()
|
||||
|
||||
if(SDL2_LIBRARY_TEMP)
|
||||
# For SDLmain
|
||||
if(SDL2MAIN_LIBRARY AND NOT SDL2_BUILDING_LIBRARY)
|
||||
list(FIND SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" _SDL2_MAIN_INDEX)
|
||||
if(_SDL2_MAIN_INDEX EQUAL -1)
|
||||
set(SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" ${SDL2_LIBRARY_TEMP})
|
||||
endif()
|
||||
unset(_SDL2_MAIN_INDEX)
|
||||
endif()
|
||||
|
||||
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
|
||||
# CMake doesn't display the -framework Cocoa string in the UI even
|
||||
# though it actually is there if I modify a pre-used variable.
|
||||
# I think it has something to do with the CACHE STRING.
|
||||
# So I use a temporary variable until the end so I can set the
|
||||
# "real" variable in one-shot.
|
||||
if(APPLE)
|
||||
set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
|
||||
endif()
|
||||
|
||||
# For threads, as mentioned Apple doesn't need this.
|
||||
# In fact, there seems to be a problem if I used the Threads package
|
||||
# and try using this line, so I'm just skipping it entirely for OS X.
|
||||
if(NOT APPLE)
|
||||
set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
|
||||
# For MinGW library
|
||||
if(MINGW)
|
||||
set(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
|
||||
endif()
|
||||
|
||||
# Set the final string here so the GUI reflects the final state.
|
||||
set(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
|
||||
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
|
||||
set(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
|
||||
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR
|
||||
VERSION_VAR SDL2_VERSION_STRING)
|
||||
@@ -1,97 +0,0 @@
|
||||
#.rst:
|
||||
# FindSDL2_image
|
||||
# -------------
|
||||
#
|
||||
# Locate SDL2_image library
|
||||
#
|
||||
# This module defines:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# SDL2_IMAGE_LIBRARIES, the name of the library to link against
|
||||
# SDL2_IMAGE_INCLUDE_DIRS, where to find the headers
|
||||
# SDL2_IMAGE_FOUND, if false, do not try to link against
|
||||
# SDL2_IMAGE_VERSION_STRING - human-readable string containing the
|
||||
# version of SDL2_image
|
||||
#
|
||||
#
|
||||
#
|
||||
# For backward compatiblity the following variables are also set:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# SDL2IMAGE_LIBRARY (same value as SDL2_IMAGE_LIBRARIES)
|
||||
# SDL2IMAGE_INCLUDE_DIR (same value as SDL2_IMAGE_INCLUDE_DIRS)
|
||||
# SDL2IMAGE_FOUND (same value as SDL2_IMAGE_FOUND)
|
||||
#
|
||||
#
|
||||
#
|
||||
# $SDL2DIR is an environment variable that would correspond to the
|
||||
# ./configure --prefix=$SDL2DIR used in building SDL2.
|
||||
#
|
||||
# Created by Eric Wing. This was influenced by the FindSDL2.cmake
|
||||
# module, but with modifications to recognize OS X frameworks and
|
||||
# additional Unix paths (FreeBSD, etc).
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2005-2009 Kitware, Inc.
|
||||
# Copyright 2012 Benjamin Eikel
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
if(NOT SDL2_IMAGE_INCLUDE_DIR AND SDL2IMAGE_INCLUDE_DIR)
|
||||
set(SDL2_IMAGE_INCLUDE_DIR ${SDL2IMAGE_INCLUDE_DIR} CACHE PATH "directory cache
|
||||
entry initialized from old variable name")
|
||||
endif()
|
||||
find_path(SDL2_IMAGE_INCLUDE_DIR SDL_image.h
|
||||
HINTS
|
||||
ENV SDL2IMAGEDIR
|
||||
ENV SDL2DIR
|
||||
${CMAKE_SOURCE_DIR}/dep/
|
||||
PATH_SUFFIXES SDL2
|
||||
# path suffixes to search inside ENV{SDL2DIR}
|
||||
include/SDL2 include
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(VC_LIB_PATH_SUFFIX lib/x64)
|
||||
else()
|
||||
set(VC_LIB_PATH_SUFFIX lib/x86)
|
||||
endif()
|
||||
|
||||
if(NOT SDL2_IMAGE_LIBRARY AND SDL2IMAGE_LIBRARY)
|
||||
set(SDL2_IMAGE_LIBRARY ${SDL2IMAGE_LIBRARY} CACHE FILEPATH "file cache entry
|
||||
initialized from old variable name")
|
||||
endif()
|
||||
find_library(SDL2_IMAGE_LIBRARY
|
||||
NAMES SDL2_image
|
||||
HINTS
|
||||
ENV SDL2IMAGEDIR
|
||||
ENV SDL2DIR
|
||||
${CMAKE_SOURCE_DIR}/dep/
|
||||
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
|
||||
)
|
||||
|
||||
set(SDL2_IMAGE_LIBRARIES ${SDL2_IMAGE_LIBRARY})
|
||||
set(SDL2_IMAGE_INCLUDE_DIRS ${SDL2_IMAGE_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_image
|
||||
REQUIRED_VARS SDL2_IMAGE_LIBRARIES SDL2_IMAGE_INCLUDE_DIRS
|
||||
VERSION_VAR SDL2_IMAGE_VERSION_STRING)
|
||||
|
||||
# for backward compatiblity
|
||||
set(SDL2IMAGE_LIBRARY ${SDL2_IMAGE_LIBRARIES})
|
||||
set(SDL2IMAGE_INCLUDE_DIR ${SDL2_IMAGE_INCLUDE_DIRS})
|
||||
set(SDL2IMAGE_FOUND ${SDL2_IMAGE_FOUND})
|
||||
|
||||
mark_as_advanced(SDL2_IMAGE_LIBRARY SDL2_IMAGE_INCLUDE_DIR)
|
||||
@@ -1,97 +0,0 @@
|
||||
#.rst:
|
||||
# FindSDL2_mixer
|
||||
# -------------
|
||||
#
|
||||
# Locate SDL2_mixer library
|
||||
#
|
||||
# This module defines:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# SDL2_MIXER_LIBRARIES, the name of the library to link against
|
||||
# SDL2_MIXER_INCLUDE_DIRS, where to find the headers
|
||||
# SDL2_MIXER_FOUND, if false, do not try to link against
|
||||
# SDL2_MIXER_VERSION_STRING - human-readable string containing the
|
||||
# version of SDL2_mixer
|
||||
#
|
||||
#
|
||||
#
|
||||
# For backward compatiblity the following variables are also set:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# SDL2MIXER_LIBRARY (same value as SDL2_MIXER_LIBRARIES)
|
||||
# SDL2MIXER_INCLUDE_DIR (same value as SDL2_MIXER_INCLUDE_DIRS)
|
||||
# SDL2MIXER_FOUND (same value as SDL2_MIXER_FOUND)
|
||||
#
|
||||
#
|
||||
#
|
||||
# $SDL2DIR is an environment variable that would correspond to the
|
||||
# ./configure --prefix=$SDL2DIR used in building SDL2.
|
||||
#
|
||||
# Created by Eric Wing. This was influenced by the FindSDL2.cmake
|
||||
# module, but with modifications to recognize OS X frameworks and
|
||||
# additional Unix paths (FreeBSD, etc).
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2005-2009 Kitware, Inc.
|
||||
# Copyright 2012 Benjamin Eikel
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
if(NOT SDL2_MIXER_INCLUDE_DIR AND SDL2MIXER_INCLUDE_DIR)
|
||||
set(SDL2_MIXER_INCLUDE_DIR ${SDL2MIXER_INCLUDE_DIR} CACHE PATH "directory cache
|
||||
entry initialized from old variable name")
|
||||
endif()
|
||||
find_path(SDL2_MIXER_INCLUDE_DIR SDL_mixer.h
|
||||
HINTS
|
||||
ENV SDL2MIXERDIR
|
||||
ENV SDL2DIR
|
||||
${CMAKE_SOURCE_DIR}/dep/
|
||||
PATH_SUFFIXES SDL2
|
||||
# path suffixes to search inside ENV{SDL2DIR}
|
||||
include/SDL2 include
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(VC_LIB_PATH_SUFFIX lib/x64)
|
||||
else()
|
||||
set(VC_LIB_PATH_SUFFIX lib/x86)
|
||||
endif()
|
||||
|
||||
if(NOT SDL2_MIXER_LIBRARY AND SDL2MIXER_LIBRARY)
|
||||
set(SDL2_MIXER_LIBRARY ${SDL2MIXER_LIBRARY} CACHE FILEPATH "file cache entry
|
||||
initialized from old variable name")
|
||||
endif()
|
||||
find_library(SDL2_MIXER_LIBRARY
|
||||
NAMES SDL2_mixer
|
||||
HINTS
|
||||
ENV SDL2MIXERDIR
|
||||
ENV SDL2DIR
|
||||
${CMAKE_SOURCE_DIR}/dep/
|
||||
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
|
||||
)
|
||||
|
||||
set(SDL2_MIXER_LIBRARIES ${SDL2_MIXER_LIBRARY})
|
||||
set(SDL2_MIXER_INCLUDE_DIRS ${SDL2_MIXER_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_mixer
|
||||
REQUIRED_VARS SDL2_MIXER_LIBRARIES SDL2_MIXER_INCLUDE_DIRS
|
||||
VERSION_VAR SDL2_MIXER_VERSION_STRING)
|
||||
|
||||
# for backward compatiblity
|
||||
set(SDL2MIXER_LIBRARY ${SDL2_MIXER_LIBRARIES})
|
||||
set(SDL2MIXER_INCLUDE_DIR ${SDL2_MIXER_INCLUDE_DIRS})
|
||||
set(SDL2MIXER_FOUND ${SDL2_MIXER_FOUND})
|
||||
|
||||
mark_as_advanced(SDL2_MIXER_LIBRARY SDL2_MIXER_INCLUDE_DIR)
|
||||
@@ -1,96 +0,0 @@
|
||||
#.rst:
|
||||
# FindSDL2_ttf
|
||||
# -----------
|
||||
#
|
||||
# Locate SDL2_ttf library
|
||||
#
|
||||
# This module defines:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# SDL2_TTF_LIBRARIES, the name of the library to link against
|
||||
# SDL2_TTF_INCLUDE_DIRS, where to find the headers
|
||||
# SDL2_TTF_FOUND, if false, do not try to link against
|
||||
# SDL2_TTF_VERSION_STRING - human-readable string containing the version of SDL2_ttf
|
||||
#
|
||||
#
|
||||
#
|
||||
# For backward compatiblity the following variables are also set:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# SDL2TTF_LIBRARY (same value as SDL2_TTF_LIBRARIES)
|
||||
# SDL2TTF_INCLUDE_DIR (same value as SDL2_TTF_INCLUDE_DIRS)
|
||||
# SDL2TTF_FOUND (same value as SDL2_TTF_FOUND)
|
||||
#
|
||||
#
|
||||
#
|
||||
# $SDL2DIR is an environment variable that would correspond to the
|
||||
# ./configure --prefix=$SDL2DIR used in building SDL2.
|
||||
#
|
||||
# Created by Eric Wing. This was influenced by the FindSDL2.cmake
|
||||
# module, but with modifications to recognize OS X frameworks and
|
||||
# additional Unix paths (FreeBSD, etc).
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2005-2009 Kitware, Inc.
|
||||
# Copyright 2012 Benjamin Eikel
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
if(NOT SDL2_TTF_INCLUDE_DIR AND SDL2TTF_INCLUDE_DIR)
|
||||
set(SDL2_TTF_INCLUDE_DIR ${SDL2TTF_INCLUDE_DIR} CACHE PATH "directory cache
|
||||
entry initialized from old variable name")
|
||||
endif()
|
||||
find_path(SDL2_TTF_INCLUDE_DIR SDL_ttf.h
|
||||
HINTS
|
||||
ENV SDL2TTFDIR
|
||||
ENV SDL2DIR
|
||||
${CMAKE_SOURCE_DIR}/dep/
|
||||
PATH_SUFFIXES SDL2
|
||||
# path suffixes to search inside ENV{SDL2DIR}
|
||||
include/SDL2 include
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(VC_LIB_PATH_SUFFIX lib/x64)
|
||||
else()
|
||||
set(VC_LIB_PATH_SUFFIX lib/x86)
|
||||
endif()
|
||||
|
||||
if(NOT SDL2_TTF_LIBRARY AND SDL2TTF_LIBRARY)
|
||||
set(SDL2_TTF_LIBRARY ${SDL2TTF_LIBRARY} CACHE FILEPATH "file cache entry
|
||||
initialized from old variable name")
|
||||
endif()
|
||||
find_library(SDL2_TTF_LIBRARY
|
||||
NAMES SDL2_ttf
|
||||
HINTS
|
||||
ENV SDL2TTFDIR
|
||||
ENV SDL2DIR
|
||||
${CMAKE_SOURCE_DIR}/dep/
|
||||
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
|
||||
)
|
||||
|
||||
set(SDL2_TTF_LIBRARIES ${SDL2_TTF_LIBRARY})
|
||||
set(SDL2_TTF_INCLUDE_DIRS ${SDL2_TTF_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_ttf
|
||||
REQUIRED_VARS SDL2_TTF_LIBRARIES SDL2_TTF_INCLUDE_DIRS
|
||||
VERSION_VAR SDL2_TTF_VERSION_STRING)
|
||||
|
||||
# for backward compatiblity
|
||||
set(SDL2TTF_LIBRARY ${SDL2_TTF_LIBRARIES})
|
||||
set(SDL2TTF_INCLUDE_DIR ${SDL2_TTF_INCLUDE_DIRS})
|
||||
set(SDL2TTF_FOUND ${SDL2_TTF_FOUND})
|
||||
|
||||
mark_as_advanced(SDL2_TTF_LIBRARY SDL2_TTF_INCLUDE_DIR)
|
||||
@@ -1,130 +0,0 @@
|
||||
# - Returns a version string from Git
|
||||
#
|
||||
# These functions force a re-configure on each git commit so that you can
|
||||
# trust the values of the variables in your build system.
|
||||
#
|
||||
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the refspec and sha hash of the current head revision
|
||||
#
|
||||
# git_describe(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe on the source tree, and adjusting
|
||||
# the output so that it tests false if an error occurs.
|
||||
#
|
||||
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe --exact-match on the source tree,
|
||||
# and adjusting the output so that it tests false if there was no exact
|
||||
# matching tag.
|
||||
#
|
||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
#
|
||||
# Copyright Iowa State University 2009-2010.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
if(__get_git_revision_description)
|
||||
return()
|
||||
endif()
|
||||
set(__get_git_revision_description YES)
|
||||
|
||||
# We must run the following at "include" time, not at function call time,
|
||||
# to find the path to this module rather than the path to a calling list file
|
||||
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||
|
||||
function(get_git_head_revision _refspecvar _hashvar)
|
||||
set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
||||
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
|
||||
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
|
||||
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
|
||||
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
|
||||
# We have reached the root directory, we are not in git
|
||||
set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
|
||||
set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
||||
endwhile()
|
||||
# check if this is a submodule
|
||||
if(NOT IS_DIRECTORY ${GIT_DIR})
|
||||
file(READ ${GIT_DIR} submodule)
|
||||
string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
|
||||
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
|
||||
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
|
||||
endif()
|
||||
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
|
||||
if(NOT EXISTS "${GIT_DATA}")
|
||||
file(MAKE_DIRECTORY "${GIT_DATA}")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${GIT_DIR}/HEAD")
|
||||
return()
|
||||
endif()
|
||||
set(HEAD_FILE "${GIT_DATA}/HEAD")
|
||||
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
|
||||
|
||||
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
|
||||
"${GIT_DATA}/grabRef.cmake"
|
||||
@ONLY)
|
||||
include("${GIT_DATA}/grabRef.cmake")
|
||||
|
||||
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
|
||||
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_describe _var)
|
||||
if(NOT GIT_FOUND)
|
||||
find_package(Git QUIET)
|
||||
endif()
|
||||
get_git_head_revision(refspec hash)
|
||||
if(NOT GIT_FOUND)
|
||||
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
if(NOT hash)
|
||||
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# TODO sanitize
|
||||
#if((${ARGN}" MATCHES "&&") OR
|
||||
# (ARGN MATCHES "||") OR
|
||||
# (ARGN MATCHES "\\;"))
|
||||
# message("Please report the following error to the project!")
|
||||
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
|
||||
#endif()
|
||||
|
||||
#message(STATUS "Arguments to execute_process: ${ARGN}")
|
||||
|
||||
execute_process(COMMAND
|
||||
"${GIT_EXECUTABLE}"
|
||||
describe
|
||||
${hash}
|
||||
${ARGN}
|
||||
WORKING_DIRECTORY
|
||||
"${CMAKE_SOURCE_DIR}"
|
||||
RESULT_VARIABLE
|
||||
res
|
||||
OUTPUT_VARIABLE
|
||||
out
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT res EQUAL 0)
|
||||
set(out "${out}-${res}-NOTFOUND")
|
||||
endif()
|
||||
|
||||
set(${_var} "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_get_exact_tag _var)
|
||||
git_describe(out --exact-match ${ARGN})
|
||||
set(${_var} "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
@@ -1,41 +0,0 @@
|
||||
#
|
||||
# Internal file for GetGitRevisionDescription.cmake
|
||||
#
|
||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
#
|
||||
# Copyright Iowa State University 2009-2010.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
set(HEAD_HASH)
|
||||
|
||||
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
|
||||
|
||||
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
|
||||
if(HEAD_CONTENTS MATCHES "ref")
|
||||
# named branch
|
||||
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
||||
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
|
||||
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
else()
|
||||
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
|
||||
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
|
||||
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
|
||||
set(HEAD_HASH "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
# detached HEAD
|
||||
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
endif()
|
||||
|
||||
if(NOT HEAD_HASH)
|
||||
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
|
||||
string(STRIP "${HEAD_HASH}" HEAD_HASH)
|
||||
endif()
|
||||
@@ -1,25 +0,0 @@
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
1. Assume other participants are posting in good faith, even if you disagree with what they say.
|
||||
2. Make an effort to treat other participants with respect.
|
||||
1. Do not take a harsh tone towards other participants, and especially don't make personal attacks against them.
|
||||
2. Recognize that criticism of your statements is not a personal attack on you.
|
||||
3. Avoid statements about the presumed typical desires, capabilities or actions of some demographic group.
|
||||
3. Be especially kind to other contributors when saying they made a mistake.
|
||||
4. Don't argue unceasingly for your preferred course of action when a decision for some other course has already been made.
|
||||
5. If other participants complain about the way you express your ideas, please make an effort to cater to them.
|
||||
6. Don't raise unrelated political issues.
|
||||
7. If you feel these standards are being violated, please alert the project lead Kevin Granade at kevin.granade@gmail.com
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][CoC homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][CoC version] and the [GNU Kind Communications Guidelines][GKCG homepage].
|
||||
|
||||
|
||||
[CoC homepage]: http://contributor-covenant.org
|
||||
[CoC version]: http://contributor-covenant.org/version/1/4/
|
||||
[GKCG homepage]: https://www.gnu.org/philosophy/kind-communication.html
|
||||
@@ -1,357 +0,0 @@
|
||||
#Disclaimer
|
||||
|
||||
**WARNING**: CMake build is **NOT** official and should be used for *dev purposes ONLY*.
|
||||
|
||||
For official way to build CataclysmDDA See:
|
||||
* The latest instructions on how to compile can be found on [our wiki](http://tools.cataclysmdda.com/wiki).
|
||||
* [COMPILING.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/COMPILING.md)
|
||||
|
||||
|
||||
#Contents
|
||||
|
||||
1. Prerequisites
|
||||
2. Build Environment
|
||||
* UNIX Environment
|
||||
* Windows Environment
|
||||
3. CMake Build
|
||||
* MinGW,MSYS,MSYS2
|
||||
5. Build Options
|
||||
* CMake specific options
|
||||
* CataclysmDDA specific options
|
||||
|
||||
#1. Prerequisites
|
||||
|
||||
You'll need to have these libraries and their development headers installed in
|
||||
order to build CataclysmDDA:
|
||||
|
||||
* General
|
||||
* `cmake` >= 3.0.0
|
||||
* `gcc-libs`
|
||||
* `glibc`
|
||||
* `zlib`
|
||||
* `bzip2`
|
||||
* Optional
|
||||
* `lua51`
|
||||
* `gettext`
|
||||
* Curses
|
||||
* `ncurses`
|
||||
* Tiles
|
||||
* `SDL` >= 2.0.0
|
||||
* `SDL_image` >= 2.0.0 (with PNG and JPEG support)
|
||||
* `SDL_mixer` >= 2.0.0 (with Ogg Vorbis support)
|
||||
* `SDL_ttf` >= 2.0.0
|
||||
* `freetype`
|
||||
* Sound
|
||||
* `vorbis`
|
||||
* `libbz2`
|
||||
* `libz`
|
||||
* `libintl`
|
||||
* `iconv`
|
||||
|
||||
|
||||
#2. Build Environment
|
||||
|
||||
You can obtain the source code tarball for the latest version from [git](https://github.com/CleverRaven/Cataclysm-DDA).
|
||||
|
||||
|
||||
## UNIX Environment
|
||||
|
||||
Obtain packages specified above with your system package manager.
|
||||
|
||||
|
||||
## Windows Environment (MSYS2)
|
||||
|
||||
1. Follow steps from here: https://msys2.github.io/
|
||||
2. Install CataclysmDDA build deps:
|
||||
|
||||
```
|
||||
pacman -S mingw-w64-i686-toolchain msys/git \
|
||||
mingw-w64-i686-cmake \
|
||||
mingw-w64-i686-SDL2_{image,mixer,ttf} \
|
||||
mingw-w64-i686-lua51 \
|
||||
ncurses-devel \
|
||||
gettext-devel
|
||||
```
|
||||
|
||||
This should get your environment set up to build console and tiles version of windows.
|
||||
|
||||
**NOTE**: This is only for 32bit builds. 64bit requires the x86_64 instead of the i686
|
||||
packages listed above:
|
||||
|
||||
```
|
||||
pacman -S mingw-w64-x86_64-toolchain msys/git \
|
||||
mingw-w64-x86_64-cmake \
|
||||
mingw-w64-x86_64-SDL2_{image,mixer,ttf} \
|
||||
mingw-w64-x86_64-lua51 \
|
||||
ncurses-devel \
|
||||
gettext-devel
|
||||
```
|
||||
|
||||
**NOTE**: If you're trying to test with Jetbrains CLion, point to the cmake version in the
|
||||
msys32/mingw32 path instead of using the built in. This will let cmake detect the
|
||||
installed packages.
|
||||
|
||||
|
||||
# CMake Build
|
||||
|
||||
CMake has separate configuration and build steps. Configuration
|
||||
is done using CMake itself, and the actual build is done using either `make`
|
||||
(for Makefiles generator) or build-system agnostic `cmake --build . ` .
|
||||
|
||||
There are two ways to build CataclysmDDA with CMake: inside the source tree or
|
||||
outside of it. Out-of-source builds have the advantage that you can have
|
||||
multiple builds with different options from one source directory.
|
||||
|
||||
**WARNING**: Inside the source tree build is **NOT** supported.
|
||||
|
||||
To build CataclysmDDA out of source:
|
||||
|
||||
```
|
||||
$ mkdir build && cd build
|
||||
$ cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
$ make
|
||||
```
|
||||
|
||||
The above example creates a build directory inside the source directory, but that's not required - you can just as easily create it in a completely different location.
|
||||
|
||||
To install CataclysmDDA after building (as root using su or sudo if necessary):
|
||||
|
||||
```
|
||||
# make install
|
||||
```
|
||||
|
||||
To change build options, you can either pass the options on the command line:
|
||||
|
||||
```
|
||||
$ cmake .. -DOPTION_NAME=option_value
|
||||
```
|
||||
|
||||
Or use either the `ccmake` or `cmake-gui` front-ends, which display all options
|
||||
and their cached values on a console and graphical UI, respectively.
|
||||
|
||||
```
|
||||
$ ccmake ..
|
||||
$ cmake-gui ..
|
||||
```
|
||||
|
||||
|
||||
## CMake Build for MSYS2 (MinGW)
|
||||
|
||||
**NOTE**: For development purposes it is preferred to use `MinGW Win64 Shell` or `MinGW Win32 Shell` instead of `MSYS2 Shell`. In other case, you will need to set `PATH` variable manually.
|
||||
|
||||
For Mingw,MSYS,MSYS2 you should set [Makefiles generator](https://cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html) to "MSYS Makefiles".
|
||||
Setting it to "MinGW Makefiles" might work as well, but might also require additional hackery.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
$ cd <Path-to-CataclysmDDA-Sources>
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake .. -G "MSYS Makefiles"
|
||||
$ make # or $ cmake --build .
|
||||
```
|
||||
|
||||
The resulting binary will be placed inside the source code directory.
|
||||
|
||||
Shared libraries:
|
||||
|
||||
If you got `libgcc_s_dw2-1.dll not found` error you need to copy shared libraries
|
||||
to directory with CataclysmDDA executables.
|
||||
|
||||
**NOTE**: For `-DRELEASE=OFF` development builds, You can automate copy process with:
|
||||
|
||||
```
|
||||
$ make install
|
||||
```
|
||||
|
||||
However, it likely will fail b/c you have different build environment setup :)
|
||||
|
||||
Currently known depends (Maybe outdated use ldd.exe to correct it for Your system)
|
||||
|
||||
* MINGW deps:
|
||||
* `libwinpthread-1.dll`
|
||||
* `libgcc_s_dw2-1.dll`
|
||||
* `libstdc++-6.dll`
|
||||
|
||||
* LOCALIZE deps:
|
||||
* `libintl-8.dll`
|
||||
* `libiconv-2.dll`
|
||||
|
||||
* LUA deps:
|
||||
* `lua51.dll`
|
||||
|
||||
* TILES deps:
|
||||
* `SDL2.dll`
|
||||
* `SDL2_ttf.dll`
|
||||
* `libfreetype-6.dll`
|
||||
* `libbz2-1.dll`
|
||||
* `libharfbuzz-0.dll`
|
||||
* `SDL2_image.dll`
|
||||
* `libpng16-16.dll`
|
||||
* `libjpeg-8.dll`
|
||||
* `libtiff-5.dll`
|
||||
* `libjbig-0.dll`
|
||||
* `liblzma-5.dll`
|
||||
* `libwebp-5.dll`
|
||||
* `zlib1.dll`
|
||||
* `libglib-2.0-0.dll`
|
||||
|
||||
* SOUND deps:
|
||||
* `SDL2_mixer.dll`
|
||||
* `libFLAC-8.dll`
|
||||
* `libogg-0.dll`
|
||||
* `libfluidsynth-1.dll`
|
||||
* `libportaudio-2.dll`
|
||||
* `libsndfile-1.dll`
|
||||
* `libvorbis-0.dll`
|
||||
* `libvorbisenc-2.dll`
|
||||
* `libmodplug-1.dll`
|
||||
* `smpeg2.dll`
|
||||
* `libvorbisfile-3.dll`
|
||||
|
||||
|
||||
## CMake Build for Visual Studio / MSBuild
|
||||
|
||||
CMake can generate `.sln` and `.vcxproj` files used either by Visual Studio itself or by MSBuild command line compiler (if you don't want
|
||||
a full fledged IDE) and have more "native" binaries than what MSYS/Cygwin can provide.
|
||||
|
||||
At the moment only a limited combination of options is supported (tiles only, no lua, no localizations, no backtrace).
|
||||
|
||||
Get the tools:
|
||||
* CMake from the official site - https://cmake.org/download/.
|
||||
* Microsoft compiler - https://visualstudio.microsoft.com/downloads/?q=build+tools , choose "Build Tools for Visual Studio 2017". When installing chose "Visual C++ Build Tools" options.
|
||||
* alternatively, you can get download and install the complete Visual Studio, but that's not required.
|
||||
|
||||
Get the required libraries:
|
||||
* `SDL2` - https://www.libsdl.org/download-2.0.php (you need the "(Visual C++ 32/64-bit)" version. Same below)
|
||||
* `SDL2_ttf` - https://www.libsdl.org/projects/SDL_ttf/
|
||||
* `SDL2_image` - https://www.libsdl.org/projects/SDL_image/
|
||||
* `SDL2_mixer` (optional, for sound support) - https://www.libsdl.org/projects/SDL_mixer/
|
||||
* Unsupported (and unused in the following instructions) optional libs:
|
||||
* `Lua` - http://luabinaries.sourceforge.net/
|
||||
* `gettext`/`libintl` - http://gnuwin32.sourceforge.net/packages/gettext.htm
|
||||
* `ncurses` - ???
|
||||
|
||||
Unpack the archives with the libraries.
|
||||
|
||||
Open windows command line (or powershell), set the environment variables to point to the libs above as follows (adjusting the paths as appropriate):
|
||||
```
|
||||
> set SDL2DIR=C:\path\to\SDL2-devel-2.0.9-VC
|
||||
> set SDL2TTFDIR=C:\path\to\SDL2_ttf-devel-2.0.15-VC
|
||||
> set SDL2IMAGEDIR=C:\path\to\SDL2_image-devel-2.0.4-VC
|
||||
> set SDL2MIXERDIR=C:\path\to\SDL2_mixer-devel-2.0.4-VC
|
||||
```
|
||||
(for powershell the syntax is `$env:SDL2DIR="C:\path\to\SDL2-devel-2.0.9-VC"`).
|
||||
|
||||
Make a build directory and run cmake configuration step
|
||||
```
|
||||
> cd <path to cdda sources>
|
||||
> mkdir build
|
||||
> cd build
|
||||
> cmake .. -DTILES=ON -DLOCALIZE=OFF -DBACKTRACE=OFF -DSOUND=ON
|
||||
```
|
||||
|
||||
|
||||
Build!
|
||||
```
|
||||
> cmake --build . -j 2 -- /p:Configuration=Release
|
||||
```
|
||||
The `-j 2` flag controls build parallelism - you can omit it if you wish. The `/p:Configuration=Release` flag is passed directly to MSBuild and
|
||||
controls optimizations. If you omit it, the `Debug` configuration would be built instead. For powershell you'll need to have an extra ` -- ` after the first one.
|
||||
|
||||
The resulting files will be put into a `Release` directory inside your source Cataclysm-DDA folder. To make them run you'd need to first move them to the
|
||||
source Cataclysm-DDA directory itself (so that the binary has access to the game data), and second put the required `.dll`s into the same folder -
|
||||
you can find those inside the directories for dev libraries under `lib/x86/` or `lib/x64/` (you likely need the `x86` ones even if you're on 64-bit machine).
|
||||
|
||||
The copying of dlls is a one-time task, but you'd need to move the binary out of `Release/` each time it's built. To automate it a bit, you can configure cmake and set the desired binaries destination directory with `-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=` option (and similar for `CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG`).
|
||||
|
||||
Run the game. Should work.
|
||||
|
||||
|
||||
# Build Options
|
||||
|
||||
A full list of options supported by CMake, you may either run the `ccmake`
|
||||
or `cmake-gui` front-ends, or run `cmake` and open the generated CMakeCache.txt
|
||||
from the build directory in a text editor.
|
||||
|
||||
```
|
||||
$ cmake -DOPTION_NAME1=option_value1 [-DOPTION_NAME2=option_value2 [...]]
|
||||
```
|
||||
|
||||
|
||||
## CMake specific options
|
||||
|
||||
* CMAKE_BUILD_TYPE=`<build type>`
|
||||
|
||||
Selects a specific build configuration when compiling. `release` produces
|
||||
the default, optimized (-Os) build for regular use. `debug` produces a
|
||||
slower and larger unoptimized (-O0) build with full debug symbols, which is
|
||||
often needed for obtaining detailed backtraces when reporting bugs.
|
||||
|
||||
**NOTE**: By default, CMake will produce `debug` builds unless a different
|
||||
configuration option is passed in the command line.
|
||||
|
||||
|
||||
* CMAKE_INSTALL_PREFIX=`<full path>`
|
||||
|
||||
Installation prefix for binaries, resources, and documentation files.
|
||||
|
||||
|
||||
## CataclysmDDA specific options
|
||||
|
||||
* CURSES=`<boolean>`
|
||||
|
||||
Build curses version.
|
||||
|
||||
|
||||
* TILES=`<boolean>`
|
||||
|
||||
Build graphical tileset version.
|
||||
|
||||
|
||||
* SOUND=`<boolean>`
|
||||
|
||||
Support for in-game sounds & music.
|
||||
|
||||
|
||||
* LUA=`<boolean>`
|
||||
|
||||
This enables Lua support. Needed only for full-fledged mods.
|
||||
|
||||
|
||||
* USE_HOME_DIR=`<boolean>`
|
||||
|
||||
Use user's home directory for save files.
|
||||
|
||||
|
||||
* LOCALIZE=`<boolean>`
|
||||
|
||||
Support for language localizations. Also enable UTF support.
|
||||
|
||||
|
||||
* DYNAMIC_LINKING=`<boolean>`
|
||||
|
||||
Use dynamic linking. Or use static to remove MinGW dependency instead.
|
||||
|
||||
|
||||
* LANGUAGES=`<str>`
|
||||
|
||||
Compile localization files for specified languages. Example:
|
||||
```
|
||||
-DLANGUAGES="cs;de;el;es_AR;es_ES"
|
||||
```
|
||||
|
||||
* LUA_BINARY=`<str>`
|
||||
|
||||
Override default Lua binary name or path. You can try to use `luajit` for extra speed.
|
||||
|
||||
|
||||
* GIT_BINARY=`<str>`
|
||||
|
||||
Override default Git binary name or path.
|
||||
|
||||
So a CMake command for building Cataclysm-DDA in release mode with tiles, sound and lua support will look as follows, provided it is run in build directory located in the project.
|
||||
```
|
||||
cmake ../ -DCMAKE_BUILD_TYPE=Release -DTILES=ON -DSOUND=ON -DLUA=ON
|
||||
```
|
||||
@@ -1,104 +0,0 @@
|
||||
# Compilation guide for 64 bit Windows (using MSYS2)
|
||||
|
||||
This guide contains steps required to allow compilation of Cataclysm-DDA on Windows under MSYS2.
|
||||
|
||||
Steps from current guide were tested on Windows 10 (64 bit) and MSYS2 (64 bit), but should work for other versions of Windows and also MSYS2 (32 bit) if you download 32 bit version of all files.
|
||||
|
||||
## Prerequisites:
|
||||
|
||||
* Computer with 64 bit version of modern Windows operating system installed (Windows 10, Windows 8.1 or Windows 7);
|
||||
* NTFS partition with ~10 Gb free space (~2 Gb for MSYS2 installation, ~3 Gb for repository and ~5 Gb for ccache);
|
||||
* 64 bit version of MSYS2 (installer can be downloaded from [MSYS2 homepage](http://www.msys2.org/));
|
||||
|
||||
**Note:** Windows XP is unsupported!
|
||||
|
||||
## Installation:
|
||||
|
||||
1. Go to [MSYS2 homepage](http://www.msys2.org/) and download 64 bit installer (e.g. [msys2-x86_64-20180531.exe](http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20180531.exe)).
|
||||
|
||||
2. Run downloaded file and install MSYS2 (click `Next` button, specify directory where MSYS2 64 bit will be installed (e.g. `C:\msys64`), click `Next` button again, specify Start Menu folder name and click `Install` button).
|
||||
|
||||
3. After MSYS2 installation is complete press `Next` button, tick `Run MSYS2 64 bit now` checkbox and press `Finish` button.
|
||||
|
||||
## Configuration:
|
||||
|
||||
1. Update the package database and core system packages with:
|
||||
|
||||
```bash
|
||||
pacman -Syu
|
||||
```
|
||||
|
||||
2. If asked close MSYS2 window and restart it from Start Menu or `C:\msys64\msys2_shell.cmd`.
|
||||
|
||||
3. Update remaining packages with:
|
||||
|
||||
```bash
|
||||
pacman -Su
|
||||
```
|
||||
|
||||
4. Install packages required for compilation with:
|
||||
|
||||
```bash
|
||||
pacman -S git git-extras-git make mingw-w64-x86_64-{astyle,ccache,gcc,libmad,libwebp,lua,ncurses,pkg-config,SDL2} mingw-w64-x86_64-SDL2_{image,mixer,ttf}
|
||||
```
|
||||
|
||||
5. Update paths in system-wide profile file (e.g. `C:\msys64\etc\profile`) as following:
|
||||
|
||||
- find lines:
|
||||
|
||||
```
|
||||
MSYS2_PATH="/usr/local/bin:/usr/bin:/bin"
|
||||
MANPATH='/usr/local/man:/usr/share/man:/usr/man:/share/man'
|
||||
INFOPATH='/usr/local/info:/usr/share/info:/usr/info:/share/info'
|
||||
```
|
||||
|
||||
and
|
||||
|
||||
```
|
||||
PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig"
|
||||
```
|
||||
|
||||
- and replace them with:
|
||||
|
||||
```
|
||||
MSYS2_PATH="/usr/local/bin:/usr/bin:/bin:/mingw64/bin"
|
||||
MANPATH='/usr/local/man:/usr/share/man:/usr/man:/share/man:/mingw64/share/man'
|
||||
INFOPATH='/usr/local/info:/usr/share/info:/usr/info:/share/info:/mingw64/share/man'
|
||||
```
|
||||
|
||||
and
|
||||
|
||||
```
|
||||
PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig:/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig"
|
||||
```
|
||||
|
||||
6. Restart MSYS2 to apply path changes.
|
||||
|
||||
## Cloning and compilation:
|
||||
|
||||
1. Clone Cataclysm-DDA repository with following command line:
|
||||
|
||||
**Note:** This will download whole CDDA repository. If you're just testing you should probably add `--depth=1`.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/CleverRaven/Cataclysm-DDA.git
|
||||
cd Cataclysm-DDA
|
||||
```
|
||||
|
||||
2. Compile with following command line:
|
||||
|
||||
```bash
|
||||
make CCACHE=1 RELEASE=1 MSYS2=1 DYNAMIC_LINKING=1 LUA=1 SDL=1 TILES=1 SOUND=1 LOCALIZE=1 LANGUAGES=all LINTJSON=0 ASTYLE=0 RUNTESTS=0
|
||||
```
|
||||
|
||||
**Note**: This will compile release version with Lua, Sound and Tiles support and all localization languages, skipping checks and tests and using ccache for faster build. You can use other switches, but `MSYS2=1`, `DYNAMIC_LINKING=1` and probably `RELEASE=1` are required to compile without issues.
|
||||
|
||||
## Running:
|
||||
|
||||
1. Run from within MSYS2 with following command line:
|
||||
|
||||
```bash
|
||||
./cataclysm-tiles
|
||||
```
|
||||
|
||||
**Note:** If you want to run compiled executable from Explorer you will also need to update user or system`PATH` variable with path to MSYS2 runtime binaries (e.g. `C:\msys64\mingw64\bin`).
|
||||
@@ -1,78 +0,0 @@
|
||||
# Compilation guide for Windows (using Visual Studio and vcpkg)
|
||||
|
||||
This guide contains steps required to allow compilation of Cataclysm-DDA on Windows using Visual Studio and vcpkg.
|
||||
|
||||
Steps from current guide were tested on Windows 10 (64 bit), Visual Studio 2017 (64 bit) and vcpkg, but should as well work with slight modifications for other versions of Windows and Visual Studio.
|
||||
|
||||
## Prerequisites:
|
||||
|
||||
* Computer with modern Windows operating system installed (Windows 10, Windows 8.1 or Windows 7);
|
||||
* NTFS partition with ~15 Gb free space (~10 Gb for Visual Studio, ~1 Gb for vcpkg installation, ~3 Gb for repository and ~1 Gb for build cache);
|
||||
* Git for Windows (installer can be downloaded from [Git homepage](https://git-scm.com/));
|
||||
* Visual Studio 2017 (or 2015 Visual Studio Update 3 and above);
|
||||
* Latest version of vcpkg (see instructions on [vcpkg homepage](https://github.com/Microsoft/vcpkg)).
|
||||
|
||||
**Note:** Windows XP is unsupported!
|
||||
|
||||
## Installation and configuration:
|
||||
|
||||
1. Install `Visual Studio` (installer can be downloaded from [Visual Studio homepage](https://visualstudio.microsoft.com/)).
|
||||
|
||||
2. Install `Git for Windows` (installer can be downloaded from [Git homepage](https://git-scm.com/)).
|
||||
|
||||
3. Install and configure `vcpkg` using instruction from [vcpkg homepage](https://github.com/Microsoft/vcpkg/blob/master/README.md#quick-start) with following command line:
|
||||
|
||||
```cmd
|
||||
git clone https://github.com/Microsoft/vcpkg.git
|
||||
cd vcpkg
|
||||
.\bootstrap-vcpkg.bat
|
||||
vcpkg integrate install
|
||||
```
|
||||
|
||||
4. Install (or upgrade) neccessary packages with following command line:
|
||||
|
||||
#### install 64 bit dependencies:
|
||||
|
||||
```cmd
|
||||
vcpkg --triplet x64-windows install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext lua
|
||||
```
|
||||
|
||||
or (if you want to build statically linked executable)
|
||||
|
||||
```cmd
|
||||
vcpkg --triplet x64-windows-static install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext lua
|
||||
```
|
||||
|
||||
|
||||
#### install32 bit dependencies:
|
||||
|
||||
```cmd
|
||||
vcpkg --triplet x86-windows install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext lua
|
||||
```
|
||||
|
||||
or (if you want to build statically linked executable)
|
||||
|
||||
```cmd
|
||||
vcpkg --triplet x86-windows-static install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext lua
|
||||
```
|
||||
|
||||
#### upgrade all dependencies:
|
||||
|
||||
```cmd
|
||||
vcpkg upgrade
|
||||
```
|
||||
|
||||
## Cloning and compilation:
|
||||
|
||||
1. Clone Cataclysm-DDA repository with following command line:
|
||||
|
||||
**Note:** This will download whole CDDA repository. If you're just testing you should probably add `--depth=1`.
|
||||
|
||||
```cmd
|
||||
git clone https://github.com/CleverRaven/Cataclysm-DDA.git
|
||||
cd Cataclysm-DDA
|
||||
```
|
||||
|
||||
2. Open one of provided solutions (`msvc-full-features\Cataclysm-vcpkg.sln` for dynamically linked executable or `msvc-full-features\Cataclysm-vcpkg-static.sln` for statically linked executable) in `Visual Studio`, select configuration (`Release` or `Debug`) an platform (`x64` or `x86`) and build it.
|
||||
|
||||
**Note**: This will compile release version with Lua, Sound, Tiles and Localization support (language files won't be automatically compiled).
|
||||
@@ -1,797 +0,0 @@
|
||||
* [General Linux Guide](#general-linux-guide)
|
||||
* [Compiler](#compiler)
|
||||
* [Tools](#tools)
|
||||
* [Dependencies](#dependencies)
|
||||
* [Make flags](#make-flags)
|
||||
* [Debian](#debian)
|
||||
* [Linux (native) ncurses builds](#linux-native-ncurses-builds)
|
||||
* [Linux (native) SDL builds](#linux-native-sdl-builds)
|
||||
* [Cross-compiling to linux 32-bit from linux 64-bit](#cross-compiling-to-linux-32-bit-from-linux-64-bit)
|
||||
* [Cross-compile to Windows from Linux](#cross-compile-to-windows-from-linux)
|
||||
* [Cross-compile to Mac OS X from Linux](#cross-compile-to-mac-os-x-from-linux)
|
||||
* [Cross-compile to Android from Linux](#cross-compile-to-android-from-linux)
|
||||
* [Mac OS X](#mac-os-x)
|
||||
* [Simple build using Homebrew](#simple-build-using-homebrew)
|
||||
* [Advanced info for Developers](#advanced-info-for-developers)
|
||||
* [Troubleshooting](#troubleshooting)
|
||||
* [Windows](#windows)
|
||||
* [Visual Studio Guide](#visual-studio-guide)
|
||||
* [MinGW Guide](#mingw-guide)
|
||||
* [Rough guide to building with only MSYS2](#rough-guide-to-building-with-only-msys2)
|
||||
* [BSDs](#bsds)
|
||||
|
||||
# General Linux Guide
|
||||
|
||||
To build Cataclysm from source you will need at least a C++ compiler, some basic developer tools, and necessary build dependencies. The exact package names vary greatly from distro to distro, so this part of the guide is intended to give you higher-level understanding of the process.
|
||||
|
||||
## Compiler
|
||||
|
||||
You have three major choices here: GCC, Clang and MXE.
|
||||
|
||||
* GCC is almost always the default on Linux systems so it's likely you already have it
|
||||
* Clang is usually faster than GCC, so it's worth installing if you plan to keep up with the latest experimentals
|
||||
* MXE is a cross-compiler, so of any importance only if you plan to compile for Windows on your Linux machine
|
||||
|
||||
(Note that your distro may have separate packages e.g. `gcc` only includes the C compiler and for C++ you'll need to install `g++`.)
|
||||
|
||||
Cataclysm is targeting C++11 standard and that means you'll need a compiler that supports it. You can easily check if your version of `g++` supports C++11 by running:
|
||||
|
||||
$ g++ --std=c++11
|
||||
g++: fatal error: no input files
|
||||
compilation terminated.
|
||||
|
||||
If you get a line like:
|
||||
|
||||
g++: error: unrecognized command line option ‘--std=c++11’
|
||||
|
||||
This means you'll need a newer version of GCC (`g++`).
|
||||
|
||||
The general rule is the newer the compiler the better.
|
||||
|
||||
## Tools
|
||||
|
||||
Most distros seem to package essential build tools as either a single package (Debian and derivatives have `build-essential`) or a package group (Arch has `base-devel`). You should use the above if available. Otherwise you'll at least need `make` and figure out the missing dependencies as you go (if any).
|
||||
|
||||
Besides the essentials you will need `git`.
|
||||
|
||||
If you plan on keeping up with experimentals you should also install `ccache`, which will considerably speed-up partial builds.
|
||||
|
||||
## Dependencies
|
||||
|
||||
There are some general dependencies, optional dependencies and then specific dependencies for either curses or tiles builds. The exact package names again depend on the distro you're using, and whether your distro packages libraries and their development files separately (e.g. Debian and derivatives).
|
||||
|
||||
Rough list based on building on Arch:
|
||||
|
||||
* General: `gcc-libs`, `glibc`, `zlib`, `bzip2`
|
||||
* Optional: `lua51`, `gettext`
|
||||
* Curses: `ncurses`
|
||||
* Tiles: `sdl2`, `sdl2_image`, `sdl2_ttf`, `sdl2_mixer`, `freetype2`
|
||||
|
||||
E.g. for curses build on Debian and derivatives you'll also need `libncurses5-dev` or `libncursesw5-dev`.
|
||||
|
||||
Note on optional dependencies:
|
||||
|
||||
* `gettext` - for localization support; if you plan to only use English you can skip it
|
||||
* `lua` - for full-fledged mods; you'll probably prefer to have it
|
||||
|
||||
You should be able to figure out what you are missing by reading the compilation errors and/or the output of `ldd` for compiled binaries.
|
||||
|
||||
## Make flags
|
||||
|
||||
Given you're building from source you have a number of choices to make:
|
||||
|
||||
* `NATIVE=` - you should only care about this if you're cross-compiling
|
||||
* `RELEASE=1` - without this you'll get a debug build (see note below)
|
||||
* `LTO=1` - enables link-time optimization with GCC/Clang
|
||||
* `TILES=1` - with this you'll get the tiles version, without it the curses version
|
||||
* `SOUND=1` - if you want sound; this requires `TILES=1`
|
||||
* `LOCALIZE=0` - this disables localizations so `gettext` is not needed
|
||||
* `LUA=1` - this enables Lua support; needed only for full-fledged mods
|
||||
* `CLANG=1` - use Clang instead of GCC
|
||||
* `CCACHE=1` - use ccache
|
||||
* `USE_LIBCXX=1` - use libc++ instead of libstdc++ with Clang (default on OS X)
|
||||
|
||||
There is a couple of other possible options - feel free to read the `Makefile`.
|
||||
|
||||
If you have a multi-core computer you'd probably want to add `-jX` to the options, where `X` should roughly be twice the number of cores you have available.
|
||||
|
||||
Example: `make -j4 CLANG=1 CCACHE=1 NATIVE=linux64 RELEASE=1 TILES=1`
|
||||
|
||||
The above will build a tiles release explicitly for 64 bit Linux, using Clang and ccache and 4 parallel processes.
|
||||
|
||||
Example: `make -j2 LOCALIZE=0`
|
||||
|
||||
The above will build a debug-enabled curses version for the architecture you are using, using GCC and 2 parallel processes.
|
||||
|
||||
**Note on debug**:
|
||||
You should probably always build with `RELEASE=1` unless you experience segfaults and are willing to provide stack traces.
|
||||
|
||||
# Debian
|
||||
|
||||
Instructions for compiling on a Debian-based system. The package names here are valid for Ubuntu 12.10 and may or may not work on your system.
|
||||
|
||||
Building instructions, below, always assume you are running them from the Cataclysm:DDA source directory.
|
||||
|
||||
## Linux (native) ncurses builds
|
||||
|
||||
Dependencies:
|
||||
|
||||
* ncurses or ncursesw (for multi-byte locales)
|
||||
* build essentials
|
||||
|
||||
Install:
|
||||
|
||||
sudo apt-get install libncurses5-dev libncursesw5-dev build-essential astyle
|
||||
|
||||
### Building
|
||||
|
||||
Run:
|
||||
|
||||
make
|
||||
|
||||
## Linux (native) SDL builds
|
||||
|
||||
Dependencies:
|
||||
|
||||
* SDL
|
||||
* SDL_ttf
|
||||
* freetype
|
||||
* build essentials
|
||||
* lua5.2 and liblua5.2 - Only necessary if compiling with lua, which some mods like stats through skills use. Versions 5.1, 5.2 and 5.3 are supported.
|
||||
* libsdl2-mixer-dev - Used if compiling with sound support.
|
||||
|
||||
Install:
|
||||
|
||||
sudo apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev build-essential lua5.2 liblua5.2-dev
|
||||
|
||||
### Building
|
||||
|
||||
A simple installation could be done by simply running:
|
||||
|
||||
make TILES=1
|
||||
|
||||
A more comprehensive alternative is:
|
||||
|
||||
make -j2 TILES=1 SOUND=1 RELEASE=1 LUA=1 USE_HOME_DIR=1
|
||||
|
||||
The -j2 flag means it will compile with two parallel processes. It can be omitted or changed to -j4 in a more modern processor. If there is no desire to use lua, or have sound, those flags can also be omitted. The USE_HOME_DIR flag places the user files, like configurations and saves into the home folder, making It easier for backups, and can also be omitted.
|
||||
|
||||
|
||||
|
||||
## Cross-compiling to linux 32-bit from linux 64-bit
|
||||
|
||||
Dependencies:
|
||||
|
||||
* 32-bit toolchain
|
||||
* 32-bit ncursesw (compatible with both multi-byte and 8-bit locales)
|
||||
|
||||
Install:
|
||||
|
||||
sudo apt-get install libc6-dev-i386 lib32stdc++-dev g++-multilib lib32ncursesw5-dev
|
||||
|
||||
### Building
|
||||
|
||||
Run:
|
||||
|
||||
make NATIVE=linux32
|
||||
|
||||
## Cross-compile to Windows from Linux
|
||||
|
||||
To cross-compile to Windows from Linux, you will need MXE. The main difference between the native build process and this one, is the use of the CROSS flag for make. The other make flags are still applicable.
|
||||
|
||||
* `CROSS=` - should be the full path to MXE g++ without the *g++* part at the end
|
||||
|
||||
Dependencies:
|
||||
|
||||
* [MXE](http://mxe.cc)
|
||||
* [MXE Requirements](http://mxe.cc/#requirements)
|
||||
|
||||
Install:
|
||||
|
||||
sudo apt-get install autoconf automake autopoint bash bison bzip2 cmake flex gettext git g++ gperf intltool libffi-dev libgdk-pixbuf2.0-dev libtool libltdl-dev libssl-dev libxml-parser-perl make openssl p7zip-full patch perl pkg-config python ruby scons sed unzip wget xz-utils g++-multilib libc6-dev-i386 libtool-bin
|
||||
mkdir -p ~/src/mxe
|
||||
git clone https://github.com/mxe/mxe.git ~/src/mxe
|
||||
cd ~/src/mxe
|
||||
make MXE_TARGETS='x86_64-w64-mingw32.static i686-w64-mingw32.static' sdl2 sdl2_ttf sdl2_image sdl2_mixer gettext lua ncurses
|
||||
|
||||
If you are not on a Debian derivative (Linux Mint, Ubuntu, etc), you will have to use a different command than apt-get to install [the MXE requirements](http://mxe.cc/#requirements). Building all these packages from MXE might take a while even on a fast computer. Be patient. If you are not planning on building for both 32-bit and 64-bit, you might want to adjust your MXE_TARGETS.
|
||||
|
||||
### Building (SDL)
|
||||
|
||||
Run:
|
||||
|
||||
PLATFORM="i686-w64-mingw32.static"
|
||||
make CROSS="~/src/mxe/usr/bin/${PLATFORM}-" TILES=1 SOUND=1 LUA=1 RELEASE=1 LOCALIZE=1
|
||||
|
||||
Change PLATFORM to x86_64-w64-mingw32.static for a 64-bit Windows build.
|
||||
|
||||
To create nice zip file with all the required resources for a trouble free copy on Windows use the bindist target like this:
|
||||
|
||||
PLATFORM="i686-w64-mingw32.static"
|
||||
make CROSS="~/src/mxe/usr/bin/${PLATFORM}-" TILES=1 SOUND=1 LUA=1 RELEASE=1 LOCALIZE=1 bindist
|
||||
|
||||
### Building (ncurses)
|
||||
|
||||
Run:
|
||||
|
||||
PLATFORM="i686-w64-mingw32.static"
|
||||
make CROSS="~/src/mxe/usr/bin/${PLATFORM}-" LUA=1 RELEASE=1 LOCALIZE=1
|
||||
|
||||
## Cross-compile to Mac OS X from Linux
|
||||
|
||||
The procedure is very much similar to cross-compilation to Windows from Linux.
|
||||
Tested on ubuntu 14.04 LTS but should work on other distros as well.
|
||||
|
||||
### Dependencies
|
||||
|
||||
* OSX cross-compiling toolchain [osxcross](https://github.com/tpoechtrager/osxcross)
|
||||
|
||||
* `genisoimage` and [libdmg-hfsplus](https://github.com/planetbeing/libdmg-hfsplus.git) to create dmg distributions
|
||||
|
||||
Make sure that all dependency tools are in search `PATH` before compiling.
|
||||
|
||||
### Setup
|
||||
|
||||
To set up the compiling environment execute the following commands
|
||||
`git clone https://github.com/tpoechtrager/osxcross.git` to clone the toolchain
|
||||
`cd osxcross`
|
||||
`cp ~/MacOSX10.11.sdk.tar.bz2 ./tarballs/` copy prepared MacOSX SDK tarball on place. [Read more about it](https://github.com/tpoechtrager/osxcross/blob/master/README.md#packaging-the-sdk)
|
||||
`OSX_VERSION_MIN=10.7 ./build.sh to build everything`
|
||||
Note the targeted minimum supported version of OSX.
|
||||
|
||||
Have a prepackaged set of libs and frameworks in place, since compiling with `osxcross` built-in MacPorts is rather difficult and not supported at the moment.
|
||||
Your directory tree should look like:
|
||||
|
||||
~/
|
||||
├── Frameworks
|
||||
│ ├── SDL2.framework
|
||||
│ ├── SDL2_image.framework
|
||||
│ ├── SDL2_mixer.framework
|
||||
│ └── SDL2_ttf.framework
|
||||
└── libs
|
||||
├── gettext
|
||||
│ ├── include
|
||||
│ └── lib
|
||||
├── lua
|
||||
│ ├── include
|
||||
│ └── lib
|
||||
└── ncurses
|
||||
├── include
|
||||
└── lib
|
||||
|
||||
Populated with respective frameworks, dylibs and headers.
|
||||
Tested lib versions are libintl.8.dylib for gettext, liblua.5.2.4.dylib for lua, libncurses.5.4.dylib for ncurses.
|
||||
These libs were obtained from `homebrew` binary distribution at OS X 10.11
|
||||
Frameworks were obtained from SDL official website as described in the next [section](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/COMPILING.md#sdl)
|
||||
|
||||
### Building (SDL)
|
||||
|
||||
To build full feature tiles and sound enabled version with localizations and lua enabled:
|
||||
|
||||
make dmgdist CROSS=x86_64-apple-darwin15- NATIVE=osx OSX_MIN=10.7 USE_HOME_DIR=1 CLANG=1
|
||||
RELEASE=1 LOCALIZE=1 LANGUAGES=all LUA=1 TILES=1 SOUND=1 FRAMEWORK=1
|
||||
OSXCROSS=1 LIBSDIR=../libs FRAMEWORKSDIR=../Frameworks
|
||||
|
||||
Make sure that `x86_64-apple-darwin15-clang++` is in `PATH` environment variable.
|
||||
|
||||
### Building (ncurses)
|
||||
|
||||
To build full curses version with localizations and lua enabled:
|
||||
|
||||
make dmgdist CROSS=x86_64-apple-darwin15- NATIVE=osx OSX_MIN=10.7 USE_HOME_DIR=1 CLANG=1
|
||||
RELEASE=1 LOCALIZE=1 LANGUAGES=all LUA=1 OSXCROSS=1 LIBSDIR=../libs FRAMEWORKSDIR=../Frameworks
|
||||
|
||||
Make sure that `x86_64-apple-darwin15-clang++` is in `PATH` environment variable.
|
||||
|
||||
## Cross-compile to Android from Linux
|
||||
|
||||
The Android build uses [Gradle](https://gradle.org/) to compile the java and native C++ code, and is based heavily off SDL's [Android project template](https://hg.libsdl.org/SDL/file/f1084c419f33/android-project). See the official SDL documentation [README-android.md](https://hg.libsdl.org/SDL/file/f1084c419f33/docs/README-android.md) for further information.
|
||||
|
||||
The Gradle project lives in the repository under `android/`. You can build it via the command line or open it in [Android Studio](https://developer.android.com/studio/). For simplicity, it only builds the SDL version with all features enabled, including tiles, sound, localization and lua.
|
||||
|
||||
### Dependencies
|
||||
|
||||
* Java JDK 8
|
||||
* SDL2 (tested with 2.0.8, though a custom fork is recommended with project-specific bugfixes)
|
||||
* SDL2_ttf (tested with 2.0.14)
|
||||
* SDL2_mixer (tested with 2.0.2)
|
||||
* SDL2_image (tested with 2.0.3)
|
||||
* libintl-lite (tested with a custom fork of libintl-lite 0.5)
|
||||
* lua (tested with lua 5.1.5)
|
||||
|
||||
The Gradle build process automatically installs dependencies from [deps.zip](android/app/deps.zip).
|
||||
|
||||
### Setup
|
||||
|
||||
Install Linux dependencies. For a desktop Ubuntu installation:
|
||||
|
||||
sudo apt-get install lua5.2 openjdk-8-jdk-headless
|
||||
|
||||
Install Android SDK and NDK:
|
||||
|
||||
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
|
||||
unzip sdk-tools-linux-4333796.zip -d ~/android-sdk
|
||||
rm sdk-tools-linux-4333796.zip
|
||||
~/android-sdk/tools/bin/sdkmanager --update
|
||||
~/android-sdk/tools/bin/sdkmanager "tools" "platform-tools" "ndk-bundle"
|
||||
~/android-sdk/tools/bin/sdkmanager --licenses
|
||||
|
||||
Export Android environment variables (you can add these to the end of `~/.bashrc`):
|
||||
|
||||
export ANDROID_SDK_ROOT=~/android-sdk
|
||||
export ANDROID_HOME=~/android-sdk
|
||||
export ANDROID_NDK_ROOT=~/android-sdk/ndk-bundle
|
||||
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
|
||||
export PATH=$PATH:$ANDROID_SDK_ROOT/tools
|
||||
export PATH=$PATH:$ANDROID_NDK_ROOT
|
||||
|
||||
### Android device setup
|
||||
|
||||
Enable [Developer options on your Android device](https://developer.android.com/studio/debug/dev-options). Connect your device to your PC via USB cable and run:
|
||||
|
||||
adb devices
|
||||
adb connect <devicename>
|
||||
|
||||
### Building
|
||||
|
||||
To build an APK, use the Gradle wrapper command line tool (gradlew). The Android Studio documentation provides a good summary of how to [build your app from the command line](https://developer.android.com/studio/build/building-cmdline).
|
||||
|
||||
To build a debug APK, from the `android/` subfolder of the repository run:
|
||||
|
||||
./gradlew assembleDebug
|
||||
|
||||
This creates a debug APK in `./android/app/build/outputs/apk/` ready to be installed on your device.
|
||||
|
||||
To build a debug APK and immediately deploy to your connected device over adb run:
|
||||
|
||||
./gradlew installDebug
|
||||
|
||||
To build a signed release APK (ie. one that can be installed on a device), [build an unsigned release APK and sign it manually](https://developer.android.com/studio/publish/app-signing#signing-manually).
|
||||
|
||||
### Additional notes
|
||||
|
||||
The app stores data files on the device in `/sdcard/Android/data/com.cleverraven/cataclysmdda/files`. The data is backwards compatible with the desktop version.
|
||||
|
||||
# Mac OS X
|
||||
|
||||
To build Cataclysm on Mac you'll need [Command Line Tools for Xcode](https://developer.apple.com/downloads/) and the [Homebrew](http://brew.sh) package manager. With Homebrew, you can easily install or build Cataclysm using the [Cataclysm](https://formulae.brew.sh/formula/cataclysm) forumla.
|
||||
|
||||
## Simple build using Homebrew
|
||||
|
||||
Homebrew installation will come with tiles, sound and lua suooprt enabled by default.
|
||||
|
||||
Once you have Homebrew installed, open Terminal and run one of the following commands.
|
||||
|
||||
For a tiles build:
|
||||
|
||||
brew install cataclysm
|
||||
|
||||
For an experimental tiles build:
|
||||
|
||||
brew install cataclysm --HEAD
|
||||
|
||||
Whichever build you choose, Homebrew will install the appropriate dependencies as needed. The installation will be in `/usr/local/Cellar/cataclysm` with a symlink named `cataclysm` in `/usr/local/bin`.
|
||||
|
||||
To launch Cataclysm, just open Terminal and run `cataclysm`.
|
||||
|
||||
To update an experimental build, you must uninstall Cataclysm, then reinstall using one of the above commands. Reinstall Cataclysm using the one of the following commands.
|
||||
|
||||
For a tiles build:
|
||||
|
||||
brew reinstall cataclysm
|
||||
|
||||
For an experimental tiles build:
|
||||
|
||||
brew reinstall cataclysm --HEAD
|
||||
|
||||
## Advanced info for Developers
|
||||
|
||||
For most people, the simple Homebrew installation is enough. For developers, here are some more technical details on building Cataclysm on Mac OS X.
|
||||
|
||||
### SDL
|
||||
|
||||
SDL2, SDL2_image, and SDL2_ttf are needed for the tiles build. Optionally, you can add SDL2_mixer for sound support. Cataclysm can be built using either the SDL framework, or shared libraries built from source.
|
||||
|
||||
The SDL framework files can be downloaded here:
|
||||
|
||||
* [**SDL2**](http://www.libsdl.org/download-2.0.php)
|
||||
* [**SDL2_image**](http://www.libsdl.org/projects/SDL_image/)
|
||||
* [**SDL2_ttf**](http://www.libsdl.org/projects/SDL_ttf/)
|
||||
|
||||
Copy `SDL2.framework`, `SDL2_image.framework`, and `SDL2_ttf.framework`
|
||||
to `/Library/Frameworks` or `/Users/name/Library/Frameworks`.
|
||||
|
||||
If you want sound support, you will need an additional SDL framework:
|
||||
|
||||
* [**SDL2_mixer**](https://www.libsdl.org/projects/SDL_mixer/)
|
||||
|
||||
Copy `SDL2_mixer.framework` to `/Library/Frameworks` or `/Users/name/Library/Frameworks`.
|
||||
|
||||
Alternatively, SDL shared libraries can be installed using a package manager:
|
||||
|
||||
For Homebrew:
|
||||
|
||||
brew install sdl2 sdl2_image sdl2_ttf
|
||||
|
||||
with sound:
|
||||
|
||||
brew install sdl2_mixer libvorbis libogg
|
||||
|
||||
For MacPorts:
|
||||
|
||||
sudo port install libsdl2 libsdl2_image libsdl2_ttf
|
||||
|
||||
with sound:
|
||||
|
||||
sudo port install libsdl2_mixer libvorbis libogg
|
||||
|
||||
### ncurses and gettext
|
||||
|
||||
ncurses (with wide character support enabled) and gettext are needed if you want to build Cataclysm with localization.
|
||||
|
||||
For Homebrew:
|
||||
|
||||
brew tap homebrew/dupes
|
||||
brew install gettext ncurses
|
||||
brew link --force gettext ncurses
|
||||
|
||||
Then, after compiling, be sure to unlink these libraries to prevent conflicts with the OS X shared libraries:
|
||||
|
||||
brew unlink gettext ncurses
|
||||
|
||||
For MacPorts:
|
||||
|
||||
sudo port install gettext ncurses
|
||||
hash -r
|
||||
|
||||
### gcc
|
||||
|
||||
The version of gcc/g++ installed with the [Command Line Tools for Xcode](https://developer.apple.com/downloads/) is actually just a front end for the same Apple LLVM as clang. This doesn't necessarily cause issues, but this version of gcc/g++ will have clang error messages and essentially produce the same results as if using clang. To compile with the "real" gcc/g++, install it with homebrew:
|
||||
|
||||
brew install gcc
|
||||
|
||||
However, homebrew installs gcc as gcc-6 (where 6 is the version) to avoid conflicts. The simplest way to use the homebrew version at `/usr/local/bin/gcc-6` instead of the Apple LLVM version at `/usr/bin/gcc` is to symlink the necessary.
|
||||
|
||||
cd /usr/local/bin
|
||||
ln -s gcc-6 gcc
|
||||
ln -s g++-6 g++
|
||||
ln -s c++-6 c++
|
||||
|
||||
Or, to do this for everything in `/usr/local/bin/` ending with `-6`,
|
||||
|
||||
find /usr/local/bin -name "*-6" -exec sh -c 'ln -s "$1" $(echo "$1" | sed "s/..$//")' _ {} \;
|
||||
|
||||
Also, you need to make sure that `/usr/local/bin` appears before `/usr/bin` in your `$PATH`, or else this will not work.
|
||||
|
||||
Check that `gcc -v` shows the homebrew version you installed.
|
||||
|
||||
### Compiling
|
||||
|
||||
The Cataclysm source is compiled using `make`.
|
||||
|
||||
### Make options
|
||||
|
||||
* `NATIVE=osx` build for OS X. Required for all Mac builds.
|
||||
* `OSX_MIN=version` sets `-mmacosx-version-min=` (for OS X > 10.5 set it to 10.6 or higher); omit for 10.5.
|
||||
* `TILES=1` build the SDL version with graphical tiles (and graphical ASCII); omit to build with `ncurses`.
|
||||
* `SOUND=1` - if you want sound; this requires `TILES=1` and the additional dependencies mentioned above.
|
||||
* `FRAMEWORK=1` (tiles only) link to SDL libraries under the OS X Frameworks folders; omit to use SDL shared libraries from Homebrew or Macports.
|
||||
* `LOCALIZE=0` disable localization (to get around possible `gettext` errors if it is not setup correctly); omit to use `gettext`.
|
||||
* `LANGUAGES="<lang_id_1>[lang_id_2][...]"` compile localization files for specified languages. e.g. `LANGUAGES="zh_CN zh_TW"`. You can also use `LANGUAGES=all` to compile all localization files.
|
||||
* `RELEASE=1` build an optimized release version; omit for debug build.
|
||||
* `CLANG=1` build with [Clang](http://clang.llvm.org/), the compiler that's included with the latest Command Line Tools for Xcode; omit to build using gcc/g++.
|
||||
* `MACPORTS=1` build against dependencies installed via Macports, currently only `gettext` and `ncurses`.
|
||||
* `USE_HOME_DIR=1` places user files (config, saves, graveyard, etc) in the user's home directory. For curses builds, this is `/Users/<user>/.cataclysm-dda`, for SDL builds it is `/Users/<user>/Library/Application Support/Cataclysm`.
|
||||
* `DEBUG_SYMBOLS=1` retains debug symbols when building an optimized release binary, making it easy for developers to spot the crash site.
|
||||
|
||||
In addition to the options above, there is an `app` make target which will package the tiles build into `Cataclysm.app`, a complete tiles build in a Mac application that can run without Terminal.
|
||||
|
||||
For more info, see the comments in the `Makefile`.
|
||||
|
||||
### Make examples
|
||||
|
||||
Build a release SDL version using Clang without gettext:
|
||||
|
||||
make NATIVE=osx OSX_MIN=10.7 RELEASE=1 TILES=1 LOCALIZE=0 CLANG=1
|
||||
|
||||
Build a release SDL version using Clang, link to libraries in the OS X Frameworks folders, don't use `gettext`, and package it into `Cataclysm.app`:
|
||||
|
||||
make app NATIVE=osx OSX_MIN=10.7 RELEASE=1 TILES=1 FRAMEWORK=1 LOCALIZE=0 CLANG=1
|
||||
|
||||
Build a release curses version with gettext supplied by Macports:
|
||||
|
||||
make NATIVE=osx OSX_MIN=10.7 RELEASE=1 LOCALIZE=1 MACPORTS=1 CLANG=1
|
||||
|
||||
### Compiling localization files
|
||||
|
||||
If you just want to compile localization files for specified languages, you can add `LANGUAGES="<lang_id_1>[lang_id_2][...]"` option to make command:
|
||||
|
||||
make LANGUAGES="zh_CN zh_TW"
|
||||
|
||||
You can get the language ID from the filenames of `*.po` in `lang/po` directory. Setting `LOCALIZE=1` may not tell `make` to compile those localization files for you.
|
||||
|
||||
### Running
|
||||
|
||||
For curses builds:
|
||||
|
||||
./cataclysm
|
||||
|
||||
For SDL:
|
||||
|
||||
./cataclysm-tiles
|
||||
|
||||
For `app` builds, launch Cataclysm.app from Finder.
|
||||
|
||||
### Test suite
|
||||
|
||||
The build will also generate a test executable at tests/cata_test.
|
||||
Invoke it as you would any other executable and it will run the full suite of tests.
|
||||
Pass the ``--help`` flag to list options.
|
||||
|
||||
### dmg distribution
|
||||
|
||||
You can build a nice dmg distribution file with the `dmgdist` target. You will need a tool called [dmgbuild](https://pypi.python.org/pypi/dmgbuild). To install this tool, you will need Python first. If you are on Mac OS X >= 10.8, Python 2.7 is pre-installed with the OS. If you are on an older version of OS X, you can download Python [on their official website](https://www.python.org/downloads/) or install it with homebrew `brew install python`. Once you have Python, you should be able to install `dmgbuild` by running:
|
||||
|
||||
# This install pip. It might not be required if it is already installed.
|
||||
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python
|
||||
# dmgbuild install
|
||||
sudo pip install dmgbuild pyobjc-framework-Quartz
|
||||
|
||||
Once `dmgbuild` is installed, you will be able to use the `dmgdist` target like this. The use of `USE_HOME_DIR=1` is important here because it will allow for an easy upgrade of the game while keeping the user config and his saves in his home directory.
|
||||
|
||||
make dmgdist NATIVE=osx OSX_MIN=10.7 RELEASE=1 TILES=1 FRAMEWORK=1 LOCALIZE=0 CLANG=1 USE_HOME_DIR=1
|
||||
|
||||
You should see a `Cataclysm.dmg` file.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### ISSUE: crash on startup due to libint.8.dylib aborting
|
||||
|
||||
If you're compiling on Mountain Lion or above, it won't be possible to run successfully on older OS X versions due to libint.8 / pthreads version issue.
|
||||
|
||||
From https://wiki.gnome.org/GTK+/OSX/Building:
|
||||
|
||||
> "There's another issue with building on Lion or Mountain Lion using either "native" or the 10.7 SDK: Apple has updated the pthreads implementation to provide recursive locking. This would be good except that Gettext's libintl uses this and if the pthreads implementation doesn't provide it it fabricates its own. Since the Lion pthreads does provide it, libintl links the provided function and then crashes when you try to run it against an older version of the library. The simplest solution is to specify the 10.6 SDK when building on Lion, but that won't work on Mountain Lion, which doesn't include it. See below for how to install and use XCode 3 on Lion and later for building applications compatible with earlier versions of OSX."
|
||||
|
||||
Workaround: install XCode 3 like that article describes, or disable localization support in Cataclysm so gettext/libint are not dependencies. Or else simply don't support OS X versions below 10.7.
|
||||
|
||||
### ISSUE: Colors don't show up correctly
|
||||
|
||||
Open Terminal's preferences, turn on "Use bright colors for bold text" in "Preferences -> Settings -> Text"
|
||||
|
||||
|
||||
# Windows
|
||||
|
||||
## Visual Studio Guide
|
||||
|
||||
Visual Studio 2015 (or later) is required to build Cataclysm. If you use a later version of Visual Studio, you will need to [enable the Visual Studio 2015 (v140) platform toolset](https://developercommunity.visualstudio.com/content/problem/48806/cant-find-v140-in-visual-studio-2017.html). We created solution and project files in directory `msvc-full-features`. Because of the complexity and how troublesome defining every combination of build feature options are, in Visual Studio project we added all build features, including tiles, sound, localization and lua.
|
||||
|
||||
### Dependencies
|
||||
|
||||
We've prepared an archive containing all the headers and libraries required to build Cataclysm: [http://dev.narc.ro/cataclysm/WinDepend-MSVC.zip](http://dev.narc.ro/cataclysm/WinDepend-MSVC.zip) or [http://dev.narc.ro/cataclysm/WinDepend-MSVC.7z](http://dev.narc.ro/cataclysm/WinDepend-MSVC.7z). The latter is smaller, but if you don't have a 7-zip archive extracter, the former one is easier to deal with.
|
||||
|
||||
Extract the 'WinDepend' folder and put it in the root folder of Cataclysm project. Run the "copy_dll_to_bin" batch file and then move the dll files from the bin folder into the root folder the Cataclysm project.
|
||||
|
||||
### Lua
|
||||
|
||||
The next thing you need to do is to install lua. Download the appropriate x86 or x64 lua from [http://lua-users.org/wiki/LuaBinaries](http://lua-users.org/wiki/LuaBinaries) or [http://dev.narc.ro/cataclysm/WinDepend-lua.zip](http://dev.narc.ro/cataclysm/WinDepend-lua.zip), and extract it to `C:\Windows\System32` or somewhere else on your path.
|
||||
|
||||
Once you have it installed, go to the project directory, then go to `src/lua`, and run `lua53 generate_bindings.lua catabindings.cpp`. This will generate the `catabindings.cpp` file which is necessary for compilation.
|
||||
|
||||
### Building
|
||||
|
||||
Building Cataclysm with Visual Studio is very simple. Just build it like a normal Visual C++ project. The process may takes a long period of time, so you'd better prepare a cup of coffee and some books in front of your computer :)
|
||||
|
||||
If you need localization support, execute the bash script `lang/compile_mo.sh` inside Git Bash GUI just like on a UNIX-like system.
|
||||
|
||||
### Debugging
|
||||
|
||||
After building Cataclysm, you may discover that after pressing the debug button in Visual Studio, Cataclysm just exits after launch with return code 1. That is because of the wrong working directory. You need to configure the working directory to `$(ProjectDir)..`.
|
||||
|
||||
### Make a distribution
|
||||
|
||||
There is a batch script in `msvc-full-features` folder `distribute.bat`. It will create a sub folder `distribution` and copy all required files(eg. `data/`, `Cataclysm.exe` and dlls) into that folder. Then you can zip it and share the archive on the Internet.
|
||||
|
||||
## MinGW Guide
|
||||
To compile under windows MinGW you first need to download mingw. An automated GUI installer assistant called mingw-get-setup.exe will make everything a lot easier. I recommend installing it to `C:\MinGW`
|
||||
https://sourceforge.net/projects/mingw/files/latest/download
|
||||
|
||||
### MinGW setup
|
||||
once installed we need to get the right packages. In "Basic Setup", mark `mingw-developer-toolkit`, `mingw32-base` and `mingw32-gcc-g++`
|
||||
|
||||
Then install these components using `Installation -> Apply Changes`.
|
||||
|
||||
#### Localization
|
||||
If we want to compile with localization, we will need gettext and libintl. In "All Packages -> MinGW -> MinGW Autotools" ensure that `mingw32-gettext` and `mingw32-libintl` are installed.
|
||||
|
||||
### Required Tiles(SDL) Libraries
|
||||
If we want to compile with Tiles (SDL) we have to download a few libraries.
|
||||
* `SDL2` http://www.libsdl.org/download-2.0.php chose `SDL2-devel-2.0.X-mingw.tar.gz`.
|
||||
* `SDL_ttf` https://www.libsdl.org/projects/SDL_ttf/ chose `SDL2_ttf-devel-2.0.12-mingw.tar.gz`.
|
||||
* `SDL_image` https://www.libsdl.org/projects/SDL_image/ chose ` SDL2_image-devel-2.0.0-mingw.tar.gz`
|
||||
* `freetype` http://gnuwin32.sourceforge.net/packages/freetype.htm chose `Binaries` and `Developer files`
|
||||
|
||||
#### Bundled Libraries
|
||||
The following archives were pre-bundled for convenience and reduction of head-aches, simply download and extract directly to the root directory of the CDDA source:
|
||||
* `64-bit SDL \ Tiles \ Sound \ Lua \ Localization` http://dev.narc.ro/cataclysm/cdda-win64-codeblocks.7z
|
||||
|
||||
#### Installing Tiles(SDL) libraries.
|
||||
For the first 3 (`SDL2`, `SDL_ttf` and `SDL_image`) you want to extract the include and lib folders from the `i686-w64-mingw32` folders into your MinGW installation folder. (Recommended `C:\MinGW`). And the `SDL2_image.dll` and `SDL2_ttf.dll` into your cataclysm root folder.
|
||||
|
||||
For freetype you want to grab the include and lib folders from the `freetype-2.X.X-X-lib.zip` and move them into your your MinGW installation folder. Then you want to get the freetype6.dll from the `freetype-2.X.X-X-bin.zip` and move it into your cataclysm root folder.
|
||||
|
||||
#### ISSUE - "winapifamily.h" no such file or directoyr
|
||||
There seems to be at the moment of writing that a file in SDL is broken and needs to be replaced.
|
||||
https://hg.libsdl.org/SDL/raw-file/e217ed463f25/include/SDL_platform.h
|
||||
Replace SDL_platform.h in the MinGW/include/SDL2 folder and it should be fine.
|
||||
|
||||
### Makefile changes
|
||||
This probably not the best way to do it. But it seems that you need to remove a few dependencies from the makefile or it will not build.
|
||||
change the line `LDFLAGS += -lfreetype -lpng -lz -ljpeg -lbz2` to `LDFLAGS += -lfreetype`
|
||||
|
||||
### Compiling
|
||||
Navigate to `MinGW\msys\1.0` and run `msys.bat`. This will start a cmd-like shell where the following entries will be made.
|
||||
|
||||
Add the MinGW toolchain to your PATH with `export PATH=$PATH:/c/MinGW/bin`. Replace /c/MinGW/ with the directory into which you installed MinGW (/c/ stands for drive C:, so if it's in F:/foo/bar, you'd use /f/foo/bar).
|
||||
|
||||
Navigate to the CDDA source code directory.
|
||||
|
||||
Compile using `make TILES=1 NATIVE=win32 LOCALIZE=1` and unless there are problems, it should produce a CDDA binary for you.
|
||||
|
||||
If you dont want tiles you can change `TILES` to 0.
|
||||
|
||||
If you dont want localization you can change `LOCALIZE` to 0.
|
||||
|
||||
## Rough guide to building with only MSYS2
|
||||
|
||||
This is a tentative step-by-step guide to building your own CDDA with Tiles, Localization and Lua using only MSYS2. You may want to follow it if the MinGW guide above doesn't work for you or you just feel adventurous. Feedback is very much welcome in terms of issues and/or pull-requests.
|
||||
|
||||
This guide assumes you're building on a x86_64 build of Windows. If not adjust the invocations appropriately. It has been tested and proven to work on Windows XP, Windows 7 and Windows 10. Your mileage may vary.
|
||||
|
||||
#### 1. Go to https://msys2.github.io/ and download appropriate MSYS (top of the page).
|
||||
|
||||
#### 2. Install MSYS2 and leave the Run ticker on. You should end up with a MSYS2 terminal.
|
||||
|
||||
#### 3. In the open terminal:
|
||||
|
||||
```bash
|
||||
pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime
|
||||
```
|
||||
|
||||
Note: You may close the terminal now and reopen it from the Start menu (MSYS2 Shell, just to be on the safe-er side).
|
||||
|
||||
Note: You may need to bash the close button repeatedly. Or use the task manager to kill it.
|
||||
|
||||
#### 4. Open an editor that preserves line-endings
|
||||
|
||||
Note: Wordpad should do. Or Notepad++.
|
||||
|
||||
#### 5. Open `C:\msys64\etc\pacman.conf` and change:
|
||||
|
||||
```bash
|
||||
# By default, pacman accepts packages signed by keys that its local keyring
|
||||
# trusts (see pacman-key and its man page), as well as unsigned packages.
|
||||
#SigLevel = Never
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
#RemoteFileSigLevel = Required
|
||||
```
|
||||
|
||||
To:
|
||||
|
||||
```bash
|
||||
# By default, pacman accepts packages signed by keys that its local keyring
|
||||
# trusts (see pacman-key and its man page), as well as unsigned packages.
|
||||
SigLevel = Never
|
||||
#SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
#RemoteFileSigLevel = Required
|
||||
```
|
||||
|
||||
(Exchange the # on SigLevel). This disables signature checking as it is currently borked.
|
||||
|
||||
#### 6. Save the file
|
||||
|
||||
#### 7. Run in MSYS2 terminal:
|
||||
|
||||
```bash
|
||||
update-core
|
||||
pacman -Su
|
||||
pacman -S mingw-w64-x86_64-gcc
|
||||
pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-SDL2_mixer mingw-w64-x86_64-SDL2_ttf
|
||||
pacman -S mingw-w64-x86_64-ncurses
|
||||
pacman -S mingw-w64-x86_64-pkg-config mingw-w64-x86_64-libwebp
|
||||
pacman -S git make
|
||||
pacman -S mingw-w64-x86_64-lua
|
||||
```
|
||||
|
||||
#### 8. Close MSYS2 terminal and open MinGW-w64 Win64 Shell from Start menu and run:
|
||||
|
||||
Note: This will download whole CDDA repository. If you're just testing you should probably add `--depth=1`.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/CleverRaven/Cataclysm-DDA.git
|
||||
cd Cataclysm-DDA
|
||||
```
|
||||
|
||||
#### 9. Compile your CDDA by running:
|
||||
|
||||
```bash
|
||||
make MSYS2=1 RELEASE=1 TILES=1 LOCALIZE=1 SOUND=1 LUA=1 NATIVE=win64
|
||||
```
|
||||
|
||||
Note: You cannot naively use `-jX` to speed up your building process with `LUA=1`. You must first run `cd src/lua/ && lua generate_bindings.lua && cd ../..` if you want to use `-jX`. X should be the number of threads/cores your processor has.
|
||||
|
||||
That's it. You should get a `cataclysm-tiles.exe` binary in the same folder you've found the `Makefile` in. The make flags are the same as the ones described above. For instance, if you do not want to build with sound support, you can remove `SOUND=1`.
|
||||
|
||||
# BSDs
|
||||
|
||||
There are reports of CDDA building fine on recent OpenBSD and FreeBSD machines (with appropriately recent compilers), and there is some work being done on making the `Makefile` "just work", however we're far from that and BSDs support is mostly based on user contributions. Your mileage may vary. So far essentially all testing has been on amd64, but there is no (known) reason that other architectures shouldn't work, in principle.
|
||||
|
||||
### Building on FreeBSD/amd64 10.1 with the system compiler
|
||||
|
||||
FreeBSD uses clang as the default compiler as of 10.0, and combines it with libc++ to provide C++11 support out of the box. You will however need gmake (examples for binary packages):
|
||||
|
||||
`pkg install gmake`
|
||||
|
||||
Tiles builds will also require SDL2:
|
||||
|
||||
`pkg install sdl2 sdl2_image sdl2_mixer sdl2_ttf`
|
||||
|
||||
Then you should be able to build with something like this (you can of course set CXXFLAGS and LDFLAGS in your .profile or something):
|
||||
|
||||
```
|
||||
export CXXFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"
|
||||
gmake # ncurses builds
|
||||
gmake TILES=1 # tiles builds
|
||||
```
|
||||
|
||||
The author has not tested tiles builds, as the build VM lacks X; they do at least compile/link successfully.
|
||||
|
||||
### Building ncurses version on FreeBSD/amd64 9.3 with GCC 4.8.4 from ports
|
||||
|
||||
For ncurses build add to `Makefile`, before `VERSION`:
|
||||
|
||||
```Makefile
|
||||
OTHERS += -D_GLIBCXX_USE_C99
|
||||
CXX = g++48
|
||||
CXXFLAGS += -I/usr/local/lib/gcc48/include
|
||||
LDFLAGS += -rpath=/usr/local/lib/gcc48
|
||||
```
|
||||
Note: or you can `setenv` the above (merging `OTHERS` into `CXXFLAGS`), but you knew that.
|
||||
|
||||
And then build with `gmake LOCALIZE=0 RELEASE=1`.
|
||||
|
||||
### Building on OpenBSD/amd64 5.8 with GCC 4.9.2 from ports/packages
|
||||
|
||||
First, install g++, gmake, and libexecinfo from packages (g++ 4.8 or 4.9 should work; 4.9 has been tested):
|
||||
|
||||
`pkg_add g++ gmake libexecinfo`
|
||||
|
||||
Then you should be able to build with something like:
|
||||
|
||||
`CXX=eg++ gmake`
|
||||
|
||||
Only an ncurses build is possible on 5.8-release, as SDL2 is broken. On recent -current or snapshots, however, you can install the SDL2 packages:
|
||||
|
||||
`pkg_add sdl2 sdl2-image sdl2-mixer sdl2-ttf`
|
||||
|
||||
and build with:
|
||||
|
||||
`CXX=eg++ gmake TILES=1`
|
||||
|
||||
### Building on NetBSD/amd64 7.0RC1 with the system compiler
|
||||
|
||||
NetBSD has (or will have) gcc 4.8.4 as of version 7.0, which is new enough to build cataclysm. You will need to install gmake and ncursesw:
|
||||
|
||||
`pkgin install gmake ncursesw`
|
||||
|
||||
Then you should be able to build with something like this (LDFLAGS for ncurses builds are taken care of by the ncurses configuration script; you can of course set CXXFLAGS/LDFLAGS in your .profile or something):
|
||||
|
||||
```
|
||||
export CXXFLAGS="-I/usr/pkg/include"
|
||||
gmake # ncurses builds
|
||||
LDFLAGS="-L/usr/pkg/lib" gmake TILES=1 # tiles builds
|
||||
```
|
||||
|
||||
SDL builds currently compile, but did not run in my testing - not only do they segfault, but gdb segfaults when reading the debug symbols! Perhaps your mileage will vary.
|
||||
@@ -1,88 +0,0 @@
|
||||
{
|
||||
"build_systems":
|
||||
[
|
||||
{
|
||||
"cmd":
|
||||
[
|
||||
"make",
|
||||
"USE_HOME_DIR=1",
|
||||
"CLANG=1",
|
||||
"CCACHE=1",
|
||||
"RELEASE=1",
|
||||
"LUA=1"
|
||||
],
|
||||
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||
"name": "make RELEASE LUA",
|
||||
"working_dir": "${folder:${project_path:${file_path}}}"
|
||||
},
|
||||
{
|
||||
"cmd":
|
||||
[
|
||||
"make",
|
||||
"USE_HOME_DIR=1",
|
||||
"CLANG=1",
|
||||
"CCACHE=1",
|
||||
"LUA=1"
|
||||
],
|
||||
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||
"name": "make LUA",
|
||||
"working_dir": "${folder:${project_path:${file_path}}}"
|
||||
},
|
||||
{
|
||||
"cmd":
|
||||
[
|
||||
"make",
|
||||
"USE_HOME_DIR=1",
|
||||
"CLANG=1",
|
||||
"CCACHE=1",
|
||||
"LUA=1",
|
||||
"TILES=1"
|
||||
],
|
||||
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||
"name": "make TILES LUA",
|
||||
"working_dir": "${folder:${project_path:${file_path}}}"
|
||||
},
|
||||
{
|
||||
"cmd":
|
||||
[
|
||||
"make",
|
||||
"USE_HOME_DIR=1",
|
||||
"CLANG=1",
|
||||
"CCACHE=1",
|
||||
"LUA=1",
|
||||
"TILES=1",
|
||||
"RELEASE=1"
|
||||
],
|
||||
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||
"name": "make RELEASE TILES LUA",
|
||||
"working_dir": "${folder:${project_path:${file_path}}}"
|
||||
}
|
||||
],
|
||||
"folders":
|
||||
[
|
||||
{
|
||||
"folder_exclude_patterns":
|
||||
[
|
||||
"Cataclysm.app"
|
||||
],
|
||||
"path": "."
|
||||
},
|
||||
{
|
||||
"path": "~/.cataclysm-dda"
|
||||
},
|
||||
{
|
||||
"path": "~/Library/Application Support/Cataclysm"
|
||||
}
|
||||
],
|
||||
"settings":
|
||||
{
|
||||
"AStyleFormatter":
|
||||
{
|
||||
"options_c++":
|
||||
{
|
||||
"additional_options_file": ".astylerc",
|
||||
"use_only_additional_options": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,357 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Cataclysm" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Release">
|
||||
<Option output="Cataclysm" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Os -O2" />
|
||||
<Add option="-DRELEASE=1" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Release (Localized)">
|
||||
<Option output="CataclysmWin" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/ReleaseLocalized/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Os -O2" />
|
||||
<Add option="-DLOCALIZE" />
|
||||
<Add option="-DRELEASE=1" />
|
||||
<Add directory="WinDepend/include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="libintl.dll.a" />
|
||||
<Add library="libiconv.dll.a" />
|
||||
<Add directory="WinDepend/lib" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release (SDL)">
|
||||
<Option output="Cataclysm-Tiles" prefix_auto="0" extension_auto="1" />
|
||||
<Option object_output="obj/ReleaseSDL/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Os -O2" />
|
||||
<Add option="-DTILES" />
|
||||
<Add option="-DSDLTILES" />
|
||||
<Add option="-DRELEASE=1" />
|
||||
<Add directory="WinDepend/include" />
|
||||
<Add directory="WinDepend/include/SDL2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="libSDL2.dll.a" />
|
||||
<Add library="libSDL2main.a" />
|
||||
<Add library="libSDL2_ttf.dll.a" />
|
||||
<Add library="libSDL2_image.dll.a" />
|
||||
<Add directory="WinDepend/lib" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release (Lua)">
|
||||
<Option output="CataclysmWin" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/ReleaseLua/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Os -O2" />
|
||||
<Add option="-DLUA" />
|
||||
<Add option="-DRELEASE=1" />
|
||||
<Add directory="WinDepend/include" />
|
||||
<Add directory="WinDepend/include/lua5.1" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="liblua5.1.a" />
|
||||
<Add directory="WinDepend/lib" />
|
||||
</Linker>
|
||||
<ExtraCommands>
|
||||
<Add before="cmd /c cd src/lua && lua5.1 -v || echo 'lua5.1' command not found!" />
|
||||
<Add before="cmd /c cd src/lua && lua5.1 generate_bindings.lua catabindings.cpp" />
|
||||
<Mode after="always" />
|
||||
</ExtraCommands>
|
||||
</Target>
|
||||
<Target title="Release (SDL, Sound)">
|
||||
<Option output="Cataclysm-Tiles" prefix_auto="0" extension_auto="1" />
|
||||
<Option object_output="obj/ReleaseSoundSDL/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Os -O2" />
|
||||
<Add option="-DTILES" />
|
||||
<Add option="-DSDLTILES" />
|
||||
<Add option="-DSDL_SOUND" />
|
||||
<Add option="-DRELEASE=1" />
|
||||
<Add directory="WinDepend/include" />
|
||||
<Add directory="WinDepend/include/SDL2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="libSDL2.dll.a" />
|
||||
<Add library="libSDL2main.a" />
|
||||
<Add library="libSDL2_ttf.dll.a" />
|
||||
<Add library="libSDL2_image.dll.a" />
|
||||
<Add library="libSDL2_mixer.dll.a" />
|
||||
<Add directory="WinDepend/lib" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release (SDL, Localized)">
|
||||
<Option output="Cataclysm-Tiles" prefix_auto="0" extension_auto="1" />
|
||||
<Option object_output="obj/ReleaseLocalizedSDL/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Os -O2" />
|
||||
<Add option="-DLOCALIZE" />
|
||||
<Add option="-DTILES" />
|
||||
<Add option="-DSDLTILES" />
|
||||
<Add option="-DRELEASE=1" />
|
||||
<Add directory="WinDepend/include" />
|
||||
<Add directory="WinDepend/include/SDL2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="libintl.dll.a" />
|
||||
<Add library="libiconv.dll.a" />
|
||||
<Add library="libSDL2.dll.a" />
|
||||
<Add library="libSDL2main.a" />
|
||||
<Add library="libSDL2_ttf.dll.a" />
|
||||
<Add library="libSDL2_image.dll.a" />
|
||||
<Add directory="WinDepend/lib" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release (SDL, Loc, Lua, Sound)">
|
||||
<Option output="Cataclysm-Tiles" prefix_auto="0" extension_auto="1" />
|
||||
<Option object_output="obj/ReleaseLocalizedLuaSoundSDL/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Os -O2" />
|
||||
<Add option="-DLOCALIZE" />
|
||||
<Add option="-DTILES" />
|
||||
<Add option="-DSDLTILES" />
|
||||
<Add option="-DSDL_SOUND" />
|
||||
<Add option="-DLUA" />
|
||||
<Add option="-DRELEASE=1" />
|
||||
<Add directory="WinDepend/include" />
|
||||
<Add directory="WinDepend/include/lua5.1" />
|
||||
<Add directory="WinDepend/include/SDL2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="libintl.dll.a" />
|
||||
<Add library="libiconv.dll.a" />
|
||||
<Add library="libSDL2.dll.a" />
|
||||
<Add library="libSDL2main.a" />
|
||||
<Add library="libSDL2_ttf.dll.a" />
|
||||
<Add library="libSDL2_image.dll.a" />
|
||||
<Add library="libSDL2_mixer.dll.a" />
|
||||
<Add library="liblua5.1.a" />
|
||||
<Add directory="WinDepend/lib" />
|
||||
</Linker>
|
||||
<ExtraCommands>
|
||||
<Add before="cmd /c cd src/lua && lua5.1 -v || echo 'lua5.1' command not found!" />
|
||||
<Add before="cmd /c cd src/lua && lua5.1 generate_bindings.lua catabindings.cpp" />
|
||||
<Mode after="always" />
|
||||
</ExtraCommands>
|
||||
</Target>
|
||||
<Target title="Debug">
|
||||
<Option output="CataclysmWin" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Debug/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-pg -g" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-pg -lgmon" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Debug (Localized)">
|
||||
<Option output="CataclysmWin" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/DebugLocalized/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-pg -g" />
|
||||
<Add option="-DLOCALIZE" />
|
||||
<Add directory="WinDepend/include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-pg -lgmon" />
|
||||
<Add library="libintl.dll.a" />
|
||||
<Add library="libiconv.dll.a" />
|
||||
<Add directory="WinDepend/lib" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Debug (SDL)">
|
||||
<Option output="CataclysmWin-Tiles" prefix_auto="0" extension_auto="1" />
|
||||
<Option object_output="obj/DebugSDL/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-pg" />
|
||||
<Add option="-pg -g" />
|
||||
<Add option="-DTILES" />
|
||||
<Add option="-DSDLTILES" />
|
||||
<Add directory="WinDepend/include" />
|
||||
<Add directory="WinDepend/include/SDL2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-pg -lgmon" />
|
||||
<Add library="libSDL2.dll.a" />
|
||||
<Add library="libSDL2main.a" />
|
||||
<Add library="libSDL2_ttf.dll.a" />
|
||||
<Add library="libSDL2_image.dll.a" />
|
||||
<Add directory="WinDepend/lib" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Debug (Lua)">
|
||||
<Option output="CataclysmWin" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/DebugLua/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-pg -g" />
|
||||
<Add option="-DLUA" />
|
||||
<Add directory="WinDepend/include" />
|
||||
<Add directory="WinDepend/include/lua5.1" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-pg -lgmon" />
|
||||
<Add library="liblua5.1.a" />
|
||||
<Add directory="WinDepend/lib" />
|
||||
</Linker>
|
||||
<ExtraCommands>
|
||||
<Add before="cmd /c cd src/lua && lua5.1 -v || echo 'lua5.1' command not found!" />
|
||||
<Add before="cmd /c cd src/lua && lua5.1 generate_bindings.lua catabindings.cpp" />
|
||||
<Mode after="always" />
|
||||
</ExtraCommands>
|
||||
</Target>
|
||||
<Target title="Debug (SDL, Sound)">
|
||||
<Option output="Cataclysm-Tiles" prefix_auto="0" extension_auto="1" />
|
||||
<Option object_output="obj/DebugSoundSDL/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-pg" />
|
||||
<Add option="-pg -g" />
|
||||
<Add option="-DTILES" />
|
||||
<Add option="-DSDLTILES" />
|
||||
<Add option="-DSDL_SOUND" />
|
||||
<Add directory="WinDepend/include" />
|
||||
<Add directory="WinDepend/include/SDL2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-pg -lgmon" />
|
||||
<Add library="libSDL2.dll.a" />
|
||||
<Add library="libSDL2main.a" />
|
||||
<Add library="libSDL2_ttf.dll.a" />
|
||||
<Add library="libSDL2_image.dll.a" />
|
||||
<Add library="libSDL2_mixer.dll.a" />
|
||||
<Add directory="WinDepend/lib" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Debug (SDL, Localized)">
|
||||
<Option output="CataclysmWin-Tiles" prefix_auto="0" extension_auto="1" />
|
||||
<Option object_output="obj/DebugLocalizedSDL/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-pg" />
|
||||
<Add option="-pg -g" />
|
||||
<Add option="-DLOCALIZE" />
|
||||
<Add option="-DSDLTILES" />
|
||||
<Add option="-DTILES" />
|
||||
<Add directory="WinDepend/include" />
|
||||
<Add directory="WinDepend/include/SDL2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-pg -lgmon" />
|
||||
<Add library="libintl.dll.a" />
|
||||
<Add library="libiconv.dll.a" />
|
||||
<Add library="libSDL2.dll.a" />
|
||||
<Add library="libSDL2main.a" />
|
||||
<Add library="libSDL2_ttf.dll.a" />
|
||||
<Add library="libSDL2_image.dll.a" />
|
||||
<Add directory="WinDepend/lib" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Debug (SDL, Loc, Lua, Sound)">
|
||||
<Option output="Cataclysm-Tiles" prefix_auto="0" extension_auto="1" />
|
||||
<Option object_output="obj/DebugLocalizedLuaSoundSDL/" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-pg" />
|
||||
<Add option="-pg -g" />
|
||||
<Add option="-DLOCALIZE" />
|
||||
<Add option="-DTILES" />
|
||||
<Add option="-DSDLTILES" />
|
||||
<Add option="-DSDL_SOUND" />
|
||||
<Add option="-DLUA" />
|
||||
<Add directory="WinDepend/include" />
|
||||
<Add directory="WinDepend/include/lua5.1" />
|
||||
<Add directory="WinDepend/include/SDL2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-pg -lgmon" />
|
||||
<Add library="libintl.dll.a" />
|
||||
<Add library="libiconv.dll.a" />
|
||||
<Add library="libSDL2.dll.a" />
|
||||
<Add library="libSDL2main.a" />
|
||||
<Add library="libSDL2_ttf.dll.a" />
|
||||
<Add library="libSDL2_image.dll.a" />
|
||||
<Add library="libSDL2_mixer.dll.a" />
|
||||
<Add library="liblua5.1.a" />
|
||||
<Add directory="WinDepend/lib" />
|
||||
</Linker>
|
||||
<ExtraCommands>
|
||||
<Add before="cmd /c cd src/lua && lua5.1 -v || echo 'lua5.1' command not found!" />
|
||||
<Add before="cmd /c cd src/lua && lua5.1 generate_bindings.lua catabindings.cpp" />
|
||||
<Mode after="always" />
|
||||
</ExtraCommands>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add option="-Wextra" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-std=c++11" />
|
||||
<Add option="-DCB_BUILD" />
|
||||
<Add option="-D_WINDOWS -D_MINGW -D_WIN32 -DWIN32 -D__MINGW__" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-Wl,-stack,12000000,-subsystem,windows" />
|
||||
<Add option="-static" />
|
||||
<Add library="gdi32" />
|
||||
<Add library="winmm" />
|
||||
</Linker>
|
||||
<ExtraCommands>
|
||||
<Add before="cmd /c git --version || echo 'git' command not found!" />
|
||||
<Add before="cmd /c git describe --tags --always --dirty > version.tmp || echo no-git> version.tmp" />
|
||||
<Add before='cmd /c for /F "tokens=*" %%i in (version.tmp) do echo #define VERSION "%%i" > src/version.h' />
|
||||
<Add before="cmd /c del version.tmp" />
|
||||
<Mode after="always" />
|
||||
</ExtraCommands>
|
||||
<UnitsGlob directory="src" recursive="0" />
|
||||
<Unit filename="src/resource.rc">
|
||||
<Option compilerVar="WINDRES" />
|
||||
</Unit>
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
<envvars />
|
||||
<DoxyBlocks>
|
||||
<comment_style block="0" line="0" />
|
||||
<doxyfile_project />
|
||||
<doxyfile_build />
|
||||
<doxyfile_warnings />
|
||||
<doxyfile_output />
|
||||
<doxyfile_dot />
|
||||
<general />
|
||||
</DoxyBlocks>
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
||||
@@ -1,40 +0,0 @@
|
||||
# Guide to add Comestibles
|
||||
|
||||
There are a large number of files in `json/items/comestibles`, and this guide will help you decide where to put your new comestible!
|
||||
|
||||
## List of special comestibles:
|
||||
`med.json` -- comestible that has an addiction effect besides alcohol and caffeine, plus bandages and disinfectant type items.
|
||||
`mre.json` -- items and comestibles related to MREs
|
||||
`mutagen.json` -- comestible that has any mutagen effect
|
||||
`carnivore.json` -- item that would normally be butchered from an animal or monster, and their cooked versions. examples: chunks of meat, tainted bones, boiled stomach
|
||||
`protein.json` -- comestibles based on protein powder
|
||||
`spice.json` -- comestibles that normally do not have nutrients, but are used to flavor a dish. examples: salt, thyme, black pepper
|
||||
`frozen.json` -- comestibles best eaten frozen
|
||||
`brewing.json` -- items used in the brewing process
|
||||
|
||||
## List of normal comestibles, in order of priority:
|
||||
When you have a comestible you want to add to the files, just go down this list, and the first filename you see in the list that matches the criteria is your choice!
|
||||
|
||||
`alcohol.json` -- "Drink" comestible with alcohol addiction
|
||||
`soup.json` -- "Drink" comestible which is a soup. This is more of a "food" than a drink - you primarily want the calories from this
|
||||
`drink.json` -- "Drink" comestible. This is your drink of choice when you're thirsty! examples: tea, juice, water
|
||||
`drink_other.json` -- "Drink" comestible that does not fit any other criteria. example: vinegar, mustard
|
||||
|
||||
`junkfood.json` -- comestible with the "junk" material. examples: cake, sugary cereal, nachos
|
||||
`sandwich.json` -- a "sandwich" is generally two slices of "bread" with something in between. examples: BLT, PB&J sandwich, fish sandwich
|
||||
`offal_dishes.json` -- comestible made of various offals. the offal types are: liver, brain, kidney, sweetbread, stomach. This must be the primary part of the dish.
|
||||
`seed.json` -- seeds
|
||||
`meat_dishes_human.json` -- comestible made of human flesh. examples: hobo helper, tio taco
|
||||
`meat_dishes.json` -- comestible made with meat.
|
||||
`raw_veggy.json` -- comestible that is a vegetable in its raw form.
|
||||
`irradiated_veggy.json` -- comestible that is an irradiated vegetable. has an indefinite shelf life.
|
||||
`raw_fruit.json` -- comestible that is a fruit in its raw form.
|
||||
`irradiated_fruit.json` -- comestible that is an irradiated fruit. has an indefinite shelf life.
|
||||
`veggy_dishes.json` -- comestible made of vegetables.
|
||||
`bread.json` -- comestible that is either a bread starter, or a cooked bread.
|
||||
`wheat.json` -- either raw wheat, or made of wheat
|
||||
`egg.json` -- either an egg, or made of egg
|
||||
`dairy.json` -- made of milk
|
||||
`mushroom.json` -- a mushroom or made of mushrooms
|
||||
`nuts.json` -- a nut or made of nuts
|
||||
`other.json` -- if you made it here, your comestible doesn't fit any other category!
|
||||
@@ -0,0 +1,28 @@
|
||||
source "https://rubygems.org"
|
||||
ruby RUBY_VERSION
|
||||
|
||||
# Hello! This is where you manage which Jekyll version is used to run.
|
||||
# When you want to use a different version, change it below, save the
|
||||
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
|
||||
#
|
||||
# bundle exec jekyll serve
|
||||
#
|
||||
# This will help ensure the proper Jekyll version is running.
|
||||
# Happy Jekylling!
|
||||
# gem "jekyll", "3.4.2"
|
||||
|
||||
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
||||
gem "minima", "~> 2.0"
|
||||
|
||||
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
||||
# uncomment the line below. To upgrade, run `bundle update github-pages`.
|
||||
gem "github-pages", group: :jekyll_plugins
|
||||
|
||||
# If you have any plugins, put them here!
|
||||
group :jekyll_plugins do
|
||||
gem "jekyll-feed", "~> 0.6"
|
||||
end
|
||||
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
# Issues
|
||||
|
||||
## How to create new issues properly
|
||||
|
||||
GitHub issues are used for everything from bug reporting to suggesting long-term ideas. You can make everything run much smoother by following some simple rules.
|
||||
|
||||
### Rule zero
|
||||
|
||||
Always give your issue a meaningful title as this is the first thing anyone will see.
|
||||
|
||||
Note: `[CR]` and `[WIP]` "tags" are meaningful only for PRs. All open issues by definition are request for comments and work in progress.
|
||||
|
||||
### Bug reports
|
||||
|
||||
Before you submit a bug always search the current list of issues to see if it has been reported already.
|
||||
|
||||
Your bug report has to include:
|
||||
|
||||
- On what OS did you experience the problem (Windows, Linux, OS X etc.)
|
||||
- What version were you playing:
|
||||
- Tiles or Curses (text-based)
|
||||
- Version string (preferably full version e.g. "0.C-4547-g3f1c109", or Jenkins build number e.g. 3245)
|
||||
- Description of the problem written in a way that enables anyone to try and recreate it
|
||||
|
||||
Your bug report may include:
|
||||
|
||||
- Screenshot(s) as some things are best explained visually
|
||||
- Save file (e.g. link to a dropbox upload)
|
||||
|
||||
Bonus points for:
|
||||
|
||||
- Checking if the bug exists under latest experimental build
|
||||
- Checking if it is OS specific
|
||||
|
||||
The OS and CDDA version are very important - with the pace of changes here it is possible the bug you have encountered has already been fixed. After that reproducibility is the key, so write your report with all the necessary details.
|
||||
|
||||
### Enhancements and addition ideas
|
||||
|
||||
We have hundreds of issues open - most of them are ideas and suggestions. If you have a general idea or anything that can't be easily described in terms of *current* code changes you'd be better off suggesting it in the appropriate section of [the forum](https://discourse.cataclysmdda.org/). You'll also get much broader exposure for your idea there. After developing a polished idea on the forum, it should be easy to make a GitHub issue for it.
|
||||
|
||||
Please first search if something like what you have on mind has been already proposed. If so, feel free to join the discussion! If your idea is related but sufficiently different, open a new issue and refer to the older discussion (use GitHub's `#issue_number` reference system).
|
||||
|
||||
Remember to take part in the discussion of your suggestions.
|
||||
|
||||
### Questions
|
||||
|
||||
You should direct your questions to the forum or ask on IRC. You should also read the included documentation and additional text files, e.g. `COMPILING.md` if you have problems building.
|
||||
|
||||
## Bounties
|
||||
|
||||
We keep the development and direction of the game community-driven so placing a bounty *does not* necessarily mean that change will be incorporated into the main game. But it may be incorporated as a mod (or not). As such feel free to post bounties on what you like, but remember we don't do "bounty-driven" development. Good way of thinking about bounties is as encouragement for contributors to work on a particular issue, and certainly not as "paying for features".
|
||||
|
||||
## Issue resolution
|
||||
|
||||
We do not assign people to issues. If you plan to work on a bug fix or a validated idea feel free to just comment about that. Actual PRs are of much greater value than any assignments. In general the first correct PR about something will be the PR that will get merged, but remember: we are using Git - you can collaborate with someone else easily by sending them patches or PRs against their PR branch.
|
||||
@@ -1,9 +0,0 @@
|
||||
Cataclysm is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
|
||||
|
||||
The Square font (data/font/square.ttf) is copyright Wouter van Oortmerssen, licensed under Creative Commons Attribution 3.0 Unported License. See http://strlen.com/square for more information.
|
||||
|
||||
GNU Unifont (data/font/unitfont.ttf) is licensed under GNU General Public License v2+ with the GNU font embedding exception. Visit http://unifoundry.com/LICENSE.txt for details.
|
||||
|
||||
CATCH unit-test framework is licensed under the Boost Software License. Visit https://github.com/philsquared/Catch/blob/master/LICENSE.txt to read the license.
|
||||
|
||||
getpost (tools/json_tools/format/getpost.h) is licensed under the MIT license, see file for text of license.
|
||||
@@ -1,61 +0,0 @@
|
||||
[](https://travis-ci.org/CleverRaven/Cataclysm-DDA)
|
||||
[](https://coveralls.io/github/CleverRaven/Cataclysm-DDA?branch=master)
|
||||
[](https://www.codetriage.com/cleverraven/cataclysm-dda)
|
||||
|
||||
# Cataclysm: Dark Days Ahead
|
||||
|
||||
Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world. While some have described it as a "zombie game", there is far more to Cataclysm than that. Struggle to survive in a harsh, persistent, procedurally generated world. Scavenge the remnants of a dead civilization for food, equipment, or, if you are lucky, a vehicle with a full tank of gas to get you the hell out of Dodge. Fight to defeat or escape from a wide variety of powerful monstrosities, from zombies to giant insects to killer robots and things far stranger and deadlier, and against the others like yourself, that want what you have...
|
||||
|
||||
|
||||
## Download
|
||||
|
||||
Visit [our website](http://cataclysmdda.org) for download links to all stable and experimental releases.
|
||||
|
||||
The source can either be downloaded as [an archive](https://github.com/CleverRaven/Cataclysm-DDA/archive/master.zip), or you can clone it from [our GitHub repository](https://github.com/CleverRaven/Cataclysm-DDA/).
|
||||
|
||||
|
||||
## Compile
|
||||
|
||||
Please read [COMPILING.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/COMPILING.md) - it covers general information and more specific recipes for Linux, OS X, Windows and BSD. We also have an "unofficial" guide on building with `cmake` at [COMPILING-CMAKE.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/COMPILING-CMAKE.md) and guide on building on Windows with `MSYS2` at [COMPILING-MSYS.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/COMPILING-MSYS.md). See [doc/COMPILER_SUPPORT.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/COMPILER_SUPPORT.md) for details on which compilers we support. And you can always dig for more information in `doc/`.
|
||||
|
||||
## Contribute
|
||||
|
||||
Cataclysm:Dark Days Ahead is the result of contributions from over 700 volunteers under the Creative Commons Attribution ShareAlike 3.0 license. The code and content of the game is free to use, modify, and redistribute for any purpose whatsoever. See http://creativecommons.org/licenses/by-sa/3.0/ for details.
|
||||
Some code distributed with the project is not part of the project and is released under different software licenses, the files covered by different software licenses have their own license notices.
|
||||
|
||||
[](https://www.bountysource.com/trackers/146201-clever-raven-cataclysm-dda?utm_source=146201&utm_medium=shield&utm_campaign=TRACKER_BADGE)
|
||||
|
||||
Please see [CONTRIBUTING.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/.github/CONTRIBUTING.md) for details.
|
||||
|
||||
## Community
|
||||
|
||||
Forums:
|
||||
https://discourse.cataclysmdda.org
|
||||
|
||||
Wiki:
|
||||
http://tools.cataclysmdda.com/wiki
|
||||
|
||||
GitHub repo:
|
||||
https://github.com/CleverRaven/Cataclysm-DDA
|
||||
|
||||
IRC:
|
||||
`irc.freenode.net` ; `#CataclysmDDA`
|
||||
http://webchat.freenode.net/?channels=#CataclysmDDA
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
#### Is there a tutorial?
|
||||
|
||||
Yes, you can find the tutorial in the **Special** menu at the main menu (be aware that due to many code changes the tutorial may not function). You can also access documentation in-game via the `?` key.
|
||||
|
||||
#### How can I change the key bindings?
|
||||
|
||||
Press the `?` key, followed by the `1` key to see the full list of key commands. Press the `+` key to add a key binding, select which action with the corresponding letter key `a-w`, and then the key you wish to assign to that action.
|
||||
|
||||
#### How can I start a new world?
|
||||
|
||||
**World** on the main menu will generate a fresh world for you. Select **Create World**.
|
||||
|
||||
#### I've found a bug / I would like to make a suggestion. What should I do?
|
||||
|
||||
Please submit an issue on [our GitHub page](https://github.com/CleverRaven/Cataclysm-DDA/issues/). If you're not able to, send an email to `kevin.granade@gmail.com`.
|
||||
@@ -1,63 +0,0 @@
|
||||
The undersigned release all their contributions to the Cataclysm project under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||
|
||||
Kevin Granade <kevin.granade@gmail.com>
|
||||
Matthew Moffatt <TheDarklingWolf@gmail.com>
|
||||
origamiwolf <origamiwolf@gmail.com>
|
||||
Frank Huard <veryinky@gmail.com>
|
||||
daftfad <daftfjord@gmail.com>
|
||||
ZwodahS <ericnjf@gmail.com>
|
||||
Williham "Wito" Totland <williham.totland@gmail.com>
|
||||
Zach Morgan <zpmorgan@gmail.com>
|
||||
Livingstone <minexal@gmail.com>
|
||||
Ethan "Soron" Kaminski <ethan.kaminski@gmail.com>
|
||||
Soyweiser <soyweiser@gmail.com>
|
||||
Jason Gilbert <0jason.gilbert@gmail.com>
|
||||
Charlie Nolan (FunnyMan3595) <funnyman3595@gmail.com>
|
||||
uzername (some_name) <ivanpost777@gmail.com>
|
||||
Christian Buskirk (i2amroy) <i2amroy@gmail.com>
|
||||
Kevin McKayven (GlyphGryph) <glyphgryph@gmail.com>
|
||||
Ozone <satori.jj@gmail.com>
|
||||
Herbert Jones <jones.herbert@gmail.com>
|
||||
Justin "MacrosBlackD" Drury <macrosblackd@gmail.com>
|
||||
AtomicDryad <fnord@fnord> / <atomicdryad@gmail.com>
|
||||
Izicata
|
||||
Voker57 <voker57@gmail.com>
|
||||
Tommy <yobbobanana@gmx.com>
|
||||
teh-sam
|
||||
Alex Casey (Tamunshin) <tamunshin@hotmail.com>
|
||||
Stevensonz <money3030@yahoo.com.>
|
||||
David Holmes <dholmes@dholmes.us>
|
||||
Sean McLaughlin <galenevil@hotmail.com> / <galenevil.eve@gmail.com>
|
||||
Robert Sørlie (1942rob) <1942rob@gmail.com>
|
||||
Angela Graves <Rivet.the.Zombie@gmail.com>
|
||||
Ian Strachan <ian_e_strachan@hotmail.com>
|
||||
Greg McNew <gmcnew@gmail.com>
|
||||
NaturesWitness <natureswitness@gmail.com>
|
||||
CodeHero <codehero@nerdpol.ch>
|
||||
tasetase "Tase" <tase on irc.freenode.net>
|
||||
Barry Peddycord III <ishara@isharacomix.org>
|
||||
Vidar Engh Skaugen <vidarsk@gmail.com>
|
||||
Brandon Bergren (Bdragon) <bdragon@rtk0.net> / <git@bdragon.rtk0.net>
|
||||
Henrik "Tivec" Bergvin <henrik@bergvin.com>
|
||||
FryCarson <frycarson@gmail.com>
|
||||
TranquilMarmot (Nate Moore) <nate272@gmail.com>
|
||||
Stéphane Travostino <stephane.travostino@gmail.com>
|
||||
Jeremy Osborne <jeremywosborne@gmail.com>
|
||||
David "Davek" Keaton <keaton.david@gmail.com>
|
||||
Piotr S. Staszewski (drbig) <p.staszewski@gmail.com>
|
||||
Donnie "Desrik" McNabb <koderkore@gmail.com>
|
||||
Christian R. Byrne <christianbyrne2012@gmail.com>
|
||||
Dmitry "illi-kun" Serov <D.E.Serov@gmail.com>
|
||||
Karl Parakenings (karlnp) <karl.parakenings@gmail.com>
|
||||
Rob Palkowski <dopeghoti@gmail.com>
|
||||
Zaweri Runewright <mrampuja@gmail.com>
|
||||
Cliffs Dover <cliffs@dancingbottle.com>
|
||||
Sven-Hendrik "svenstaro" Haase <svenstaro@gmail.com>
|
||||
Nick Owens <mischief@offblast.org>
|
||||
Brett Dong <brett.browning.dong@gmail.com>
|
||||
Barry Gackle <bdgackle@gmail.com>
|
||||
BorkBorkGoesTheCode <imreallytoolazy@protonmail.com>
|
||||
Patrik Stridvall <patrik@stridvall.se>
|
||||
Ryan Schneider (RadHazard) <rslego@gmail.com>
|
||||
Paul Bransford (draeath) <draeath@gmail.com>
|
||||
Mark Langsdorf (mlangsdorf) <mark.langsdorf@gmail.com> / <mlangsdo@redhat.com>
|
||||
@@ -0,0 +1,35 @@
|
||||
# Welcome to Jekyll!
|
||||
#
|
||||
# This config file is meant for settings that affect your whole blog, values
|
||||
# which you are expected to set up once and rarely edit after that. If you find
|
||||
# yourself editing this file very often, consider using Jekyll's data files
|
||||
# feature for the data you need to update frequently.
|
||||
#
|
||||
# For technical reasons, this file is *NOT* reloaded automatically when you use
|
||||
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
|
||||
|
||||
# Site settings
|
||||
# These are used to personalize your new site. If you look in the HTML files,
|
||||
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
|
||||
# You can create any custom variable you would like, and they will be accessible
|
||||
# in the templates via {{ site.myvariable }}.
|
||||
title: "Cataclysm: Dark Days Ahead"
|
||||
email: kevin.granade@gmail.com
|
||||
description: > # this means to ignore newlines until "baseurl:"
|
||||
Official homepage of Cataclysm: Dark Days Ahead open source turn-based survival RPG development project.
|
||||
Hosts downloads of game and links to community sites and resources.
|
||||
baseurl: "" # the subpath of your site, e.g. /blog
|
||||
url: "https://cataclysmdda.org" # the base hostname & protocol for your site, e.g. http://example.com
|
||||
repository: CleverRaven/Cataclysm-DDA
|
||||
|
||||
# Build settings
|
||||
markdown: kramdown
|
||||
theme: minima
|
||||
plugins:
|
||||
- jekyll-feed
|
||||
exclude:
|
||||
- Gemfile
|
||||
- Gemfile.lock
|
||||
- vendor
|
||||
include:
|
||||
- .well-known
|
||||
@@ -0,0 +1,18 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
|
||||
<meta name="description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}">
|
||||
|
||||
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
|
||||
<link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">
|
||||
<link rel="alternate" type="application/rss+xml" title="{{ site.title | escape }}" href="{{ "/feed.xml" | relative_url }}">
|
||||
<link rel="me" href="https://mastodon.gamedev.place/@kevingranade">
|
||||
<link rel="me" href="https://social.treehouse.systems/@itsmaya">
|
||||
|
||||
{% if jekyll.environment == 'production' and site.google_analytics %}
|
||||
{% include google-analytics.html %}
|
||||
{% endif %}
|
||||
</head>
|
||||
@@ -0,0 +1,31 @@
|
||||
<header class="site-header">
|
||||
|
||||
<div class="wrapper">
|
||||
{%- assign default_paths = site.pages | map: "path" -%}
|
||||
{%- assign page_paths = site.header_pages | default: default_paths -%}
|
||||
{%- assign titles_size = site.pages | map: 'title' | join: '' | size -%}
|
||||
<a class="site-title" rel="author" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>
|
||||
|
||||
{%- if titles_size > 0 -%}
|
||||
<nav class="site-nav">
|
||||
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
||||
<label for="nav-trigger">
|
||||
<span class="menu-icon">
|
||||
<svg viewBox="0 0 18 15" width="18px" height="15px">
|
||||
<path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/>
|
||||
</svg>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<div class="trigger">
|
||||
<a class="page-link" href="/">Home</a>
|
||||
<a class="page-link" href="/releases/">Releases</a>
|
||||
<!--<a class="page-link" href="/changes/">Changes</a>-->
|
||||
<a class="page-link" href="/contributions/">Contribution Guidelines</a>
|
||||
<a class="page-link" href="/donations/">Donations</a>
|
||||
<a class="page-link" href="https://github.com/CleverRaven/Cataclysm-DDA/">GitHub</a>
|
||||
</div>
|
||||
</nav>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
</header>
|
||||
@@ -1,17 +0,0 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/workspace.xml
|
||||
/.idea/libraries
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
!config/
|
||||
/app/jni/libintl-lite
|
||||
/app/jni/lua
|
||||
/app/jni/mpg-123
|
||||
/app/jni/SDL2
|
||||
/app/jni/SDL2_image
|
||||
/app/jni/SDL2_mixer
|
||||
/app/jni/SDL2_ttf
|
||||
@@ -1,172 +0,0 @@
|
||||
import org.gradle.internal.os.OperatingSystem;
|
||||
|
||||
def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');
|
||||
def buildAsApplication = !buildAsLibrary
|
||||
if (buildAsApplication) {
|
||||
apply plugin: 'com.android.application'
|
||||
}
|
||||
else {
|
||||
apply plugin: 'com.android.library'
|
||||
}
|
||||
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def njobs = getProperty("j")
|
||||
def luaBinary = 'lua'
|
||||
if( localProperties.getProperty('luaBinary') != null ) {
|
||||
luaBinary = localProperties.getProperty('luaBinary')
|
||||
}
|
||||
|
||||
task unzipDeps(type: Copy) {
|
||||
def zipFile = new File('./deps.zip')
|
||||
def outputDir = new File('.')
|
||||
from zipTree(zipFile)
|
||||
into outputDir
|
||||
}
|
||||
|
||||
preBuild.dependsOn unzipDeps
|
||||
|
||||
switch(OperatingSystem.current()) {
|
||||
case OperatingSystem.LINUX:
|
||||
task makeLocalization(type: Exec) {
|
||||
workingDir './../..'
|
||||
commandLine 'make', 'localization', 'LANGUAGES=all'
|
||||
}
|
||||
|
||||
task makeLuaBindings(type: Exec) {
|
||||
workingDir './jni/src/lua'
|
||||
commandLine luaBinary, 'generate_bindings.lua'
|
||||
}
|
||||
|
||||
preBuild.dependsOn makeLocalization
|
||||
preBuild.dependsOn makeLuaBindings
|
||||
break
|
||||
case OperatingSystem.WINDOWS:
|
||||
task makeLocalization(type: Exec) {
|
||||
workingDir './../..'
|
||||
commandLine 'sh.exe', 'android/app/makelocalizations.sh'
|
||||
}
|
||||
|
||||
task makeLuaBindings(type: Exec) {
|
||||
workingDir './../../src/lua'
|
||||
commandLine luaBinary, 'generate_bindings.lua'
|
||||
}
|
||||
unzipDeps.dependsOn makeLocalization
|
||||
preBuild.dependsOn makeLuaBindings
|
||||
break
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 26
|
||||
buildToolsVersion "28.0.1"
|
||||
|
||||
|
||||
if(OperatingSystem.current().isLinux()) {
|
||||
exec {
|
||||
workingDir './../..'
|
||||
commandLine 'make', 'version'
|
||||
}
|
||||
}
|
||||
if(OperatingSystem.current().isWindows()) {
|
||||
exec {
|
||||
workingDir './../..'
|
||||
commandLine 'sh.exe', '-c', 'make version'
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 26
|
||||
versionCode 1
|
||||
versionName new File('app/jni/src/version.h').text.split("\"")[1]
|
||||
if (buildAsApplication) {
|
||||
applicationId "com.cleverraven.cataclysmdda"
|
||||
setProperty("archivesBaseName", "cataclysmdda-" + versionName)
|
||||
}
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a"
|
||||
//abiFilters "x86" // use this for testing on emulators
|
||||
}
|
||||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
arguments "APP_PLATFORM=android-16", "-j$njobs"
|
||||
}
|
||||
}
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
signingConfigs {
|
||||
if( localProperties.getProperty('storeFile') != null ) {
|
||||
if( file(localProperties.getProperty('storeFile')).exists() ) {
|
||||
release {
|
||||
storeFile file(localProperties.getProperty("storeFile"))
|
||||
storePassword localProperties.getProperty("storePassword")
|
||||
keyAlias localProperties.getProperty("keyAlias")
|
||||
keyPassword localProperties.getProperty("keyPassword")
|
||||
}
|
||||
} else {
|
||||
throw new GradleException("Keystore file " + localProperties.getProperty("storeFile") + " was not found.\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
if( signingConfigs.hasProperty("release") ) {
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
cFlags "-DNDEBUG", "-DRELEASE", "-Os"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debug {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
|
||||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
|
||||
sourceSets.main {
|
||||
jniLibs.srcDir 'libs'
|
||||
}
|
||||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
path 'jni/Android.mk'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
if (buildAsLibrary) {
|
||||
libraryVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
def outputFile = output.outputFile
|
||||
if (outputFile != null && outputFile.name.endsWith(".aar")) {
|
||||
def fileName = "com.cleverraven.cataclysmdda.aar";
|
||||
output.outputFile = new File(outputFile.parent, fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api fileTree(include: ['*.jar'], dir: 'libs')
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
# Reference: https://developer.android.com/ndk/guides/android_mk.html
|
||||
|
||||
include $(call all-subdir-makefiles)
|
||||
@@ -1,17 +0,0 @@
|
||||
# Reference: https://developer.android.com/ndk/guides/application_mk.html
|
||||
|
||||
# See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information
|
||||
APP_STL := c++_shared
|
||||
APP_CPPFLAGS += -std=c++11
|
||||
ifneq ($(OS),Windows_NT)
|
||||
APP_LDFLAGS += -fuse-ld=gold
|
||||
endif
|
||||
|
||||
# Do not specify APP_OPTIM here, it is done through ndk-build NDK_DEBUG=0/1 setting instead
|
||||
# See https://developer.android.com/ndk/guides/ndk-build.html#dvr
|
||||
#APP_OPTIM := debug
|
||||
#APP_OPTIM := release
|
||||
|
||||
# Min SDK level
|
||||
APP_PLATFORM=android-16
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../src
|
||||
@@ -1,17 +0,0 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in [sdk]/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
@@ -1,66 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Replace com.test.game with the identifier of your game below, e.g.
|
||||
com.gamemaker.game
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.cleverraven.cataclysmdda"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0"
|
||||
android:installLocation="auto">
|
||||
|
||||
<!-- Android 4.0.1 -->
|
||||
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="24" />
|
||||
|
||||
<!-- OpenGL ES 2.0 -->
|
||||
<uses-feature android:glEsVersion="0x00020000" />
|
||||
|
||||
<!-- Allow writing to external storage -->
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<!-- Allow access to the vibrator -->
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
<!-- if you want to capture audio, uncomment this. -->
|
||||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" /> -->
|
||||
|
||||
<!-- Create a Java class extending SDLActivity and place it in a
|
||||
directory under app/src/main/java matching the package, e.g. app/src/main/java/com/gamemaker/game/MyGame.java
|
||||
|
||||
then replace "SDLActivity" with the name of your class (e.g. "MyGame")
|
||||
in the XML below.
|
||||
|
||||
An example Java class can be found in README-android.md
|
||||
-->
|
||||
<application android:label="@string/app_name"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:allowBackup="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:hardwareAccelerated="true"
|
||||
android:isGame="true" >
|
||||
|
||||
<!-- Example of setting SDL hints from AndroidManifest.xml:
|
||||
<meta-data android:name="SDL_ENV.SDL_ACCELEROMETER_AS_JOYSTICK" android:value="0"/>
|
||||
-->
|
||||
|
||||
<activity android:name="SplashScreen"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleInstance"
|
||||
android:keepScreenOn="true"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:configChanges="keyboardHidden|keyboard|orientation|screenSize"
|
||||
>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="CataclysmDDA"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleInstance"
|
||||
android:keepScreenOn="true"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:configChanges="keyboardHidden|keyboard|orientation|screenSize"
|
||||
>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
Before Width: | Height: | Size: 8.5 KiB |
@@ -1 +0,0 @@
|
||||
../../../../../data
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../gfx
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../../lang/mo
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../lua
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.cleverraven.cataclysmdda;
|
||||
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.content.Context;
|
||||
import android.os.Vibrator;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
import android.content.res.Configuration;
|
||||
|
||||
public class CataclysmDDA extends SDLActivity {
|
||||
private static final String TAG = "CDDA";
|
||||
|
||||
public void vibrate(int duration) {
|
||||
try {
|
||||
Vibrator v = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);
|
||||
v.vibrate(duration);
|
||||
} catch(Exception e) {
|
||||
System.err.println(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void toast(final String message) {
|
||||
try {
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
} catch(Exception e) {
|
||||
System.err.println(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isHardwareKeyboardAvailable() {
|
||||
return getResources().getConfiguration().keyboard == Configuration.KEYBOARD_QWERTY;
|
||||
}
|
||||
|
||||
private float getDisplayDensity() {
|
||||
return getResources().getDisplayMetrics().density;
|
||||
}
|
||||
|
||||
public void show_sdl_surface() {
|
||||
try {
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
mLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
} catch(Exception e) {
|
||||
System.err.println(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getDefaultSetting(final String settingsName, boolean defaultValue) {
|
||||
return PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getBoolean(settingsName, defaultValue);
|
||||
}
|
||||
}
|
||||
@@ -1,325 +0,0 @@
|
||||
package com.cleverraven.cataclysmdda;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.res.AssetManager;
|
||||
import android.os.*;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
|
||||
public class SplashScreen extends Activity {
|
||||
private static final String TAG = "Splash";
|
||||
private static final int INSTALL_DIALOG_ID = 0;
|
||||
private ProgressDialog installDialog;
|
||||
|
||||
public CharSequence[] mSettingsNames = { "Software rendering" };
|
||||
public boolean[] mSettingsValues = { true };
|
||||
|
||||
private String getVersionName() {
|
||||
try {
|
||||
Context context = getApplicationContext();
|
||||
PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
|
||||
return pInfo.versionName;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "error";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
Log.e(TAG, "onCreate()");
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// Start the game if already installed, otherwise start installing...
|
||||
if (getVersionName().equals(PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("installed", ""))) {
|
||||
startGameActivity(false);
|
||||
}
|
||||
else {
|
||||
new InstallProgramTask().execute();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(int id) {
|
||||
switch (id) {
|
||||
case INSTALL_DIALOG_ID:
|
||||
installDialog = new ProgressDialog(this);
|
||||
installDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||
boolean clean_install = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("installed", "").isEmpty();
|
||||
installDialog.setTitle(getString(clean_install ? R.string.installing : R.string.upgrading));
|
||||
installDialog.setIndeterminate(true);
|
||||
installDialog.setCancelable(false);
|
||||
return installDialog;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void startGameActivity(boolean delay) {
|
||||
if (!delay) {
|
||||
runOnUiThread(new StartGameRunnable());
|
||||
}
|
||||
else {
|
||||
// Wait 1.5 seconds, then start game
|
||||
Timer timer = new Timer();
|
||||
TimerTask gameStartTask = new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
runOnUiThread(new StartGameRunnable());
|
||||
}
|
||||
};
|
||||
timer.schedule(gameStartTask, 1500);
|
||||
}
|
||||
}
|
||||
|
||||
private final class StartGameRunnable implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
Intent intent = new Intent(SplashScreen.this, CataclysmDDA.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
overridePendingTransition(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private class InstallProgramTask extends AsyncTask<Void, Integer, Boolean> {
|
||||
private final List<String> PRESERVE_SUBFOLDERS = Arrays.asList("sound", "mods", "gfx"); // don't delete custom subfolders under these folders
|
||||
private final List<String> PRESERVE_FOLDERS = Arrays.asList("font"); // don't delete this folder
|
||||
private final List<String> PRESERVE_FILES = Arrays.asList("user-default-mods.json"); // don't delete this file
|
||||
|
||||
private int totalFiles = 0;
|
||||
private int installedFiles = 0;
|
||||
|
||||
private AlertDialog installationAlert;
|
||||
private AlertDialog settingsAlert;
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
installationAlert = new AlertDialog.Builder(SplashScreen.this)
|
||||
.setTitle("Installation Failed")
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
SplashScreen.this.finish();
|
||||
return;
|
||||
}
|
||||
}).create();
|
||||
AssetManager assetManager = getAssets();
|
||||
try {
|
||||
totalFiles = countTotalAssets(assetManager, "data") +
|
||||
countTotalAssets(assetManager, "gfx") +
|
||||
countTotalAssets(assetManager, "lua") +
|
||||
countTotalAssets(assetManager, "lang");
|
||||
showDialog(INSTALL_DIALOG_ID);
|
||||
} catch(Exception e) {
|
||||
installationAlert.setMessage(e.getMessage());
|
||||
installationAlert.show();
|
||||
}
|
||||
|
||||
settingsAlert = new AlertDialog.Builder(SplashScreen.this)
|
||||
.setTitle("Settings")
|
||||
.setMultiChoiceItems(SplashScreen.this.mSettingsNames, SplashScreen.this.mSettingsValues, new DialogInterface.OnMultiChoiceClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
|
||||
SplashScreen.this.mSettingsValues[which] = isChecked;
|
||||
}})
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("Start game", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
for (int i = 0; i < mSettingsNames.length; ++i)
|
||||
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean(SplashScreen.this.mSettingsNames[i].toString(), SplashScreen.this.mSettingsValues[i]).commit();
|
||||
SplashScreen.this.startGameActivity(false);
|
||||
return;
|
||||
}
|
||||
}).create();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean doInBackground(Void... params) {
|
||||
if (installDialog != null) {
|
||||
installDialog.setIndeterminate(false);
|
||||
installDialog.setMax(totalFiles);
|
||||
}
|
||||
publishProgress(installedFiles);
|
||||
|
||||
AssetManager assetManager = getAssets();
|
||||
String externalFilesDir = getExternalFilesDir(null).getPath();
|
||||
|
||||
try {
|
||||
// Clear out the old data if it exists (but preserve custom folders + files)
|
||||
deleteRecursive(assetManager, externalFilesDir, new File(externalFilesDir + "/data"));
|
||||
deleteRecursive(assetManager, externalFilesDir, new File(externalFilesDir + "/gfx"));
|
||||
deleteRecursive(assetManager, externalFilesDir, new File(externalFilesDir + "/lua"));
|
||||
deleteRecursive(assetManager, externalFilesDir, new File(externalFilesDir + "/lang"));
|
||||
|
||||
// Install the new data over the top
|
||||
copyAssetFolder(assetManager, "data", externalFilesDir + "/data");
|
||||
copyAssetFolder(assetManager, "gfx", externalFilesDir + "/gfx");
|
||||
copyAssetFolder(assetManager, "lua", externalFilesDir + "/lua");
|
||||
copyAssetFolder(assetManager, "lang", externalFilesDir + "/lang");
|
||||
} catch(Exception e) {
|
||||
installationAlert.setMessage(e.getMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Remember which version the installed data is
|
||||
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putString("installed", getVersionName()).commit();
|
||||
|
||||
publishProgress(++installedFiles);
|
||||
Log.d(TAG, "Total number of files copied: " + installedFiles);
|
||||
return true;
|
||||
}
|
||||
|
||||
void deleteRecursive(AssetManager assetManager, String externalFilesDir, File fileOrDirectory) {
|
||||
String parentFolder = fileOrDirectory.getParentFile().getName().toLowerCase();
|
||||
String fileOrDirectoryName = fileOrDirectory.getName().toLowerCase();
|
||||
if (fileOrDirectory.isDirectory()) {
|
||||
// Don't delete the folder if it is in the preserve folders list
|
||||
if (PRESERVE_FOLDERS.contains(fileOrDirectoryName))
|
||||
return;
|
||||
|
||||
// Don't delete the folder if its parent is in the preserve subfolders list, and it doesn't exist in the APK assets (so must be custom data)
|
||||
if (PRESERVE_SUBFOLDERS.contains(parentFolder) && !assetExists(assetManager, fileOrDirectory.getPath().substring(externalFilesDir.length()+1)))
|
||||
return;
|
||||
|
||||
for (File child : fileOrDirectory.listFiles())
|
||||
deleteRecursive(assetManager, externalFilesDir, child);
|
||||
}
|
||||
else {
|
||||
// Don't delete the file if it's in the preserve files list
|
||||
if (PRESERVE_FILES.contains(fileOrDirectoryName))
|
||||
return;
|
||||
}
|
||||
|
||||
fileOrDirectory.delete();
|
||||
}
|
||||
|
||||
// Returns true if an asset exists in the APK (either a directory or a file)
|
||||
// eg. assetExists("data/sound") or assetExists("data/font", "unifont.ttf") would both return true
|
||||
private boolean assetExists(AssetManager assetManager, String assetPath) {
|
||||
return assetExists(assetManager, assetPath, "");
|
||||
}
|
||||
|
||||
private boolean assetExists(AssetManager assetManager, String assetPath, String assetName) {
|
||||
try {
|
||||
String[] files = assetManager.list(assetPath);
|
||||
if (assetName.isEmpty())
|
||||
return files.length > 0; // folder exists
|
||||
for (String file : files) {
|
||||
if (file.equalsIgnoreCase(assetName))
|
||||
return true; // file exists
|
||||
}
|
||||
return false;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private int countTotalAssets(AssetManager assetManager, String assetPath) throws Exception {
|
||||
try {
|
||||
String[] files = assetManager.list(assetPath);
|
||||
int count = 0;
|
||||
for (String file : files)
|
||||
{
|
||||
String filePath = assetPath + "/" + file;
|
||||
String subdir_files[] = assetManager.list(filePath);
|
||||
if (subdir_files.length == 0) // file
|
||||
count++;
|
||||
else // folder
|
||||
count += countTotalAssets(assetManager, filePath);
|
||||
}
|
||||
return count;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
// Pinched from http://stackoverflow.com/questions/16983989/copy-directory-from-assets-to-data-folder
|
||||
private boolean copyAssetFolder(AssetManager assetManager, String fromAssetPath, String toPath) throws Exception {
|
||||
try {
|
||||
String[] files = assetManager.list(fromAssetPath);
|
||||
new File(toPath).mkdirs();
|
||||
boolean res = true;
|
||||
for (String file : files)
|
||||
{
|
||||
String subdir_files[] = assetManager.list(fromAssetPath + "/" + file);
|
||||
if (subdir_files.length == 0) // file
|
||||
res &= copyAsset(assetManager, fromAssetPath + "/" + file, toPath + "/" + file);
|
||||
else // folder
|
||||
res &= copyAssetFolder(assetManager, fromAssetPath + "/" + file, toPath + "/" + file);
|
||||
}
|
||||
return res;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean copyAsset(AssetManager assetManager, String fromAssetPath, String toPath) throws Exception {
|
||||
publishProgress(++installedFiles, totalFiles);
|
||||
InputStream in = null;
|
||||
OutputStream out = null;
|
||||
try {
|
||||
in = assetManager.open(fromAssetPath);
|
||||
new File(toPath).createNewFile();
|
||||
out = new FileOutputStream(toPath);
|
||||
copyFile(in, out);
|
||||
in.close();
|
||||
in = null;
|
||||
out.flush();
|
||||
out.close();
|
||||
out = null;
|
||||
return true;
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private void copyFile(InputStream in, OutputStream out) throws IOException {
|
||||
byte[] buffer = new byte[1024];
|
||||
int read;
|
||||
while((read = in.read(buffer)) != -1) {
|
||||
out.write(buffer, 0, read);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onProgressUpdate(Integer... values) {
|
||||
if (installDialog == null) {
|
||||
return;
|
||||
}
|
||||
installDialog.setProgress(values[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Boolean result) {
|
||||
removeDialog(INSTALL_DIALOG_ID);
|
||||
if(result) {
|
||||
settingsAlert.show();
|
||||
} else {
|
||||
installationAlert.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package org.libsdl.app;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/**
|
||||
SDL library initialization
|
||||
*/
|
||||
public class SDL {
|
||||
|
||||
// This function should be called first and sets up the native code
|
||||
// so it can call into the Java classes
|
||||
public static void setupJNI() {
|
||||
SDLActivity.nativeSetupJNI();
|
||||
SDLAudioManager.nativeSetupJNI();
|
||||
SDLControllerManager.nativeSetupJNI();
|
||||
}
|
||||
|
||||
// This function should be called each time the activity is started
|
||||
public static void initialize() {
|
||||
setContext(null);
|
||||
|
||||
SDLActivity.initialize();
|
||||
SDLAudioManager.initialize();
|
||||
SDLControllerManager.initialize();
|
||||
}
|
||||
|
||||
// This function stores the current activity (SDL or not)
|
||||
public static void setContext(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public static Context getContext() {
|
||||
return mContext;
|
||||
}
|
||||
|
||||
protected static Context mContext;
|
||||
}
|
||||
@@ -1,178 +0,0 @@
|
||||
package org.libsdl.app;
|
||||
|
||||
import android.media.*;
|
||||
import android.util.Log;
|
||||
|
||||
public class SDLAudioManager
|
||||
{
|
||||
protected static final String TAG = "SDLAudio";
|
||||
|
||||
protected static AudioTrack mAudioTrack;
|
||||
protected static AudioRecord mAudioRecord;
|
||||
|
||||
public static void initialize() {
|
||||
mAudioTrack = null;
|
||||
mAudioRecord = null;
|
||||
}
|
||||
|
||||
// Audio
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static int audioOpen(int sampleRate, boolean is16Bit, boolean isStereo, int desiredFrames) {
|
||||
int channelConfig = isStereo ? AudioFormat.CHANNEL_CONFIGURATION_STEREO : AudioFormat.CHANNEL_CONFIGURATION_MONO;
|
||||
int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
|
||||
int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
|
||||
|
||||
Log.v(TAG, "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + (sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
|
||||
|
||||
// Let the user pick a larger buffer if they really want -- but ye
|
||||
// gods they probably shouldn't, the minimums are horrifyingly high
|
||||
// latency already
|
||||
desiredFrames = Math.max(desiredFrames, (AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat) + frameSize - 1) / frameSize);
|
||||
|
||||
if (mAudioTrack == null) {
|
||||
mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate,
|
||||
channelConfig, audioFormat, desiredFrames * frameSize, AudioTrack.MODE_STREAM);
|
||||
|
||||
// Instantiating AudioTrack can "succeed" without an exception and the track may still be invalid
|
||||
// Ref: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/media/java/android/media/AudioTrack.java
|
||||
// Ref: http://developer.android.com/reference/android/media/AudioTrack.html#getState()
|
||||
|
||||
if (mAudioTrack.getState() != AudioTrack.STATE_INITIALIZED) {
|
||||
Log.e(TAG, "Failed during initialization of Audio Track");
|
||||
mAudioTrack = null;
|
||||
return -1;
|
||||
}
|
||||
|
||||
mAudioTrack.play();
|
||||
}
|
||||
|
||||
Log.v(TAG, "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + (mAudioTrack.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static void audioWriteShortBuffer(short[] buffer) {
|
||||
if (mAudioTrack == null) {
|
||||
Log.e(TAG, "Attempted to make audio call with uninitialized audio!");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < buffer.length; ) {
|
||||
int result = mAudioTrack.write(buffer, i, buffer.length - i);
|
||||
if (result > 0) {
|
||||
i += result;
|
||||
} else if (result == 0) {
|
||||
try {
|
||||
Thread.sleep(1);
|
||||
} catch(InterruptedException e) {
|
||||
// Nom nom
|
||||
}
|
||||
} else {
|
||||
Log.w(TAG, "SDL audio: error return from write(short)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static void audioWriteByteBuffer(byte[] buffer) {
|
||||
if (mAudioTrack == null) {
|
||||
Log.e(TAG, "Attempted to make audio call with uninitialized audio!");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < buffer.length; ) {
|
||||
int result = mAudioTrack.write(buffer, i, buffer.length - i);
|
||||
if (result > 0) {
|
||||
i += result;
|
||||
} else if (result == 0) {
|
||||
try {
|
||||
Thread.sleep(1);
|
||||
} catch(InterruptedException e) {
|
||||
// Nom nom
|
||||
}
|
||||
} else {
|
||||
Log.w(TAG, "SDL audio: error return from write(byte)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static int captureOpen(int sampleRate, boolean is16Bit, boolean isStereo, int desiredFrames) {
|
||||
int channelConfig = isStereo ? AudioFormat.CHANNEL_CONFIGURATION_STEREO : AudioFormat.CHANNEL_CONFIGURATION_MONO;
|
||||
int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
|
||||
int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
|
||||
|
||||
Log.v(TAG, "SDL capture: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + (sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
|
||||
|
||||
// Let the user pick a larger buffer if they really want -- but ye
|
||||
// gods they probably shouldn't, the minimums are horrifyingly high
|
||||
// latency already
|
||||
desiredFrames = Math.max(desiredFrames, (AudioRecord.getMinBufferSize(sampleRate, channelConfig, audioFormat) + frameSize - 1) / frameSize);
|
||||
|
||||
if (mAudioRecord == null) {
|
||||
mAudioRecord = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, sampleRate,
|
||||
channelConfig, audioFormat, desiredFrames * frameSize);
|
||||
|
||||
// see notes about AudioTrack state in audioOpen(), above. Probably also applies here.
|
||||
if (mAudioRecord.getState() != AudioRecord.STATE_INITIALIZED) {
|
||||
Log.e(TAG, "Failed during initialization of AudioRecord");
|
||||
mAudioRecord.release();
|
||||
mAudioRecord = null;
|
||||
return -1;
|
||||
}
|
||||
|
||||
mAudioRecord.startRecording();
|
||||
}
|
||||
|
||||
Log.v(TAG, "SDL capture: got " + ((mAudioRecord.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioRecord.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + (mAudioRecord.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** This method is called by SDL using JNI. */
|
||||
public static int captureReadShortBuffer(short[] buffer, boolean blocking) {
|
||||
// !!! FIXME: this is available in API Level 23. Until then, we always block. :(
|
||||
//return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
||||
return mAudioRecord.read(buffer, 0, buffer.length);
|
||||
}
|
||||
|
||||
/** This method is called by SDL using JNI. */
|
||||
public static int captureReadByteBuffer(byte[] buffer, boolean blocking) {
|
||||
// !!! FIXME: this is available in API Level 23. Until then, we always block. :(
|
||||
//return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
||||
return mAudioRecord.read(buffer, 0, buffer.length);
|
||||
}
|
||||
|
||||
|
||||
/** This method is called by SDL using JNI. */
|
||||
public static void audioClose() {
|
||||
if (mAudioTrack != null) {
|
||||
mAudioTrack.stop();
|
||||
mAudioTrack.release();
|
||||
mAudioTrack = null;
|
||||
}
|
||||
}
|
||||
|
||||
/** This method is called by SDL using JNI. */
|
||||
public static void captureClose() {
|
||||
if (mAudioRecord != null) {
|
||||
mAudioRecord.stop();
|
||||
mAudioRecord.release();
|
||||
mAudioRecord = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static native int nativeSetupJNI();
|
||||
}
|
||||
@@ -1,435 +0,0 @@
|
||||
package org.libsdl.app;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.*;
|
||||
import android.view.*;
|
||||
import android.util.Log;
|
||||
|
||||
|
||||
public class SDLControllerManager
|
||||
{
|
||||
|
||||
public static native int nativeSetupJNI();
|
||||
|
||||
public static native int nativeAddJoystick(int device_id, String name, String desc,
|
||||
int is_accelerometer, int nbuttons,
|
||||
int naxes, int nhats, int nballs);
|
||||
public static native int nativeRemoveJoystick(int device_id);
|
||||
public static native int nativeAddHaptic(int device_id, String name);
|
||||
public static native int nativeRemoveHaptic(int device_id);
|
||||
public static native int onNativePadDown(int device_id, int keycode);
|
||||
public static native int onNativePadUp(int device_id, int keycode);
|
||||
public static native void onNativeJoy(int device_id, int axis,
|
||||
float value);
|
||||
public static native void onNativeHat(int device_id, int hat_id,
|
||||
int x, int y);
|
||||
|
||||
protected static SDLJoystickHandler mJoystickHandler;
|
||||
protected static SDLHapticHandler mHapticHandler;
|
||||
|
||||
private static final String TAG = "SDLControllerManager";
|
||||
|
||||
public static void initialize() {
|
||||
mJoystickHandler = null;
|
||||
mHapticHandler = null;
|
||||
|
||||
SDLControllerManager.setup();
|
||||
}
|
||||
|
||||
public static void setup() {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
mJoystickHandler = new SDLJoystickHandler_API16();
|
||||
} else if (Build.VERSION.SDK_INT >= 12) {
|
||||
mJoystickHandler = new SDLJoystickHandler_API12();
|
||||
} else {
|
||||
mJoystickHandler = new SDLJoystickHandler();
|
||||
}
|
||||
mHapticHandler = new SDLHapticHandler();
|
||||
}
|
||||
|
||||
// Joystick glue code, just a series of stubs that redirect to the SDLJoystickHandler instance
|
||||
public static boolean handleJoystickMotionEvent(MotionEvent event) {
|
||||
return mJoystickHandler.handleMotionEvent(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static void pollInputDevices() {
|
||||
mJoystickHandler.pollInputDevices();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static void pollHapticDevices() {
|
||||
mHapticHandler.pollHapticDevices();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static void hapticRun(int device_id, int length) {
|
||||
mHapticHandler.run(device_id, length);
|
||||
}
|
||||
|
||||
// Check if a given device is considered a possible SDL joystick
|
||||
public static boolean isDeviceSDLJoystick(int deviceId) {
|
||||
InputDevice device = InputDevice.getDevice(deviceId);
|
||||
// We cannot use InputDevice.isVirtual before API 16, so let's accept
|
||||
// only nonnegative device ids (VIRTUAL_KEYBOARD equals -1)
|
||||
if ((device == null) || (deviceId < 0)) {
|
||||
return false;
|
||||
}
|
||||
int sources = device.getSources();
|
||||
|
||||
/* This is called for every button press, so let's not spam the logs */
|
||||
/**
|
||||
if ((sources & InputDevice.SOURCE_CLASS_JOYSTICK) == InputDevice.SOURCE_CLASS_JOYSTICK) {
|
||||
Log.v(TAG, "Input device " + device.getName() + " is a joystick.");
|
||||
}
|
||||
if ((sources & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD) {
|
||||
Log.v(TAG, "Input device " + device.getName() + " is a dpad.");
|
||||
}
|
||||
if ((sources & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) {
|
||||
Log.v(TAG, "Input device " + device.getName() + " is a gamepad.");
|
||||
}
|
||||
**/
|
||||
|
||||
return (((sources & InputDevice.SOURCE_CLASS_JOYSTICK) == InputDevice.SOURCE_CLASS_JOYSTICK) ||
|
||||
((sources & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD) ||
|
||||
((sources & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* A null joystick handler for API level < 12 devices (the accelerometer is handled separately) */
|
||||
class SDLJoystickHandler {
|
||||
|
||||
/**
|
||||
* Handles given MotionEvent.
|
||||
* @param event the event to be handled.
|
||||
* @return if given event was processed.
|
||||
*/
|
||||
public boolean handleMotionEvent(MotionEvent event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles adding and removing of input devices.
|
||||
*/
|
||||
public void pollInputDevices() {
|
||||
}
|
||||
}
|
||||
|
||||
/* Actual joystick functionality available for API >= 12 devices */
|
||||
class SDLJoystickHandler_API12 extends SDLJoystickHandler {
|
||||
|
||||
static class SDLJoystick {
|
||||
public int device_id;
|
||||
public String name;
|
||||
public String desc;
|
||||
public ArrayList<InputDevice.MotionRange> axes;
|
||||
public ArrayList<InputDevice.MotionRange> hats;
|
||||
}
|
||||
static class RangeComparator implements Comparator<InputDevice.MotionRange> {
|
||||
@Override
|
||||
public int compare(InputDevice.MotionRange arg0, InputDevice.MotionRange arg1) {
|
||||
return arg0.getAxis() - arg1.getAxis();
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayList<SDLJoystick> mJoysticks;
|
||||
|
||||
public SDLJoystickHandler_API12() {
|
||||
|
||||
mJoysticks = new ArrayList<SDLJoystick>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pollInputDevices() {
|
||||
int[] deviceIds = InputDevice.getDeviceIds();
|
||||
// It helps processing the device ids in reverse order
|
||||
// For example, in the case of the XBox 360 wireless dongle,
|
||||
// so the first controller seen by SDL matches what the receiver
|
||||
// considers to be the first controller
|
||||
|
||||
for(int i=deviceIds.length-1; i>-1; i--) {
|
||||
SDLJoystick joystick = getJoystick(deviceIds[i]);
|
||||
if (joystick == null) {
|
||||
joystick = new SDLJoystick();
|
||||
InputDevice joystickDevice = InputDevice.getDevice(deviceIds[i]);
|
||||
if (SDLControllerManager.isDeviceSDLJoystick(deviceIds[i])) {
|
||||
joystick.device_id = deviceIds[i];
|
||||
joystick.name = joystickDevice.getName();
|
||||
joystick.desc = getJoystickDescriptor(joystickDevice);
|
||||
joystick.axes = new ArrayList<InputDevice.MotionRange>();
|
||||
joystick.hats = new ArrayList<InputDevice.MotionRange>();
|
||||
|
||||
List<InputDevice.MotionRange> ranges = joystickDevice.getMotionRanges();
|
||||
Collections.sort(ranges, new RangeComparator());
|
||||
for (InputDevice.MotionRange range : ranges ) {
|
||||
if ((range.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {
|
||||
if (range.getAxis() == MotionEvent.AXIS_HAT_X ||
|
||||
range.getAxis() == MotionEvent.AXIS_HAT_Y) {
|
||||
joystick.hats.add(range);
|
||||
}
|
||||
else {
|
||||
joystick.axes.add(range);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mJoysticks.add(joystick);
|
||||
SDLControllerManager.nativeAddJoystick(joystick.device_id, joystick.name, joystick.desc, 0, -1,
|
||||
joystick.axes.size(), joystick.hats.size()/2, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check removed devices */
|
||||
ArrayList<Integer> removedDevices = new ArrayList<Integer>();
|
||||
for(int i=0; i < mJoysticks.size(); i++) {
|
||||
int device_id = mJoysticks.get(i).device_id;
|
||||
int j;
|
||||
for (j=0; j < deviceIds.length; j++) {
|
||||
if (device_id == deviceIds[j]) break;
|
||||
}
|
||||
if (j == deviceIds.length) {
|
||||
removedDevices.add(Integer.valueOf(device_id));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=0; i < removedDevices.size(); i++) {
|
||||
int device_id = removedDevices.get(i).intValue();
|
||||
SDLControllerManager.nativeRemoveJoystick(device_id);
|
||||
for (int j=0; j < mJoysticks.size(); j++) {
|
||||
if (mJoysticks.get(j).device_id == device_id) {
|
||||
mJoysticks.remove(j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected SDLJoystick getJoystick(int device_id) {
|
||||
for(int i=0; i < mJoysticks.size(); i++) {
|
||||
if (mJoysticks.get(i).device_id == device_id) {
|
||||
return mJoysticks.get(i);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleMotionEvent(MotionEvent event) {
|
||||
if ((event.getSource() & InputDevice.SOURCE_JOYSTICK) != 0) {
|
||||
int actionPointerIndex = event.getActionIndex();
|
||||
int action = event.getActionMasked();
|
||||
switch(action) {
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
SDLJoystick joystick = getJoystick(event.getDeviceId());
|
||||
if ( joystick != null ) {
|
||||
for (int i = 0; i < joystick.axes.size(); i++) {
|
||||
InputDevice.MotionRange range = joystick.axes.get(i);
|
||||
/* Normalize the value to -1...1 */
|
||||
float value = ( event.getAxisValue( range.getAxis(), actionPointerIndex) - range.getMin() ) / range.getRange() * 2.0f - 1.0f;
|
||||
SDLControllerManager.onNativeJoy(joystick.device_id, i, value );
|
||||
}
|
||||
for (int i = 0; i < joystick.hats.size(); i+=2) {
|
||||
int hatX = Math.round(event.getAxisValue( joystick.hats.get(i).getAxis(), actionPointerIndex ) );
|
||||
int hatY = Math.round(event.getAxisValue( joystick.hats.get(i+1).getAxis(), actionPointerIndex ) );
|
||||
SDLControllerManager.onNativeHat(joystick.device_id, i/2, hatX, hatY );
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getJoystickDescriptor(InputDevice joystickDevice) {
|
||||
return joystickDevice.getName();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class SDLJoystickHandler_API16 extends SDLJoystickHandler_API12 {
|
||||
|
||||
@Override
|
||||
public String getJoystickDescriptor(InputDevice joystickDevice) {
|
||||
String desc = joystickDevice.getDescriptor();
|
||||
|
||||
if (desc != null && !desc.isEmpty()) {
|
||||
return desc;
|
||||
}
|
||||
|
||||
return super.getJoystickDescriptor(joystickDevice);
|
||||
}
|
||||
}
|
||||
|
||||
class SDLHapticHandler {
|
||||
|
||||
class SDLHaptic {
|
||||
public int device_id;
|
||||
public String name;
|
||||
public Vibrator vib;
|
||||
}
|
||||
|
||||
private ArrayList<SDLHaptic> mHaptics;
|
||||
|
||||
public SDLHapticHandler() {
|
||||
mHaptics = new ArrayList<SDLHaptic>();
|
||||
}
|
||||
|
||||
public void run(int device_id, int length) {
|
||||
SDLHaptic haptic = getHaptic(device_id);
|
||||
if (haptic != null) {
|
||||
haptic.vib.vibrate (length);
|
||||
}
|
||||
}
|
||||
|
||||
public void pollHapticDevices() {
|
||||
|
||||
final int deviceId_VIBRATOR_SERVICE = 999999;
|
||||
boolean hasVibratorService = false;
|
||||
|
||||
int[] deviceIds = InputDevice.getDeviceIds();
|
||||
// It helps processing the device ids in reverse order
|
||||
// For example, in the case of the XBox 360 wireless dongle,
|
||||
// so the first controller seen by SDL matches what the receiver
|
||||
// considers to be the first controller
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 16)
|
||||
{
|
||||
for (int i = deviceIds.length - 1; i > -1; i--) {
|
||||
SDLHaptic haptic = getHaptic(deviceIds[i]);
|
||||
if (haptic == null) {
|
||||
InputDevice device = InputDevice.getDevice(deviceIds[i]);
|
||||
Vibrator vib = device.getVibrator();
|
||||
if (vib.hasVibrator()) {
|
||||
haptic = new SDLHaptic();
|
||||
haptic.device_id = deviceIds[i];
|
||||
haptic.name = device.getName();
|
||||
haptic.vib = vib;
|
||||
mHaptics.add(haptic);
|
||||
SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check VIBRATOR_SERVICE */
|
||||
Vibrator vib = (Vibrator) SDL.getContext().getSystemService(Context.VIBRATOR_SERVICE);
|
||||
if (vib != null) {
|
||||
if (Build.VERSION.SDK_INT >= 11) {
|
||||
hasVibratorService = vib.hasVibrator();
|
||||
} else {
|
||||
hasVibratorService = true;
|
||||
}
|
||||
|
||||
if (hasVibratorService) {
|
||||
SDLHaptic haptic = getHaptic(deviceId_VIBRATOR_SERVICE);
|
||||
if (haptic == null) {
|
||||
haptic = new SDLHaptic();
|
||||
haptic.device_id = deviceId_VIBRATOR_SERVICE;
|
||||
haptic.name = "VIBRATOR_SERVICE";
|
||||
haptic.vib = vib;
|
||||
mHaptics.add(haptic);
|
||||
SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check removed devices */
|
||||
ArrayList<Integer> removedDevices = new ArrayList<Integer>();
|
||||
for(int i=0; i < mHaptics.size(); i++) {
|
||||
int device_id = mHaptics.get(i).device_id;
|
||||
int j;
|
||||
for (j=0; j < deviceIds.length; j++) {
|
||||
if (device_id == deviceIds[j]) break;
|
||||
}
|
||||
|
||||
if (device_id == deviceId_VIBRATOR_SERVICE && hasVibratorService) {
|
||||
// don't remove the vibrator if it is still present
|
||||
} else if (j == deviceIds.length) {
|
||||
removedDevices.add(device_id);
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=0; i < removedDevices.size(); i++) {
|
||||
int device_id = removedDevices.get(i);
|
||||
SDLControllerManager.nativeRemoveHaptic(device_id);
|
||||
for (int j=0; j < mHaptics.size(); j++) {
|
||||
if (mHaptics.get(j).device_id == device_id) {
|
||||
mHaptics.remove(j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected SDLHaptic getHaptic(int device_id) {
|
||||
for(int i=0; i < mHaptics.size(); i++) {
|
||||
if (mHaptics.get(i).device_id == device_id) {
|
||||
return mHaptics.get(i);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class SDLGenericMotionListener_API12 implements View.OnGenericMotionListener {
|
||||
// Generic Motion (mouse hover, joystick...) events go here
|
||||
@Override
|
||||
public boolean onGenericMotion(View v, MotionEvent event) {
|
||||
float x, y;
|
||||
int action;
|
||||
|
||||
switch ( event.getSource() ) {
|
||||
case InputDevice.SOURCE_JOYSTICK:
|
||||
case InputDevice.SOURCE_GAMEPAD:
|
||||
case InputDevice.SOURCE_DPAD:
|
||||
return SDLControllerManager.handleJoystickMotionEvent(event);
|
||||
|
||||
case InputDevice.SOURCE_MOUSE:
|
||||
if (!SDLActivity.mSeparateMouseAndTouch) {
|
||||
break;
|
||||
}
|
||||
action = event.getActionMasked();
|
||||
switch (action) {
|
||||
case MotionEvent.ACTION_SCROLL:
|
||||
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
|
||||
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
|
||||
SDLActivity.onNativeMouse(0, action, x, y);
|
||||
return true;
|
||||
|
||||
case MotionEvent.ACTION_HOVER_MOVE:
|
||||
x = event.getX(0);
|
||||
y = event.getY(0);
|
||||
|
||||
SDLActivity.onNativeMouse(0, action, x, y);
|
||||
return true;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Event was not managed
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 24 KiB |
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:drawable="@color/black"/>
|
||||
|
||||
<item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:src="@drawable/splash"/>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
|
Before Width: | Height: | Size: 86 KiB |
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="black">#000000</color>
|
||||
<color name="accent_material_dark">#009926</color>
|
||||
<color name="primary_material_dark">#212121</color>
|
||||
<color name="background_material_dark">#212121</color>
|
||||
</resources>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Cataclysm DDA</string>
|
||||
<string name="installing">Installing game data...</string>
|
||||
<string name="upgrading">Upgrading game data...</string>
|
||||
</resources>
|
||||
@@ -1,10 +0,0 @@
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme" parent="@android:style/Theme.Material.NoActionBar.Fullscreen">
|
||||
<item name="android:windowBackground">@drawable/background_splash</item>
|
||||
<item name="android:colorAccent">@color/accent_material_dark</item>
|
||||
<item name="android:colorPrimary">@color/primary_material_dark</item>
|
||||
<item name="android:colorBackground">@color/background_material_dark</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -1,25 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.1.0'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
jcenter()
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
# Project-wide Gradle settings.
|
||||
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx1536m
|
||||
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
|
||||
# This property controls the number of jobs sent by -j switch to ndk-build
|
||||
# You can override this from the command line by passing "-Pj=#"
|
||||
j=2
|
||||
@@ -1,6 +0,0 @@
|
||||
#Tue Aug 28 01:10:32 MDT 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
||||
@@ -1,160 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
@@ -1,90 +0,0 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1 +0,0 @@
|
||||
include ':app'
|
||||
|
After Width: | Height: | Size: 1.7 MiB |
@@ -1,9 +0,0 @@
|
||||
src/advanced_inv.cpp
|
||||
src/character.cpp
|
||||
src/iexamine.cpp
|
||||
src/json.cpp
|
||||
src/npctalk.cpp
|
||||
src/player.cpp
|
||||
src/sdltiles.cpp
|
||||
src/ui.cpp
|
||||
src/veh_interact.cpp
|
||||
@@ -1,99 +0,0 @@
|
||||
#HOWTO:
|
||||
# run this from the root of the cdda repo using `docker build -f build-scripts/Dockerfile.debian-build . -t cdda`
|
||||
# (note: the -t cdda is optional but convenient. It tags the resulting image with `cdda`)
|
||||
# (note: the `.` is required and orients Docker to the file/dir struture you want to bring into the image with COPY once the setup is done)
|
||||
|
||||
# basing the build on debian testing is an easy way to bring in clang-6.0. Debian testing is quite stable.
|
||||
# (We want clang for faster builds, and clang 6 is latest)
|
||||
FROM debian:testing
|
||||
|
||||
# read latest package index on repos
|
||||
RUN apt-get -qq update
|
||||
|
||||
# we want apt-fast because it makes apt installs way faster by downloading many packages at once, and these packages are used for a fast/easy install of apt-fast
|
||||
RUN apt-get -qq install curl openssl ca-certificates sudo wget --no-install-recommends
|
||||
# we strip 'sudo' calls out of the script so we don't have to bother with sudo even though it's installed, and we avoid the recommended packages from the apt install in the script as they tend to be bloat on a server-like setup like this build image
|
||||
RUN curl -sL https://git.io/vokNn | sed s/'sudo '//g | sed s/'apt-get install'/'apt-get install --no-install-recommends'/g | bash && echo "DOWNLOADBEFORE=true" >> /etc/apt-fast.conf
|
||||
|
||||
# ensure we know about the latest packages
|
||||
RUN apt-fast -qq update
|
||||
|
||||
# random convenience packages
|
||||
RUN apt-fast -qq install --no-install-recommends aptitude man software-properties-common gpg
|
||||
|
||||
# CDDA: for building
|
||||
RUN apt-fast -qq install --no-install-recommends build-essential clang-6.0 cmake ccache
|
||||
# we probably don't want gcc/g++ so we don't accidentally build with them; note, we may find that we might actually want them
|
||||
RUN apt-get -qq remove gcc g++ && apt-get -qq autoremove
|
||||
|
||||
# CDDA: general stuff; gettext is required for localization
|
||||
RUN apt-fast -qq install --no-install-recommends gettext
|
||||
|
||||
# CDDA: libraries for curses-based terminal cdda
|
||||
RUN apt-fast -qq install --no-install-recommends libncurses5-dev libncursesw5-dev
|
||||
|
||||
# CDDA: libraries for tiles build
|
||||
RUN apt-fast -qq install --no-install-recommends libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev lua5.2 liblua5.2-dev
|
||||
|
||||
# general packages for a much nicer time inside the container (we install psmisc for `killall`)
|
||||
RUN apt-fast -qq install --no-install-recommends tree watch tmux fish colormake vim emacs git silversearcher-ag lsof psmisc dstat
|
||||
|
||||
# install opensssh-server and prepare for running it
|
||||
#TODO: find a nice way of getting ssh keys into the image - by grabbing .pub keys from somewhere?
|
||||
RUN apt-fast -qq install --no-install-recommends openssh-server && mkdir -p /run/sshd
|
||||
|
||||
|
||||
# experimental: trying to get X11 forwarding or x2go to run; xauth seems to be required
|
||||
RUN apt-fast install -qq --no-install-recommends xauth
|
||||
|
||||
# install lldb, the llvm debugger (lldb is quite good, and the clang compiler is based on llvm so it's kinda connected)
|
||||
# NOTE: we have to add `--privileged` to `docker run` to be able to debug inside the container, or else we get a pretty cryptic error once we `run` inside the debugger
|
||||
# NOTE: we can probably run an external debugger and attach it to the process inside the container somehow, to be able to debug inside the container using a full IDE on the host
|
||||
RUN apt-fast -qq install --no-install-recommends lldb-6.0
|
||||
|
||||
|
||||
# we prefer to build as a regular user (cdda) rather than root
|
||||
RUN mkdir /cdda
|
||||
# --disabled-password is a way to rush through the user generation (it's inelegant though), and then we set the password 'lol'
|
||||
#TODO: bring the password in as an ARG with an option
|
||||
RUN adduser cdda --disabled-password && echo cdda:lol | chpasswd
|
||||
USER cdda
|
||||
WORKDIR /home/cdda
|
||||
|
||||
# copy everything from the source directory on the host (the `.` in docker build) - except the contents of .dockerignore
|
||||
COPY --chown=cdda:cdda . .
|
||||
|
||||
# we build in build dirs rather than at the repo root
|
||||
# TODO: move build dirs to a directory ABOVE the source so we can Docker mount in the source dir for 'live' builds of code you're hacking on on the host
|
||||
RUN mkdir cmake-build-debug cmake-build-debug-tiles
|
||||
|
||||
WORKDIR /home/cdda/cmake-build-debug
|
||||
|
||||
|
||||
WORKDIR /home/cdda/cmake-build-debug
|
||||
|
||||
RUN env CC=clang-6.0 CXX=clang++-6.0 cmake ..
|
||||
|
||||
RUN echo `pwd` configured for build; to actually build, run "make -j`nproc --all`" here
|
||||
|
||||
WORKDIR /home/cdda/cmake-build-debug-tiles
|
||||
|
||||
RUN env CC=clang-6.0 CXX=clang++-6.0 cmake -DTILES=ON ..
|
||||
|
||||
RUN echo `pwd` configured for build; to actually build, run "make -j`nproc --all`" here
|
||||
|
||||
|
||||
## ssh server stuff (experimental and not needed except for testing ssh stuff with CDDA! you don't need ssh to get a shell inside the container!)
|
||||
## uncomment this to get ssh
|
||||
##
|
||||
## tell Docker to expose port 22 by default on `docker run` (the result is that it's mapped to a random port on the host so you can ssh in with ssh cdda@localhost:{RANDOMPORT}. Running `docker ps` will reveal the external port.
|
||||
## Note that you DO NOT need SSH to get a shell inside the container. This is for testing only.
|
||||
## Crash course: The usual way into the container is `docker {run or exec} -it {container/image name} bash` (or better yet, tmux or fish rather than bash). Docker run is to start a running container from an image, docker exec is to execute a process inside an already-started container.
|
||||
## TODO: expose 22 to fixed port by default, perhaps with an ARG?
|
||||
#EXPOSE 22
|
||||
##
|
||||
## the CMD entry tells Docker to run that command by default when you `docker run` the image as a container
|
||||
## NOTE: disabled as it's probably not a good default for the container. However, when enabled, `docker run` gives you a somewhat persistent container that accepts SSH connections, and then for a regular shell inside the container you do `docker exec -it {containername} bash` (or ssh if you wish)
|
||||
#USER root
|
||||
#WORKDIR /run/sshd
|
||||
#CMD ["/usr/sbin/sshd", "-De", "-f", "/etc/ssh/sshd_config"]
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Build script intended for use in Travis CI
|
||||
|
||||
set -ex
|
||||
|
||||
function run_tests
|
||||
{
|
||||
$WINE "$@" -d yes -r cata --rng-seed time $EXTRA_TEST_OPTS
|
||||
}
|
||||
|
||||
if [ -n "$CMAKE" ]
|
||||
then
|
||||
if [ "$RELEASE" = "1" ]
|
||||
then
|
||||
build_type=MinSizeRel
|
||||
else
|
||||
build_type=Debug
|
||||
fi
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake \
|
||||
-DBACKTRACE=ON \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-DCMAKE_BUILD_TYPE="$build_type" \
|
||||
-DTILES=${TILES:-0} \
|
||||
-DSOUND=${SOUND:-0} \
|
||||
..
|
||||
make -j3
|
||||
cd ..
|
||||
[ -f cata_test ] && run_tests ./cata_test
|
||||
[ -f cata_test-tiles ] && run_tests ./cata_test-tiles
|
||||
else
|
||||
make -j3 RELEASE=1 BACKTRACE=1 DEBUG_SYMBOLS=1 CROSS="$CROSS_COMPILATION"
|
||||
run_tests ./tests/cata_test
|
||||
if [ -n "$MODS" ]
|
||||
then
|
||||
run_tests ./tests/cata_test $MODS
|
||||
fi
|
||||
build-scripts/lint-json.sh
|
||||
fi
|
||||
@@ -1 +0,0 @@
|
||||
find . -name *json -type f -exec python -m json.tool {} >/dev/null \;
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ -n "${CODE_COVERAGE}" ]; then
|
||||
travis_retry pip install --user pyyaml cpp-coveralls;
|
||||
export CXXFLAGS=--coverage;
|
||||
export LDFLAGS=--coverage;
|
||||
fi
|
||||
|
||||
# Influenced by https://github.com/zer0main/battleship/blob/master/build/windows/requirements.sh
|
||||
if [ -n "${MXE_TARGET}" ]; then
|
||||
sudo add-apt-repository 'deb [arch=amd64] https://mirror.mxe.cc/repos/apt xenial main'
|
||||
travis_retry sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 84C7C89FC632241A6999ED0A580873F586B72ED9
|
||||
# We need to treat apt-get update warnings as errors for which the exit code
|
||||
# is not sufficient. The following workaround inspired by
|
||||
# https://unix.stackexchange.com/questions/175146/apt-get-update-exit-status/
|
||||
exec {fd}>&2
|
||||
travis_retry bash -o pipefail -c \
|
||||
"sudo apt-get update 2>&1 | tee /dev/fd/$fd | ( ! grep -q -e '^Err:' -e '^[WE]:' )"
|
||||
exec {fd}>&-
|
||||
|
||||
MXE2_TARGET=$(echo "$MXE_TARGET" | sed 's/_/-/g')
|
||||
export MXE_DIR=/usr/lib/mxe/usr/bin
|
||||
travis_retry sudo apt-get --yes install mxe-${MXE2_TARGET}-gcc mxe-${MXE2_TARGET}-gettext mxe-${MXE2_TARGET}-glib mxe-${MXE2_TARGET}-sdl2 mxe-${MXE2_TARGET}-sdl2-ttf mxe-${MXE2_TARGET}-sdl2-image mxe-${MXE2_TARGET}-sdl2-mixer
|
||||
export PLATFORM='i686-w64-mingw32.static'
|
||||
export CROSS_COMPILATION='${MXE_DIR}/${PLATFORM}-'
|
||||
# Need to overwrite CXX to make the Makefile $CROSS logic work right.
|
||||
export CXX="$COMPILER"
|
||||
export CCACHE=1
|
||||
fi
|
||||
|
||||
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||
brew update
|
||||
brew install sdl2 sdl2_image sdl2_ttf sdl2_mixer gettext ncurses lua
|
||||
brew link --force gettext ncurses
|
||||
fi
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$ghprbPullId" ]; then exit 0; fi
|
||||
|
||||
allowed_section_titles='Features|Content|Interface|Mods|Balance|Bugfixes|Performance|Infrastructure|Build|I18N'
|
||||
|
||||
echo 'Validating Summary line from pull request.'
|
||||
echo "$ghprbPullLongDescription" | grep -Pi '(^|\\r\\n)\s*(`){0,3}SUMMARY: +((None)|(('"${allowed_section_titles}"') +\\?"(.*?)\\?"))(`){0,3}\s*(\\r\\n|$)'
|
||||
if [ $? -eq 0 ]; then
|
||||
echo 'Summary looks good.'
|
||||
exit 0
|
||||
else
|
||||
echo 'Invalid Summary line, please provide a summary similar to the following:'
|
||||
echo 'SUMMARY: Features "Added ability to fly."'
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/bin/sh
|
||||
TARGET_FILE=$0
|
||||
|
||||
cd `dirname $TARGET_FILE`
|
||||
TARGET_FILE=`basename $TARGET_FILE`
|
||||
|
||||
# Iterate down a (possible) chain of symlinks.
|
||||
while [ -L "$TARGET_FILE" ]
|
||||
do
|
||||
TARGET_FILE=`readlink $TARGET_FILE`
|
||||
cd `dirname $TARGET_FILE`
|
||||
TARGET_FILE=`basename $TARGET_FILE`
|
||||
done
|
||||
|
||||
# Find the physical path and name of target file.
|
||||
DIR=`pwd -P`
|
||||
BIN=`basename $0`
|
||||
|
||||
cd "$DIR" || exit $?
|
||||
|
||||
# If name does not match a binary or is this same script, find the right one
|
||||
if [ ! -f "$BIN" ] || [ "$BIN" = "cataclysm-launcher" ]
|
||||
then
|
||||
BIN=
|
||||
for bin in cataclysm-tiles cataclysm
|
||||
do
|
||||
[ -f "$bin" ] && BIN="$bin" && break
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$BIN" ]
|
||||
then
|
||||
exec "./$BIN"
|
||||
else
|
||||
echo "Couldn't find cataclysm game binary in $DIR/"
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
layout: page
|
||||
title: Changes
|
||||
permalink: /changes/
|
||||
---
|
||||
{% for pull in site.github.pulls %}
|
||||
{{ pull.title }}
|
||||
------------------
|
||||
|
||||
{{ pull.body }}
|
||||
{% endfor %}
|
||||
@@ -1,22 +0,0 @@
|
||||
IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
|
||||
ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
|
||||
FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
STRING(REGEX REPLACE "\n" ";" files "${files}")
|
||||
FOREACH(file ${files})
|
||||
MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
||||
IF(EXISTS "$ENV{DESTDIR}${file}")
|
||||
EXEC_PROGRAM(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
IF("${rm_retval}" STREQUAL 0)
|
||||
ELSE("${rm_retval}" STREQUAL 0)
|
||||
MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
||||
ENDIF("${rm_retval}" STREQUAL 0)
|
||||
ELSE(EXISTS "$ENV{DESTDIR}${file}")
|
||||
MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
|
||||
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
|
||||
ENDFOREACH(file)
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
layout: page
|
||||
title: "Contribution Guidelines"
|
||||
permalink: /contributions/
|
||||
---
|
||||
|
||||
# Contribute
|
||||
|
||||
**Opening a new issue?** Please read our [issue guidelines]({{ site.baseurl }}{% link pages/issues.md %}) first.
|
||||
|
||||
**Contributing code?** Check the [code contribution guidelines]({{ site.baseurl }}{% link pages/code_contributions.md %}).
|
||||
|
||||
**Investigating bugs?** These [debugging commands]({{ site.baseurl }}{% link pages/debugging.md %}) can help.
|
||||
|
||||
**Need help with git?** [git howto]({{ site.baseurl }}{% link pages/branch_management.md %}) might be what you're looking for.
|
||||
|
||||
Contributing code or data to Cataclysm: Dark Days Ahead is easy - simply fork the repository on our [GitHub](https://github.com/CleverRaven/Cataclysm-DDA/), make your changes, and then send us a pull request.
|
||||
|
||||
Cataclysm: Dark Days Ahead is released under the Creative Commons Attribution ShareAlike 3.0 license. The code and content of the game is free to use, modify, and redistribute for any purpose whatsoever. See [https://creativecommons.org/licenses/by-sa/3.0/](https://creativecommons.org/licenses/by-sa/3.0/) for details.
|
||||
This means any contribution you make to the project will also be covered by the same license, and this license is irrevocable.
|
||||
|
||||
## Guidelines
|
||||
|
||||
There are a couple of guidelines we suggest sticking to:
|
||||
|
||||
* Add the repository as an `upstream` remote.
|
||||
* Keep your `master` branch clean. This means you can easily pull changes made to this repository into yours.
|
||||
* Create a new branch for each new feature or set of related bug fixes.
|
||||
* Never merge from your local branches into your `master` branch. Only update `master` by pulling from `upstream/master`.
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
#### Why does `git pull --ff-only` result in an error?
|
||||
|
||||
If `git pull --ff-only` shows an error, it means that you've committed directly to your local `master` branch. To fix this, you can create a new branch with these commits, find the point at which you diverged from `upstream/master`, and then reset `master` to that point.
|
||||
|
||||
$ git pull --ff-only upstream master
|
||||
From https://github.com/CleverRaven/Cataclysm-DDA
|
||||
* branch master -> FETCH_HEAD
|
||||
fatal: Not possible to fast-forward, aborting.
|
||||
$ git branch new_branch master # mark the current commit with a tmp branch
|
||||
$ git merge-base master upstream/master
|
||||
cc31d0... # the last commit before we committed directly to master
|
||||
$ git reset --hard cc31d0....
|
||||
HEAD is now at cc31d0... ...
|
||||
|
||||
Now that `master` has been cleaned up, you can easily pull from `upstream/master`, and then continue working on `new_branch`.
|
||||
|
||||
$ git pull --ff-only upstream master
|
||||
# gets changes from the "upstream" remote for the matching branch, in this case "master"
|
||||
$ git checkout new_branch
|
||||
|
||||
#### How does the project work anyway?
|
||||
|
||||
I-am-Erk has written a guide outlining project governance.
|
||||
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/development_process.md
|
||||
@@ -1,39 +0,0 @@
|
||||
# Cataclysm data files
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
SET(CATACLYSM_DATA_DIRS
|
||||
${CMAKE_SOURCE_DIR}/data/font
|
||||
${CMAKE_SOURCE_DIR}/data/json
|
||||
${CMAKE_SOURCE_DIR}/data/mods
|
||||
${CMAKE_SOURCE_DIR}/data/names
|
||||
${CMAKE_SOURCE_DIR}/data/raw
|
||||
${CMAKE_SOURCE_DIR}/data/motd
|
||||
${CMAKE_SOURCE_DIR}/data/credits
|
||||
${CMAKE_SOURCE_DIR}/data/title
|
||||
)
|
||||
|
||||
IF(SOUND)
|
||||
SET(CATACLYSM_DATA_DIRS
|
||||
${CATACLYSM_DATA_DIRS}
|
||||
${CMAKE_SOURCE_DIR}/data/sound
|
||||
)
|
||||
ENDIF(SOUND)
|
||||
|
||||
IF(TILES)
|
||||
SET(CATACLYSM_DATA_DIRS
|
||||
${CATACLYSM_DATA_DIRS}
|
||||
${CMAKE_SOURCE_DIR}/gfx
|
||||
)
|
||||
ENDIF(TILES)
|
||||
|
||||
SET(CATACLYSM_DATA_FILES
|
||||
${CMAKE_SOURCE_DIR}/data/changelog.txt
|
||||
${CMAKE_SOURCE_DIR}/data/cataicon.ico
|
||||
${CMAKE_SOURCE_DIR}/data/fontdata.json
|
||||
${CMAKE_SOURCE_DIR}/LICENSE.txt
|
||||
)
|
||||
|
||||
IF(RELEASE)
|
||||
install(DIRECTORY ${CATACLYSM_DATA_DIRS} DESTINATION ${DATA_PREFIX})
|
||||
install(FILES ${CATACLYSM_DATA_FILES} DESTINATION ${DATA_PREFIX})
|
||||
ENDIF(RELEASE)
|
||||
|
Before Width: | Height: | Size: 66 KiB |
@@ -1,27 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id": "water",
|
||||
"type": "ammunition_type",
|
||||
"name": "water",
|
||||
"default": "water"
|
||||
},
|
||||
{
|
||||
"id": "water",
|
||||
"type": "COMESTIBLE",
|
||||
"comestible_type": "DRINK",
|
||||
"category": "food",
|
||||
"name": "water",
|
||||
"name_plural": "water",
|
||||
"description": "Water, the stuff of life, the best thirst-quencher available. It would be safer to drink once purified.",
|
||||
"weight": 250,
|
||||
"volume": 1,
|
||||
"price": 50,
|
||||
"symbol": "~",
|
||||
"color": "light_blue",
|
||||
"phase": "liquid",
|
||||
"container": "bottle_plastic",
|
||||
"quench": 50,
|
||||
"ammo_data": { "ammo_type": "water" },
|
||||
"flags": [ "EATEN_COLD" ]
|
||||
}
|
||||
]
|
||||
@@ -1,387 +0,0 @@
|
||||
[
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Fires can spread easily, especially with abundance of fuel." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Even without electricity, ovens can be useful fire containers." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Light itself doesn't draw zombies, it's sight, noise or smell." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Moose may not be your friend." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Turnout gear protects from fire but not from overheating." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Peek around corners. You may see your enemy before it sees you." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Cold food lasts longer. Find a cool basement or make a root cellar." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Dying is part of the experience. Try again with what you've learned." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Frozen food? Put it by a fire or heat it up in a pan." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Underground spaces like basements or caves stay cool year-round." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Afraid of wildlife? Yell until it goes away. But beware of what comes instead." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Animals and zombies are not friends. You can take advantage of that." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "A door is not the only way in or out of most places." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Don't fight against the odds. There's no shame in running to survive." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "You don't have to sit next to fire to use it." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Many items have special actions. Try to find out what they do." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Just because a place is dangerous doesn't mean it's worth looting." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "If you're breaking in, be sure you also know how to get back out." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "There's usually more than one way to do things. Think outside the box." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Survival order: shelter, water, food, then everything else." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Balance armor versus encumbrance. Even dropping a backpack can help in melee." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Scared of melee? Throw some things at enemies and use reach weapons like spears." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Makeshift weapons can break easily, but they are weapons, and can be made again." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Not much survives a car at 120mph. Can you?" ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Rotten food typically attracts bugs, and bugs got a lot bigger recently..." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Drugs are great for quick stat boosts, but be careful of addictions or overdose." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Use your map wisely. Prioritize looting places that will get you what you need." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Wounds heal over time. Bandages and disinfectant speeds that up." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Don't get grabbed by zombies. Their bites can be infectious." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Feeling odd after waking up? Try eating healthier and your health may improve." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Eat well or your health might suffer. Fast food is only good in a pinch." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Nature can provide. You can live off the land if you learn how." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Raw food and water from unsafe sources can't be healthy. Right?" ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Why walk when you can use a car? Or a tank?" ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Food from before the Cataclysm won't last forever. Keep that in mind." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "You can make unusual things from usual stuff. Go full MacGyver style if needed." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "There are fungi you want to eat, and those you want to burn. You'll know the difference." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Having a backup weapon is wise. So is having a backup plan." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Windows can't stop zombies but they can stop gas, bile, and smoke. And your smell." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Wet and angry? A dry towel will bring your smile back." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Like to gamble? Use mutagen! Be a winner today!" ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Smoking and napping is asking for more than a hole in your shirt." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "You're on fire? Stop and wait to put it out." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Why it's called chicken walker? Because you'll chicken out every time you'll see it." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Routine kills. Stay alert! Don't let your guard down." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Most medicine doesn't work instantly, so don't swallow a whole bottle of pills." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Famous last words: Let's poke this electric zombie with a metal stick." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "A full stomach will not solve your starvation. Give it time and eat regularly." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Be mindful of environmental protection of your gear. It can take you places." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Don't overlook protective gear, like gas masks or turnout gear. You never know." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Out of resources? Breaking or disassembling stuff can yield interesting components." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Temperature affects the shelf life of foods. The colder, the better." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Frozen food doesn't rot, but may be inedible if not defrosted." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Some dry foods can be eaten frozen. Some foods become mushy after defrosting." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Thirsty on a long winter journey? Take a thermos with you." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "'Tis but a scratch?' Bandage and disinfect it anyway to speed up healing." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Broken limb pinned you down? Hospitals might have next-gen tech to get you going." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Don't be afraid to make the game easier on yourself. Worlds can be made to spawn with more resources." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Don't get caught with your pants down. There's no toilet paper anymore anyway." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Terrain that slows you down will also slow down your enemies." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "When the whole town is one big supermarket a shopping cart becomes your best friend." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Trying out different characters, professions, and scenarios can spice up your game. Roleplay!" ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "A survivor saved is a friend earned. Most of the time..." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Learning how to play? Visit the keybindings menu and learn your ropes." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Expect the unexpected, even if it's the Spanish Inquisition." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "You can throw things while peeking around corners. Perfect for taking down gun turrets." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Nobody told the vending machines that the world ended. Save those cash cards!" ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "There's got to be some cool stuff in those top-secret underground labs, right?" ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Put a funnel over a jug or barrel to collect rainwater over time." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "The number of zombies in a city is large but finite. You can (eventually) kill them all." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Did you *only* take everything not nailed down? Go back for the nails!" ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "You can make your own Safe Mode rules in the pause menu." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "The best gun in the world is useless without ammo." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Most zombies go through cars, not around them. Remember that when running away." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "If you're stuck inside with a broken leg, read some books to pass the time." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Certain corpses can give you bionics if you dissect them." ]
|
||||
},
|
||||
{
|
||||
"type": "snippet",
|
||||
"category": "tip",
|
||||
"text": [ "Don't be too greedy. Loot doesn't matter if you're dead." ]
|
||||
}
|
||||
]
|
||||
@@ -1,18 +0,0 @@
|
||||
# Die maximale Zeilenlänge beträgt 78 Zeichen. Die folgende Linie dient als Referenz.
|
||||
# Zu lange Zeilen werden automatisch umgebrochen.
|
||||
##############################################################################
|
||||
Ur-Autor: Projekt-Manager: Webpräsenz/Forum:
|
||||
Whales (ausgestiegen) KevinGranade GlyphGryph
|
||||
|
||||
Aktuelle Hauptentwickler/GitHub-Manager:
|
||||
KevinGranade, Rivet-the-Zombie, BevapDin, Coolthulhu, i2amroy
|
||||
|
||||
Besonderes Dankeschön an:
|
||||
Narc – Für das Aufsetzen des automatischen Jenkins-Build-Bots.
|
||||
Acidia – Für wunderschöne NPC-, Missions- und Ortsbeiträge.
|
||||
Wuzzy und VlasovVitaly – Für übermenschliche Übersetzungsarbeiten.
|
||||
HuXTUS – Für eine Riesenmenge an großartigen Inhalten.
|
||||
|
||||
Für eine vollständige Liste an Mitwirkenden (auf English), siehe:
|
||||
https://github.com/CleverRaven/Cataclysm-DDA/contributors
|
||||
Cataclysm: Dark Days Ahead wird unter der CC-BY-SA 3.0 veröffentlicht.
|
||||
@@ -1,18 +0,0 @@
|
||||
# Max length of a line is 78 characters; the following line is for reference
|
||||
# Longer lines will be automatically folded
|
||||
##############################################################################
|
||||
Original author: Project Manager: Website/Forum:
|
||||
Whales (retired) KevinGranade GlyphGryph
|
||||
|
||||
Current Main Developers/GitHub Managers:
|
||||
KevinGranade, Rivet-the-Zombie, BevapDin, Coolthulu, i2amroy
|
||||
|
||||
Special thanks to:
|
||||
Narc - For setting up the automatic Jenkins build-bot.
|
||||
Acidia - For wonderful NPC, Quest and Location contributions.
|
||||
Wuzzy and VlasovVitaly - For herculean translation efforts.
|
||||
HuXTUS - For a huge amount of amazing content.
|
||||
|
||||
For a full list of contributors please see:
|
||||
https://github.com/CleverRaven/Cataclysm-DDA/contributors
|
||||
Cataclysm: Dark Days Ahead is released under CC-BY-SA 3.0.
|
||||