diff options
author | Kitware Robot <kwrobot@kitware.com> | 2019-05-10 19:34:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-05-14 19:26:46 (GMT) |
commit | 932dcce1e63b98739ab547f2146a39310c2d0e1e (patch) | |
tree | 6802b7f96be03d8bfee2867c0f308307982d6ffc /Modules/FindKDE3.cmake | |
parent | e2d0aea2c734c8c5028f3573082e75bd157dbe72 (diff) | |
download | CMake-932dcce1e63b98739ab547f2146a39310c2d0e1e.zip CMake-932dcce1e63b98739ab547f2146a39310c2d0e1e.tar.gz CMake-932dcce1e63b98739ab547f2146a39310c2d0e1e.tar.bz2 |
Modules: Consistently use 2 space indentation
Diffstat (limited to 'Modules/FindKDE3.cmake')
-rw-r--r-- | Modules/FindKDE3.cmake | 210 |
1 files changed, 105 insertions, 105 deletions
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake index f916359..30ea5e6 100644 --- a/Modules/FindKDE3.cmake +++ b/Modules/FindKDE3.cmake @@ -139,7 +139,7 @@ Author: Alexander Neundorf <neundorf@kde.org> #]=======================================================================] if(NOT UNIX AND KDE3_FIND_REQUIRED) - message(FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported") + message(FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported") endif() # If Qt4 has already been found, fail. @@ -170,24 +170,24 @@ find_package(X11 ${_REQ_STRING_KDE3}) #now try to find some kde stuff find_program(KDECONFIG_EXECUTABLE NAMES kde-config HINTS - $ENV{KDEDIR}/bin - PATHS - /opt/kde3/bin - /opt/kde/bin + $ENV{KDEDIR}/bin + PATHS + /opt/kde3/bin + /opt/kde/bin ) set(KDE3PREFIX) if(KDECONFIG_EXECUTABLE) - execute_process(COMMAND ${KDECONFIG_EXECUTABLE} --version - OUTPUT_VARIABLE kde_config_version ) + execute_process(COMMAND ${KDECONFIG_EXECUTABLE} --version + OUTPUT_VARIABLE kde_config_version ) - string(REGEX MATCH "KDE: .\\." kde_version "${kde_config_version}") - if ("${kde_version}" MATCHES "KDE: 3\\.") - execute_process(COMMAND ${KDECONFIG_EXECUTABLE} --prefix - OUTPUT_VARIABLE kdedir ) - string(REPLACE "\n" "" KDE3PREFIX "${kdedir}") + string(REGEX MATCH "KDE: .\\." kde_version "${kde_config_version}") + if ("${kde_version}" MATCHES "KDE: 3\\.") + execute_process(COMMAND ${KDECONFIG_EXECUTABLE} --prefix + OUTPUT_VARIABLE kdedir ) + string(REPLACE "\n" "" KDE3PREFIX "${kdedir}") - endif () + endif () endif() @@ -196,22 +196,22 @@ endif() # kpassdlg.h comes from kdeui and doesn't exist in KDE4 anymore find_path(KDE3_INCLUDE_DIR kpassdlg.h HINTS - $ENV{KDEDIR}/include - ${KDE3PREFIX}/include + $ENV{KDEDIR}/include + ${KDE3PREFIX}/include PATHS - /opt/kde3/include - /opt/kde/include + /opt/kde3/include + /opt/kde/include PATH_SUFFIXES include/kde ) #now the KDE library directory find_library(KDE3_KDECORE_LIBRARY NAMES kdecore HINTS - $ENV{KDEDIR}/lib - ${KDE3PREFIX}/lib + $ENV{KDEDIR}/lib + ${KDE3PREFIX}/lib PATHS - /opt/kde3/lib - /opt/kde/lib + /opt/kde3/lib + /opt/kde/lib ) set(QT_AND_KDECORE_LIBS ${QT_LIBRARIES} ${KDE3_KDECORE_LIBRARY}) @@ -219,49 +219,49 @@ set(QT_AND_KDECORE_LIBS ${QT_LIBRARIES} ${KDE3_KDECORE_LIBRARY}) get_filename_component(KDE3_LIB_DIR ${KDE3_KDECORE_LIBRARY} PATH ) if(NOT KDE3_LIBTOOL_DIR) - if(KDE3_KDECORE_LIBRARY MATCHES lib64) - set(KDE3_LIBTOOL_DIR /lib64/kde3) - elseif(KDE3_KDECORE_LIBRARY MATCHES libx32) - set(KDE3_LIBTOOL_DIR /libx32/kde3) - else() - set(KDE3_LIBTOOL_DIR /lib/kde3) - endif() + if(KDE3_KDECORE_LIBRARY MATCHES lib64) + set(KDE3_LIBTOOL_DIR /lib64/kde3) + elseif(KDE3_KDECORE_LIBRARY MATCHES libx32) + set(KDE3_LIBTOOL_DIR /libx32/kde3) + else() + set(KDE3_LIBTOOL_DIR /lib/kde3) + endif() endif() #now search for the dcop utilities find_program(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl HINTS - $ENV{KDEDIR}/bin - ${KDE3PREFIX}/bin + $ENV{KDEDIR}/bin + ${KDE3PREFIX}/bin PATHS - /opt/kde3/bin - /opt/kde/bin + /opt/kde3/bin + /opt/kde/bin ) find_program(KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp HINTS - $ENV{KDEDIR}/bin - ${KDE3PREFIX}/bin + $ENV{KDEDIR}/bin + ${KDE3PREFIX}/bin PATHS - /opt/kde3/bin - /opt/kde/bin + /opt/kde3/bin + /opt/kde/bin ) find_program(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler HINTS - $ENV{KDEDIR}/bin - ${KDE3PREFIX}/bin + $ENV{KDEDIR}/bin + ${KDE3PREFIX}/bin PATHS - /opt/kde3/bin - /opt/kde/bin + /opt/kde3/bin + /opt/kde/bin ) #SET KDE3_FOUND if (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE) - set(KDE3_FOUND TRUE) + set(KDE3_FOUND TRUE) else () - set(KDE3_FOUND FALSE) + set(KDE3_FOUND FALSE) endif () # add some KDE specific stuff @@ -269,36 +269,36 @@ set(KDE3_DEFINITIONS -DQT_CLEAN_NAMESPACE -D_GNU_SOURCE) # set compiler flags only if KDE3 has actually been found if(KDE3_FOUND) - set(_KDE3_USE_FLAGS FALSE) - if(CMAKE_COMPILER_IS_GNUCXX) - set(_KDE3_USE_FLAGS TRUE) # use flags for gnu compiler - execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version - OUTPUT_VARIABLE out) - # gnu gcc 2.96 does not work with flags - # I guess 2.95 also doesn't then - if("${out}" MATCHES "2.9[56]") - set(_KDE3_USE_FLAGS FALSE) - endif() - endif() - - #only on linux, but NOT e.g. on FreeBSD: - if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS) - set (KDE3_DEFINITIONS ${KDE3_DEFINITIONS} -D_XOPEN_SOURCE=500 -D_BSD_SOURCE) - set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") - set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-exceptions -fno-check-new -fno-common") - endif() - - # works on FreeBSD, NOT tested on NetBSD and OpenBSD - if (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS) - set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") - set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common") - endif () - - # if no special buildtype is selected, add -O2 as default optimization - if (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS) - set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") - set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") - endif () + set(_KDE3_USE_FLAGS FALSE) + if(CMAKE_COMPILER_IS_GNUCXX) + set(_KDE3_USE_FLAGS TRUE) # use flags for gnu compiler + execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version + OUTPUT_VARIABLE out) + # gnu gcc 2.96 does not work with flags + # I guess 2.95 also doesn't then + if("${out}" MATCHES "2.9[56]") + set(_KDE3_USE_FLAGS FALSE) + endif() + endif() + + #only on linux, but NOT e.g. on FreeBSD: + if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS) + set (KDE3_DEFINITIONS ${KDE3_DEFINITIONS} -D_XOPEN_SOURCE=500 -D_BSD_SOURCE) + set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-exceptions -fno-check-new -fno-common") + endif() + + # works on FreeBSD, NOT tested on NetBSD and OpenBSD + if (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS) + set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common") + endif () + + # if no special buildtype is selected, add -O2 as default optimization + if (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS) + set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") + endif () #set(CMAKE_SHARED_LINKER_FLAGS "-avoid-version -module -Wl,--no-undefined -Wl,--allow-shlib-undefined") #set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc") @@ -311,49 +311,49 @@ include(${CMAKE_CURRENT_LIST_DIR}/KDE3Macros.cmake) macro (KDE3_PRINT_RESULTS) - if(KDE3_INCLUDE_DIR) - message(STATUS "Found KDE3 include dir: ${KDE3_INCLUDE_DIR}") - else() - message(STATUS "Didn't find KDE3 headers") - endif() - - if(KDE3_LIB_DIR) - message(STATUS "Found KDE3 library dir: ${KDE3_LIB_DIR}") - else() - message(STATUS "Didn't find KDE3 core library") - endif() - - if(KDE3_DCOPIDL_EXECUTABLE) - message(STATUS "Found KDE3 dcopidl preprocessor: ${KDE3_DCOPIDL_EXECUTABLE}") - else() - message(STATUS "Didn't find the KDE3 dcopidl preprocessor") - endif() - - if(KDE3_DCOPIDL2CPP_EXECUTABLE) - message(STATUS "Found KDE3 dcopidl2cpp preprocessor: ${KDE3_DCOPIDL2CPP_EXECUTABLE}") - else() - message(STATUS "Didn't find the KDE3 dcopidl2cpp preprocessor") - endif() - - if(KDE3_KCFGC_EXECUTABLE) - message(STATUS "Found KDE3 kconfig_compiler preprocessor: ${KDE3_KCFGC_EXECUTABLE}") - else() - message(STATUS "Didn't find the KDE3 kconfig_compiler preprocessor") - endif() + if(KDE3_INCLUDE_DIR) + message(STATUS "Found KDE3 include dir: ${KDE3_INCLUDE_DIR}") + else() + message(STATUS "Didn't find KDE3 headers") + endif() + + if(KDE3_LIB_DIR) + message(STATUS "Found KDE3 library dir: ${KDE3_LIB_DIR}") + else() + message(STATUS "Didn't find KDE3 core library") + endif() + + if(KDE3_DCOPIDL_EXECUTABLE) + message(STATUS "Found KDE3 dcopidl preprocessor: ${KDE3_DCOPIDL_EXECUTABLE}") + else() + message(STATUS "Didn't find the KDE3 dcopidl preprocessor") + endif() + + if(KDE3_DCOPIDL2CPP_EXECUTABLE) + message(STATUS "Found KDE3 dcopidl2cpp preprocessor: ${KDE3_DCOPIDL2CPP_EXECUTABLE}") + else() + message(STATUS "Didn't find the KDE3 dcopidl2cpp preprocessor") + endif() + + if(KDE3_KCFGC_EXECUTABLE) + message(STATUS "Found KDE3 kconfig_compiler preprocessor: ${KDE3_KCFGC_EXECUTABLE}") + else() + message(STATUS "Didn't find the KDE3 kconfig_compiler preprocessor") + endif() endmacro () if (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND) - #bail out if something wasn't found - KDE3_PRINT_RESULTS() - message(FATAL_ERROR "Could NOT find everything required for compiling KDE 3 programs") + #bail out if something wasn't found + KDE3_PRINT_RESULTS() + message(FATAL_ERROR "Could NOT find everything required for compiling KDE 3 programs") endif () if (NOT KDE3_FIND_QUIETLY) - KDE3_PRINT_RESULTS() + KDE3_PRINT_RESULTS() endif () #add the found Qt and KDE include directories to the current include path |