Signed-off-by: Alexander Golubev <fatzer2@gmail.com>feat/cmakeConv-r1
parent
df2b04abca
commit
83a22cbef3
@ -0,0 +1,65 @@
|
||||
macro(type_to_varname _type _varname)
|
||||
string( TOUPPER "${_type}" ${_varname} )
|
||||
string( REPLACE " " "_" "${${_varname}}" ${_varname} )
|
||||
string( REPLACE "*" "P" "${${_varname}}" ${_varname} )
|
||||
endmacro( type_to_varname )
|
||||
|
||||
# A helper macro to determin the type used as socklen_t
|
||||
macro( check_socklen_t_type _var )
|
||||
foreach( _type ${ARGN})
|
||||
type_to_varname( "HAVE_${_type}_AS_SOCKLEN_T" _type_var)
|
||||
check_cxx_source_compiles(
|
||||
"#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
int main(){
|
||||
${_type} len;
|
||||
getpeername(0,0,&len);
|
||||
}"
|
||||
${_type_var}
|
||||
)
|
||||
if( ${_type_var} )
|
||||
set( ${_var} ${_type} CACHE INTERNAL "A socklen_t type" )
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro( check_socklen_t_type )
|
||||
|
||||
if( UNIX )
|
||||
|
||||
check_symbol_exists( SIG_IGN "signal.h" HAVE_SIG_IGN )
|
||||
if( NOT HAVE_SIG_IGN )
|
||||
tde_message_fatal( "Systems without SIG_IGN definition are not supported" )
|
||||
endif()
|
||||
|
||||
# Check which type we should use as socklen_t
|
||||
check_socklen_t_type( QT_SOCKLEN_T socklen_t size_t int )
|
||||
if( NOT QT_SOCKLEN_T )
|
||||
tde_message_fatal( "Failed to determin typy used as socklen_t" )
|
||||
endif()
|
||||
|
||||
check_symbol_exists( snprintf "stdio.h" QT_SNPRINTF )
|
||||
check_symbol_exists( vsnprintf "stdarg.h;stdio.h" QT_VSNPRINTF )
|
||||
|
||||
tde_save_and_set( CMAKE_REQUIRED_LIBRARIES "Xext" )
|
||||
check_symbol_exists( XShmCreateImage "X11/Xlib.h;X11/extensions/XShm.h" QT_MITSHM )
|
||||
tde_restore( CMAKE_REQUIRED_LIBRARIES )
|
||||
|
||||
configure_file( qplatformdefs_unix.h.cmake qplatformdefs.h @ONLY )
|
||||
else()
|
||||
tde_message_fatal(
|
||||
"Unsupported platform"
|
||||
"Currently tqt cmake supports autoconfiguration only for unix platforms."
|
||||
"Use -DTQT_PLATFORM=platform to specify specify another platform."
|
||||
)
|
||||
endif()
|
||||
|
||||
configure_file( qmake.conf.cmake qmake.conf @ONLY )
|
||||
|
||||
if( BUILD_TQMAKE )
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/qplatformdefs.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/qmake.conf
|
||||
DESTINATION "${QT_INSTALL_DATA}/mkspecs/local/"
|
||||
)
|
||||
endif( BUILD_TQMAKE )
|
@ -0,0 +1,90 @@
|
||||
#
|
||||
#
|
||||
# qmake configuration for local system generated by cmake
|
||||
|
||||
# FIXME: This file is WIP <2024-03-09 Fat-Zer> #
|
||||
|
||||
MAKEFILE_GENERATOR = UNIX
|
||||
TEMPLATE = app
|
||||
CONFIG += qt warn_on release incremental link_prl
|
||||
QMAKE_INCREMENTAL_STYLE = sublib
|
||||
|
||||
QMAKE_CC = @CMAKE_C_COMPILER@
|
||||
QMAKE_LEX = @FLEX_EXECUTABLE@
|
||||
QMAKE_LEXFLAGS =
|
||||
QMAKE_YACC = @BISON_EXECUTABLE@
|
||||
QMAKE_YACCFLAGS = @BISON_FLAGS@
|
||||
# QMAKE_YACCFLAGS_MANGLE = -p $base -b $base
|
||||
# QMAKE_YACC_HEADER = $base.tab.h
|
||||
# QMAKE_YACC_SOURCE = $base.tab.c
|
||||
QMAKE_CFLAGS = @CMAKE_C_FLAGS@
|
||||
# QMAKE_CFLAGS_DEP = -M
|
||||
# QMAKE_CFLAGS_WARN_ON = -Wall -W
|
||||
# QMAKE_CFLAGS_WARN_OFF = -w
|
||||
QMAKE_CFLAGS_RELEASE = @CMAKE_C_FLAGS_RELEASE@
|
||||
QMAKE_CFLAGS_DEBUG = @CMAKE_C_FLAGS_DEBUG@
|
||||
# QMAKE_CFLAGS_SHLIB = -fPIC
|
||||
# QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
|
||||
# QMAKE_CFLAGS_THREAD = -D_REENTRANT
|
||||
|
||||
QMAKE_CXX = @CMAKE_CXX_COMPILER@
|
||||
QMAKE_CXXFLAGS = @CMAKE_CXX_FLAGS@
|
||||
QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
|
||||
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
|
||||
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
|
||||
QMAKE_CXXFLAGS_RELEASE = @CMAKE_CXX_FLAGS_RELEASE@
|
||||
QMAKE_CXXFLAGS_DEBUG = @CMAKE_CXX_FLAGS_DEBUG@
|
||||
QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
|
||||
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
|
||||
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
|
||||
|
||||
QMAKE_INCDIR =
|
||||
QMAKE_LIBDIR =
|
||||
# QMAKE_INCDIR_X11 = /usr/X11R6/include
|
||||
# QMAKE_LIBDIR_X11 = /usr/X11R6/lib64
|
||||
QMAKE_INCDIR_TQT = $(TQTDIR)/include
|
||||
QMAKE_LIBDIR_TQT = $(TQTDIR)/@SYSTEM_LIBDIR@
|
||||
# QMAKE_INCDIR_OPENG = /usr/X11R6/include
|
||||
# QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib64
|
||||
|
||||
QMAKE_LINK = @CMAKE_LINKER@
|
||||
QMAKE_LINK_SHLIB = g++
|
||||
# QMAKE_LFLAGS = -luuid
|
||||
# QMAKE_LFLAGS_RELEASE =
|
||||
# QMAKE_LFLAGS_DEBUG =
|
||||
QMAKE_LFLAGS_SHLIB = @CMAKE_SHARED_LINKER_FLAGS@
|
||||
# QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
|
||||
# QMAKE_LFLAGS_SONAME = -Wl,-soname,
|
||||
# QMAKE_LFLAGS_THREAD =
|
||||
# QMAKE_RPATH = -Wl,-rpath,
|
||||
|
||||
# QMAKE_LIBS = -luuid
|
||||
# QMAKE_LIBS_DYNLOAD = -ldl
|
||||
# QMAKE_LIBS_X11 = -lXext -lX11 -lm
|
||||
# QMAKE_LIBS_X11SM = -lSM -lICE
|
||||
# QMAKE_LIBS_NIS = -lnsl
|
||||
# QMAKE_LIBS_QT = -lqt
|
||||
# QMAKE_LIBS_QT_THREAD = -ltqt-mt
|
||||
# QMAKE_LIBS_OPENGL = -lGLU -lGL -lXmu
|
||||
# QMAKE_LIBS_OPENGL_QT = -lGL -lXmu
|
||||
# QMAKE_LIBS_THREAD = -lpthread
|
||||
|
||||
QMAKE_MOC = $(TQTDIR)/bin/tqmoc
|
||||
QMAKE_UIC = $(TQTDIR)/bin/tquic
|
||||
|
||||
QMAKE_AR = ar cqs
|
||||
QMAKE_RANLIB =
|
||||
|
||||
QMAKE_TAR = tar -cf
|
||||
QMAKE_GZIP = gzip -9f
|
||||
|
||||
QMAKE_COPY = cp -f
|
||||
QMAKE_COPY_FILE = $(COPY)
|
||||
QMAKE_COPY_DIR = $(COPY) -r
|
||||
QMAKE_MOVE = mv -f
|
||||
QMAKE_DEL_FILE = rm -f
|
||||
QMAKE_DEL_DIR = rmdir
|
||||
QMAKE_STRIP = strip
|
||||
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
|
||||
QMAKE_CHK_DIR_EXISTS = test -d
|
||||
QMAKE_MKDIR = mkdir -p
|
@ -0,0 +1,60 @@
|
||||
#ifndef TQPLATFORMDEFS_H
|
||||
#define TQPLATFORMDEFS_H
|
||||
|
||||
// Get TQt defines/settings
|
||||
|
||||
#include "ntqglobal.h"
|
||||
|
||||
// This will make gcc much happier with our code
|
||||
#if defined(__gnu_linux__) && !defined(_DEFAULT_SOURCE)
|
||||
# define _DEFAULT_SOURCE
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
// We are hot - unistd.h should have turned on the specific APIs we requested
|
||||
|
||||
|
||||
#ifdef TQT_THREAD_SUPPORT
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
#include <grp.h>
|
||||
#include <pwd.h>
|
||||
#include <signal.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/shm.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
// DNS header files are not fully covered by X/Open specifications.
|
||||
// In particular nothing is said about res_* :/
|
||||
// Header files <netinet/in.h> and <arpa/nameser.h> are not included
|
||||
// by <resolv.h> on older versions of the GNU C library. Note that
|
||||
// <arpa/nameser.h> must be included before <resolv.h>.
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#include <resolv.h>
|
||||
|
||||
|
||||
#define QT_SIGNAL_RETTYPE void
|
||||
#define QT_SIGNAL_ARGS int
|
||||
#define QT_SIGNAL_IGNORE SIG_IGN
|
||||
|
||||
#cmakedefine QT_SOCKLEN_T @QT_SOCKLEN_T@
|
||||
|
||||
#cmakedefine QT_SNPRINTF ::snprintf
|
||||
#cmakedefine QT_VSNPRINTF ::vsnprintf
|
||||
|
||||
#cmakedefine QT_MITSHM
|
||||
|
||||
#endif // TQPLATFORMDEFS_H
|
Loading…
Reference in new issue