Some more CMake white space formatting

- tabs to spaces
 - use Unix line endings everywhere
 - newline at end of file
 - remove trailing white space
 - no space between keywords and opening parenthesis
 - use 2 spaces to indent
This commit is contained in:
Thomas Otto 2024-04-21 11:02:27 +02:00
parent 8e531a5496
commit 00389c50ea
48 changed files with 828 additions and 816 deletions

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
encoder.cpp)

View File

@ -7,14 +7,14 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if (UNIX)
if(UNIX)
set(D3_GAMEDIR "~/Descent3/")
string(APPEND CMAKE_CXX_FLAGS " -Wno-write-strings -Wno-multichar ${BITS} ${EXTRA_CXX_FLAGS}")
string(APPEND CMAKE_C_FLAGS " ${BITS}")
find_package(SDL REQUIRED)
if (APPLE)
if(APPLE)
# Provide FIND_PACKAGE( SDL_image ) below with an include dir and library that work with brew-installed sdl2_image
find_path(SDL_IMAGE_INCLUDE_DIR SDL_image.h PATH_SUFFIXES include/SDL2)
find_library(SDL_IMAGE_LIBRARY SDL2_image)
@ -23,22 +23,22 @@ if (UNIX)
find_package(SDL_image REQUIRED)
find_package(Curses REQUIRED)
find_package(OpenGL REQUIRED)
message( "SDL Include Dir is " ${SDL_INCLUDE_DIR} )
message("SDL Include Dir is " ${SDL_INCLUDE_DIR})
endif()
if (UNIX AND NOT APPLE)
if(UNIX AND NOT APPLE)
message("Building for Linux")
add_definitions( -D_DEBUG -D__LINUX__ -DLINUX -D_MAX_PATH=260 -D_MAX_FNAME=256 -D_REENRANT -D__32BIT__ -DHAVEALLOCA_H -D_USE_OGL_ACTIVE_TEXTURES)
set(PLATFORM_INCLUDES "lib/linux" ${SDL_INCLUDE_DIR} )
set(PLATFORM_INCLUDES "lib/linux" ${SDL_INCLUDE_DIR})
endif()
if (APPLE)
if(APPLE)
message("Building for MAC OSX")
add_definitions(-D_DEBUG -D__LINUX__ -DLINUX -D_MAX_PATH=260 -D_MAX_FNAME=256 -D_REENRANT -DMACOSX=1 -D_USE_OGL_ACTIVE_TEXTURES)
set(PLATFORM_INCLUDES "lib/linux" ${SDL_INCLUDE_DIR} "/usr/X11/include" )
set(PLATFORM_INCLUDES "lib/linux" ${SDL_INCLUDE_DIR} "/usr/X11/include")
endif()
if (WIN32)
if(WIN32)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "lib/win" "lib/win/directx")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /EHsc /RTC1 /W3 /nologo /c /Zi /TP /errorReport:prompt")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL /FD /EHsc /W3 /nologo /c /Zi /TP /errorReport:prompt")
@ -57,7 +57,7 @@ if (WIN32)
find_library(DXGUID_LIBRARY NAMES dxguid "${CMAKE_SOURCE_DIR}/lib/win" "${CMAKE_SOURCE_DIR}/lib/win/directx")
find_library(DDRAW_LIBRARY NAMES ddraw "${CMAKE_SOURCE_DIR}/lib/win" "${CMAKE_SOURCE_DIR}/lib/win/directx")
if (MSVC AND CMAKE_CXX_SIMULATE_ID STREQUAL "")
if(MSVC AND CMAKE_CXX_SIMULATE_ID STREQUAL "")
add_compile_options("/we4150") # deletion of pointer to incomplete type 'type'; no destructor called
# add_compile_options("/we4305") # truncation from 'X' to 'Y'
add_compile_options("/we4474") # too many arguments passed for format string
@ -69,7 +69,7 @@ if (WIN32)
add_compile_options("/we4715") # 'function' : not all control paths return a value
add_compile_options("/we4834") # discarding return value of function with [[nodiscard]] attribute
endif()
endif ()
endif()
include_directories("lib" "Descent3" ${PLATFORM_INCLUDES})
@ -82,7 +82,7 @@ add_subdirectory(cfile)
add_subdirectory(czip)
add_subdirectory(d3music)
if (WIN32)
if(WIN32)
add_subdirectory(dd_grwin32)
add_subdirectory(dd_vidwin32)
add_subdirectory(win32)
@ -90,7 +90,7 @@ if (WIN32)
add_subdirectory(ddio_win)
endif()
if (UNIX)
if(UNIX)
add_subdirectory(linux)
add_subdirectory(ddvid_lnx)
add_subdirectory(dd_lnxsound)

