diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindVNC.cmake | 17 | ||||
-rw-r--r-- | cmake/OpenPGMConfig.cmake | 63 | ||||
-rw-r--r-- | cmake/Uninstall.cmake | 21 |
3 files changed, 101 insertions, 0 deletions
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) |