Skip to content

Commit

Permalink
Merge pull request #517 from Lgt2x/cmake-headers
Browse files Browse the repository at this point in the history
CMake: add all headers to target sources
  • Loading branch information
winterheart authored Aug 12, 2024
2 parents e74515d + 60c5dbf commit 7337320
Show file tree
Hide file tree
Showing 26 changed files with 144 additions and 54 deletions.
5 changes: 4 additions & 1 deletion 2dlib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
set(HEADERS
gr.h
lib2d.h)
set(CPPS
font.cpp
hardsurf.cpp
Expand All @@ -9,7 +12,7 @@ set(CPPS
viewport.cpp
)

add_library(2dlib STATIC ${CPPS})
add_library(2dlib STATIC ${HEADERS} ${CPPS})
target_link_libraries(2dlib PRIVATE
cfile
mem
Expand Down
6 changes: 5 additions & 1 deletion AudioEncode/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
set(HEADERS
adecode.h
aencode.h
audio_encode.h)
set(CPPS
adecode.cpp
aencode.cpp
encoder.cpp
)

add_library(AudioEncode STATIC ${CPPS})
add_library(AudioEncode STATIC ${HEADERS} ${CPPS})
target_link_libraries(AudioEncode PRIVATE
libacm
)
Expand Down
48 changes: 25 additions & 23 deletions Descent3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
set(HEADERS
aiambient.h
AIGoal.h
AIMain.h
BOA.h
Briefing.h
BriefingParse.h
ConfigItem.h
CtlCfgElem.h
D3ForceFeedback.h
DeathInfo.h
DllWrappers.h
Inventory.h
LoadLevel.h
Mission.h
NewPyroGauges.h
ObjScript.h
PilotPicsAPI.h
SmallViews.h
TelCom.h
TelComAutoMap.h
TelComCargo.h
TelComEffects.h
TelComEfxStructs.h
TelComGoals.h
aiambient.h
aipath.h
aistruct.h
aistruct_external.h
Expand All @@ -11,31 +32,25 @@ set(HEADERS
attach.h
audiotaunts.h
bnode.h
BOA.h
Briefing.h
BriefingParse.h
bsp.h
buddymenu.h
cinematics.h
cockpit.h
config.h
ConfigItem.h
controls.h
credits.h
CtlCfgElem.h
ctlconfig.h
ctlconfigtxt.h
D3ForceFeedback.h
d3movie.h
d3music.h
d3serial.h
damage.h
damage_external.h
DeathInfo.h
deathinfo_external.h
debuggraph.h
descent.h
difficulty.h
difficulty_external.h
DllWrappers.h
door.h
doorway.h
fireball.h
Expand All @@ -56,44 +71,38 @@ set(HEADERS
hotspotmap.h
hud.h
init.h
Inventory.h
levelgoal.h
levelgoal_external.h
lighting.h
lightmap_info.h
list.h
LoadLevel.h
localization.h
marker.h
matcen.h
matcen_external.h
menu.h
Mission.h
mission_download.h
mmItem.h
multi.h
multisafe.h
multi_client.h
multi_dll_mgr.h
multi_external.h
multi_save_settings.h
multi_server.h
multi_ui.h
multi_world_state.h
NewPyroGauges.h
multisafe.h
newui.h
newui_core.h
object.h
object_external.h
object_lighting.h
objinfo.h
objinit.h
ObjScript.h
osiris_dll.h
osiris_predefs.h
osiris_share.h
pilot.h
PilotPicsAPI.h
pilot_class.h
player.h
player_external.h
Expand All @@ -113,7 +122,6 @@ set(HEADERS
screens.h
ship.h
slew.h
SmallViews.h
soar.h
soar_helpers.h
sounds.h
Expand All @@ -122,12 +130,6 @@ set(HEADERS
splinter.h
stringtable.h
subtitles.h
TelCom.h
TelComAutoMap.h
TelComCargo.h
TelComEffects.h
TelComEfxStructs.h
TelComGoals.h
terrain.h
trigger.h
vclip.h
Expand Down
6 changes: 3 additions & 3 deletions bitmap/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
set(HEADERS iff.h)
set(HEADERS
NewBitmap.h
iff.h)
set(CPPS
NewBitmap.cpp
NewBitmap.h

bitmain.cpp
bumpmap.cpp
iff.cpp
Expand Down
6 changes: 5 additions & 1 deletion cfile/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
set(HEADERS
cfile.h
hogfile.h
inffile.h)
set(CPPS
cfile.cpp
hogfile.cpp
inffile.cpp
)

add_library(cfile STATIC ${CPPS})
add_library(cfile STATIC ${HEADERS} ${CPPS})
target_link_libraries(cfile PRIVATE
ddio
mem
Expand Down
6 changes: 5 additions & 1 deletion ddebug/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
set(HEADERS
debug.h
debugbreak.h
mono.h)
set(CPPS
debug.cpp
$<$<PLATFORM_ID:Darwin,Linux>:
Expand All @@ -10,7 +14,7 @@ set(CPPS
>
)

add_library(ddebug STATIC ${CPPS})
add_library(ddebug STATIC ${HEADERS} ${CPPS})
add_dependencies(ddebug get_git_hash)
target_include_directories(ddebug PUBLIC
$<BUILD_INTERFACE:
Expand Down
8 changes: 7 additions & 1 deletion ddio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
set(HEADERS
chrono_timer.h
ddio.h
ddio_common.h
ddio_lnx.h
ddio_win.h)
set(CPPS
chrono_timer.cpp
ddio.cpp
Expand All @@ -17,7 +23,7 @@ set(CPPS
winfile.cpp
>
)
add_library(ddio STATIC ${CPPS})
add_library(ddio STATIC ${HEADERS} ${CPPS})
target_link_libraries(ddio PRIVATE
SDL2::SDL2
ddebug
Expand Down
3 changes: 2 additions & 1 deletion fix/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set(HEADERS)
set(HEADERS
fix.h)
set(CPPS
fix.cpp)

Expand Down
5 changes: 4 additions & 1 deletion grtext/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
set(HEADERS
grtext.h
grtextlib.h)
set(CPPS
grfont.cpp
grtext.cpp
textaux.cpp
)

add_library(grtext STATIC ${CPPS})
add_library(grtext STATIC ${HEADERS} ${CPPS})
target_link_libraries(grtext PRIVATE
ddio
mem
Expand Down
8 changes: 7 additions & 1 deletion libmve/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
set(HEADERS
decoders.h
movie_sound.h
mve_audio.h
mvelib.h
sound_interface.h)
set(CPPS
decoder8.cpp
decoder16.cpp
Expand All @@ -7,7 +13,7 @@ set(CPPS
mveplay.cpp
)

add_library(libmve STATIC ${CPPS})
add_library(libmve STATIC ${HEADERS} ${CPPS})
target_link_libraries(libmve PRIVATE
ddio
SDL2::SDL2
Expand Down
7 changes: 6 additions & 1 deletion linux/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
set(HEADERS
linux_fix.h
lnxapp.h
lnxcontroller.h
registry.h)
set(CPPS
lnxcon.cpp
lnxcon_raw.cpp
Expand All @@ -8,7 +13,7 @@ set(CPPS
registry.cpp
)

add_library(linux STATIC ${CPPS})
add_library(linux STATIC ${HEADERS} ${CPPS})
target_link_libraries(linux PRIVATE
cfile
)
Expand Down
4 changes: 1 addition & 3 deletions md5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ set(HEADERS md5.h)
set(CPPS
md5.cpp)

set(PLATFORMCPPS)

add_library(md5 STATIC ${HEADERS} ${CPPS} ${PLATFORMCPPS})
add_library(md5 STATIC ${HEADERS} ${CPPS})

if(BUILD_TESTING)
add_subdirectory(tests)
Expand Down
7 changes: 3 additions & 4 deletions mem/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
set(CPPS
mem.cpp
)
set(HEADERS mem.h)
set(CPPS mem.cpp)

add_library(mem STATIC ${CPPS})
add_library(mem STATIC ${HEADERS} ${CPPS})
target_compile_definitions(mem PUBLIC
$<$<BOOL:${ENABLE_MEM_RTL}>:MEM_USE_RTL>
)
Expand Down
9 changes: 8 additions & 1 deletion misc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
set(HEADERS
log.h
logfile.h
pserror.h
psglob.h
psrand.h
pstring.h)
set(CPPS
error.cpp
logfile.cpp
Expand All @@ -7,7 +14,7 @@ set(CPPS
pstring.cpp
)

add_library(misc STATIC ${CPPS})
add_library(misc STATIC ${HEADERS} ${CPPS})
target_link_libraries(misc PRIVATE
ddebug
SDL2::SDL2
Expand Down
4 changes: 3 additions & 1 deletion model/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
set(HEADERS
polymodel.h)
set(CPPS
newstyle.cpp
polymodel.cpp
)

add_library(model STATIC ${CPPS})
add_library(model STATIC ${HEADERS} ${CPPS})
target_link_libraries(model PRIVATE
cfile
mem
Expand Down
4 changes: 3 additions & 1 deletion music/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
set(HEADERS)
set(HEADERS
music.h
musiclib.h)
set(CPPS
omflex.cpp
sequencer.cpp
Expand Down
5 changes: 4 additions & 1 deletion netcon/lanclient/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
set(HEADERS
lanclient.h
lanstrings.h)
set(CPPS lanclient.cpp)

add_library(Direct_TCP_IP MODULE ${CPPS})
add_library(Direct_TCP_IP MODULE ${HEADERS} ${CPPS})
set_target_properties(Direct_TCP_IP PROPERTIES PREFIX "")
set_target_properties(Direct_TCP_IP PROPERTIES CXX_VISIBILITY_PRESET "hidden")
set_target_properties(Direct_TCP_IP PROPERTIES OUTPUT_NAME "Direct TCP~IP")
Expand Down
9 changes: 8 additions & 1 deletion netcon/mtclient/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
set(HEADERS
chat_api.h
mt_net.h
mtclient.h
mtgametrack.h
mtpilottrack.h
mtstrings.h)
set(CPPS
chat_api.cpp
mt_net.cpp
Expand All @@ -6,7 +13,7 @@ set(CPPS
mtpilottracker.cpp
)

add_library(Parallax_Online MODULE ${CPPS})
add_library(Parallax_Online MODULE ${HEADERS} ${CPPS})
set_target_properties(Parallax_Online PROPERTIES PREFIX "")
set_target_properties(Parallax_Online PROPERTIES CXX_VISIBILITY_PRESET "hidden")
set_target_properties(Parallax_Online PROPERTIES OUTPUT_NAME "Parallax Online")
Expand Down
4 changes: 3 additions & 1 deletion netgames/coop/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
set(HEADERS coop.h)
set(HEADERS
coop.h
coopstr.h)
set(CPPS coop.cpp)

set(NETGAME_MODULE coop)
Expand Down
Loading

0 comments on commit 7337320

Please sign in to comment.