cmake: sort options a bit and add some configuration sanity checks

Fix build with WITH_MODULE_INPUTMETHOD=OFF

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
feat/cmakeConv-r1
Alexander Golubev 2 months ago
parent f47d954825
commit 84df939ab9

@ -65,30 +65,33 @@ set( QT_INSTALL_SYSCONF "/etc/${PROJECT_NAME}" CACH
##### optional stuff
option( WITH_ALL_OPTIONS "Enable all optional support" ON )
option( WITH_ALL_OPTIONS "Enable all optional support" ON )
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" OFF )
option( WITH_IMMODULE_EXTENSIONS "Enable immodule extensions support" OFF ) # break ABI
option( WITH_STL "Enable c++ stl support" ${WITH_ALL_OPTIONS} )
option( WITH_STL "Enable c++ stl support" ON ) # breaks ABI
option( WITH_IPV6 "Enable IPv6 support" ${WITH_ALL_OPTIONS} )
option( WITH_CUPS "Enable cups support" ${WITH_ALL_OPTIONS} )
option( WITH_SOUND "Enable sound support with Nas" ${WITH_ALL_OPTIONS} )
option( WITH_GLIBMAINLOOP "Enable Glib support" ${WITH_ALL_OPTIONS} )
option( WITH_XFT "Enable Xft support" ${WITH_ALL_OPTIONS} )
option( WITH_XSHAPE "Enable XShape support" ${WITH_ALL_OPTIONS} )
option( WITH_SOUND "Enable sound support with Nas" ${WITH_ALL_OPTIONS} )
##### X11-related options
option( WITH_SM "Enable Session management support" ${WITH_ALL_OPTIONS} )
option( WITH_TABLET "Enable tablet support" ${WITH_ALL_OPTIONS} )
option( WITH_XCURSOR "Enable XCursor support" ${WITH_ALL_OPTIONS} )
option( WITH_XFT "Enable Xft support" ${WITH_ALL_OPTIONS} )
option( WITH_XINERAMA "Enable Xinerame support" ${WITH_ALL_OPTIONS} )
option( WITH_XKB "Enable X KeyBoard support" ${WITH_ALL_OPTIONS} )
option( WITH_XRANDR "Enable Xrandr support" ${WITH_ALL_OPTIONS} )
option( WITH_XRENDER "Enable XRender support" ${WITH_ALL_OPTIONS} )
option( WITH_XSHAPE "Enable XShape support" ${WITH_ALL_OPTIONS} )
option( WITH_XSYNC "Enable Xsync support" ${WITH_ALL_OPTIONS} )
option( WITH_XKB "Enable X KeyBoard support" ${WITH_ALL_OPTIONS} )
option( WITH_SM "Enable Session management support" ${WITH_ALL_OPTIONS} )
option( WITH_XCURSOR "Enable XCursor support" ${WITH_ALL_OPTIONS} )
option( WITH_IMMODULE_EXTENSIONS "Enable immodule extensions support" OFF ) # breaks ABI
##### user requested build
set( TQT_CONFIG "full-config" CACHE STRING "Enable tqt functionalities" ) #choices: minimal-config|small-config|medium-config|large-config|full-config
option( BUILD_ALL "Build all" ON )
option( BUILD_LIB "Build the tqt library itself" ${BUILD_ALL} )
option( BUILD_TQMAKE "Build the tqmake executable" ${BUILD_ALL} )
@ -102,10 +105,13 @@ option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
##### user requested tqt modules
option( WITH_MODULE_ALL "Build all modules" ON )
option( WITH_MODULE_TOOLS "Build the tools module" ${WITH_MODULE_ALL} )
option( WITH_MODULE_KERNEL "Build the kernel module" ${WITH_MODULE_ALL} )
option( WITH_MODULE_WIDGETS "Build the widgets module" ${WITH_MODULE_ALL} )
option( WITH_MODULE_DIALOGS "Build the dialog module" ${WITH_MODULE_ALL} )
# Essential modules; build without them isn't viable at the moment
option( WITH_MODULE_STYLES "Build the styles module" ON )
option( WITH_MODULE_TOOLS "Build the tools module" ON )
option( WITH_MODULE_KERNEL "Build the kernel module" ON )
option( WITH_MODULE_WIDGETS "Build the widgets module" ON )
option( WITH_MODULE_DIALOGS "Build the dialog module" ON )
# Optional modules
option( WITH_MODULE_WORKSPACE "Build the worspace module" ${WITH_MODULE_ALL} )
option( WITH_MODULE_INPUTMETHOD "Build the inputmethode module" ${WITH_MODULE_ALL} )
option( WITH_MODULE_NETWORK "Build the network module" ${WITH_MODULE_ALL} )
@ -113,7 +119,6 @@ option( WITH_MODULE_CANVAS "Build the canvas module" ${WITH_MODULE_AL
option( WITH_MODULE_TABLE "Build the table module" ${WITH_MODULE_ALL} )
option( WITH_MODULE_XML "Build the xml module" ${WITH_MODULE_ALL} )
option( WITH_MODULE_OPENGL "Build the OpenGL module" ${WITH_MODULE_ALL} )
option( WITH_MODULE_STYLES "Build the styles module" ${WITH_MODULE_ALL} )
option( WITH_MODULE_SQL "Build the SQL module" ${WITH_MODULE_ALL} )
@ -217,6 +222,15 @@ option( BUILD_EXAMPLE_DCLOCK "Build example dclock" ${BUILD_EXAMPLE_
#option( BUILD_EXAMPLE_DEMO "Build example demo" ${BUILD_EXAMPLE_ALL} )
##### Advanced options
set( TQT_CONFIG "full" CACHE STRING
"Predefined set of tqt interanl options, one of: minimal|small|medium|large|full" )
set( WITH_UNSUPORTED_CONFIG OFF CACHE BOOL "Build TQt regardles some unsupported option configuration" )
mark_as_advanced( TQT_CONFIG WITH_UNSUPORTED_CONFIG )
##### configure checks
include( ConfigureChecks.cmake )

@ -18,6 +18,26 @@ if( WITH_GCC_VISIBILITY )
endif( WITH_GCC_VISIBILITY )
#### configuration sanity check
if( NOT TQT_CONFIG MATCHES "minimal|small|medium|large|full")
tde_message_fatal(
"TQT_CONFIG=\"${TQT_CONFIG}\" is not supported."
"Only supported variants are: minimal, small, medium, large, full"
)
elseif( NOT TQT_CONFIG STREQUAL "full" )
tqt_expert_config ("TQT_CONFIG!=\"full\"")
endif( )
tqt_requires( WITH_MODULE_SQL WITH_MODULE_TABLE )
# build without this core modules won't be successful
foreach( _mod KERNEL TOOLS WIDGETS DIALOGS STYLES )
if( NOT WITH_MODULE_${_mod} )
tqt_expert_config ("WITH_MODULE_${_mod}=OFF")
endif( )
endforeach( )
##### check for fontconfig
pkg_search_module( LIBFONTCONFIG fontconfig )
@ -262,12 +282,19 @@ check_include_file( "unistd.h" Q_OS_UNIX ) #probabl
check_include_file( "sys/mman.h" Q_OS_LINUX ) #probably not needed
##### variables to generate <ntconfig.h> (include folder)
##### variables to generate <ntqconfig.h> (include folder)
set( _TQT_CONFIG_STRING "${TQT_CONFIG}-config" )
set( _HOST_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR} )
set( _HOST_SYSTEM_NAME ${CMAKE_CXX_PLATFORM_ID} )
set( _SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P} )
# a predefined configuration for not-well supported embedded builds
if( NOT TQT_CONFIG STREQUAL "full" )
string( TOUPPER _TQT_CONFIG_MACRO "TQCONFIG_${TQT_CONFIG}" )
add_definitions( ${_TQT_CONFIG_MACRO} )
endif()
if( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "4.0.0") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") )
set( _COMPILER_NAME "g++-4.*" )
else()
@ -277,24 +304,28 @@ endif()
##### immodule extensions
if( WITH_IMMODULE_EXTENSIONS )
if( NOT WITH_IMMODULE_EXTENSIONS )
set( TQT_NO_IM_EXTENSIONS 1 )
endif()
##### set build for modules
##### build utilities
if( BUILD_TMOC )
set( TMOC_EXECUTABLE $<TARGET_FILE:tmoc> CACHE INTERNAL "" )
set( MOC_EXECUTABLE $<TARGET_FILE:tmoc> CACHE INTERNAL "" )
else()
find_program( TMOC_EXECUTABLE NAMES tmoc tqmoc REQUIRED )
set( MOC_EXECUTABLE "${TMOC_EXECUTABLE}" CACHE INTERNAL "" )
endif()
if( BUILD_TOOLS )
set( UIC_EXECUTABLE $<TARGET_FILE:tquic> CACHE INTERNAL "" )
endif()
##### set build for modules
if( WITH_MODULE_STYLES )
set( TQT_MODULE_STYLES 1 )
endif()

@ -6,6 +6,28 @@
include( TDEMacros )
#################################################
#####
##### tqt_expert_config
#####
##### If WITH_UNSUPORTED_CONFIG is not supplied prints messages and exits
#####
##### Syntax:
##### tqt_requires( opt [msg ...] )
macro( tqt_expert_config _opt )
if( NOT WITH_UNSUPORTED_CONFIG )
tde_message_fatal(
"${_opt} is not well-supported."
${ARGN}
"Use -DWITH_UNSUPORTED_CONFIG=ON if you know what you are doing."
)
else( )
message( STATUS "Using expert configuration option: ${_opt}" )
endif( )
endmacro( tqt_expert_config )
#################################################
#####
##### tqt_requires

@ -5,7 +5,7 @@
#define QT_PRODUCT_LICENSE "qt-free"
/* Build key */
#define TQT_BUILD_KEY "@_HOST_SYSTEM_PROCESSOR@ @_HOST_SYSTEM_NAME@ @_COMPILER_NAME@ @TQT_CONFIG@"
#define TQT_BUILD_KEY "@_HOST_SYSTEM_PROCESSOR@ @_HOST_SYSTEM_NAME@ @_COMPILER_NAME@ @_TQT_CONFIG_STRING@"
/* Machine byte-order */
#define Q_BIG_ENDIAN 4321

@ -41,8 +41,6 @@ set( _SRC_ qtaddons_x11.cpp
qdnd_x11.cpp
qdesktopwidget_x11.cpp
qfont_x11.cpp
qinputcontext.cpp
qinputcontext_x11.cpp
qmotifdnd_x11.cpp
qpixmap_x11.cpp
qpaintdevice_x11.cpp
@ -129,6 +127,13 @@ set( _SRC_ qtaddons_x11.cpp
qaccessible.cpp
)
if( WITH_MODULE_INPUTMETHOD )
list( APPEND _SRC_
qinputcontext.cpp
qinputcontext_x11.cpp
)
endif()
if( WITH_SOUND )
list( APPEND _SRC_ qsound.cpp qsound_x11.cpp )
endif()

Loading…
Cancel
Save