[Chinese-commits] [fqterm] 12/34: CMakeLists.txt cleanup

Boyuan Yang hosiet-guest at moszumanska.debian.org
Tue Nov 1 06:06:06 UTC 2016


This is an automated email from the git hooks/post-receive script.

hosiet-guest pushed a commit to branch master
in repository fqterm.

commit b91ee982b8ce1e08aad128a65312501ef5dd8ecd
Author: Iru Cai <mytbk920423 at gmail.com>
Date:   Sun Apr 3 00:22:30 2016 +0800

    CMakeLists.txt cleanup
    
    - remove qt4_automoc
    - set VERBOSE_MAKEFILE
    - set FQTERM_LIBS
    - remove trailing spaces and empty lines
---
 CMakeLists.txt               | 34 ++++++++++++++++++++++------------
 CMakeLists.txt.freebsd       | 15 +++------------
 CMakeLists.txt.linux         | 27 ++++++++-------------------
 CMakeLists.txt.macos         | 18 +++---------------
 CMakeLists.txt.mingw         | 18 ++++--------------
 CMakeLists.txt.win32         | 22 ++++++----------------
 src/CMakeLists.txt           |  6 ------
 src/common/CMakeLists.txt    |  5 ++---
 src/fqterm/CMakeLists.txt    | 10 ++++------
 src/protocol/CMakeLists.txt  |  7 ++-----
 src/terminal/CMakeLists.txt  |  7 ++-----
 src/ui/CMakeLists.txt        | 12 ++++--------
 src/unite/CMakeLists.txt     |  8 ++------
 src/utilities/CMakeLists.txt |  4 ++--
 14 files changed, 64 insertions(+), 129 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b8d3dd2..e6d081c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,8 @@
 project(fqterm)
 
 set(FQTERM_VERSION "0.9.8")
-
-cmake_minimum_required( VERSION 2.8.11 FATAL_ERROR )
+set(CMAKE_VERBOSE_MAKEFILE ON)
+cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
 
 if(COMMAND cmake_policy)
   cmake_policy(SET CMP0003 NEW)
@@ -12,10 +12,6 @@ set(CMAKE_MODULE_PATH
   ${CMAKE_SOURCE_DIR}/cmake
 )
 
-IF(NOT CMAKE_BUILD_TYPE) 
-    SET(CMAKE_BUILD_TYPE "MinsizeRel") 
-ENDIF(NOT CMAKE_BUILD_TYPE)
-
 set(CMAKE_COLOR_MAKEFILE ON)
 
 include(GetGitRevisionDescription)
@@ -46,14 +42,14 @@ ELSE(USE_QT5)
     ${CMAKE_SOURCE_DIR}/res/dict/common_zh_CN.ts
     )
 ENDIF(USE_QT5)
-  
+
 add_custom_target(fqterm_qm_target
   DEPENDS ${fqterm_qm_files}
 )
-FIND_PACKAGE(PythonLibs) 
+FIND_PACKAGE(PythonLibs)
 if (PYTHONLIBS_FOUND)
-  SET(PYTHON_LIB ${PYTHON_LIBRARIES}) 
-  INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) 
+  SET(PYTHON_LIB ${PYTHON_LIBRARIES})
+  INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
   ADD_DEFINITIONS(-DFOUND_PYTHON)
 else (PYTHONLIBS_FOUND)
   SET(PYTHON_LIB)
@@ -79,6 +75,22 @@ endif(NOT USE_QT5)
 
 SET(SUB_CMAKELIST "UNKNOWN")
 
+ADD_DEFINITIONS(-D "FQTERM_VERSION_STRING=\\\"${FQTERM_VERSION}\\\"")
+
+# Before adding src directory, make sure all the necessary definitions
+# are added
+add_subdirectory(src)
+
+set(FQTERM_LIBS
+  fqterm_main
+  fqterm_terminal
+  fqterm_protocol
+  fqterm_utilities
+  fqterm_ui
+  fqterm_common
+  fqterm_unite
+  )
+
 IF(WIN32)
   IF(MINGW)
     SET(SUB_CMAKELIST "CMakeLists.txt.mingw")
