From fbfc28021ca0dee1dfb0d84e886e4ee9d8af05a3 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 Nov 2011 18:47:15 -0600 Subject: [PATCH] Initial attempt at using the standard CMake system --- CMakeLists.txt | 75 +++++++++++++++++++++++++++ ConfigureChecks.cmake | 30 +++++++++++ config.h.cmake | 5 ++ icons/CMakeLists.txt | 12 +++++ po/CMakeLists.txt | 17 ++++++ po/{ar.po => ar/wlassistant.po} | 0 po/{ca.po => ca/wlassistant.po} | 0 po/{es.po => es/wlassistant.po} | 0 po/{fr.po => fr/wlassistant.po} | 0 po/{nb.po => nb/wlassistant.po} | 0 po/{pl.po => pl/wlassistant.po} | 0 po/{pt_BR.po => pt_BR/wlassistant.po} | 0 po/{sv.po => sv/wlassistant.po} | 0 po/{zh_CN.po => zh_CN/wlassistant.po} | 0 po/{zh_TW.po => zh_TW/wlassistant.po} | 0 src/CMakeLists.txt | 39 ++++++++++++++ 16 files changed, 178 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 ConfigureChecks.cmake create mode 100644 config.h.cmake create mode 100644 icons/CMakeLists.txt create mode 100644 po/CMakeLists.txt rename po/{ar.po => ar/wlassistant.po} (100%) rename po/{ca.po => ca/wlassistant.po} (100%) rename po/{es.po => es/wlassistant.po} (100%) rename po/{fr.po => fr/wlassistant.po} (100%) rename po/{nb.po => nb/wlassistant.po} (100%) rename po/{pl.po => pl/wlassistant.po} (100%) rename po/{pt_BR.po => pt_BR/wlassistant.po} (100%) rename po/{sv.po => sv/wlassistant.po} (100%) rename po/{zh_CN.po => zh_CN/wlassistant.po} (100%) rename po/{zh_TW.po => zh_TW/wlassistant.po} (100%) create mode 100644 src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..692f4e1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,75 @@ +################################################# +# +# (C) 2011 Timothy Pearson +# kb9vqf (AT) pearsoncomputing.net +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +cmake_minimum_required( VERSION 2.8 ) + + +##### general package setup ##################### + +project( wlassistant ) + + +##### include essential cmake modules ########### + +include( CheckCXXSourceCompiles ) +include( CheckFunctionExists ) +include( CheckIncludeFileCXX ) +include( CheckLibraryExists ) +include( CheckStructHasMember ) +include( CheckSymbolExists ) +include( CheckTypeSize ) +include( FindPkgConfig ) + + +##### include our cmake modules ################# + +set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) +include( TDEMacros ) + + +##### setup install paths ####################### + +include( TDESetupPaths ) +tde_setup_paths( ) + + +##### user requested modules #################### + +option( BUILD_ALL "Build all" OFF ) +option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) + + +##### 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 "-Wl,--no-undefined" ) +set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" ) + + +##### source directories ######################## + +add_subdirectory( src ) +add_subdirectory( icons ) +tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po ) + + +##### write configure files ##################### + +configure_file( config.h.cmake config.h @ONLY ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 0000000..16f316d --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,30 @@ +################################################# +# +# (C) 2011 Timothy Pearson +# kb9vqf (AT) pearsoncomputing.net +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE ) + find_program( MSGFMT_EXECUTABLE msgfmt ) + if( NOT MSGFMT_EXECUTABLE ) + tde_message_fatal( "msgfmt program is required, but was not found on your system" ) + endif( ) +endif( ) + +check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY ) +check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY ) + +check_include_file( stdint.h HAVE_STDINT_H ) +check_include_file( systems.h HAVE_SYSTEMS_H ) +check_include_file( linux/inotify.h HAVE_INOTIFY ) + +check_function_exists( statvfs HAVE_STATVFS ) + +# common required stuff +find_package( TQt ) +find_package( TDE ) diff --git a/config.h.cmake b/config.h.cmake new file mode 100644 index 0000000..d81a482 --- /dev/null +++ b/config.h.cmake @@ -0,0 +1,5 @@ +#cmakedefine SIZEOF_INT @SIZEOF_INT@ +#cmakedefine SIZEOF_LONG @SIZEOF_LONG@ +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_SYSTEMS_H 1 +#cmakedefine HAVE_STATVFS 1 \ No newline at end of file diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt new file mode 100644 index 0000000..fcacb7e --- /dev/null +++ b/icons/CMakeLists.txt @@ -0,0 +1,12 @@ +################################################# +# +# (C) 2011 Timothy Pearson +# kb9vqf (AT) pearsoncomputing.net +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +tde_install_icons( ) diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt new file mode 100644 index 0000000..77a6378 --- /dev/null +++ b/po/CMakeLists.txt @@ -0,0 +1,17 @@ +################################################# +# +# (C) 2011 Timothy Pearson +# kb9vqf (AT) pearsoncomputing.net +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} wlassistant.po ) + +foreach( _po ${po_files} ) + get_filename_component( _lang ${_po} PATH ) + tde_create_translation( FILES ${_po} LANG ${_lang} ) +endforeach( ) diff --git a/po/ar.po b/po/ar/wlassistant.po similarity index 100% rename from po/ar.po rename to po/ar/wlassistant.po diff --git a/po/ca.po b/po/ca/wlassistant.po similarity index 100% rename from po/ca.po rename to po/ca/wlassistant.po diff --git a/po/es.po b/po/es/wlassistant.po similarity index 100% rename from po/es.po rename to po/es/wlassistant.po diff --git a/po/fr.po b/po/fr/wlassistant.po similarity index 100% rename from po/fr.po rename to po/fr/wlassistant.po diff --git a/po/nb.po b/po/nb/wlassistant.po similarity index 100% rename from po/nb.po rename to po/nb/wlassistant.po diff --git a/po/pl.po b/po/pl/wlassistant.po similarity index 100% rename from po/pl.po rename to po/pl/wlassistant.po diff --git a/po/pt_BR.po b/po/pt_BR/wlassistant.po similarity index 100% rename from po/pt_BR.po rename to po/pt_BR/wlassistant.po diff --git a/po/sv.po b/po/sv/wlassistant.po similarity index 100% rename from po/sv.po rename to po/sv/wlassistant.po diff --git a/po/zh_CN.po b/po/zh_CN/wlassistant.po similarity index 100% rename from po/zh_CN.po rename to po/zh_CN/wlassistant.po diff --git a/po/zh_TW.po b/po/zh_TW/wlassistant.po similarity index 100% rename from po/zh_TW.po rename to po/zh_TW/wlassistant.po diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..3ebb7c2 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,39 @@ +################################################# +# +# (C) 2011 Timothy Pearson +# kb9vqf (AT) pearsoncomputing.net +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${TDE_INCLUDE_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/src + ${CMAKE_SOURCE_DIR}/src +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES wlassistant.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) + + +##### wlassistant(executable) ################### + +tde_add_executable( wlassistant + SOURCES main.cpp netlistviewitem.cpp + ui_NetParamsEdit.ui ui_netparamsedit.cpp + ui_NetParamsWizard.ui ui_netparamswizard.cpp + ui_main.ui waconfig.cpp watools.cpp wlassistant.cpp + LINK tdecore-shared tdeui-shared iw-shared + DESTINATION ${BIN_INSTALL_DIR} +)