From 6d0111d16d6d22ffa8a54e6ed165b333ca64b4b0 Mon Sep 17 00:00:00 2001 From: Sebastian Schmelzer Date: Mon, 21 Feb 2011 19:12:58 +0100 Subject: add warnings for unused, unreachable code moved cmake (module) files to cmake dir --- CMakeLists.txt | 4 +-- FindVNC.cmake | 17 ------------- OpenPGMConfig.cmake | 63 ----------------------------------------------- Uninstall.cmake | 21 ---------------- cmake/FindVNC.cmake | 17 +++++++++++++ cmake/OpenPGMConfig.cmake | 63 +++++++++++++++++++++++++++++++++++++++++++++++ cmake/Uninstall.cmake | 21 ++++++++++++++++ 7 files changed, 103 insertions(+), 103 deletions(-) delete mode 100644 FindVNC.cmake delete mode 100644 OpenPGMConfig.cmake delete mode 100644 Uninstall.cmake create mode 100644 cmake/FindVNC.cmake create mode 100644 cmake/OpenPGMConfig.cmake create mode 100644 cmake/Uninstall.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index f45fda8..4f8aa11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,13 +10,13 @@ CMAKE_MINIMUM_REQUIRED( VERSION 2.6.2 ) # set compiler optimizations for debug and release SET(CMAKE_BUILD_TYPE Debug) -SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall") +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Wunused -Wunreachable-code") SET(CMAKE_C_FLAGS_RELEASE "-O3 -march=native") SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall") SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -DQT_NO_DEBUG_OUTPUT" ) # local cmake modules -SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}) +SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) # this command finds libraries and sets all required variables FIND_PACKAGE( Qt4 4.5.0 REQUIRED ) diff --git a/FindVNC.cmake b/FindVNC.cmake deleted file mode 100644 index 8b460d3..0000000 --- a/FindVNC.cmake +++ /dev/null @@ -1,17 +0,0 @@ -FIND_PATH(VNC_INCLUDES rfb.h /usr/include/rfb /usr/local/include/rfb) - -FIND_LIBRARY(VNC_LIBRARIES NAMES libvncclient.so PATH /usr/lib /usr/local/lib) - -IF (VNC_INCLUDES AND VNC_LIBRARIES) - SET(VNC_FOUND TRUE) -ENDIF (VNC_INCLUDES AND VNC_LIBRARIES) - -IF (VNC_FOUND) - IF (NOT VNC_FIND_QUIETLY) - MESSAGE(STATUS "Found VNC: ${VNC_LIBRARIES}") - ENDIF (NOT VNC_FIND_QUIETLY) -ELSE (VNC_FOUND) - IF (VNC_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find VNC") - ENDIF (VNC_FIND_REQUIRED) -ENDIF (VNC_FOUND) \ No newline at end of file diff --git a/OpenPGMConfig.cmake b/OpenPGMConfig.cmake deleted file mode 100644 index 1b7adbc..0000000 --- a/OpenPGMConfig.cmake +++ /dev/null @@ -1,63 +0,0 @@ -# Set up build -SET(pgm_VERSION - svn-r1135 -) - -IF(UNIX) - IF(CMAKE_COMPILER_IS_GNUCC) - # The scripts are fine for Linux/GCC, other platforms may or may - # not work. - SET(LIBPGM_DEFINITIONS - -D_XOPEN_SOURCE=600 - -D_BSD_SOURCE - -D_REENTRANT - -DCONFIG_HAVE_GETPROTOBYNAME_R2 - -DCONFIG_HAVE_ISO_VARARGS - -DCONFIG_HAVE_ALLOCA_H - -DCONFIG_16BIT_CHECKSUM - -DCONFIG_HAVE_PROC - -DCONFIG_HAVE_BACKTRACE - -DCONFIG_HAVE_PSELECT - -DCONFIG_HAVE_RTC - -DCONFIG_HAVE_TSC - -DCONFIG_HAVE_HPET - -DCONFIG_HAVE_POLL - -DCONFIG_HAVE_EPOLL - -DCONFIG_HAVE_GETIFADDRS - -DCONFIG_HAVE_IFR_NETMASK - -DCONFIG_HAVE_MCAST_JOIN - -DCONFIG_HAVE_IP_MREQN - -DCONFIG_HAVE_SPRINTF_GROUPING - -DCONFIG_HAVE_VASPRINTF - -DCONFIG_HAVE_DSO_VISIBILITY - -DCONFIG_BIND_INADDR_ANY - -DCONFIG_GALOIS_MUL_LUT - -DCONFIG_HAVE_GETOPT - ) - SET(LIBPGM_CFLAGS - -std=gnu99 - ${LIBPGM_DEFINITIONS} - ) - SET(LIBPGM_CXXFLAGS - -std=gnu++98 - ${LIBPGM_DEFINITIONS} - ) - - SET(LIBPGM_LIBRARIES - m rt - ${GLIB_LIBRARIES}) - - SET(_SYSTEM_SPECIFICS_SET 1) - ENDIF(CMAKE_COMPILER_IS_GNUCC) -ENDIF(UNIX) - -# Complain if this is NOT Linux/GCC. -IF(NOT _SYSTEM_SPECIFICS_SET) - MESSAGE(FATAL_ERROR "Can only build libpgm on Unix with gcc.") -ENDIF(NOT _SYSTEM_SPECIFICS_SET) - -INCLUDE_DIRECTORIES( - ${CMAKE_SOURCE_DIR}/3rdparty/openpgm-${pgm_VERSION}/pgm/include - ${GLIB_INCLUDES_DIR} -) - diff --git a/Uninstall.cmake b/Uninstall.cmake deleted file mode 100644 index dbda3a2..0000000 --- a/Uninstall.cmake +++ /dev/null @@ -1,21 +0,0 @@ -IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") -ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - -FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) -STRING(REGEX REPLACE "\n" ";" files "${files}") -FOREACH(file ${files}) - MESSAGE(STATUS "Uninstalling: $ENV{DESTDIR}${file}") - IF(EXISTS "$ENV{DESTDIR}${file}") - EXEC_PROGRAM( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" - OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval - ) - IF(NOT "${rm_retval}" STREQUAL 0) - MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") - ENDIF(NOT "${rm_retval}" STREQUAL 0) - ELSE(EXISTS "$ENV{DESTDIR}${file}") - MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") - ENDIF(EXISTS "$ENV{DESTDIR}${file}") -ENDFOREACH(file) diff --git a/cmake/FindVNC.cmake b/cmake/FindVNC.cmake new file mode 100644 index 0000000..8b460d3 --- /dev/null +++ b/cmake/FindVNC.cmake @@ -0,0 +1,17 @@ +FIND_PATH(VNC_INCLUDES rfb.h /usr/include/rfb /usr/local/include/rfb) + +FIND_LIBRARY(VNC_LIBRARIES NAMES libvncclient.so PATH /usr/lib /usr/local/lib) + +IF (VNC_INCLUDES AND VNC_LIBRARIES) + SET(VNC_FOUND TRUE) +ENDIF (VNC_INCLUDES AND VNC_LIBRARIES) + +IF (VNC_FOUND) + IF (NOT VNC_FIND_QUIETLY) + MESSAGE(STATUS "Found VNC: ${VNC_LIBRARIES}") + ENDIF (NOT VNC_FIND_QUIETLY) +ELSE (VNC_FOUND) + IF (VNC_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find VNC") + ENDIF (VNC_FIND_REQUIRED) +ENDIF (VNC_FOUND) \ No newline at end of file diff --git a/cmake/OpenPGMConfig.cmake b/cmake/OpenPGMConfig.cmake new file mode 100644 index 0000000..1b7adbc --- /dev/null +++ b/cmake/OpenPGMConfig.cmake @@ -0,0 +1,63 @@ +# Set up build +SET(pgm_VERSION + svn-r1135 +) + +IF(UNIX) + IF(CMAKE_COMPILER_IS_GNUCC) + # The scripts are fine for Linux/GCC, other platforms may or may + # not work. + SET(LIBPGM_DEFINITIONS + -D_XOPEN_SOURCE=600 + -D_BSD_SOURCE + -D_REENTRANT + -DCONFIG_HAVE_GETPROTOBYNAME_R2 + -DCONFIG_HAVE_ISO_VARARGS + -DCONFIG_HAVE_ALLOCA_H + -DCONFIG_16BIT_CHECKSUM + -DCONFIG_HAVE_PROC + -DCONFIG_HAVE_BACKTRACE + -DCONFIG_HAVE_PSELECT + -DCONFIG_HAVE_RTC + -DCONFIG_HAVE_TSC + -DCONFIG_HAVE_HPET + -DCONFIG_HAVE_POLL + -DCONFIG_HAVE_EPOLL + -DCONFIG_HAVE_GETIFADDRS + -DCONFIG_HAVE_IFR_NETMASK + -DCONFIG_HAVE_MCAST_JOIN + -DCONFIG_HAVE_IP_MREQN + -DCONFIG_HAVE_SPRINTF_GROUPING + -DCONFIG_HAVE_VASPRINTF + -DCONFIG_HAVE_DSO_VISIBILITY + -DCONFIG_BIND_INADDR_ANY + -DCONFIG_GALOIS_MUL_LUT + -DCONFIG_HAVE_GETOPT + ) + SET(LIBPGM_CFLAGS + -std=gnu99 + ${LIBPGM_DEFINITIONS} + ) + SET(LIBPGM_CXXFLAGS + -std=gnu++98 + ${LIBPGM_DEFINITIONS} + ) + + SET(LIBPGM_LIBRARIES + m rt + ${GLIB_LIBRARIES}) + + SET(_SYSTEM_SPECIFICS_SET 1) + ENDIF(CMAKE_COMPILER_IS_GNUCC) +ENDIF(UNIX) + +# Complain if this is NOT Linux/GCC. +IF(NOT _SYSTEM_SPECIFICS_SET) + MESSAGE(FATAL_ERROR "Can only build libpgm on Unix with gcc.") +ENDIF(NOT _SYSTEM_SPECIFICS_SET) + +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/3rdparty/openpgm-${pgm_VERSION}/pgm/include + ${GLIB_INCLUDES_DIR} +) + diff --git a/cmake/Uninstall.cmake b/cmake/Uninstall.cmake new file mode 100644 index 0000000..dbda3a2 --- /dev/null +++ b/cmake/Uninstall.cmake @@ -0,0 +1,21 @@ +IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") +ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + +FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +STRING(REGEX REPLACE "\n" ";" files "${files}") +FOREACH(file ${files}) + MESSAGE(STATUS "Uninstalling: $ENV{DESTDIR}${file}") + IF(EXISTS "$ENV{DESTDIR}${file}") + EXEC_PROGRAM( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + IF(NOT "${rm_retval}" STREQUAL 0) + MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") + ENDIF(NOT "${rm_retval}" STREQUAL 0) + ELSE(EXISTS "$ENV{DESTDIR}${file}") + MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") + ENDIF(EXISTS "$ENV{DESTDIR}${file}") +ENDFOREACH(file) -- cgit v1.2.3-55-g7522