2010-01-01 23:49:41 +00:00
|
|
|
#
|
|
|
|
# Conky, a system monitor, based on torsmo
|
|
|
|
#
|
|
|
|
# Please see COPYING for details
|
|
|
|
#
|
2021-02-27 15:14:19 +00:00
|
|
|
# Copyright (c) 2005-2021 Brenden Matthews, et. al. (see AUTHORS) All rights
|
2018-12-23 21:38:00 +00:00
|
|
|
# reserved.
|
2010-01-01 23:49:41 +00:00
|
|
|
#
|
2018-12-23 21:38:00 +00:00
|
|
|
# This program is free software: you can redistribute it and/or modify it under
|
|
|
|
# the terms of the GNU General Public License as published by the Free Software
|
|
|
|
# Foundation, either version 3 of the License, or (at your option) any later
|
|
|
|
# version.
|
2010-01-01 23:49:41 +00:00
|
|
|
#
|
2018-12-23 21:38:00 +00:00
|
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
# details. You should have received a copy of the GNU General Public License
|
2010-01-01 23:49:41 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
2009-11-26 19:25:32 +00:00
|
|
|
|
2018-05-12 23:26:31 +00:00
|
|
|
cmake_minimum_required(VERSION 3.6)
|
2009-11-26 19:25:32 +00:00
|
|
|
|
|
|
|
project(conky)
|
|
|
|
|
|
|
|
# This is the directory for our custom CMake modules.
|
2009-12-09 23:56:07 +00:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
2009-11-26 19:25:32 +00:00
|
|
|
|
2009-12-08 04:46:49 +00:00
|
|
|
# 'core' CMake stuff
|
|
|
|
include(Conky)
|
2009-11-26 19:25:32 +00:00
|
|
|
|
2009-12-05 20:00:10 +00:00
|
|
|
# Handle build options
|
|
|
|
include(ConkyBuildOptions)
|
|
|
|
|
|
|
|
# Do platform checks
|
|
|
|
include(ConkyPlatformChecks)
|
|
|
|
|
2009-12-08 04:46:49 +00:00
|
|
|
# CPack module for installation tasks
|
|
|
|
include(ConkyCPackSetup)
|
2009-11-26 19:25:32 +00:00
|
|
|
|
2009-12-08 05:16:11 +00:00
|
|
|
# setup our configuration headers
|
2009-12-09 23:56:07 +00:00
|
|
|
configure_file(${CMAKE_MODULE_PATH}/config.h.in ${CMAKE_BINARY_DIR}/config.h)
|
|
|
|
configure_file(${CMAKE_MODULE_PATH}/build.h.in ${CMAKE_BINARY_DIR}/build.h)
|
2009-12-08 05:16:11 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
set(conky_sources ${CMAKE_BINARY_DIR}/config.h ${CMAKE_BINARY_DIR}/build.h)
|
2018-05-12 16:03:00 +00:00
|
|
|
|
2009-12-08 04:46:49 +00:00
|
|
|
# Finally, add some code
|
2009-11-26 19:25:32 +00:00
|
|
|
add_subdirectory(lua)
|
2010-01-03 00:23:02 +00:00
|
|
|
add_subdirectory(data)
|
2009-11-26 19:25:32 +00:00
|
|
|
add_subdirectory(doc)
|
Add toluapp subtree (#712)
* First commit!
* Import to git
* Droping down CMake requirement
* Corrected installation of libraries
* Adding travis build
* Updated cmake macros
* Fixed find package
* Updated travis hook
* Updated travis hook
* Patch to support Lua 5.3.
* Fix Lua header include directives in tolua++.h
Use angle bracket rather than double quotes when including Lua headers in the tolua++ header. This fixes a problem on systems that default to a Lua version newer than 5.1 and install the tolua++ header to the same directory as newer Lua headers.
As there are (usually) no Lua headers in the same directory when building tolua++ itself, the preprocessor will look to the include directories passed to the compiler, one of which would be the Lua 5.1 include directory, and tolua++ will build with those (correct) headers. Then the tolua++ header is usually installed in the default include directory, alongside the newer Lua headers, which you wouldn't expect to cause any trouble.
But it does cause trouble when trying to build other programs that include the tolua++ header, because now the preprocessor does find Lua headers in the same directory as the tolua++ header, which are the newer (incorrect) headers. Now the program will either fail to compile, because it doesn't support the newer headers, or fail to link with the tolua++ shared object because they were compiled against different Lua headers.
Using angle brackets instead of double quotes in the include directives will fix the problem, because then the preprocessor will look to the include directories passed to the compiler first.
See http://www.cegui.org.uk/forum/viewtopic.php?f=10&t=7195
* Remove email notifications.
* Update travis build.
* Build shared and static libs.
* Patch toluapp to support Lua 5.3.
With this change, support for Lua 5.1 is dropped.
This resolve #116.
* Add some comments to clarify the toluapp handling.
* Add minor sonar fix.
2018-12-20 20:18:51 +00:00
|
|
|
|
|
|
|
# Include 3rdparty toluapp
|
|
|
|
add_subdirectory(3rdparty/toluapp)
|
|
|
|
set(conky_libs ${conky_libs} toluapp_lib_static)
|
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
if(BUILD_TESTS)
|
2021-02-28 20:53:59 +00:00
|
|
|
if(USING_CLANG)
|
|
|
|
message(STATUS "Detected clang, enabling test coverage reports")
|
2018-12-23 21:38:00 +00:00
|
|
|
# Enable coverage checks
|
|
|
|
include(CodeCoverage)
|
|
|
|
append_coverage_compiler_flags()
|
|
|
|
else()
|
|
|
|
message(STATUS "NOT enabling test coverage reports")
|
|
|
|
endif()
|
|
|
|
include(Catch)
|
|
|
|
endif()
|
|
|
|
|
2010-01-03 00:23:02 +00:00
|
|
|
add_subdirectory(src)
|
2009-11-26 19:25:32 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
if(BUILD_TESTS)
|
|
|
|
add_subdirectory(tests)
|
|
|
|
enable_testing()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT DEFINED DOC_PATH)
|
2018-05-12 16:03:00 +00:00
|
|
|
set(DOC_PATH "share/doc/${CPACK_PACKAGE_NAME}-${VERSION}")
|
2018-12-23 21:38:00 +00:00
|
|
|
endif(NOT DEFINED DOC_PATH)
|
2010-12-11 12:50:59 +00:00
|
|
|
set(DOC_FILES extras/convert.lua data/conky_no_x11.conf data/conky.conf)
|
2009-12-18 03:46:26 +00:00
|
|
|
|
2010-12-11 12:50:59 +00:00
|
|
|
set(HTML_PATH "${DOC_PATH}/html")
|
2018-12-23 21:38:00 +00:00
|
|
|
set(HTML_FILES
|
|
|
|
doc/config_settings.html
|
|
|
|
doc/docs.html
|
|
|
|
doc/lua.html
|
|
|
|
doc/variables.html)
|
2010-12-11 12:50:59 +00:00
|
|
|
|
|
|
|
set(MAN_PATH "share/man/man1")
|
|
|
|
set(MAN_FILES doc/conky.1)
|
2015-06-22 00:49:06 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
install(FILES ${DOC_FILES} DESTINATION ${DOC_PATH})
|
2010-12-11 12:50:59 +00:00
|
|
|
|
2019-03-27 18:58:20 +00:00
|
|
|
if(BUILD_DOCS)
|
2018-12-23 21:38:00 +00:00
|
|
|
install(FILES ${HTML_FILES} DESTINATION ${HTML_PATH})
|
2010-12-11 12:50:59 +00:00
|
|
|
|
2018-12-23 21:38:00 +00:00
|
|
|
install(FILES ${MAN_FILES} DESTINATION ${MAN_PATH})
|
2019-03-27 18:58:20 +00:00
|
|
|
endif(BUILD_DOCS)
|
2018-05-12 23:26:31 +00:00
|
|
|
|
2019-01-09 00:34:46 +00:00
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
2019-02-23 02:57:10 +00:00
|
|
|
install(FILES conky.desktop DESTINATION share/applications)
|
|
|
|
install(FILES logo/conky-logomark-violet.svg
|
|
|
|
DESTINATION share/icons/hicolor/scalable/apps)
|
|
|
|
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
2019-01-09 00:34:46 +00:00
|
|
|
|
2018-05-12 23:26:31 +00:00
|
|
|
if(CHECK_CODE_QUALITY)
|
|
|
|
find_package(ClangTidy)
|
2019-02-23 19:40:34 +00:00
|
|
|
find_package(ClangFormat)
|
2018-05-12 23:26:31 +00:00
|
|
|
endif(CHECK_CODE_QUALITY)
|