@@ -110,5 +122,3 @@ IF(SUB_CMAKELIST MATCHES "UNKNOWN")
 ELSE(SUB_CMAKELIST MATCHES "UNKNOWN")
   INCLUDE("${SUB_CMAKELIST}")
 ENDIF(SUB_CMAKELIST MATCHES "UNKNOWN")
-
-
diff --git a/CMakeLists.txt.freebsd b/CMakeLists.txt.freebsd
index fc34e1b..4970568 100644
--- a/CMakeLists.txt.freebsd
+++ b/CMakeLists.txt.freebsd
@@ -6,7 +6,6 @@ set(CMAKE_VERBOSE_MAKEFILE ON)
 ADD_DEFINITIONS(-Wall)
 ADD_DEFINITIONS(-DQT_SHARED)
 ADD_DEFINITIONS(-D_OS_FREEBSD_)
-ADD_DEFINITIONS(-DFQTERM_VERSION_STRING="\\"${FQTERM_VERSION}\\"")
 
 IF(OSS_FOUND)
   ADD_DEFINITIONS(-DAUDIO_OSS)
@@ -15,8 +14,6 @@ ELSE(OSS_FOUND)
   SET(AUDIO_INCLUDE_DIR)
 ENDIF(OSS_FOUND)
 
-add_subdirectory(src)
-
 ADD_EXECUTABLE(fqterm.bin
   src/fqterm/main.cpp
 )
@@ -40,17 +37,11 @@ link_directories(
 )
 
 target_link_libraries(fqterm.bin
-  fqterm_main
-  fqterm_terminal 
-  fqterm_protocol 
-  fqterm_utilities 
-  fqterm_ui
-  fqterm_common 
-  fqterm_unite
+  ${FQTERM_LIBS}
   ${QT_QTNETWORK_LIBRARIES}
-  ${QT_QTSCRIPT_LIBRARIES}  
+  ${QT_QTSCRIPT_LIBRARIES}
   ${QT_LIBRARIES}
-  ${QT_QTXML_LIBRARIES}  
+  ${QT_QTXML_LIBRARIES}
   ${OPENSSL_LIBRARIES}
   ${PYTHON_LIB}
 )
diff --git a/CMakeLists.txt.linux b/CMakeLists.txt.linux
index ad28fb1..6d640cf 100644
--- a/CMakeLists.txt.linux
+++ b/CMakeLists.txt.linux
@@ -2,8 +2,6 @@ find_package(OpenSSL REQUIRED)
 find_package(ALSA)
 find_package(OSS)
 
-set(CMAKE_VERBOSE_MAKEFILE ON)
-
 if (FQTERM_USE_STATIC_QT)
   ADD_DEFINITIONS(-DFQTERM_USE_STATIC_QT)
 endif(FQTERM_USE_STATIC_QT)
@@ -22,11 +20,8 @@ endif(ALSA_FOUND)
 
 ADD_DEFINITIONS(-Wall)
 ADD_DEFINITIONS(-D_OS_LINUX_)
-ADD_DEFINITIONS(-D "FQTERM_VERSION_STRING=\\\"${FQTERM_VERSION}\\\"")
 ADD_DEFINITIONS(--std=c++11)
 
-add_subdirectory(src)
-
 ADD_EXECUTABLE(fqterm.bin
   src/fqterm/main.cpp
 )
