From 036c815e405121135437870421fee77c7fb218f3 Mon Sep 17 00:00:00 2001 From: Marek Rusinowski Date: Tue, 24 Sep 2024 22:35:43 +0200 Subject: [PATCH] CMake Cleanups (#1696) - Fix erroneous additional comma I've introduced in #1689 - Allow setting `PREFER_STATIC_LIBS` and `MINGWLIB` related to dependency resolution as part of environment - Remove mapcompile dependency as it's no longer used - Remove unused `MANDIR` option, fixes https://github.com/beyond-all-reason/spring/issues/1690 --- .gitmodules | 3 --- CMakeLists.txt | 15 +++++++++------ docker-build/scripts/02_configure.sh | 2 -- tools/CMakeLists.txt | 4 ---- tools/mapcompile | 1 - 5 files changed, 9 insertions(+), 16 deletions(-) delete mode 160000 tools/mapcompile diff --git a/.gitmodules b/.gitmodules index 8e4eff1506..10b492fcee 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,9 +7,6 @@ [submodule "tools/pr-downloader"] path = tools/pr-downloader url = https://github.com/beyond-all-reason/pr-downloader -[submodule "tools/SpringMapConvNG"] - path = tools/mapcompile - url = https://github.com/spring/SpringMapConvNG.git [submodule "AI/Skirmish/BARb"] path = AI/Skirmish/BARb url = https://github.com/rlcevg/CircuitAI.git diff --git a/CMakeLists.txt b/CMakeLists.txt index c219d07064..27431c838e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,9 @@ project(Spring) add_definitions(-DFMT_HEADER_ONLY) #for fmt lib option(INSTALL_PORTABLE "Make a portable installation (instead of regular system installation)" TRUE) -option(WITH_MAPCOMPILER "Include map compiler" TRUE) + +# Allow to set PREFER_STATIC_LIBS from env, defaults to false +option(PREFER_STATIC_LIBS "Prefer static libraries when linking deps" $ENV{PREFER_STATIC_LIBS}) # dummy so that qtcreator shows all files (even those of windows) if(CMAKE_VERSION VERSION_GREATER 3.1.2) @@ -115,7 +117,7 @@ if (UNIX AND NOT MINGW) set(BINDIR "." CACHE STRING "Where to install binaries") set(LIBDIR "." CACHE STRING "Where to install libraries") set(DATADIR "." CACHE STRING "Where to install game content") - set(DOCDIR, "doc" CACHE STRING "Where to install basic project documentation (README, LICENSE, etc.)") + set(DOCDIR "doc" CACHE STRING "Where to install basic project documentation (README, LICENSE, etc.)") else() set(BINDIR "bin" CACHE STRING "Where to install binaries") set(LIBDIR "lib" CACHE STRING "Where to install libraries") @@ -123,7 +125,6 @@ if (UNIX AND NOT MINGW) set(DOCDIR "share/doc/spring-VERSION" CACHE STRING "Where to install basic project documentation (README, LICENSE, etc.)") # TODO set correct version here, and re-enable userdocs in doc/CMakeLists.txt endif() - set(MANDIR "share/man" CACHE STRING "Where to install man pages") set(APPLICATIONS_DIR "share/applications" CACHE STRING "Where to install desktop files") set(PIXMAPS_DIR "share/pixmaps" CACHE STRING "Where to install icons") set(MIME_DIR "share/mime" CACHE STRING "Where MIME definitions are located") @@ -134,19 +135,21 @@ else (UNIX AND NOT MINGW) set(DATADIR "." CACHE STRING "Where to install game content") if (NOT MINGWLIBS) - if(MSVC) + if (DEFINED ENV{MINGWLIBS}) + set(MINGWLIBS $ENV{MINGWLIBS} CACHE PATH "Location of the mingwlibs package") + elseif(MSVC) if(BUILD_BITS EQUAL 32) set(MINGWLIBS ${CMAKE_SOURCE_DIR}/vclibs CACHE PATH "Location of the vclibs package") else(BUILD_BITS EQUAL 32) set(MINGWLIBS ${CMAKE_SOURCE_DIR}/vclibs64 CACHE PATH "Location of the vclibs package") endif(BUILD_BITS EQUAL 32) - else(MSVC) + else() if(BUILD_BITS EQUAL 32) set(MINGWLIBS ${CMAKE_SOURCE_DIR}/mingwlibs CACHE PATH "Location of the mingwlibs package") else(BUILD_BITS EQUAL 32) set(MINGWLIBS ${CMAKE_SOURCE_DIR}/mingwlibs64 CACHE PATH "Location of the mingwlibs package") endif(BUILD_BITS EQUAL 32) - endif(MSVC) + endif() endif () if (EXISTS "${MINGWLIBS}" AND IS_DIRECTORY "${MINGWLIBS}") if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.17.0") diff --git a/docker-build/scripts/02_configure.sh b/docker-build/scripts/02_configure.sh index 1f390d5b6e..95fd0dac08 100755 --- a/docker-build/scripts/02_configure.sh +++ b/docker-build/scripts/02_configure.sh @@ -14,7 +14,6 @@ if [ "${PLATFORM}" == "linux-64" ]; then -DBINDIR:PATH=./ -DLIBDIR:PATH=./ -DDATADIR:PATH=./ - -DMANDIR:PATH=share/man -DDOCDIR:PATH=doc ) export PKG_CONFIG_LIBDIR=${LIBS_DIR}/lib/pkgconfig @@ -45,7 +44,6 @@ cmake \ -DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_DIR}" \ -DUSERDOCS_PLAIN=ON \ -DINSTALL_PORTABLE=ON \ - -DWITH_MAPCOMPILER=OFF \ -DAI_EXCLUDE_REGEX="^CppTestAI$" \ "${MYCMAKEFLAGS}" \ "${EXTRA_CMAKE_ARGS[@]}" \ diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 525888baf5..30bc109f18 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -2,10 +2,6 @@ add_subdirectory(unitsync) add_subdirectory(DemoTool) -if (WITH_MAPCOMPILER) - add_subdirectory(mapcompile) -endif(WITH_MAPCOMPILER) - if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/pr-downloader/CMakeLists.txt") message(FATAL_ERROR "${CMAKE_CURRENT_SOURCE_DIR}/pr-downloader/ is missing, please run\n git submodule init && git submodule update") endif () diff --git a/tools/mapcompile b/tools/mapcompile deleted file mode 160000 index 0ddd86eaa8..0000000000 --- a/tools/mapcompile +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0ddd86eaa8871dc0833c69f931f55cd856c5009d