Skip to content

Commit

Permalink
CMake improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ec- committed Jan 27, 2018
1 parent e1e3050 commit 6b633c5
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 21 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
endif()
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")

if(NOT DEFINED DEDICATED)
set(DEDICATED OFF CACHE BOOL "choose client or dedicated server build." FORCE)
endif()

if (DEDICATED)
add_definitions(-DDEDICATED)
endif()

add_subdirectory(code)

# TODO
Expand Down
13 changes: 9 additions & 4 deletions code/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#add_subdirectory(asm)
add_subdirectory(botlib)
add_subdirectory(client)
add_subdirectory(jpeg-8c)

if (NOT DEDICATED)
add_subdirectory(client)
add_subdirectory(jpeg-8c)
add_subdirectory(renderer)
#add_subdirectory(renderer2)
endif()

add_subdirectory(qcommon)
add_subdirectory(renderer)
#add_subdirectory(renderer2)
add_subdirectory(server)

if(WIN32)
add_subdirectory(win32)
else(WIN32)
Expand Down
36 changes: 23 additions & 13 deletions code/unix/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
add_executable(quake3e
linux_glimp.c
linux_joystick.c
linux_qgl.c
linux_signals.c
linux_snd.c
unix_main.c
unix_shared.c
x11_dga.c
x11_randr.c
x11_vidmode.c
)
if(DEDICATED)
add_executable(q3eded
linux_signals.c
unix_main.c
unix_shared.c
)
target_link_libraries(q3eded botlib qcommon server m dl)
else()
link_directories("/usr/X11R7/lib")
add_executable(quake3e
linux_signals.c
unix_main.c
unix_shared.c
linux_glimp.c
linux_joystick.c
linux_qgl.c
linux_snd.c
x11_dga.c
x11_randr.c
x11_vidmode.c
)
target_link_libraries(quake3e botlib client jpeg qcommon renderer server X11 Xext m dl)
endif()

target_link_libraries(quake3e botlib client jpeg qcommon renderer server X11 Xext m dl)
6 changes: 2 additions & 4 deletions code/win32/win_wndproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,11 @@ void WIN_DisableAltTab( void )
if ( s_alttab_disabled )
return;

#if 0
if ( g_wv.hWnd && glw_state.cdsFullscreen ) {
// topmost window
SetWindowLong( g_wv.hWnd, GWL_EXSTYLE, WINDOW_ESTYLE_FULLSCREEN );
SetWindowLong( g_wv.hWnd, GWL_STYLE, WINDOW_STYLE_FULLSCREEN );
}
#endif

if ( !Q_stricmp( Cvar_VariableString( "arch" ), "winnt" ) )
RegisterHotKey( NULL, 0, MOD_ALT, VK_TAB );
Expand All @@ -142,13 +141,12 @@ void WIN_EnableAltTab( void )
if ( !s_alttab_disabled )
return;

#if 0
if ( g_wv.hWnd && glw_state.cdsFullscreen ) {
// allow moving other windows on foreground
SetWindowLong( g_wv.hWnd, GWL_EXSTYLE, WINDOW_ESTYLE_NORMAL );
SetWindowLong( g_wv.hWnd, GWL_STYLE, WINDOW_STYLE_FULLSCREEN_MIN );
SetWindowPos( g_wv.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
}
#endif

if ( !Q_stricmp( Cvar_VariableString( "arch" ), "winnt" ) )
UnregisterHotKey( NULL, 0 );
Expand Down

0 comments on commit 6b633c5

Please sign in to comment.