From 858b221c326dd3fa96edb9ec9a471a324c30ff76 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 18 Jun 2008 08:37:32 -0400 Subject: ENH: try to module run test --- Modules/FindKDE3.cmake | 8 ++++---- Modules/FindQt3.cmake | 15 +++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake index 7a48ac7..721f24d 100644 --- a/Modules/FindKDE3.cmake +++ b/Modules/FindKDE3.cmake @@ -84,17 +84,17 @@ FIND_PACKAGE(X11 ${_REQ_STRING_KDE3}) SET(KDE3_DEFINITIONS -DQT_CLEAN_NAMESPACE -D_GNU_SOURCE) #only on linux, but NOT e.g. on FreeBSD: -IF(CMAKE_SYSTEM_NAME MATCHES "Linux") +IF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_COMPILER_IS_GNUCXX) 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(CMAKE_SYSTEM_NAME MATCHES "Linux") +ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_COMPILER_IS_GNUCXX) # works on FreeBSD, NOT tested on NetBSD and OpenBSD -IF (CMAKE_SYSTEM_NAME MATCHES BSD) +IF (CMAKE_SYSTEM_NAME MATCHES BSD AND CMAKE_COMPILER_IS_GNUCXX) 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 (CMAKE_SYSTEM_NAME MATCHES BSD) +ENDIF (CMAKE_SYSTEM_NAME MATCHES BSD AND CMAKE_COMPILER_IS_GNUCXX) # if no special buildtype is selected, add -O2 as default optimization IF (NOT CMAKE_BUILD_TYPE) diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake index 658d7ec..2ad6fec 100644 --- a/Modules/FindQt3.cmake +++ b/Modules/FindQt3.cmake @@ -186,7 +186,7 @@ IF (QT_MIN_VERSION) #now parse the parts of the user given version string into variables STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+$" req_qt_major_vers "${QT_MIN_VERSION}") IF (NOT req_qt_major_vers) - MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"3.1.5\"") + error_message( "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"3.1.5\"") ENDIF (NOT req_qt_major_vers) STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_qt_major_vers "${QT_MIN_VERSION}") @@ -194,21 +194,28 @@ IF (QT_MIN_VERSION) STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}") # req = "6.5.4", qt = "3.2.1" + macro(error_message msg) + IF(QT3_REQUIRED) + MESSAGE( FATAL_ERROR ${msg}) + ELSE(QT3_REQUIRED) + MESSAGE( STATUS ${msg}) + ENDIF(QT3_REQUIRED) + endmacro(error_message) IF (req_qt_major_vers GREATER qt_major_vers) # (6 > 3) ? - MESSAGE( FATAL_ERROR "Qt major version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes + error_message( "Qt major version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes ELSE (req_qt_major_vers GREATER qt_major_vers) # no IF (req_qt_major_vers LESS qt_major_vers) # (6 < 3) ? SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes ELSE (req_qt_major_vers LESS qt_major_vers) # ( 6==3) ? IF (req_qt_minor_vers GREATER qt_minor_vers) # (5>2) ? - MESSAGE( FATAL_ERROR "Qt minor version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes + error_message( "Qt minor version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes ELSE (req_qt_minor_vers GREATER qt_minor_vers) # no IF (req_qt_minor_vers LESS qt_minor_vers) # (5<2) ? SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes ELSE (req_qt_minor_vers LESS qt_minor_vers) # (5==2) IF (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ? - MESSAGE( FATAL_ERROR "Qt patch level not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes + error_message( "Qt patch level not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes ELSE (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ? SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes ENDIF (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ? -- cgit v0.12