Skip to content

Commit

Permalink
Update CMakeLists.txt (#63)
Browse files Browse the repository at this point in the history
* Update CMakeLists.txt

* Update CMakeLists.txt
  • Loading branch information
Velaron committed Oct 12, 2021
1 parent fc78663 commit 45e9799
Showing 1 changed file with 17 additions and 93 deletions.
110 changes: 17 additions & 93 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,103 +20,25 @@
# SOFTWARE.
#

cmake_minimum_required(VERSION 2.8.0)
project (MAINUI)

include(FWGSLib)
cmake_minimum_required(VERSION 2.8.12)
project(MAINUI)

# By default we require C++11 support.
# But it can be overriden with -DMY_COMPILER_SUCKS compiler option
# It's not recommended and may not work(as it's done only for MSVC6 support)
set(CMAKE_CXX_STANDARD 11)

set(MAINUI_LIBRARY xashmenu)
fwgs_fix_default_msvc_settings()

option(MAINUI_USE_CUSTOM_FONT_RENDER "Use custom font rendering" ON)
option(MAINUI_USE_STB "Use stb_truetype.h for rendering(*nix-only)" OFF)
option(MAINUI_RENDER_PICBUTTON_TEXT "Use custom font render to render picbuttons(experimental)" OFF)
option(MAINUI_RENDER_PICBUTTON_TEXT "Use custom font render to render picbuttons (experimental)" OFF)
option(MAINUI_FONT_SCALE "Scale fonts by height" OFF)

set(MAINUI_CONTROLS_SOURCES
controls/Framework.cpp
controls/BaseItem.cpp
controls/Action.cpp
controls/Bitmap.cpp
controls/CheckBox.cpp
controls/ItemsHolder.cpp
controls/Field.cpp
controls/PicButton.cpp
controls/Slider.cpp
controls/SpinControl.cpp
controls/YesNoMessageBox.cpp
controls/MessageBox.cpp
controls/Editable.cpp
controls/Switch.cpp
controls/BaseWindow.cpp
controls/ProgressBar.cpp
controls/BackgroundBitmap.cpp
controls/Table.cpp
controls/TabView.cpp
controls/PlayerModelView.cpp
controls/ScrollView.cpp
)

set(MAINUI_MENUS_SOURCES
menus/AdvancedControls.cpp
menus/Audio.cpp
menus/Configuration.cpp
menus/Controls.cpp
menus/CreateGame.cpp
menus/Credits.cpp
menus/CustomGame.cpp
menus/FileDialog.cpp
menus/GameOptions.cpp
menus/Gamepad.cpp
menus/InputDevices.cpp
menus/LoadGame.cpp
menus/Main.cpp
menus/Multiplayer.cpp
menus/NewGame.cpp
menus/PlayerSetup.cpp
menus/SaveLoad.cpp
menus/ServerBrowser.cpp
menus/TouchButtons.cpp
menus/Touch.cpp
menus/TouchEdit.cpp
menus/TouchOptions.cpp
menus/Video.cpp
menus/VideoModes.cpp
menus/VideoOptions.cpp
menus/PlayerIntroduceDialog.cpp
menus/ConnectionProgress.cpp
menus/ConnectionWarning.cpp
menus/dynamic/ScriptMenu.cpp
)

set(MAINUI_FONT_RENDER_SOURCES
font/WinAPIFont.cpp
font/BitmapFont.cpp
font/FontManager.cpp
font/FreeTypeFont.cpp
font/StbFont.cpp
font/BaseFontBackend.cpp
)

set(MAINUI_SOURCES
miniutl/utlmemory.cpp
unicode_strtools.cpp
EventSystem.cpp
EngineCallback.cpp
BaseMenu.cpp
Btns.cpp
Color.cpp
MenuStrings.cpp
CFGScript.cpp
Utils.cpp
Scissor.cpp
udll_int.cpp
WindowSystem.cpp
)
file(GLOB MAINUI_CONTROLS_SOURCES "controls/*.cpp")
file(GLOB MAINUI_MENUS_SOURCES "menus/*.cpp" "menus/dynamic/*.cpp")
file(GLOB MAINUI_FONT_RENDER_SOURCES "font/*.cpp")
file(GLOB MAINUI_SOURCES "miniutl/*.cpp" "*.cpp")

if(CS16CLIENT)
add_definitions(-DCS16CLIENT)
Expand All @@ -132,12 +54,11 @@ endif()
list(APPEND MAINUI_SOURCES ${MAINUI_CONTROLS_SOURCES})
list(APPEND MAINUI_SOURCES ${MAINUI_MENUS_SOURCES})
list(APPEND MAINUI_SOURCES ${MAINUI_FONT_RENDER_SOURCES})
add_library (${MAINUI_LIBRARY} SHARED ${MAINUI_SOURCES})
add_library(${MAINUI_LIBRARY} MODULE ${MAINUI_SOURCES})

if(NOT WIN32 AND NOT MINGW)
fwgs_add_compile_options(C -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable)
add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable)
else()

# Only for MSVC6 compatibility mode! Newer VC does fail with this define
# add_definitions(-DMY_COMPILER_SUCKS)
endif()
Expand All @@ -156,7 +77,7 @@ endif()

# Force stb_truetype for Apple devices, as there is no Apple native font renderer
# And freetype&fontconfig isn't used on this platform by default
if(APPLE)
if(ANDROID)
set(MAINUI_USE_STB TRUE)
endif()

Expand Down Expand Up @@ -198,7 +119,7 @@ elseif(WIN32)
OUTPUT_NAME menu PREFIX "")
endif()

if(XASH_64BIT)
if(XASH_64BIT AND NOT ANDROID)
get_target_property(MAINUI_NAME ${MAINUI_LIBRARY} OUTPUT_NAME)
if(NOT MAINUI_NAME)
set(MAINUI_NAME ${MAINUI_LIBRARY})
Expand All @@ -207,5 +128,8 @@ if(XASH_64BIT)
OUTPUT_NAME ${MAINUI_NAME}64)
endif()

fwgs_set_default_properties(${MAINUI_LIBRARY})
fwgs_install(${MAINUI_LIBRARY})
install(TARGETS ${MAINUI_LIBRARY} DESTINATION .)

if(MSVC)
install(FILES $<TARGET_PDB_FILE:${MAINUI_LIBRARY}> DESTINATION . OPTIONAL)
endif()

0 comments on commit 45e9799

Please sign in to comment.