summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'x11-plugins/cd-plugins-old/files')
-rw-r--r--x11-plugins/cd-plugins-old/files/cd-plugins-old-3.0.1-CMakeLists.txt154
1 files changed, 154 insertions, 0 deletions
diff --git a/x11-plugins/cd-plugins-old/files/cd-plugins-old-3.0.1-CMakeLists.txt b/x11-plugins/cd-plugins-old/files/cd-plugins-old-3.0.1-CMakeLists.txt
new file mode 100644
index 0000000..721c44d
--- /dev/null
+++ b/x11-plugins/cd-plugins-old/files/cd-plugins-old-3.0.1-CMakeLists.txt
@@ -0,0 +1,154 @@
+########### requirements ###############
+
+cmake_minimum_required (VERSION 2.6)
+find_package (PkgConfig)
+include (CheckLibraryExists)
+include (CheckIncludeFiles)
+include (CheckFunctionExists)
+include (CheckSymbolExists)
+include ("${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/GNUInstallDirs.cmake")
+
+########### project ###############
+
+project ("cairo-dock-plugins")
+set (VERSION "3.0.1")
+
+add_definitions (-std=c99 -Wextra -Wwrite-strings -Wuninitialized -Werror-implicit-function-declaration -Wstrict-prototypes) # removed for stable versions: -Wstrict-prototypes #-Wunreachable-code -Wno-unused-parameter -Wall
+add_definitions (-DGL_GLEXT_PROTOTYPES="1")
+
+############ sources tarball #############
+
+set (CPACK_SOURCE_GENERATOR "TGZ")
+set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}")
+set (CPACK_SOURCE_IGNORE_FILES
+ "/build/;/.bzr/;bzrignore$;/misc/;~$;${CPACK_SOURCE_IGNORE_FILES}")
+include (CPack)
+
+add_custom_target(dist
+ COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
+add_custom_target(dist-bzr
+ COMMAND bzr export ${CMAKE_PROJECT_NAME}-${VERSION}.tar.gz
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+
+########### global variables ###############
+
+if( WIN32 )
+ message(FATAL_ERROR "Cairo-Dock requires an air-conditioned room. Please close Windows!")
+endif( WIN32 )
+
+set (PACKAGE ${CMAKE_PROJECT_NAME})
+set (GETTEXT_PACKAGE ${PACKAGE})
+
+# get plug-ins install dir
+execute_process(
+ COMMAND pkg-config gldi --variable=pluginsdir # /usr/lib/cairo-dock # or /usr/lib/x86_64-linux-gnu/cairo-dock
+ OUTPUT_VARIABLE pluginsdir)
+STRING (REGEX REPLACE "\n" "" pluginsdir ${pluginsdir}) # remove the \n
+# get plug-ins data dir
+execute_process(
+ COMMAND pkg-config gldi --variable=pluginsdatadir # /usr/share/cairo-dock/plug-ins
+ OUTPUT_VARIABLE pluginsdatadir)
+STRING (REGEX REPLACE "\n" "" pluginsdatadir ${pluginsdatadir})
+# get prefix dir
+execute_process(
+ COMMAND pkg-config gldi --variable=prefix # /usr/share/cairo-dock/plug-ins
+ OUTPUT_VARIABLE prefix)
+STRING (REGEX REPLACE "\n" "" prefix ${prefix})
+# get GTK version (must be the same as the core, as GTK2 and GTK3 can't coexist at runtime)
+execute_process(
+ COMMAND pkg-config gldi --variable=gtkversion # 2 or 3
+ OUTPUT_VARIABLE gtkversion)
+STRING (REGEX REPLACE "\n" "" gtkversion ${gtkversion})
+# check that version matches with the core
+execute_process(
+ COMMAND pkg-config --modversion gldi # 2.2.0-3
+ OUTPUT_VARIABLE dock_version)
+STRING (REGEX REPLACE "\n" "" dock_version ${dock_version})
+if (NOT "${dock_version}" STREQUAL "${VERSION}") # Version
+ if ("${PACKAGEMENT}" STREQUAL "")
+ MESSAGE (FATAL_ERROR "Error : version mismatch with the core : " ${VERSION} <> ${dock_version})
+ else ()
+ MESSAGE (WARNING "Warning : version mismatch with the core : " ${VERSION} <> ${dock_version})
+ endif ()
+endif()
+
+# check that installation dir matches with the core
+GET_FILENAME_COMPONENT(libdir "${pluginsdir}/.." ABSOLUTE) # /usr/lib # or /usr/lib/x86_64-linux-gnu
+GET_FILENAME_COMPONENT(datadir "${pluginsdatadir}/../.." ABSOLUTE) # /usr/share
+if (NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "${prefix}"
+ OR NOT "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" STREQUAL "${libdir}"
+ OR NOT "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}" STREQUAL "${datadir}")
+ message (STATUS "It seems that the current CMAKE_INSTALL_{PREFIX,LIBDIR,DATAROOTDIR} flags are not the same that you have used with the core.")
+ message (STATUS " It will be replaced by this value: ${prefix}")
+ message (WARNING "Plug-ins should be installed in the same directory as the core, that is to say in ${pluginsdir}")
+ set (CMAKE_INSTALL_PREFIX "${prefix}")
+ #set (libdir "${CMAKE_INSTALL_PREFIX}/${libname}/cairo-dock")
+endif()
+
+# set internationalisation
+set (GETTEXT_PLUGINS "cairo-dock-plugins")
+set (localedir "${prefix}/${CMAKE_INSTALL_LOCALEDIR}")
+set (gaugesdir "${datadir}/cairo-dock/gauges")
+
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/") # additionnal FindPackage files
+
+########### dependencies ###############
+
+message ("")
+message (STATUS "=====================")
+message (STATUS "Check dependencies...")
+message (STATUS "=====================")
+message ("")
+
+pkg_check_modules ("PACKAGE" REQUIRED "cairo" "librsvg-2.0" "dbus-1" "dbus-glib-1" "libxml-2.0")
+#pkg_check_modules ("PACKAGE" REQUIRED "ig")
+pkg_check_modules ("GLDI" REQUIRED "gldi") # we don't want to link with gldi, so we check it separately.
+set (PACKAGE_INCLUDE_DIRS "${GLDI_INCLUDE_DIRS}")
+
+add_definitions (-DGTK_DISABLE_DEPRECATED="1")
+
+############# GLIB #################
+pkg_check_modules (GLIB glib-2.0)
+ STRING (REGEX REPLACE "\\..*" "" GLIB_MAJOR "${GLIB_VERSION}") # 2.28.3 => 2
+ STRING (REGEX REPLACE "[0-9]*\\.([^ ]+)" "\\1" GLIB_MINOR "${GLIB_VERSION}") # 2.28.3 => 2.28
+ STRING (REGEX REPLACE "\\.[0-9]*" "" GLIB_MINOR "${GLIB_MINOR}") # 2.28 => 28
+ STRING (REGEX REPLACE ".*\\." "" GLIB_NANO "${GLIB_VERSION}") # 2.28.3 => 3
+ STRING (REGEX REPLACE "-.*" "" GLIB_NANO "${GLIB_NANO}")
+
+############# NETSPEED #################
+if (ENABLE_NETSPEED)
+ message (STATUS "> NetSpeed:")
+ set (GETTEXT_NETSPEED ${GETTEXT_PLUGINS})
+ set (VERSION_NETSPEED "1.2.9")
+ set (PACKAGE_NETSPEED "cd-netspeed")
+ set (netspeeddatadir "${pluginsdatadir}/netspeed")
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/netspeed/data/netspeed.conf.in ${CMAKE_CURRENT_BINARY_DIR}/netspeed/data/netspeed.conf)
+ add_subdirectory (netspeed)
+ set (with_netspeed "yes")
+else()
+ set (with_netspeed "no")
+endif()
+
+############# WIFI #################
+if (ENABLE_WIFI)
+ message (STATUS "> WiFi:")
+ set (GETTEXT_WIFI ${GETTEXT_PLUGINS})
+ set (VERSION_WIFI "1.2.11")
+ set (PACKAGE_WIFI "cd-wifi")
+ set (wifidatadir "${pluginsdatadir}/wifi")
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/wifi/data/wifi.conf.in ${CMAKE_CURRENT_BINARY_DIR}/wifi/data/wifi.conf)
+ add_subdirectory (wifi)
+ set (with_wifi "yes")
+else()
+ set (with_wifi "no")
+endif()
+
+message ("")
+message (STATUS "===============")
+message (STATUS "Plug-ins build:")
+message (STATUS "===============")
+message ("")
+message (STATUS "Old:")
+message (STATUS " - with Netspeed applet: ${with_netspeed}")
+message (STATUS " - with Wifi applet: ${with_wifi}")
+message ("")