Skip to content

Commit

Permalink
CMake Cleanups (#1696)
Browse files Browse the repository at this point in the history
- 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 #1690
  • Loading branch information
p2004a authored Sep 24, 2024
1 parent 8d1ecf0 commit 036c815
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 9 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -115,15 +117,14 @@ 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")
set(DATADIR "share/games/spring" CACHE STRING "Where to install game content")
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")
Expand All @@ -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")
Expand Down
2 changes: 0 additions & 2 deletions docker-build/scripts/02_configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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[@]}" \
Expand Down
4 changes: 0 additions & 4 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand Down
1 change: 0 additions & 1 deletion tools/mapcompile
Submodule mapcompile deleted from 0ddd86

0 comments on commit 036c815

Please sign in to comment.