Browse Source

Conversion to the cmake building system.

Signed-off-by: gregory guy <gregory-tde@laposte.net>
pull/2/head
gregory guy 3 years ago
parent
commit
671faf252f
No known key found for this signature in database
GPG Key ID: 3BCCA0F7AB4536F4
  1. 69
      CMakeLists.txt
  2. 37
      ConfigureChecks.cmake
  3. 8
      config.h.cmake
  4. 50
      src/CMakeLists.txt
  5. 28
      src/tqca.cpp
  6. 12
      src/tqca.h
  7. 12
      src/tqca.pc.cmake
  8. 12
      src/tqcaprovider.h

69
CMakeLists.txt

@ -0,0 +1,69 @@
############################################
# #
# Improvements and feedbacks are welcome #
# #
# This file is released under GPL >= 3 #
# #
############################################
cmake_minimum_required( VERSION 2.8 )
#### general package setup
project( tqca )
set( VERSION R14.1.0 )
#### include essential cmake modules
include( FindPkgConfig )
include( CheckFunctionExists )
include( CheckSymbolExists )
include( CheckIncludeFile )
include( CheckLibraryExists )
include( CheckCSourceCompiles )
include( CheckCXXSourceCompiles )
#### include our cmake modules
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include( TDEMacros )
##### setup install paths
include( TDESetupPaths )
tde_setup_paths( )
##### optional stuff
option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
##### configure checks
include( ConfigureChecks.cmake )
###### global compiler settings
add_definitions( -DHAVE_CONFIG_H )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
##### source directories
add_subdirectory( src )
##### write configure files
configure_file( config.h.cmake config.h @ONLY )

37
ConfigureChecks.cmake

@ -0,0 +1,37 @@
###########################################
# #
# Improvements and feedback are welcome #
# #
# This file is released under GPL >= 3 #
# #
###########################################
# required stuff
tde_setup_architecture_flags( )
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
tde_setup_largefiles( )
find_package( TQt )
find_package( TDE )
##### check for gcc visibility support
if( WITH_GCC_VISIBILITY )
tde_setup_gcc_visibility( )
endif( WITH_GCC_VISIBILITY )
##### look for tqt3 headers path
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE}
--variable=includedir tqt-mt
OUTPUT_VARIABLE TQT_HEADERS_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if( TQT_HEADER_DIRS )
set( TQT_HEADERS_DIRS "${TQT_HEADERS_DIRS}" )
endif()

8
config.h.cmake

@ -0,0 +1,8 @@
#define VERSION "@VERSION@"
// Defined if you have fvisibility and fvisibility-inlines-hidden support.
#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@

50
src/CMakeLists.txt

@ -0,0 +1,50 @@
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
)
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)
##### tqca (shared)
tde_add_library( ${PROJECT_NAME} SHARED AUTOMOC
SOURCES
tqca.cpp
LINK
tdecore-shared
VERSION 1.0.0
DESTINATION ${LIB_INSTALL_DIR}
)
##### headers
install(
FILES ${PROJECT_NAME}.h
DESTINATION ${TQT_HEADERS_DIRS}
)
##### other data
string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_EXEC_PREFIX ${EXEC_INSTALL_PREFIX} )
string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" TQT_HEADERS_DIRS ${TQT_HEADERS_DIRS} )
string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${LIB_INSTALL_DIR} )
configure_file( ${PROJECT_NAME}.pc.cmake ${PROJECT_NAME}.pc @ONLY )
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
DESTINATION ${PKGCONFIG_INSTALL_DIR}
)

28
src/qca.cpp → src/tqca.cpp

@ -18,19 +18,19 @@
*
*/
#include"qca.h"
#include<tqptrlist.h>
#include<tqdir.h>
#include<tqfileinfo.h>
#include<tqstringlist.h>
#include<tqlibrary.h>
#include<tqtimer.h>
#include<tqhostaddress.h>
#include<tqapplication.h>
#include<tqguardedptr.h>
#include<stdlib.h>
#include"qcaprovider.h"
#include "tqca.h"
#include "tqcaprovider.h"
#include <tqptrlist.h>
#include <tqdir.h>
#include <tqfileinfo.h>
#include <tqstringlist.h>
#include <tqlibrary.h>
#include <tqtimer.h>
#include <tqhostaddress.h>
#include <tqapplication.h>
#include <tqguardedptr.h>
#include <cstdlib>
#if defined(Q_OS_WIN32)
#define PLUGIN_EXT "dll"
@ -1477,3 +1477,5 @@ TQByteArray SASL::readOutgoing()
d->outbuf.resize(0);
return a;
}
#include "tqca.moc"

12
src/qca.h → src/tqca.h

@ -21,12 +21,12 @@
#ifndef TQCA_H
#define TQCA_H
#include<tqstring.h>
#include<tqcstring.h>
#include<tqdatetime.h>
#include<tqmap.h>
#include<tqptrlist.h>
#include<tqobject.h>
#include <tqstring.h>
#include <tqcstring.h>
#include <tqdatetime.h>
#include <tqmap.h>
#include <tqptrlist.h>
#include <tqobject.h>
#ifdef Q_OS_WIN32
# ifndef TQCA_STATIC

12
src/tqca.pc.cmake

@ -0,0 +1,12 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@PC_EXEC_PREFIX@
libdir=@PC_LIB_DIR@
includedir=@TQT_HEADERS_DIRS@
Name: @PROJECT_NAME@
Description: TQt Cryptographic Architecture.
URL: https://mirror.git.trinitydesktop.org/gitea/TDE/tqca.git
Requires:
Version: 1.0.0
Libs: -L${libdir} -l@PROJECT_NAME@
Cflags: -I${includedir}

12
src/qcaprovider.h → src/tqcaprovider.h

@ -21,12 +21,12 @@
#ifndef TQCAPROVIDER_H
#define TQCAPROVIDER_H
#include<tqglobal.h>
#include<tqstring.h>
#include<tqdatetime.h>
#include<tqobject.h>
#include<tqhostaddress.h>
#include"qca.h"
#include <tqglobal.h>
#include <tqstring.h>
#include <tqdatetime.h>
#include <tqobject.h>
#include <tqhostaddress.h>
#include "tqca.h"
#define TQCA_PLUGIN_VERSION 1
Loading…
Cancel
Save