View File

@ -144,7 +144,7 @@ set(HEADERS
weapon_external.h
weather.h)
set (CPPS
set(CPPS
aiambient.cpp
AIGoal.cpp
AImain.cpp
@ -273,25 +273,23 @@ set (CPPS
voice.cpp
weapon.cpp
WeaponFire.cpp
weather.cpp
)
weather.cpp)
if (WIN32)
set (PLATFORM_LIBS dd_sndlib dd_grwin32 dd_vidwin32 ddio_win win32 wsock32.lib winmm.lib Glu32.lib
if(WIN32)
set(PLATFORM_LIBS dd_sndlib dd_grwin32 dd_vidwin32 ddio_win win32 wsock32.lib winmm.lib Glu32.lib
${DSOUND_LIBRARY} ${DINPUT_LIBRARY} ${DXGUID_LIBRARY} ${DDRAW_LIBRARY})
set(PLATFORM_CPPS winmain.cpp )
set(PLATFORM_CPPS winmain.cpp)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO /SUBSYSTEM:WINDOWS /NODEFAULTLIB:LIBC")
endif()
if (UNIX AND NOT APPLE)
if(UNIX AND NOT APPLE)
set(PLATFORM_LIBS linux dd_lnxsound ddvid_lnx lnxcontroller ddio_lnx SDL::SDL m ${CMAKE_DL_LIBS} OpenGL::GLU ${CURSES_LIBRARIES})
set(PLATFORM_CPPS loki_utils.c lnxmain.cpp)
endif()
if (APPLE)
set (PLATFORM_LIBS linux dd_lnxsound ddvid_lnx lnxcontroller ddio_lnx SDL::SDL ${CURSES_LIBRARIES})
set (PLATFORM_CPPS loki_utils.c lnxmain.cpp SDLMain.m)
if(APPLE)
set(PLATFORM_LIBS linux dd_lnxsound ddvid_lnx lnxcontroller ddio_lnx SDL::SDL ${CURSES_LIBRARIES})
set(PLATFORM_CPPS loki_utils.c lnxmain.cpp SDLMain.m)
set(CMAKE_EXE_LINKER_FLAGS "-framework IOKit -framework Cocoa -framework OpenGL -framework Carbon")
endif()
@ -304,6 +302,6 @@ target_link_libraries(Descent3
music networking physics renderer rtperformance sndlib ui unzip vecmat md5
${PLATFORM_LIBS})
if (WIN32)
if(WIN32)
set_target_properties(Descent3 PROPERTIES WIN32_EXECUTABLE ON)
endif()

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
acmlib.cpp)

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
CFILE.cpp
hog.cpp

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
BitIO.cpp
CZip.cpp

View File

@ -1,4 +1,4 @@
set(HEADERS ddlnxsound.h )
set(HEADERS ddlnxsound.h)
set(CPPS mixer.cpp sdlsound.cpp ../dd_sndlib/ssl_lib.cpp ../dd_sndlib/ddsoundload.cpp)
add_library(dd_lnxsound STATIC ${HEADERS} ${CPPS})

View File

@ -1,4 +1,15 @@
set(HEADERS ddio_lnx.h)
set(CPPS lnxfile.cpp lnxforcefeedback.cpp lnxio.cpp sdljoy.cpp lnxkey.cpp lnxkey_null.cpp lnxmouse.cpp lnxtimer.cpp lnxkey_raw.cpp lnxcdrom.cpp lnxkey_sdl.cpp)
set(CPPS
lnxfile.cpp
lnxforcefeedback.cpp
lnxio.cpp
sdljoy.cpp
lnxkey.cpp
lnxkey_null.cpp
lnxmouse.cpp
lnxtimer.cpp
lnxkey_raw.cpp
lnxcdrom.cpp
lnxkey_sdl.cpp)
add_library(ddio_lnx STATIC ${HEADERS} ${CPPS})

View File

@ -1,4 +1,4 @@
set(HEADERS ddio_win.h )
set(HEADERS ddio_win.h)
set(CPPS
serial.cpp
winfile.cpp

View File

@ -1,5 +1,5 @@
set (HEADERS )
set (CPPS
set(HEADERS)
set(CPPS
fix.cpp)
add_library(fix STATIC ${HEADERS} ${CPPS})

View File

@ -1,4 +1,4 @@
set(HEADERS grtextlib.h )
set(HEADERS grtextlib.h)
set(CPPS
grfont.cpp
grtext.cpp

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
aencode.cpp
libacm.cpp)

View File

@ -1,18 +1,19 @@
set(HEADERS mvegfx.h
set(HEADERS
mvegfx.h
mvelibi.h
mvelibl.h
platform.h
snd8to16.h
SystemInterfaces.h )
SystemInterfaces.h)
set(CPPS
mveasm.cpp
mvelibl.cpp
platform.cpp)
set(PLATFORM_CPPS )
set(PLATFORM_CPPS)
if (UNIX)
set (PLATFORM_CPPS "lnxdsound.cpp")
if(UNIX)
set(PLATFORM_CPPS "lnxdsound.cpp")
endif()
add_library(libmve STATIC ${HEADERS} ${CPPS} ${PLATFORM_CPPS})

View File

@ -1,4 +1,4 @@
set(HEADERS registry.h )
set(HEADERS registry.h)
set(CPPS
lnxcon.cpp
lnxcon_raw.cpp

View File

@ -1,6 +1,4 @@
set (HEADERS )
set (CPPS
lnxcontroller.cpp
)
set(HEADERS)
set(CPPS lnxcontroller.cpp)
add_library(lnxcontroller STATIC ${HEADERS} ${CPPS})

View File

@ -1,4 +1,13 @@
set(HEADERS dyna_pthread.h dyna_xext.h dyna_xwin.h lnxdsound.h mvegfx.h mvelibi.h mvelibl.h snd8to16.h )
set(HEADERS
dyna_pthread.h
dyna_xext.h
dyna_xwin.h
lnxdsound.h
mvegfx.h
mvelibi.h
mvelibl.h
snd8to16.h)
set(CPPS
lnxdraw.cpp
lnxdsound.cpp

View File

@ -1,4 +1,5 @@
set(HEADERS doorpage.h
set(HEADERS
doorpage.h
gamefilepage.h
genericpage.h
megapage.h
@ -7,7 +8,7 @@ set(HEADERS doorpage.h
shippage.h
soundpage.h
texpage.h
weaponpage.h )
weaponpage.h)
set(CPPS
doorpage.cpp
gamefilepage.cpp

View File

@ -2,6 +2,6 @@ set(HEADERS md5.h)
set(CPPS
md5.cpp)
set(PLATFORMCPPS )
set(PLATFORMCPPS)
add_library(md5 STATIC ${HEADERS} ${CPPS} ${PLATFORMCPPS})

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
mem.cpp)

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
endian.cpp
error.cpp

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
newstyle.cpp
polymodel.cpp)

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
module.cpp)

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
d3movie.cpp)

View File

@ -3,7 +3,6 @@ set(HEADERS)
set(CPPS
CFtp.cpp
Chttpget.cpp
inetgetfile.cpp
)
inetgetfile.cpp)
add_library(inetfile STATIC ${HEADERS} ${CPPS})

View File

@ -1,8 +1,8 @@
set(HEADERS dmfcdllinit.h
set(HEADERS
dmfcdllinit.h
dmfcinputcommands.h
dmfcinternal.h
encryption.h
)
encryption.h)
set(CPPS
dmfcbase.cpp

View File

@ -1,7 +1,7 @@
set(HEADERS hoardaux.h Hoard.h hoardstr.h)
set(CPPS hoard.cpp hoard_ui.cpp)
set (NETGAME_MODULE hoard)
set(NETGAME_MODULE hoard)
add_library(${NETGAME_MODULE} SHARED ${CPPS} ${HEADERS})
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
networking.cpp)

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
Collide.cpp
FindIntersection.cpp

View File

@ -23,7 +23,7 @@ set(CPPS
SoftwareSetup.cpp)
if(UNIX)
set (CPPS ${CPPS} lnxscreenmode.cpp)
set(CPPS ${CPPS} lnxscreenmode.cpp)
endif()
# These are excluded.

View File

@ -1,9 +1,8 @@
add_definitions (-DCHECKSUM=2273873307UL)
add_definitions(-DCHECKSUM=2273873307UL)
set(HEADERS)
set(CPPS)
if(UNIX)
set (CPPS
set(CPPS
linux_lib.cpp)
endif()
@ -73,13 +72,11 @@ foreach(SCRIPT ${SCRIPTS})
TARGET ${SCRIPT}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${SCRIPT}> "${CMAKE_SOURCE_DIR}/scripts/data/linuxfullhog/"
COMMENT "Copying file ${SCRIPT} to hogfile directory..."
)
COMMENT "Copying file ${SCRIPT} to hogfile directory...")
add_custom_command(
TARGET ${SCRIPT}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${SCRIPT}> "${CMAKE_SOURCE_DIR}/scripts/data/linuxdemohog/"
)
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${SCRIPT}> "${CMAKE_SOURCE_DIR}/scripts/data/linuxdemohog/")
endif()
endforeach()
@ -96,8 +93,7 @@ if(UNIX AND NOT APPLE)
COMMAND ${CMAKE_COMMAND} -E remove "${CMAKE_SOURCE_DIR}/scripts/data/linuxfullhog/new.hog"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/scripts/data/linuxfullhog/"
DEPENDS ${SCRIPTS}
COMMENT "Building platform specific hog."
)
COMMENT "Building platform specific hog.")
add_custom_target("DemoLinuxHog"
ALL
COMMAND ${HOGBUILDCMD} "--makehog" "d3linuxdemohog.txt"
@ -106,6 +102,5 @@ if(UNIX AND NOT APPLE)
COMMAND ${CMAKE_COMMAND} -E remove "${CMAKE_SOURCE_DIR}/scripts/data/linuxdemohog/new.hog"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/scripts/data/linuxdemohog/"
DEPENDS ${SCRIPTS}
COMMENT "Building platform specific hog."
)
COMMENT "Building platform specific hog.")
endif()

View File

@ -1,4 +1,4 @@
set(HEADERS sndrender.h )
set(HEADERS sndrender.h)
set(CPPS
hlsoundlib.cpp
sndrender.cpp

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
osfarchive.cpp
streamaudio.cpp)

View File

@ -1,4 +1,5 @@
set(HEADERS infblock.h
set(HEADERS
infblock.h
infcodes.h
inffast.h
inffixed.h
@ -6,7 +7,7 @@ set(HEADERS infblock.h
infutil.h
zconf.h
zlib.h
zutil.h )
zutil.h)
set(CPPS
unzip.cpp
adler32.c
@ -15,7 +16,6 @@ set(CPPS
inffast.c
inflate.c
inftrees.c
infutil.c
)
infutil.c)
add_library(unzip STATIC ${HEADERS} ${CPPS})

View File

@ -1,4 +1,4 @@
set(HEADERS )
set(HEADERS)
set(CPPS
vector.cpp)

View File

@ -1,4 +1,4 @@
set(HEADERS win32os.h )
set(HEADERS win32os.h)
set(CPPS
winapp.cpp
wincon.cpp