@@ -65,28 +60,22 @@ link_directories(
 
 if (FQTERM_USE_STATIC_QT)
   set(FQ_QT_STATIC_PLUGINS
-  ${QT_PLUGINS_DIR}/imageformats/libqgif.a    
-  ${QT_PLUGINS_DIR}/imageformats/libqjpeg.a    
-  ${QT_PLUGINS_DIR}/imageformats/libqmng.a    
-  ${QT_PLUGINS_DIR}/codecs/libqcncodecs.a   
-  ${QT_PLUGINS_DIR}/codecs/libqjpcodecs.a   
-  ${QT_PLUGINS_DIR}/codecs/libqkrcodecs.a   
+  ${QT_PLUGINS_DIR}/imageformats/libqgif.a
+  ${QT_PLUGINS_DIR}/imageformats/libqjpeg.a
+  ${QT_PLUGINS_DIR}/imageformats/libqmng.a
+  ${QT_PLUGINS_DIR}/codecs/libqcncodecs.a
+  ${QT_PLUGINS_DIR}/codecs/libqjpcodecs.a
+  ${QT_PLUGINS_DIR}/codecs/libqkrcodecs.a
   ${QT_PLUGINS_DIR}/codecs/libqtwcodecs.a
   jpeg
   )
 endif(FQTERM_USE_STATIC_QT)
 
 target_link_libraries(fqterm.bin
-  fqterm_main
-  fqterm_terminal 
-  fqterm_protocol 
-  fqterm_utilities 
-  fqterm_ui
-  fqterm_common
-  fqterm_unite
+  ${FQTERM_LIBS}
   ${QT_QTNETWORK_LIBRARIES}
   ${QT_QTXML_LIBRARIES}
-  ${QT_QTSCRIPT_LIBRARIES}  
+  ${QT_QTSCRIPT_LIBRARIES}
   ${FQ_QT_STATIC_PLUGINS}
   ${QT_LIBRARIES}
   ${OPENSSL_LIBRARIES}
diff --git a/CMakeLists.txt.macos b/CMakeLists.txt.macos
index 9016271..bc972df 100644
--- a/CMakeLists.txt.macos
+++ b/CMakeLists.txt.macos
@@ -1,17 +1,11 @@
 find_package(OpenSSL REQUIRED)
 
-set(CMAKE_VERBOSE_MAKEFILE ON)
-
 ADD_DEFINITIONS(-Wall)
-ADD_DEFINITIONS(-DFQTERM_VERSION_STRING="\\"${FQTERM_VERSION}\\"")
-
 
 if(FQTERM_USE_STATIC_QT)
   ADD_DEFINITIONS(-DFQTERM_USE_STATIC_QT)
 endif(FQTERM_USE_STATIC_QT)
 
-add_subdirectory(src)
-
 find_library(APPKIT_LIBRARY AppKit)
 
 FIND_LIBRARY(CARBON_LIBRARY Carbon)
@@ -57,6 +51,7 @@ if(FQTERM_USE_STATIC_QT)
 endif(FQTERM_USE_STATIC_QT)
 
 target_link_libraries(fqterm
+  ${FQTERM_LIBS}
   ${QT_LIBRARIES}
   ${QT_QTCORE_LIBRARY}
   ${QT_QTGUI_LIBRARY}
@@ -67,16 +62,9 @@ target_link_libraries(fqterm
   ${FQ_QT_STATIC_PLUGINS}
   ${PYTHON_LIB}
   ${ZLIB_LIBRARIES}
-  ${QT_QTXML_LIBRARIES}  
-  ssl 
+  ${QT_QTXML_LIBRARIES}
+  ssl
   crypto
-  fqterm_common 
-  fqterm_protocol 
-  fqterm_terminal 
-  fqterm_utilities 
-  fqterm_ui
-  fqterm_main
-  fqterm_unite
 )
 
 add_dependencies(fqterm
diff --git a/CMakeLists.txt.mingw b/CMakeLists.txt.mingw
index 69e6ddf..9163144 100644
--- a/CMakeLists.txt.mingw
+++ b/CMakeLists.txt.mingw
@@ -1,17 +1,13 @@
 find_package(OpenSSL REQUIRED)
-set(CMAKE_VERBOSE_MAKEFILE ON)
 #ADD_DEFINITIONS(-DUSE_DOTNET_STYLE)
-ADD_DEFINITIONS(-D "FQTERM_VERSION_STRING=\\\"${FQTERM_VERSION}\\\"")
 
 if(FQTERM_USE_STATIC_QT)
   ADD_DEFINITIONS(-DFQTERM_USE_STATIC_QT)
   REMOVE_DEFINITIONS(-DQT_DLL)
 endif(FQTERM_USE_STATIC_QT)
 
-add_subdirectory(src)
-
 set(fqterm_RCS
-  fqterm.rc    
+  fqterm.rc
 )
 
 include_directories(
@@ -49,17 +45,11 @@ else(FQTERM_USE_STATIC_QT)
   )
 endif(FQTERM_USE_STATIC_QT)
 
-target_link_libraries(fqterm 
-  fqterm_main
-  fqterm_terminal
-  fqterm_protocol
-  fqterm_utilities
-  fqterm_ui
-  fqterm_common
-  fqterm_unite
+target_link_libraries(fqterm
+  ${FQTERM_LIBS}
   ${QT_QTNETWORK_LIBRARIES}
   ${QT_QTXML_LIBRARIES}
-  ${QT_QTSCRIPT_LIBRARIES}  
+  ${QT_QTSCRIPT_LIBRARIES}
   ${FQ_QT_STATIC_PLUGINS}
   ${QT_LIBRARIES}
   ${PYTHON_LIB}
diff --git a/CMakeLists.txt.win32 b/CMakeLists.txt.win32
index 2b09250..53338dc 100644
--- a/CMakeLists.txt.win32
+++ b/CMakeLists.txt.win32
@@ -15,18 +15,14 @@ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Zi /Od /MD")
 
 ADD_DEFINITIONS(/D USE_DOTNET_STYLE)
 ADD_DEFINITIONS(/D _CRT_SECURE_NO_DEPRECATE)
-ADD_DEFINITIONS(/D FQTERM_VERSION_STRING="\\"${FQTERM_VERSION}\\"")
-
 
 if(FQTERM_USE_STATIC_QT)
   ADD_DEFINITIONS(/D FQTERM_USE_STATIC_QT)
   REMOVE_DEFINITIONS(-DQT_DLL)
 endif(FQTERM_USE_STATIC_QT)
 
-add_subdirectory(src)
-
 set(fqterm_RCS
-  fqterm.rc    
+  fqterm.rc
 )
 
 include_directories(
@@ -54,7 +50,7 @@ ADD_EXECUTABLE(fqterm
 if(FQTERM_USE_STATIC_QT)
   set(FQ_QT_STATIC_PLUGINS
   qcncodecs qjpcodecs qkrcodecs qtwcodecs
-  qjpeg qgif qmng 
+  qjpeg qgif qmng
   )
   set(SOUND_LIBRARIES
   "winmm.lib"
@@ -65,18 +61,12 @@ if(FQTERM_USE_STATIC_QT)
   )
 endif(FQTERM_USE_STATIC_QT)
 
-target_link_libraries(fqterm 
-  fqterm_main
-  fqterm_terminal
-  fqterm_protocol
-  fqterm_utilities
-  fqterm_ui
-  fqterm_common
-  fqterm_unite
+target_link_libraries(fqterm
+  ${FQTERM_LIBS}
   ${QT_LIBRARIES}
   ${QT_QTNETWORK_LIBRARIES}
-  ${QT_QTSCRIPT_LIBRARIES}  
-  ${QT_QTXML_LIBRARIES}  
+  ${QT_QTSCRIPT_LIBRARIES}
+  ${QT_QTXML_LIBRARIES}
   ${OPENSSL_LIBRARIES}
   ${FQ_QT_STATIC_PLUGINS}
   ${PYTHON_LIB}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e8aedb4..607d599 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,13 +1,7 @@
 add_subdirectory(common)
-
 add_subdirectory(protocol)
-
 add_subdirectory(ui)
-
 add_subdirectory(terminal)
-
 add_subdirectory(utilities)
-
 add_subdirectory(unite)
-
 add_subdirectory(fqterm)
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 30524fe..cc4a354 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(CMAKE_AUTOMOC ON)
+
 set(fqterm_common_SRCS
   common.h
   common.cpp
@@ -24,12 +26,10 @@ set(fqterm_common_SRCS
 
 if(USE_QT5)
   set(CMAKE_INCLUDE_CURRENT_DIR ON)
-  set(CMAKE_AUTOMOC ON)
   find_package(Qt5Core REQUIRED)
   find_package(Qt5Widgets REQUIRED)
   find_package(Qt5Multimedia REQUIRED)
 else(USE_QT5)
-  qt4_automoc(${fqterm_common_SRCS})
   include_directories(
     ${QT_INCLUDE_DIR}
     ${QT_QTCORE_INCLUDE_DIR}
@@ -45,4 +45,3 @@ add_library(fqterm_common
 if(USE_QT5)
   target_link_libraries(fqterm_common Qt5::Core Qt5::Widgets Qt5::Multimedia)
 endif(USE_QT5)
-  
\ No newline at end of file
diff --git a/src/fqterm/CMakeLists.txt b/src/fqterm/CMakeLists.txt
index 6ed1d23..2c770c6 100644
--- a/src/fqterm/CMakeLists.txt
+++ b/src/fqterm/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(CMAKE_AUTOMOC ON)
+
 set(fqterm_SRCS
   fqterm_app.h
   fqterm_frame.h
@@ -19,7 +21,7 @@ IF(IMAGE_USE_PICFLOW)
   ADD_DEFINITIONS(-DIMAGE_USE_PICFLOW)
 ELSE(IMAGE_USE_PICFLOW)
 ENDIF(IMAGE_USE_PICFLOW)
-  
+
 IF(GLOBAL_HOTKEY EQUAL 1)
 IF(WIN32)
   set(global_shortcut_impl_SRCS 3rdparty/qxtglobalshortcut_win.cpp)
@@ -54,7 +56,6 @@ set(3rdparty_SRCS
 )
 
 if(USE_QT5)
-  set(CMAKE_AUTOMOC ON)
   find_package(Qt5Core REQUIRED)
   find_package(Qt5Widgets REQUIRED)
   find_package(Qt5Network REQUIRED)
@@ -65,10 +66,6 @@ if(USE_QT5)
     ${CMAKE_SOURCE_DIR}/res/dict/fqterm_zh_CN.ts
     )
 else(USE_QT5)
-  qt4_automoc(${fqterm_SRCS}
-    ${3rdparty_SRCS}
-    )
-
   qt4_create_translation(fqterm_qm_file
     ${fqterm_SRCS}
     ${CMAKE_SOURCE_DIR}/res/dict/fqterm_zh_CN.ts
@@ -87,6 +84,7 @@ include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}/../utilities
   ${CMAKE_CURRENT_SOURCE_DIR}/../unite
   ${CMAKE_CURRENT_SOURCE_DIR}/../ui
+  ${CMAKE_CURRENT_SOURCE_DIR}/../ui/imageviewer
   ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty
   ${CMAKE_CURRENT_BINARY_DIR}/../ui
   ${CMAKE_CURRENT_BINARY_DIR}
diff --git a/src/protocol/CMakeLists.txt b/src/protocol/CMakeLists.txt
index 8eeeb9b..c6cf81d 100644
--- a/src/protocol/CMakeLists.txt
+++ b/src/protocol/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(CMAKE_AUTOMOC ON)
+
 set(export_SRCS
   fqterm_socket.cpp
   fqterm_socket.h
@@ -45,14 +47,9 @@ set(internal_SRCS
 )
 
 if(USE_QT5)
-  set(CMAKE_AUTOMOC ON)
   find_package(Qt5Core REQUIRED)
   find_package(Qt5Network REQUIRED)
 else(USE_QT5)
-  qt4_automoc(
-    ${export_SRCS}
-    ${internal_SRCS}
-    )
 endif(USE_QT5)
 
 include_directories(
diff --git a/src/terminal/CMakeLists.txt b/src/terminal/CMakeLists.txt
index 92b120e..5abe2c6 100644
--- a/src/terminal/CMakeLists.txt
+++ b/src/terminal/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(CMAKE_AUTOMOC ON)
+
 set(export_SRCS
   fqterm_buffer.h
   fqterm_session.h
@@ -41,14 +43,9 @@ add_dependencies(fqterm_terminal
 )
 
 if(USE_QT5)
-  set(CMAKE_AUTOMOC ON)
   find_package(Qt5Core REQUIRED)
   find_package(Qt5Network REQUIRED)
   find_package(Qt5Widgets REQUIRED)
   target_link_libraries(fqterm_terminal Qt5::Core Qt5::Widgets Qt5::Network)
 else(USE_QT5)
-  QT4_AUTOMOC(
-    ${export_SRCS}
-    ${internal_SRCS}
-    )
 endif(USE_QT5)
diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt
index 8fc7b0b..e47ee73 100644
--- a/src/ui/CMakeLists.txt
+++ b/src/ui/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(CMAKE_AUTOMOC ON)
+
 if(IMAGE_USE_PICFLOW)
   set(IMGVIEW_SRCS
     imageviewer.h
@@ -99,10 +101,9 @@ set(fqterm_ui_UIS
 
 if(USE_QT5)
 qt5_wrap_ui(fqterm_ui_UIS_H
-  ${fqterm_ui_UIS} 
+  ${fqterm_ui_UIS}
 )
 
-set(CMAKE_AUTOMOC ON)
 find_package(Qt5Core REQUIRED)
 find_package(Qt5Widgets REQUIRED)
 find_package(Qt5Network REQUIRED)
@@ -114,12 +115,7 @@ qt5_create_translation(fqterm_ui_qm_file
 )
 else(USE_QT5)
 qt4_wrap_ui(fqterm_ui_UIS_H
-  ${fqterm_ui_UIS} 
-)
-
-qt4_automoc(
-  ${fqterm_ui_SRCS}
-  ${fqterm_ui_gen_HS}
+  ${fqterm_ui_UIS}
 )
 
 qt4_create_translation(fqterm_ui_qm_file
diff --git a/src/unite/CMakeLists.txt b/src/unite/CMakeLists.txt
index a8d9d96..cf17842 100644
--- a/src/unite/CMakeLists.txt
+++ b/src/unite/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(CMAKE_AUTOMOC ON)
+
 set(fqunite_SRCS
   fqterm_mini_server.h
   fqterm_mini_server.cpp
@@ -32,7 +34,6 @@ add_library(fqterm_unite
 )
 
 if(USE_QT5)
-  set(CMAKE_AUTOMOC ON)
   find_package(Qt5Core REQUIRED)
   find_package(Qt5Widgets REQUIRED)
   find_package(Qt5Network REQUIRED)
@@ -44,14 +45,9 @@ if(USE_QT5)
     Qt5::Xml
     )
 else(USE_QT5)
-  qt4_automoc(
-    ${fqunite_SRCS}
-    ${fqunite_internal_SRCS}
-    )
 endif(USE_QT5)
 
 add_dependencies(fqterm_unite
   fqterm_common
 )
 
-  
diff --git a/src/utilities/CMakeLists.txt b/src/utilities/CMakeLists.txt
index e74a0d9..8470516 100644
--- a/src/utilities/CMakeLists.txt
+++ b/src/utilities/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(CMAKE_AUTOMOC ON)
+
 set(fqterm_utilities_SRCS
   fqterm_convert.h
   fqterm_http.h
@@ -27,11 +29,9 @@ add_dependencies(fqterm_utilities
 )
 
 if(USE_QT5)
-  set(CMAKE_AUTOMOC ON)
   find_package(Qt5Core REQUIRED)
   find_package(Qt5Widgets REQUIRED)
   find_package(Qt5Network REQUIRED)
   target_link_libraries(fqterm_utilities Qt5::Core Qt5::Widgets Qt5::Network)
 else(USE_QT5)
-  qt4_automoc(${fqterm_utilities_SRCS})
 endif(USE_QT5)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/chinese/fqterm.git



More information about the Chinese-commits mailing list