From 56d54cf60eb5814f77dfcce91cf12879f01e1d1b Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 7 Apr 2019 11:57:55 +0200 Subject: Add: introduce CMake for project management CMake works on all our supported platforms, like MSVC, Mingw, GCC, Clang, and many more. It allows for a single way of doing things, so no longer we need shell scripts and vbs scripts to work on all our supported platforms. Additionally, CMake allows to generate project files for like MSVC, KDevelop, etc. This heavily reduces the lines of code we need to support multiple platforms from a project perspective. Addtiionally, this heavily improves our detection of libraries, etc. --- src/os/CMakeLists.txt | 4 ++++ src/os/macosx/CMakeLists.txt | 11 +++++++++++ src/os/os2/CMakeLists.txt | 4 ++++ src/os/unix/CMakeLists.txt | 9 +++++++++ src/os/windows/CMakeLists.txt | 8 ++++++++ src/os/windows/ottdres.rc.in | 14 +++++++------- 6 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 src/os/CMakeLists.txt create mode 100644 src/os/macosx/CMakeLists.txt create mode 100644 src/os/os2/CMakeLists.txt create mode 100644 src/os/unix/CMakeLists.txt create mode 100644 src/os/windows/CMakeLists.txt (limited to 'src/os') diff --git a/src/os/CMakeLists.txt b/src/os/CMakeLists.txt new file mode 100644 index 000000000..e302c448b --- /dev/null +++ b/src/os/CMakeLists.txt @@ -0,0 +1,4 @@ +add_subdirectory(macosx) +add_subdirectory(os2) +add_subdirectory(unix) +add_subdirectory(windows) diff --git a/src/os/macosx/CMakeLists.txt b/src/os/macosx/CMakeLists.txt new file mode 100644 index 000000000..e6b6c237b --- /dev/null +++ b/src/os/macosx/CMakeLists.txt @@ -0,0 +1,11 @@ +add_files( + crashlog_osx.cpp + macos.h + macos.mm + osx_stdafx.h + splash.cpp + splash.h + string_osx.cpp + string_osx.h + CONDITION APPLE +) diff --git a/src/os/os2/CMakeLists.txt b/src/os/os2/CMakeLists.txt new file mode 100644 index 000000000..52534dbcb --- /dev/null +++ b/src/os/os2/CMakeLists.txt @@ -0,0 +1,4 @@ +add_files( + os2.cpp + CONDITION OPTION_OS2 +) diff --git a/src/os/unix/CMakeLists.txt b/src/os/unix/CMakeLists.txt new file mode 100644 index 000000000..b548d3bb2 --- /dev/null +++ b/src/os/unix/CMakeLists.txt @@ -0,0 +1,9 @@ +add_files( + crashlog_unix.cpp + CONDITION UNIX AND NOT APPLE AND NOT OPTION_OS2 +) + +add_files( + unix.cpp + CONDITION UNIX AND NOT OPTION_OS2 +) diff --git a/src/os/windows/CMakeLists.txt b/src/os/windows/CMakeLists.txt new file mode 100644 index 000000000..19d1bd46e --- /dev/null +++ b/src/os/windows/CMakeLists.txt @@ -0,0 +1,8 @@ +add_files( + crashlog_win.cpp + string_uniscribe.cpp + string_uniscribe.h + win32.cpp + win32.h + CONDITION WIN32 +) diff --git a/src/os/windows/ottdres.rc.in b/src/os/windows/ottdres.rc.in index a2f8c28f5..741fa0e10 100644 --- a/src/os/windows/ottdres.rc.in +++ b/src/os/windows/ottdres.rc.in @@ -37,7 +37,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -100 ICON DISCARDABLE "../../../media/openttd.ico" +100 ICON DISCARDABLE "${CMAKE_SOURCE_DIR}/os/windows/openttd.ico" ///////////////////////////////////////////////////////////////////////////// // @@ -77,8 +77,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,11,0,!!ISODATE!! - PRODUCTVERSION 1,11,0,!!ISODATE!! + FILEVERSION 1,11,0,${REV_ISODATE} + PRODUCTVERSION 1,11,0,${REV_ISODATE} FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -96,14 +96,14 @@ BEGIN VALUE "Comments", "This program is licensed under the GNU General Public License version 2.\0" VALUE "CompanyName", "OpenTTD Development Team\0" VALUE "FileDescription", "OpenTTD\0" - VALUE "FileVersion", "!!VERSION!!\0" + VALUE "FileVersion", "${REV_VERSION}\0" VALUE "InternalName", "openttd\0" - VALUE "LegalCopyright", "Copyright \xA9 OpenTTD Developers 2002-!!YEAR!!. All Rights Reserved.\0" + VALUE "LegalCopyright", "Copyright \xA9 OpenTTD Developers 2002-${REV_YEAR}. All Rights Reserved.\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "openttd.exe\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "OpenTTD\0" - VALUE "ProductVersion", "!!VERSION!!\0" + VALUE "ProductVersion", "${REV_VERSION}\0" VALUE "SpecialBuild", "-\0" END END @@ -116,7 +116,7 @@ END #endif // !_MAC #ifdef __MINGW32__ -1 24 "..\\..\\..\\projects\\dpi_aware.manifest" +1 24 "${CMAKE_SOURCE_DIR}/os/windows/openttd.manifest" #endif #endif // Neutral (Default) resources -- cgit v1.2.3-70-g09d2