conversion to the cmake building system

Signed-off-by: gregory guy <g-gregory@gmx.fr>
pull/2/head
gregory guy 6 years ago
parent a00e7b445a
commit 08e08ddd20
No known key found for this signature in database
GPG Key ID: 6EFE0EF249A874C0

@ -0,0 +1,75 @@
############################################
# #
# Improvements and feedbacks are welcome #
# #
# This file is released under GPL >= 3 #
# #
############################################
cmake_minimum_required( VERSION 2.8 )
#### general package setup
project( knmap )
set( VERSION R14.1.0 )
#### include essential cmake modules
include( FindPkgConfig )
include( CheckFunctionExists )
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} )
##### user requested modules
option( BUILD_ALL "Build all" ON )
option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
##### configure checks
include( ConfigureChecks.cmake )
###### global compiler settings
add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST -UTQT_NO_COMPAT )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
##### directories
add_subdirectory( src )
tde_conditional_add_subdirectory( BUILD_DOC doc )
##### write configure files
configure_file( config.h.cmake config.h @ONLY )

@ -0,0 +1,45 @@
###########################################
# #
# Improvements and feedback are welcome #
# #
# This file is released under GPL >= 3 #
# #
###########################################
# required stuff
find_package( TQt )
find_package( TDE )
tde_setup_architecture_flags( )
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
##### check for gcc visibility support
if( WITH_GCC_VISIBILITY )
if( NOT UNIX )
tde_message_fatal( "gcc visibility support was requested, but your system is not *NIX" )
endif( NOT UNIX )
set( __KDE_HAVE_GCC_VISIBILITY 1 )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
endif( WITH_GCC_VISIBILITY )
##### gettext
if( BUILD_TRANSLATIONS )
include( FindGettext )
if( GETTEXT_FOUND )
set( MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT_EXECUTABLE}
CACHE FILEPATH "path to msgfmt executable" )
endif( GETTEXT_FOUND )
if( NOT MSGFMT_EXECUTABLE )
tde_message_fatal( "msgfmt is required but was not found on your system." )
endif( NOT MSGFMT_EXECUTABLE )
endif( BUILD_TRANSLATIONS )

@ -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@

@ -0,0 +1 @@
add_subdirectory( en )

@ -0,0 +1 @@
tde_create_handbook( DESTINATION ${PROJECT_NAME} )

@ -0,0 +1,68 @@
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
)
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)
##### knmap (executable)
tde_add_executable( ${PROJECT_NAME} AUTOMOC
SOURCES
main.cpp
knmap.cpp
mainwidget.cpp
outputwidget.cpp
commonwidget.cpp
timingwidget.cpp
compoundwidget.cpp
htmlwidget.cpp
stylesheetdialog.cpp
profiledialog.cpp
loggingoptions.cpp
simpleoptions.cpp
pandsoptions.cpp
whatsthis.cpp
tabwidgetptrlist.cpp
tabwidgetdata.cpp
scanwidget.cpp
indexwidget.cpp
scannamedialog.cpp
scanstack.cpp
scanmonitor.cpp
scanmonitorevent.cpp
nmapoutputbuffer.cpp
LINK
tdeio-shared
tdehtml-shared
tdeui-shared
tdecore-shared
DESTINATION ${BIN_INSTALL_DIR}
)
##### icons
tde_install_icons( )
##### other data
install(
FILES knmapui.rc nmap_manpage.html nmap_manpage.html.diff
DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
)
install(
FILES ${PROJECT_NAME}.desktop
DESTINATION ${APPS_INSTALL_DIR}/Internet
)

@ -653,3 +653,5 @@ bool CommonWidget::validatePortRangeText( TQString& text, uint& portFirst, uint&
return true;
}
#include "commonwidget.moc"

@ -680,3 +680,5 @@ void CompoundWidget::slotWhatsThisClicked( )
else if( m_ttlSpinBox->hasMouse( )) emit( displayHelp( "--ttl" ));
else emit( displayUnknown( ));
}
#include "compoundwidget.moc"

@ -364,3 +364,5 @@ void HTMLWidget::zoomOut( )
m_htmlPart->setZoomFactor( int( m_zoomFactor ));
emit( optionsDirty( ));
}
#include "htmlwidget.moc"

@ -271,3 +271,5 @@ void IndexWidget::slotScanStopped( ScanWidget* scanWidget )
delete m_blinkTimer;
m_blinkTimer = NULL;
}
#include "indexwidget.moc"

@ -458,3 +458,5 @@ void LoggingOptions::slotXMLLogCheckBoxClicked( )
{ m_xmlLogButton->setEnabled( m_xmlLogCheckBox->isChecked( ));
m_xmlLogLineEdit->setEnabled( m_xmlLogCheckBox->isChecked( ));
}
#include "loggingoptions.moc"

@ -461,3 +461,5 @@ void MainWidget::slotZoomIn( )
void MainWidget::slotZoomOut( )
{ m_htmlWidget->zoomOut( );
}
#include "mainwidget.moc"

@ -172,3 +172,5 @@ void OutputWidget::slotUpdateStatusBarText( )
emit( statusBarText( TQString( "Output: %1 lines (%2)" ).arg( TQString::number( paragraphs( ) - 1 )).arg( dataBytes )));
}
#include "outputwidget.moc"

@ -413,3 +413,5 @@ void PAndSOptions::slotWhatsThisClicked( )
else if( m_timestampCheckBox->hasMouse( )) emit( displayHelp( "-PP" ));
else emit( displayUnknown( ));
}
#include "pandsoptions.moc"

@ -323,3 +323,5 @@ void ProfileDialog::slotRename( )
TQString ProfileDialog::stripPrefix( const TQString& profileName ) const
{ return profileName.right( profileName.length( ) - strlen( PROFILE_PREFIX ));
}
#include "profiledialog.moc"

@ -100,3 +100,5 @@ void ScanNameDialog::slotUseHostNameToggled( bool on )
if( !on )
m_scanNameEdit->setFocus( );
}
#include "scannamedialog.moc"

@ -192,3 +192,5 @@ void ScanStack::wrapText( const bool wrap )
for( resetScanWidgets( i ); moreScanWidgets( i ); nextScanWidget( i ))
currentScanWidget( i )->wrapText( wrap );
}
#include "scanstack.moc"

@ -1059,3 +1059,5 @@ void ScanWidget::useTargetHost( const bool b )
void ScanWidget::wrapText( const bool wrap )
{ m_outputWidget->setWordWrap( wrap ? TQTextEdit::WidgetWidth : TQTextEdit::NoWrap );
}
#include "scanwidget.moc"

@ -245,3 +245,5 @@ void SimpleOptions::slotWhatsThisClicked( )
else if( m_verboseCheckBox->hasMouse( )) emit( displayHelp( "-v" ));
else emit( displayUnknown( ));
}
#include "simpleoptions.moc"

@ -126,3 +126,5 @@ void StylesheetDialog::slotURLListBoxDoubleClicked( TQListBoxItem* item )
{ m_urlLineEdit->setText( item->text( ));
slotOk( );
}
#include "stylesheetdialog.moc"

@ -662,3 +662,5 @@ void TimingWidget::slotWhatsThisClicked( )
else if( m_sneakyRadio->hasMouse( )) emit( displayHelp( "-T" ));
else emit( displayUnknown( ));
}
#include "timingwidget.moc"

@ -40,3 +40,5 @@ TQString WhatsThis::text( const TQPoint& /*pos */)
{ emit( clicked( ));
return "";
}
#include "whatsthis.moc"

Loading…
Cancel
Save