69 Commits

Author SHA1 Message Date
Stephen E. Baker
bb5f323963 CTest fixes
* Allow ctest to run from build dir
* Remove extra libs linked to ctest
* Prevent test from running twice

Manually adding tests isn't useful as we have catch_discover_tests which
does the same thing on a granular basis for catch2
2025-05-16 21:47:51 -04:00
Stephen E. Baker
1ddbbb4e35 Clean up obsolete cmake options (#2846)
* Remove remainder of VLD

Some components were left behind when I removed the cmake option for
vld.

* Remove USE_PRECOMPILED_DEPS option

Hasn't been maintained in 8 years. The use case has been replaced by
vcpkg.
2025-05-05 13:47:43 +03:00
Stephen E. Baker
e61231df95 Option for CMake to fetch Catch2
Trying to build CorsixTH on Debian 12, Catch2 was one dependency I
couldn't satisfy. This option allows CMake to fetch the files it needs
for unit tests.
2025-04-26 23:46:52 -04:00
Toby Lane
1d7950b690 Add WITH_FONT build option, and search for bundled font, for if user doesn't choose a font file 2025-04-19 18:47:09 +01:00
Stephen E. Baker
14d1a581a1 Add support for AddressSanitizer, drop VLD (#2813)
* Add support for AddressSanitizer, drop VLD

VLD is no longer maintained so it's removed.

Added a convenience option for enabling AddressSanitizer:
https://github.com/google/sanitizers/wiki/AddressSanitizer

The options provided here work in gcc and llvm. Address sanitizer
is available in MSVC but uses a slightly different flag. Undefined Behavior sanitizer in not available for MSVC at this time.

I have not enabled it in the windows dev preset because I cannot test
it.
2025-04-06 13:06:15 -04:00
lewri
dca78020b3 Add WITH_UPDATE_CHECK comment 2024-07-16 18:11:28 +01:00
Toby Lane
2911c3584c Add cmake build options to vcpkg 2024-06-20 17:29:26 +01:00
Stephen E. Baker
deb726a281 Update CMakeLists.txt
Co-authored-by: Toby <mrtobylane@gmail.com>
2024-05-11 21:11:34 -04:00
Stephen E. Baker
d234034b1e Add linking lua modules 2024-05-11 21:11:34 -04:00
Stephen E. Baker
b9b831ce12 Switch to libcurl for update check
Removes dependence on undermaintained luasocket and luasec libraries.

As an additional benefit, update checks can now be disabled at build
time for distros that would prefer not to show it.
2024-04-21 17:07:09 -04:00
Stephen E. Baker
d8b28b463d Add vcpkg support for animview and optional movies 2024-02-18 13:45:01 -05:00
Stephen E. Baker
5c638a2dba Switch to external vcpkg with manifests
Adds support for independently versioning different vcpkg
dependendencies, better binary cache support, and external registries
for specific ports which are now used instead of forking for ffmpeg and
sdl2_mixer.

If you previously built using USE_VCPKG_DEPS you need to migrate
to the new build method.

1. Delete your CorsixTH/vcpkg directory.
2. Delete your build directory
3. Download and install vcpkg following the instructions at:
   https://learn.microsoft.com/en-us/vcpkg/get_started/get-started
4. Run `cmake --prefix dev`
5. Open the visual studio project for your new build directory at
   `./build/dev`
2024-02-18 13:40:52 -05:00
Toby Lane
6873af95ab Fix references to AnimView 2023-12-31 14:09:00 +00:00
Alberth289346
073ec51da9 Add cli function for decoding RNC files. (#2191)
Co-authored-by: Alberth289346 <alberth289346@gmail.com>
Co-authored-by: Stephen E. Baker <baker.stephen.e@gmail.com>
2022-07-03 16:40:15 -04:00
Stephen E. Baker
a3572952b7 Set startup project for Visual Studio
Minor convenience for Visual Studio users.

If CorsixTH is built, set it as the startup project for the top level
sln

Set CorsixTH as the startup project for the CorsixTH.sln
Set AnimView as the startup project for the AnimView.sln
2021-11-27 11:07:47 -05:00
yangfl
84410a86e1 Search more locations for interpreter
Currently Corsix-TH only uses hardcoded CORSIX_TH_INTERPRETER_PATH if no
--interpreter option passed. Search more locations (including the working
directory and the program directory where corsix-th exists) for
CORSIX_TH_INTERPRETER_NAME (i.e. CorsixTH.lua).

Partially address #1569 so the working directory does not have to be the
program directory.
2021-07-11 12:22:44 +08:00
Toby Lane
308d1ad320 Bump required CMake version to 3.10 2021-07-02 15:04:09 +01:00
Stephen E. Baker
6edf76d737 th_movie: Drop support for LibAV
No distributions have included LibAV for a number of years, the last
release was 3 years ago and the mailing lists are silent.
2021-06-16 23:13:49 -04:00
Alexandre Lavoie
38f90e3ba9 Nixpkgs Implementation (and Docker Improvement) (#1881)
* Fix  Dockerfile would not complete due to interactivity being enabled.
* Added docker-compose.yml to build with `docker-compose up`.
* Removed Lua 5.2 from Dockerfile.
* Add BUILD_CORSIXTH cmake flag for disabling building the main program, e.g. if you only want AnimView
2021-06-02 17:01:27 -04:00
Toby Lane
8fe826e648 Change BUILD_ANIMVIEWER to BUILD_ANIMVIEW and add sanity check in AnimView cmake 2021-05-01 17:52:49 +01:00
Toby Lane
6b19d8ac72 Cmakelint changes 2020-09-21 15:50:22 +01:00
Toby Lane
9005643e15 Add cmake option WITH_LUAROCKS to install required luarocks locally
Lpeg, luafilesystem, luasocket and luasec are installed into the
CorsixTH.app/Contents/MacOS folder.
2020-08-04 10:02:16 +01:00
Stephen E. Baker
9c24c865ae Handle current VCPKG and Visual Studio versions
SDL_mixer now requires dynamic_load unless building statically, and no
longer brings over the dynamic libraries it depends on automatically.

Visual Studio 2019 defaults to x64 instead of x86.

Vcpkg is available on more versions of Visual Studio, as well as Linux
and MacOS these days, though our CMake is still not compatible with
using it on non-windows platforms yet.
2020-05-29 23:48:07 -04:00
Toby Lane
a390da605c Cmakelists.txt and docs cleanup 2020-02-07 14:49:48 +00:00
Stephen E. Baker
365af5035d Convert common source into libraries 2020-01-20 14:11:30 -05:00
DavidFair
1dd1672127 Add Catch2 for unit testing (#1550)
Adds catch 2 to CMakeLists in a basic form which duplicates all files
across, with an example test to validate it runs correctly

Moves the implementation of CorsixTH into a main executable and a
seperate static lib we can link against for unit testing. This means we
don't have to mess around with deps for unit testing.

Appveyor and travis changes
2019-06-14 08:16:23 -04:00
Stephen E. Baker
ba90e733f5 [RDY] Bump travis to Xenial (#1528)
* Bump to xenial

* Add ant

Not included by default in xenial

* Remove explicit gcc version

Xenial defaults to a new enough gcc.

* Bump minimum cmake version

Since Travis is bumped to Xenial we are no longer testing any CMake version
older than 3.5.
2019-04-25 06:48:39 -04:00
Stephen E. Baker
893f1d05ab Use CMake standard method of setting C++ std 2019-02-10 21:29:00 -05:00
Stephen E. Baker
c365c751be Add USE_SOURCE_DATADIRS option incompatible with make install
The new option uses the source directory (wherever it is) for the
data directory of CorsixTH, which eliminates the need to run from
a shell script.
2018-02-08 21:33:39 -05:00
Stephen E. Baker
a58814c644 Use GNU paths on linux
CorsixTH now looks for data files in a directory specified in CMake.
On unix systems (other than apple) GNU paths are now used.
2018-02-01 07:34:26 -05:00
Stephen E. Baker
78bc74508c Move doc target to own file 2018-01-11 06:49:45 -05:00
Stephen E. Baker
69d4b5e61e Drop msinttypes
We require Visual Studio 2015+ which have inttypes built in.
2018-01-11 06:49:45 -05:00
Stephen E. Baker
6edc1926b6 Consistent style for CMake scripts 2018-01-10 21:44:59 -05:00
David Fairbrother
ef0c23866d Add script to build and package libs in MS vcpkg
This commit adds a new script which can be executed on
a Windows machine to build and package the libraries
for CorsixTH. A new folder called vcpkg will be created
in the same folder as the script. The script is
integrated into CMake and run by default when
targetting MSVC.
2017-11-10 21:41:30 -05:00
David Fairbrother
7ad371f57e Use CMake to pull in and use precompiled deps for Linux
This commit adds a new module which clones and automatically sets
the include and library paths for the precompiled dependencies.

Linux users can opt in however they must choose the final arch
(i.e. x86 or x64) they intend to compile against.
2017-11-10 21:35:21 -05:00
Stephen E. Baker
809e238110 Bump minimum CMake version to 3.2
Our TravisCI environment is using 3.2, so we are not actively testing on any
older version.
2017-11-10 21:33:05 -05:00
Stephen E. Baker
1156f4054b Remove old map editor
Removes the old map editor and files that only it depended on.
2016-02-09 19:31:20 -05:00
Toby Lane
07fa991a6c Remove cmake target deployment/architecture, credit to msmollin #959 2016-02-02 15:25:07 +00:00
Stephen E. Baker
d7d728de5a Replace all usage of non-standard malloc.h / alloc.h
Calls to alloc have been replaced with C++ vectors. malloc.h is not available
on some OSX machines as per #961
2016-01-06 19:33:13 -05:00
Stephen E. Baker
b22de2d067 Remove outdated lines from cmake scripts 2015-11-13 19:55:41 -05:00
Toby Lane
1120e1db23 Bump OS X target to 10.9 for c++11 compatibility 2015-11-04 21:27:48 +00:00
Stephen E. Baker
82a178ac76 Default WITH_LUAJIT to OFF
LuaJIT is no longer the recommend lua runtime for 0.50 so it should not be
the default.
2015-07-10 12:20:41 -04:00
Alberth
461a1ac2a9 Always include cstdint 2015-06-25 19:16:57 +02:00
timdiels
1a9405e6af Generate documentation for CorsixTH with make doc
Generate reference doc for CorsixTH, AnimView, LevelEdit, MapEdit with doxygen.
Allow LDocGen to generate documentation in any working directory.
Upload documentation to web with TravisCI.

Corrections to the original pull request contributed by:
Alberth <alberth289346@gmail.com>
2015-04-15 19:45:08 -04:00
Stephen E. Baker
f445d049e2 Add support for Visual Leak Detector for Visual Studio
A library that detects memory leaks at run time for Visual Studio.
The library can be enabled in cmake with WITH_VLD.

Get Visual Leak Detector at https://vld.codeplex.com
2015-04-02 20:11:56 +02:00
Stephen E. Baker
8e281a5616 Build with -std=c++11 on compilers that support it.
Falls back to -std=c++0x on older compilers if available
2015-03-15 17:26:44 -07:00
Stephen E. Baker
8dc72bd609 Support playing movies with libav
Makes libav an optional alternative to ffmpeg, selected in cmake.

The intro movie plays perfectly with this libav code.
2015-02-02 19:18:35 -05:00
Stephen E. Baker
4d8f0e4b8d Merge branch 'master' into sdl2
Conflicts:
	CMakeLists.txt
	CorsixTH/Lua/app.lua
	CorsixTH/Lua/ui.lua
	CorsixTH/SDLMain/CMakeLists.txt
	CorsixTH/Src/th_lua_gfx.cpp
	CorsixTH/Src/th_lua_sound.cpp
2015-01-11 12:33:01 -05:00
Adam Daley
e4a79ff3c6 Update cmake files to fix OS X build issues
Updated OS X deployment target to 10.7 and set architecture to x86_64.
Also, removed existing unused code used to copy libraries for OS X from
CorsixTH and MapEdit cmake files and replaced with new code that
automatically bundles app up and includes them in the app. Added
the code to create a bundle to the AnimView cmake file. Finally, updated
the MapEdit cmake file to use the Lua find package code from the CorsixTH
cmake file, which includes a fix for OS X 64bit.
2014-12-09 18:59:37 +00:00
Alan Woolley
01d0d58713 Update CMake files for mingw-w64 2014-02-15 12:12:24 +00:00