1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-02-05 05:28:32 +00:00

Reformat CMake files.

Applied `cmake_format`.
This commit is contained in:
Brenden Matthews 2019-01-03 09:25:58 -05:00
parent 95a4f0e2f0
commit 03f3ce7bdc
13 changed files with 570 additions and 472 deletions

View File

@ -92,15 +92,13 @@ same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
#]=======================================================================] #]=======================================================================]
#------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
function(catch_discover_tests TARGET) function(catch_discover_tests TARGET)
cmake_parse_arguments( cmake_parse_arguments(""
"" ""
"" "TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST"
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST" "TEST_SPEC;EXTRA_ARGS;PROPERTIES"
"TEST_SPEC;EXTRA_ARGS;PROPERTIES" ${ARGN})
${ARGN}
)
if(NOT _WORKING_DIRECTORY) if(NOT _WORKING_DIRECTORY)
set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
@ -109,67 +107,66 @@ function(catch_discover_tests TARGET)
set(_TEST_LIST ${TARGET}_TESTS) set(_TEST_LIST ${TARGET}_TESTS)
endif() endif()
## Generate a unique name based on the extra arguments # Generate a unique name based on the extra arguments
string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS}") string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS}")
string(SUBSTRING ${args_hash} 0 7 args_hash) string(SUBSTRING ${args_hash}
0
7
args_hash)
# Define rule to generate test list for aforementioned test executable # Define rule to generate test list for aforementioned test executable
set(ctest_include_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_include-${args_hash}.cmake") set(ctest_include_file
set(ctest_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_tests-${args_hash}.cmake") "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_include-${args_hash}.cmake")
set(ctest_tests_file
"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_tests-${args_hash}.cmake")
get_property(crosscompiling_emulator get_property(crosscompiling_emulator
TARGET ${TARGET} TARGET ${TARGET}
PROPERTY CROSSCOMPILING_EMULATOR PROPERTY CROSSCOMPILING_EMULATOR)
) add_custom_command(TARGET
add_custom_command( ${TARGET}
TARGET ${TARGET} POST_BUILD POST_BUILD
BYPRODUCTS "${ctest_tests_file}" BYPRODUCTS
COMMAND "${CMAKE_COMMAND}" "${ctest_tests_file}"
-D "TEST_TARGET=${TARGET}" COMMAND "${CMAKE_COMMAND}" -D "TEST_TARGET=${TARGET}" -D
-D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>" "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>" -D
-D "TEST_EXECUTOR=${crosscompiling_emulator}" "TEST_EXECUTOR=${crosscompiling_emulator}" -D
-D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}" "TEST_WORKING_DIR=${_WORKING_DIRECTORY}" -D
-D "TEST_SPEC=${_TEST_SPEC}" "TEST_SPEC=${_TEST_SPEC}" -D
-D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}" "TEST_EXTRA_ARGS=${_EXTRA_ARGS}" -D
-D "TEST_PROPERTIES=${_PROPERTIES}" "TEST_PROPERTIES=${_PROPERTIES}" -D
-D "TEST_PREFIX=${_TEST_PREFIX}" "TEST_PREFIX=${_TEST_PREFIX}" -D
-D "TEST_SUFFIX=${_TEST_SUFFIX}" "TEST_SUFFIX=${_TEST_SUFFIX}" -D
-D "TEST_LIST=${_TEST_LIST}" "TEST_LIST=${_TEST_LIST}" -D
-D "CTEST_FILE=${ctest_tests_file}" "CTEST_FILE=${ctest_tests_file}" -P
-P "${_CATCH_DISCOVER_TESTS_SCRIPT}" "${_CATCH_DISCOVER_TESTS_SCRIPT}"
VERBATIM VERBATIM)
)
file(WRITE "${ctest_include_file}" file(
"if(EXISTS \"${ctest_tests_file}\")\n" WRITE
" include(\"${ctest_tests_file}\")\n" "${ctest_include_file}"
"else()\n" "if(EXISTS \"${ctest_tests_file}\")\n"
" add_test(${TARGET}_NOT_BUILT-${args_hash} ${TARGET}_NOT_BUILT-${args_hash})\n" " include(\"${ctest_tests_file}\")\n"
"endif()\n" "else()\n"
) " add_test(${TARGET}_NOT_BUILT-${args_hash} ${TARGET}_NOT_BUILT-${args_hash})\n"
"endif()\n")
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0") if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0")
# Add discovered tests to directory TEST_INCLUDE_FILES # Add discovered tests to directory TEST_INCLUDE_FILES
set_property(DIRECTORY set_property(DIRECTORY
APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}" APPEND
) PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}")
else() else()
# Add discovered tests as directory TEST_INCLUDE_FILE if possible # Add discovered tests as directory TEST_INCLUDE_FILE if possible
get_property(test_include_file_set DIRECTORY PROPERTY TEST_INCLUDE_FILE SET) get_property(test_include_file_set DIRECTORY PROPERTY TEST_INCLUDE_FILE SET)
if (NOT ${test_include_file_set}) if(NOT ${test_include_file_set})
set_property(DIRECTORY set_property(DIRECTORY PROPERTY TEST_INCLUDE_FILE "${ctest_include_file}")
PROPERTY TEST_INCLUDE_FILE "${ctest_include_file}"
)
else() else()
message(FATAL_ERROR message(FATAL_ERROR "Cannot set more than one TEST_INCLUDE_FILE")
"Cannot set more than one TEST_INCLUDE_FILE"
)
endif() endif()
endif() endif()
endfunction() endfunction()
############################################################################### #
set(_CATCH_DISCOVER_TESTS_SCRIPT set(_CATCH_DISCOVER_TESTS_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/CatchAddTests.cmake)
${CMAKE_CURRENT_LIST_DIR}/CatchAddTests.cmake
)

View File

@ -24,49 +24,48 @@ endfunction()
# Run test executable to get list of available tests # Run test executable to get list of available tests
if(NOT EXISTS "${TEST_EXECUTABLE}") if(NOT EXISTS "${TEST_EXECUTABLE}")
message(FATAL_ERROR message(
"Specified test executable '${TEST_EXECUTABLE}' does not exist" FATAL_ERROR "Specified test executable '${TEST_EXECUTABLE}' does not exist")
)
endif() endif()
execute_process( execute_process(COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec}
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only --list-test-names-only
OUTPUT_VARIABLE output OUTPUT_VARIABLE output
RESULT_VARIABLE result RESULT_VARIABLE result)
) # Catch --list-test-names-only reports the number of tests, so 0 is...
# Catch --list-test-names-only reports the number of tests, so 0 is... surprising # surprising
if(${result} EQUAL 0) if(${result} EQUAL 0)
message(WARNING message(WARNING "Test executable '${TEST_EXECUTABLE}' contains no tests!\n")
"Test executable '${TEST_EXECUTABLE}' contains no tests!\n"
)
elseif(${result} LESS 0) elseif(${result} LESS 0)
message(FATAL_ERROR message(FATAL_ERROR "Error running test executable '${TEST_EXECUTABLE}':\n"
"Error running test executable '${TEST_EXECUTABLE}':\n" " Result: ${result}\n" " Output: ${output}\n")
" Result: ${result}\n"
" Output: ${output}\n"
)
endif() endif()
string(REPLACE "\n" ";" output "${output}") string(REPLACE "\n"
";"
output
"${output}")
# Parse output # Parse output
foreach(line ${output}) foreach(line ${output})
set(test ${line}) set(test ${line})
# use escape commas to handle properly test cases with commans inside the name # use escape commas to handle properly test cases with commans inside the name
string(REPLACE "," "\\," test_name ${test}) string(REPLACE ","
"\\,"
test_name
${test})
# ...and add to script # ...and add to script
add_command(add_test add_command(add_test
"${prefix}${test}${suffix}" "${prefix}${test}${suffix}"
${TEST_EXECUTOR} ${TEST_EXECUTOR}
"${TEST_EXECUTABLE}" "${TEST_EXECUTABLE}"
"${test_name}" "${test_name}"
${extra_args} ${extra_args})
)
add_command(set_tests_properties add_command(set_tests_properties
"${prefix}${test}${suffix}" "${prefix}${test}${suffix}"
PROPERTIES PROPERTIES
WORKING_DIRECTORY "${TEST_WORKING_DIR}" WORKING_DIRECTORY
${properties} "${TEST_WORKING_DIR}"
) ${properties})
list(APPEND tests "${prefix}${test}${suffix}") list(APPEND tests "${prefix}${test}${suffix}")
endforeach() endforeach()

View File

@ -3,23 +3,22 @@
# #
# Please see COPYING for details # Please see COPYING for details
# #
# Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) # Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) All rights
# All rights reserved. # reserved.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify it under
# it under the terms of the GNU General Public License as published by # the terms of the GNU General Public License as published by the Free Software
# the Free Software Foundation, either version 3 of the License, or # Foundation, either version 3 of the License, or (at your option) any later
# (at your option) any later version. # version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful, but WITHOUT
# but WITHOUT ANY WARRANTY; without even the implied warranty of # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# GNU General Public License for more details. # details. You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
#set(RELEASE true) # set(RELEASE true)
# Set system vars # Set system vars
if(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES "Linux")
@ -54,11 +53,37 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(OS_DARWIN true) set(OS_DARWIN true)
endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
if(NOT OS_LINUX AND NOT OS_FREEBSD AND NOT OS_OPENBSD AND NOT OS_DRAGONFLY if(NOT OS_LINUX
AND NOT OS_SOLARIS AND NOT OS_HAIKU AND NOT OS_DARWIN) AND NOT OS_FREEBSD
message(FATAL_ERROR "Your platform, '${CMAKE_SYSTEM_NAME}', is not currently supported. Patches are welcome.") AND NOT OS_OPENBSD
endif(NOT OS_LINUX AND NOT OS_FREEBSD AND NOT OS_OPENBSD AND NOT OS_DRAGONFLY AND NOT OS_DRAGONFLY
AND NOT OS_SOLARIS AND NOT OS_HAIKU AND NOT OS_DARWIN) AND NOT OS_SOLARIS
AND NOT OS_HAIKU
AND NOT OS_DARWIN)
message(
FATAL_ERROR
"Your platform, '${CMAKE_SYSTEM_NAME}', is not currently supported. Patches are welcome."
)
endif(NOT
OS_LINUX
AND
NOT
OS_FREEBSD
AND
NOT
OS_OPENBSD
AND
NOT
OS_DRAGONFLY
AND
NOT
OS_SOLARIS
AND
NOT
OS_HAIKU
AND
NOT
OS_DARWIN)
include(FindThreads) include(FindThreads)
find_package(Threads) find_package(Threads)
@ -67,13 +92,17 @@ set(conky_libs ${CMAKE_THREAD_LIBS_INIT})
set(conky_includes ${CMAKE_BINARY_DIR}) set(conky_includes ${CMAKE_BINARY_DIR})
# #
# On Darwin _POSIX_C_SOURCE must be >= __DARWIN_C_FULL for asprintf to be enabled! # On Darwin _POSIX_C_SOURCE must be >= __DARWIN_C_FULL for asprintf to be
# Thus disable this and _LARGEFILE64_SOURCE isnt needed, it is already used on macOS. # enabled! Thus disable this and _LARGEFILE64_SOURCE isnt needed, it is already
# used on macOS.
# #
if(NOT OS_DARWIN) if(NOT OS_DARWIN)
add_definitions(-D_LARGEFILE64_SOURCE -D_POSIX_C_SOURCE=200809L) # Standard definitions add_definitions(-D_LARGEFILE64_SOURCE -D_POSIX_C_SOURCE=200809L) # Standard
set(CMAKE_REQUIRED_DEFINITIONS # definitions
"${CMAKE_REQUIRED_DEFINITIONS} -D_LARGEFILE64_SOURCE -D_POSIX_C_SOURCE=200809L") set(
CMAKE_REQUIRED_DEFINITIONS
"${CMAKE_REQUIRED_DEFINITIONS} -D_LARGEFILE64_SOURCE -D_POSIX_C_SOURCE=200809L"
)
endif(NOT OS_DARWIN) endif(NOT OS_DARWIN)
if(OS_DRAGONFLY) if(OS_DRAGONFLY)
@ -120,17 +149,22 @@ endif(NOT RELEASE)
mark_as_advanced(APP_AWK APP_WC APP_DATE APP_UNAME) mark_as_advanced(APP_AWK APP_WC APP_DATE APP_UNAME)
#BUILD_DATE=$(LANG=en_US LC_ALL=en_US LOCALE=en_US date) # BUILD_DATE=$(LANG=en_US LC_ALL=en_US LOCALE=en_US date) BUILD_ARCH="$(uname
#BUILD_ARCH="$(uname -sr) ($(uname -m))" # -sr) ($(uname -m))"
execute_process(COMMAND ${APP_DATE} RESULT_VARIABLE RETVAL OUTPUT_VARIABLE execute_process(COMMAND ${APP_DATE}
BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) RESULT_VARIABLE RETVAL
execute_process(COMMAND ${APP_UNAME} -srm RESULT_VARIABLE RETVAL OUTPUT_VARIABLE BUILD_DATE
OUTPUT_VARIABLE BUILD_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${APP_UNAME} -srm
RESULT_VARIABLE RETVAL
OUTPUT_VARIABLE BUILD_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(RELEASE) if(RELEASE)
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
else(RELEASE) else(RELEASE)
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_pre${COMMIT_COUNT}") set(VERSION
"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_pre${COMMIT_COUNT}")
endif(RELEASE) endif(RELEASE)
set(COPYRIGHT "Copyright Brenden Matthews, et al, 2005-2018") set(COPYRIGHT "Copyright Brenden Matthews, et al, 2005-2018")
@ -146,11 +180,13 @@ macro(AC_SEARCH_LIBS FUNCTION_NAME INCLUDES TARGET_VAR)
unset(AC_SEARCH_LIBS_TMP CACHE) unset(AC_SEARCH_LIBS_TMP CACHE)
unset(AC_SEARCH_LIBS_FOUND CACHE) unset(AC_SEARCH_LIBS_FOUND CACHE)
find_library(AC_SEARCH_LIBS_TMP ${LIB}) find_library(AC_SEARCH_LIBS_TMP ${LIB})
check_library_exists(${LIB} ${FUNCTION_NAME} ${AC_SEARCH_LIBS_TMP} check_library_exists(${LIB}
AC_SEARCH_LIBS_FOUND) ${FUNCTION_NAME}
${AC_SEARCH_LIBS_TMP}
AC_SEARCH_LIBS_FOUND)
if(${AC_SEARCH_LIBS_FOUND}) if(${AC_SEARCH_LIBS_FOUND})
set(${TARGET_VAR} ${AC_SEARCH_LIBS_TMP} CACHE INTERNAL set(${TARGET_VAR} ${AC_SEARCH_LIBS_TMP}
"Library containing ${FUNCTION_NAME}") CACHE INTERNAL "Library containing ${FUNCTION_NAME}")
break() break()
endif(${AC_SEARCH_LIBS_FOUND}) endif(${AC_SEARCH_LIBS_FOUND})
endforeach(LIB) endforeach(LIB)
@ -158,26 +194,30 @@ macro(AC_SEARCH_LIBS FUNCTION_NAME INCLUDES TARGET_VAR)
endif("${TARGET_VAR}" MATCHES "^${TARGET_VAR}$") endif("${TARGET_VAR}" MATCHES "^${TARGET_VAR}$")
endmacro(AC_SEARCH_LIBS) endmacro(AC_SEARCH_LIBS)
# A function to print the target build properties # A function to print the target build properties
function(print_target_properties tgt) function(print_target_properties tgt)
if(NOT TARGET ${tgt}) if(NOT TARGET ${tgt})
message("There is no target named '${tgt}'") message("There is no target named '${tgt}'")
return() return()
endif()
# this list of properties can be extended as needed
set(CMAKE_PROPERTY_LIST
SOURCE_DIR
BINARY_DIR
COMPILE_DEFINITIONS
COMPILE_OPTIONS
INCLUDE_DIRECTORIES
LINK_LIBRARIES)
message("Configuration for target ${tgt}")
foreach(prop ${CMAKE_PROPERTY_LIST})
get_property(propval TARGET ${tgt} PROPERTY ${prop} SET)
if(propval)
get_target_property(propval ${tgt} ${prop})
message(STATUS "${prop} = ${propval}")
endif() endif()
endforeach(prop)
# this list of properties can be extended as needed
set(CMAKE_PROPERTY_LIST SOURCE_DIR BINARY_DIR COMPILE_DEFINITIONS
COMPILE_OPTIONS INCLUDE_DIRECTORIES LINK_LIBRARIES)
message("Configuration for target ${tgt}")
foreach (prop ${CMAKE_PROPERTY_LIST})
get_property(propval TARGET ${tgt} PROPERTY ${prop} SET)
if (propval)
get_target_property(propval ${tgt} ${prop})
message (STATUS "${prop} = ${propval}")
endif()
endforeach(prop)
endfunction(print_target_properties) endfunction(print_target_properties)

View File

@ -3,19 +3,18 @@
# #
# Please see COPYING for details # Please see COPYING for details
# #
# Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) # Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) All rights
# All rights reserved. # reserved.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify it under
# it under the terms of the GNU General Public License as published by # the terms of the GNU General Public License as published by the Free Software
# the Free Software Foundation, either version 3 of the License, or # Foundation, either version 3 of the License, or (at your option) any later
# (at your option) any later version. # version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful, but WITHOUT
# but WITHOUT ANY WARRANTY; without even the implied warranty of # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# GNU General Public License for more details. # details. You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
@ -23,40 +22,42 @@ set(CPACK_GENERATOR "TGZ;STGZ;DEB")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.10-1), libgcc1 (>= 1:4.4.0)") set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.10-1), libgcc1 (>= 1:4.4.0)")
set(CPACK_PACKAGE_CONTACT "brenden@diddyinc.com") set(CPACK_PACKAGE_CONTACT "brenden@diddyinc.com")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Brenden Matthews") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Brenden Matthews")
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}-${CMAKE_SYSTEM_NAME}-${CPU_ARCH}") set(CPACK_PACKAGE_FILE_NAME
"${PROJECT_NAME}-${VERSION}-${CMAKE_SYSTEM_NAME}-${CPU_ARCH}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_NAME}) set(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_NAME})
set(CPACK_STRIP_FILES true) set(CPACK_STRIP_FILES true)
# Version numbering, copyright notice, etc. are taken from the variables # Version numbering, copyright notice, etc. are taken from the variables defined
# defined in ../CMakeLists.txt. # in ../CMakeLists.txt.
set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}") set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}") set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}") set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
if(CPACK_GENERATOR MATCHES "NSIS") if(CPACK_GENERATOR MATCHES "NSIS")
set(CPACK_NSIS_COMPRESSOR "/FINAL /SOLID lzma") set(CPACK_NSIS_COMPRESSOR "/FINAL /SOLID lzma")
set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME} ${PROJECT_NAME}) set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME} ${PROJECT_NAME})
endif(CPACK_GENERATOR MATCHES "NSIS") endif(CPACK_GENERATOR MATCHES "NSIS")
# Source package setup. Compile with "make package_source". # Source package setup. Compile with "make package_source".
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}-src") set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}-src")
set(CPACK_SOURCE_GENERATOR "TBZ2") set(CPACK_SOURCE_GENERATOR "TBZ2")
execute_process(COMMAND ${APP_UNAME} COMMAND ${APP_AWK} "{print $1}" execute_process(COMMAND ${APP_UNAME}
RESULT_VARIABLE RETVAL OUTPUT_VARIABLE CPU_ARCH COMMAND ${APP_AWK} "{print $1}"
OUTPUT_STRIP_TRAILING_WHITESPACE) RESULT_VARIABLE RETVAL
OUTPUT_VARIABLE CPU_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CPACK_SOURCE_IGNORE_FILES set(CPACK_SOURCE_IGNORE_FILES
# Exclude backup files generated by text editors. # Exclude backup files generated by text editors.
"~$" "~$"
# Git dir/files. # Git dir/files.
"\\\\.git.*$" "\\\\.git.*$"
# vim swap files # vim swap files
"\\\\..*\\\\.swp$" "\\\\..*\\\\.swp$"
# Build dir. # Build dir.
"build.*$" "build.*$")
)
# Enable CPack # Enable CPack
include(CPack) include(CPack)

View File

@ -3,19 +3,18 @@
# #
# Please see COPYING for details # Please see COPYING for details
# #
# Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) # Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) All rights
# All rights reserved. # reserved.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify it under
# it under the terms of the GNU General Public License as published by # the terms of the GNU General Public License as published by the Free Software
# the Free Software Foundation, either version 3 of the License, or # Foundation, either version 3 of the License, or (at your option) any later
# (at your option) any later version. # version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful, but WITHOUT
# but WITHOUT ANY WARRANTY; without even the implied warranty of # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# GNU General Public License for more details. # details. You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
@ -42,7 +41,7 @@ else(CMAKE_SYSTEM_NAME MATCHES "Darwin")
check_symbol_exists(statfs64 "sys/statfs.h" HAVE_STATFS64) check_symbol_exists(statfs64 "sys/statfs.h" HAVE_STATFS64)
endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
AC_SEARCH_LIBS(clock_gettime "time.h" CLOCK_GETTIME_LIB "rt") ac_search_libs(clock_gettime "time.h" CLOCK_GETTIME_LIB "rt")
if(NOT DEFINED CLOCK_GETTIME_LIB) if(NOT DEFINED CLOCK_GETTIME_LIB)
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
message(FATAL_ERROR "clock_gettime not found.") message(FATAL_ERROR "clock_gettime not found.")
@ -92,11 +91,37 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(OS_DARWIN true) set(OS_DARWIN true)
endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
if(NOT OS_LINUX AND NOT OS_FREEBSD AND NOT OS_OPENBSD AND NOT OS_DRAGONFLY if(NOT OS_LINUX
AND NOT OS_SOLARIS AND NOT OS_HAIKU AND NOT OS_DARWIN) AND NOT OS_FREEBSD
message(FATAL_ERROR "Your platform, '${CMAKE_SYSTEM_NAME}', is not currently supported. Patches are welcome.") AND NOT OS_OPENBSD
endif(NOT OS_LINUX AND NOT OS_FREEBSD AND NOT OS_OPENBSD AND NOT OS_DRAGONFLY AND NOT OS_DRAGONFLY
AND NOT OS_SOLARIS AND NOT OS_HAIKU AND NOT OS_DARWIN) AND NOT OS_SOLARIS
AND NOT OS_HAIKU
AND NOT OS_DARWIN)
message(
FATAL_ERROR
"Your platform, '${CMAKE_SYSTEM_NAME}', is not currently supported. Patches are welcome."
)
endif(NOT
OS_LINUX
AND
NOT
OS_FREEBSD
AND
NOT
OS_OPENBSD
AND
NOT
OS_DRAGONFLY
AND
NOT
OS_SOLARIS
AND
NOT
OS_HAIKU
AND
NOT
OS_DARWIN)
# Check for soundcard header # Check for soundcard header
if(OS_LINUX) if(OS_LINUX)
@ -113,23 +138,22 @@ if(BUILD_I18N AND OS_DRAGONFLY)
endif(BUILD_I18N AND OS_DRAGONFLY) endif(BUILD_I18N AND OS_DRAGONFLY)
if(BUILD_I18N AND OS_DARWIN) if(BUILD_I18N AND OS_DARWIN)
find_path(LIBINTL_H_N libintl.h PATHS find_path(LIBINTL_H_N libintl.h
/usr/local/opt/gettext/include PATHS /usr/local/opt/gettext/include
/usr/include /usr/include
/usr/local/include /usr/local/include
/usr/local/opt/include /usr/local/opt/include)
)
if(LIBINTL_H_N) if(LIBINTL_H_N)
include_directories(${LIBINTL_H_N}) include_directories(${LIBINTL_H_N})
else(LIBINTL_H_N) else(LIBINTL_H_N)
message(FATAL_ERROR "Unable to find libintl.h (try `brew install gettext`)") message(FATAL_ERROR "Unable to find libintl.h (try `brew install gettext`)")
endif(LIBINTL_H_N) endif(LIBINTL_H_N)
find_library(INTL_LIB NAMES intl PATHS find_library(INTL_LIB
/usr/local/opt/gettext/lib NAMES intl
/usr/lib PATHS /usr/local/opt/gettext/lib
/usr/local/lib /usr/lib
/usr/local/opt/lib /usr/local/lib
) /usr/local/opt/lib)
set(conky_libs ${conky_libs} ${INTL_LIB}) set(conky_libs ${conky_libs} ${INTL_LIB})
endif(BUILD_I18N AND OS_DARWIN) endif(BUILD_I18N AND OS_DARWIN)
@ -198,7 +222,11 @@ if(BUILD_NCURSES)
endif(BUILD_NCURSES) endif(BUILD_NCURSES)
if(BUILD_MYSQL) if(BUILD_MYSQL)
find_path(mysql_INCLUDE_PATH mysql.h ${INCLUDE_SEARCH_PATH} /usr/include/mysql /usr/local/include/mysql) find_path(mysql_INCLUDE_PATH
mysql.h
${INCLUDE_SEARCH_PATH}
/usr/include/mysql
/usr/local/include/mysql)
if(NOT mysql_INCLUDE_PATH) if(NOT mysql_INCLUDE_PATH)
message(FATAL_ERROR "Unable to find mysql.h") message(FATAL_ERROR "Unable to find mysql.h")
endif(NOT mysql_INCLUDE_PATH) endif(NOT mysql_INCLUDE_PATH)
@ -229,20 +257,24 @@ if(BUILD_PORT_MONITORS)
if(NOT HAVE_GETNAMEINFO) if(NOT HAVE_GETNAMEINFO)
message(FATAL_ERROR "could not find getnameinfo()") message(FATAL_ERROR "could not find getnameinfo()")
endif(NOT HAVE_GETNAMEINFO) endif(NOT HAVE_GETNAMEINFO)
check_include_files("netdb.h;netinet/in.h;netinet/tcp.h;sys/socket.h;arpa/inet.h" HAVE_PORTMON_HEADERS) check_include_files(
"netdb.h;netinet/in.h;netinet/tcp.h;sys/socket.h;arpa/inet.h"
HAVE_PORTMON_HEADERS)
if(NOT HAVE_PORTMON_HEADERS) if(NOT HAVE_PORTMON_HEADERS)
message(FATAL_ERROR "missing needed network header(s) for port monitoring") message(FATAL_ERROR "missing needed network header(s) for port monitoring")
endif(NOT HAVE_PORTMON_HEADERS) endif(NOT HAVE_PORTMON_HEADERS)
endif(BUILD_PORT_MONITORS) endif(BUILD_PORT_MONITORS)
# Check for iconv # Check for iconv
if(BUILD_ICONV) if(BUILD_ICONV)
check_include_files(iconv.h HAVE_ICONV_H) check_include_files(iconv.h HAVE_ICONV_H)
find_library(ICONV_LIBRARY NAMES iconv) find_library(ICONV_LIBRARY NAMES iconv)
if(NOT ICONV_LIBRARY) if(NOT ICONV_LIBRARY)
# maybe iconv() is provided by libc # maybe iconv() is provided by libc
set(ICONV_LIBRARY "" CACHE FILEPATH "Path to the iconv library, if iconv is not provided by libc" FORCE) set(ICONV_LIBRARY ""
CACHE FILEPATH
"Path to the iconv library, if iconv is not provided by libc"
FORCE)
endif(NOT ICONV_LIBRARY) endif(NOT ICONV_LIBRARY)
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY}) set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
check_function_exists(iconv ICONV_FUNC) check_function_exists(iconv ICONV_FUNC)
@ -254,7 +286,6 @@ if(BUILD_ICONV)
endif(HAVE_ICONV_H AND ICONV_FUNC) endif(HAVE_ICONV_H AND ICONV_FUNC)
endif(BUILD_ICONV) endif(BUILD_ICONV)
# check for Xlib # check for Xlib
if(BUILD_X11) if(BUILD_X11)
include(FindX11) include(FindX11)
@ -278,23 +309,27 @@ if(BUILD_X11)
if(NOT X11_Xshape_FOUND) if(NOT X11_Xshape_FOUND)
message(FATAL_ERROR "Unable to find Xshape library") message(FATAL_ERROR "Unable to find Xshape library")
endif(NOT X11_Xshape_FOUND) endif(NOT X11_Xshape_FOUND)
set(conky_libs ${conky_libs} ${X11_Xshape_LIB} ) set(conky_libs ${conky_libs} ${X11_Xshape_LIB})
endif(BUILD_XSHAPE) endif(BUILD_XSHAPE)
# check for Xft # check for Xft
if(BUILD_XFT) if(BUILD_XFT)
find_path(freetype_INCLUDE_PATH config/ftconfig.h ${INCLUDE_SEARCH_PATH} find_path(freetype_INCLUDE_PATH
/usr/include/freetype2 config/ftconfig.h
/usr/local/include/freetype2 ${INCLUDE_SEARCH_PATH}
/usr/pkg/include/freetype2) /usr/include/freetype2
/usr/local/include/freetype2
/usr/pkg/include/freetype2)
if(freetype_INCLUDE_PATH) if(freetype_INCLUDE_PATH)
set(freetype_FOUND true) set(freetype_FOUND true)
set(conky_includes ${conky_includes} ${freetype_INCLUDE_PATH}) set(conky_includes ${conky_includes} ${freetype_INCLUDE_PATH})
else(freetype_INCLUDE_PATH) else(freetype_INCLUDE_PATH)
find_path(freetype_INCLUDE_PATH freetype/config/ftconfig.h ${INCLUDE_SEARCH_PATH} find_path(freetype_INCLUDE_PATH
/usr/include/freetype2 freetype/config/ftconfig.h
/usr/local/include/freetype2 ${INCLUDE_SEARCH_PATH}
/usr/pkg/include/freetype2) /usr/include/freetype2
/usr/local/include/freetype2
/usr/pkg/include/freetype2)
if(freetype_INCLUDE_PATH) if(freetype_INCLUDE_PATH)
set(freetype_FOUND true) set(freetype_FOUND true)
set(conky_includes ${conky_includes} ${freetype_INCLUDE_PATH}) set(conky_includes ${conky_includes} ${freetype_INCLUDE_PATH})
@ -321,7 +356,15 @@ if(BUILD_X11)
endif(BUILD_X11) endif(BUILD_X11)
# Otherwise, use the most recent Lua version # Otherwise, use the most recent Lua version
pkg_search_module(LUA REQUIRED lua>=5.3 lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52) pkg_search_module(LUA
REQUIRED
lua>=5.3
lua5.3
lua-5.3
lua53
lua5.2
lua-5.2
lua52)
set(conky_libs ${conky_libs} ${LUA_LIBRARIES}) set(conky_libs ${conky_libs} ${LUA_LIBRARIES})
set(conky_includes ${conky_includes} ${LUA_INCLUDE_DIRS}) set(conky_includes ${conky_includes} ${LUA_INCLUDE_DIRS})
link_directories(${LUA_LIBRARY_DIRS}) link_directories(${LUA_LIBRARY_DIRS})
@ -341,7 +384,10 @@ if(BUILD_X11)
if(BUILD_LUA_IMLIB2) if(BUILD_LUA_IMLIB2)
pkg_search_module(IMLIB2 REQUIRED imlib2 Imlib2) pkg_search_module(IMLIB2 REQUIRED imlib2 Imlib2)
set(luaimlib2_libs ${IMLIB2_LIBS} ${IMLIB2_LDFLAGS} ${LUA_LIBRARIES}) set(luaimlib2_libs ${IMLIB2_LIBS} ${IMLIB2_LDFLAGS} ${LUA_LIBRARIES})
set(luaimlib2_includes ${IMLIB2_INCLUDE_DIRS} ${LUA_INCLUDE_DIRS} ${X11_INCLUDE_DIR}) set(luaimlib2_includes
${IMLIB2_INCLUDE_DIRS}
${LUA_INCLUDE_DIRS}
${X11_INCLUDE_DIR})
endif(BUILD_LUA_IMLIB2) endif(BUILD_LUA_IMLIB2)
if(BUILD_LUA_RSVG) if(BUILD_LUA_RSVG)
pkg_check_modules(RSVG REQUIRED librsvg-2.0) pkg_check_modules(RSVG REQUIRED librsvg-2.0)
@ -360,7 +406,10 @@ if(BUILD_AUDACIOUS)
pkg_check_modules(AUDACIOUS REQUIRED audacious<1.4.0) pkg_check_modules(AUDACIOUS REQUIRED audacious<1.4.0)
endif(NEW_AUDACIOUS_FOUND) endif(NEW_AUDACIOUS_FOUND)
set(conky_libs ${conky_libs} ${AUDACIOUS_LIBRARIES} ${DBUS_GLIB_LIBRARIES}) set(conky_libs ${conky_libs} ${AUDACIOUS_LIBRARIES} ${DBUS_GLIB_LIBRARIES})
set(conky_includes ${conky_includes} ${AUDACIOUS_INCLUDE_DIRS} ${DBUS_GLIB_INCLUDE_DIRS}) set(conky_includes
${conky_includes}
${AUDACIOUS_INCLUDE_DIRS}
${DBUS_GLIB_INCLUDE_DIRS})
endif(BUILD_AUDACIOUS) endif(BUILD_AUDACIOUS)
if(BUILD_BMPX) if(BUILD_BMPX)
@ -473,7 +522,12 @@ if(MAINTAINER_MODE)
if(NOT APP_SED) if(NOT APP_SED)
message(FATAL_ERROR "Unable to find program 'sed'") message(FATAL_ERROR "Unable to find program 'sed'")
endif(NOT APP_SED) endif(NOT APP_SED)
mark_as_advanced(APP_DB2X_XSLTPROC APP_DB2X_MANXML APP_XSLTPROC APP_MAN APP_SED APP_LESS) mark_as_advanced(APP_DB2X_XSLTPROC
APP_DB2X_MANXML
APP_XSLTPROC
APP_MAN
APP_SED
APP_LESS)
endif(MAINTAINER_MODE) endif(MAINTAINER_MODE)
if(CMAKE_BUILD_TYPE MATCHES "Debug") if(CMAKE_BUILD_TYPE MATCHES "Debug")
@ -483,9 +537,12 @@ endif(CMAKE_BUILD_TYPE MATCHES "Debug")
# The version numbers are simply derived from the date and number of commits # The version numbers are simply derived from the date and number of commits
# since start of month # since start of month
if(DEBUG) if(DEBUG)
execute_process(COMMAND execute_process(COMMAND ${APP_GIT} --git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git
${APP_GIT} --git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git log log --since=${VERSION_MAJOR}-${VERSION_MINOR}-01
--since=${VERSION_MAJOR}-${VERSION_MINOR}-01 --pretty=oneline COMMAND --pretty=oneline
${APP_WC} -l COMMAND ${APP_AWK} "{print $1}" RESULT_VARIABLE RETVAL COMMAND ${APP_WC} -l
OUTPUT_VARIABLE COMMIT_COUNT OUTPUT_STRIP_TRAILING_WHITESPACE) COMMAND ${APP_AWK} "{print $1}"
RESULT_VARIABLE RETVAL
OUTPUT_VARIABLE COMMIT_COUNT
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif(DEBUG) endif(DEBUG)

View File

@ -3,87 +3,97 @@
# #
# Please see COPYING for details # Please see COPYING for details
# #
# Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) # Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) All rights
# All rights reserved. # reserved.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify it under
# it under the terms of the GNU General Public License as published by # the terms of the GNU General Public License as published by the Free Software
# the Free Software Foundation, either version 3 of the License, or # Foundation, either version 3 of the License, or (at your option) any later
# (at your option) any later version. # version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful, but WITHOUT
# but WITHOUT ANY WARRANTY; without even the implied warranty of # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# GNU General Public License for more details. # details. You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
# ${db2x_xsltproc_cmd} -s man ${srcdir}/docs.xml -o docs.mxml # ${db2x_xsltproc_cmd} -s man ${srcdir}/docs.xml -o docs.mxml ${db2x_manxml_cmd}
# ${db2x_manxml_cmd} docs.mxml # docs.mxml ${xsltproc_cmd} ${srcdir}/docbook-xml/docbook.xsl ${srcdir}/docs.xml
# ${xsltproc_cmd} ${srcdir}/docbook-xml/docbook.xsl ${srcdir}/docs.xml > docs.html # > docs.html man -P 'less -is' ./conky.1 > README sed -i
# man -P 'less -is' ./conky.1 > README # "s/[[:cntrl:]]\[[0-9]*m//g" README sed -i "s/\xE2//g" README sed -i
# sed -i "s/[[:cntrl:]]\[[0-9]*m//g" README # "s/\x80//g" README sed -i "s/\x90/-/g" README mv README ${top_srcdir}
# sed -i "s/\xE2//g" README # ${xsltproc_cmd} ${srcdir}/variables.xsl ${srcdir}/variables.xml >
# sed -i "s/\x80//g" README # variables.html ${xsltproc_cmd} ${srcdir}/config_settings.xsl
# sed -i "s/\x90/-/g" README # ${srcdir}/config_settings.xml > config_settings.html ${xsltproc_cmd}
# mv README ${top_srcdir} # ${srcdir}/lua.xsl ${srcdir}/lua.xml > lua.html
# ${xsltproc_cmd} ${srcdir}/variables.xsl ${srcdir}/variables.xml > variables.html
# ${xsltproc_cmd} ${srcdir}/config_settings.xsl ${srcdir}/config_settings.xml > config_settings.html
# ${xsltproc_cmd} ${srcdir}/lua.xsl ${srcdir}/lua.xml > lua.html
#else # else conky.1:
#conky.1:
#endif # endif
#man_MANS = conky.1 # man_MANS = conky.1
if(MAINTAINER_MODE) if(MAINTAINER_MODE)
function(wrap_xsltproc) function(wrap_xsltproc)
if(NOT ARGV) if(NOT ARGV)
message(SEND_ERROR "Error: wrap_xsltproc called without any files") message(SEND_ERROR "Error: wrap_xsltproc called without any files")
return() return()
endif(NOT ARGV) endif(NOT ARGV)
FOREACH(FIL ${ARGV}) foreach(FIL ${ARGV})
ADD_CUSTOM_COMMAND( add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html COMMAND ${APP_XSLTPROC}
COMMAND ${APP_XSLTPROC} ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xsl ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml > ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xsl
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xsl ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml >
COMMENT "Running xsltproc on ${FIL}" ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html
) DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xsl
ADD_CUSTOM_TARGET(${FIL}.html ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html) ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml
ENDFOREACH(FIL) COMMENT "Running xsltproc on ${FIL}")
add_custom_target(${FIL}.html ALL
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html)
endforeach(FIL)
endfunction(wrap_xsltproc) endfunction(wrap_xsltproc)
function(wrap_man)
if(NOT ARGV)
message(SEND_ERROR "Error: wrap_man called without any files")
return()
endif(NOT ARGV)
function(wrap_man) foreach(FIL ${ARGV})
if(NOT ARGV) add_custom_command(
message(SEND_ERROR "Error: wrap_man called without any files") OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html
return() ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.1
endif(NOT ARGV) ${CMAKE_SOURCE_DIR}/README
COMMAND ${APP_XSLTPROC}
${CMAKE_SOURCE_DIR}/doc/docbook-xml/html/docbook.xsl
${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml >
${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html
COMMAND ${APP_DB2X_XSLTPROC} -s man
${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml -o ${FIL}.mxml
COMMAND ${APP_DB2X_MANXML}
--encoding=utf-8 ${FIL}.mxml
--output-dir ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${APP_XSLTPROC}
${CMAKE_SOURCE_DIR}/doc/docbook-xml/html/docbook.xsl
${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml >
${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html
COMMAND ${APP_MAN} -P '${APP_LESS} -is'
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.1 >
${CMAKE_SOURCE_DIR}/README
COMMAND ${APP_SED} -i'' -e 's/[[:cntrl:]]\\[[0-9]*m//g'
${CMAKE_SOURCE_DIR}/README
COMMAND ${APP_SED} -i'' -e 's/\\xE2//g' ${CMAKE_SOURCE_DIR}/README
COMMAND ${APP_SED} -i'' -e 's/\\x80//g' ${CMAKE_SOURCE_DIR}/README
COMMAND ${APP_SED} -i'' -e 's/\\x90/-/g' ${CMAKE_SOURCE_DIR}/README
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml
COMMENT "Proccessing man page for ${FIL}")
add_custom_target(${FIL} ALL
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html)
endforeach(FIL)
FOREACH(FIL ${ARGV}) endfunction(wrap_man)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.1 ${CMAKE_SOURCE_DIR}/README
COMMAND ${APP_XSLTPROC} ${CMAKE_SOURCE_DIR}/doc/docbook-xml/html/docbook.xsl ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml > ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html
COMMAND ${APP_DB2X_XSLTPROC} -s man ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml -o ${FIL}.mxml
COMMAND ${APP_DB2X_MANXML} --encoding=utf-8 ${FIL}.mxml --output-dir ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${APP_XSLTPROC} ${CMAKE_SOURCE_DIR}/doc/docbook-xml/html/docbook.xsl ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml > ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html
COMMAND ${APP_MAN} -P '${APP_LESS} -is' ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.1 > ${CMAKE_SOURCE_DIR}/README
COMMAND ${APP_SED} -i'' -e 's/[[:cntrl:]]\\[[0-9]*m//g' ${CMAKE_SOURCE_DIR}/README
COMMAND ${APP_SED} -i'' -e 's/\\xE2//g' ${CMAKE_SOURCE_DIR}/README
COMMAND ${APP_SED} -i'' -e 's/\\x80//g' ${CMAKE_SOURCE_DIR}/README
COMMAND ${APP_SED} -i'' -e 's/\\x90/-/g' ${CMAKE_SOURCE_DIR}/README
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.xml
COMMENT "Proccessing man page for ${FIL}"
)
ADD_CUSTOM_TARGET(${FIL} ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FIL}.html)
ENDFOREACH(FIL)
endfunction(wrap_man)
endif(MAINTAINER_MODE) endif(MAINTAINER_MODE)

View File

@ -2,34 +2,28 @@
# #
if(NOT CLANG_TIDY_BIN_NAME) if(NOT CLANG_TIDY_BIN_NAME)
set(CLANG_TIDY_BIN_NAME clang-tidy) set(CLANG_TIDY_BIN_NAME clang-tidy)
endif() endif()
# if custom path check there first # if custom path check there first
if(CLANG_TIDY_ROOT_DIR) if(CLANG_TIDY_ROOT_DIR)
find_program(CLANG_TIDY_BIN find_program(CLANG_TIDY_BIN
NAMES NAMES ${CLANG_TIDY_BIN_NAME}
${CLANG_TIDY_BIN_NAME} PATHS "${CLANG_TIDY_ROOT_DIR}"
PATHS NO_DEFAULT_PATH)
"${CLANG_TIDY_ROOT_DIR}"
NO_DEFAULT_PATH)
endif() endif()
find_program(CLANG_TIDY_BIN NAMES ${CLANG_TIDY_BIN_NAME}) find_program(CLANG_TIDY_BIN NAMES ${CLANG_TIDY_BIN_NAME})
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS( find_package_handle_standard_args(CLANG_TIDY DEFAULT_MSG CLANG_TIDY_BIN)
CLANG_TIDY
DEFAULT_MSG
CLANG_TIDY_BIN)
mark_as_advanced( mark_as_advanced(CLANG_TIDY_BIN)
CLANG_TIDY_BIN
)
if(CLANG_TIDY_FOUND) if(CLANG_TIDY_FOUND)
# A CMake script to find all source files and setup clang-tidy targets for them # A CMake script to find all source files and setup clang-tidy targets for
include(clang-tidy) # them
include(clang-tidy)
else() else()
message("clang-tidy not found. Not setting up tidy targets") message("clang-tidy not found. Not setting up tidy targets")
endif() endif()

View File

@ -1,7 +1,7 @@
# - Find the Xinerama include file and library # * Find the Xinerama include file and library
# #
SET(Xinerama_INC_SEARCH_PATH set(Xinerama_INC_SEARCH_PATH
/usr/X11R6/include /usr/X11R6/include
/usr/local/include /usr/local/include
/usr/include/X11 /usr/include/X11
@ -10,36 +10,32 @@ SET(Xinerama_INC_SEARCH_PATH
/opt/graphics/OpenGL/include /opt/graphics/OpenGL/include
/usr/include) /usr/include)
SET(Xinerama_LIB_SEARCH_PATH set(Xinerama_LIB_SEARCH_PATH
/usr/X11R6/lib /usr/X11R6/lib
/usr/local/lib /usr/local/lib
/usr/openwin/lib /usr/openwin/lib
/usr/lib) /usr/lib)
find_path(Xinerama_INCLUDE_DIR X11/extensions/Xinerama.h
FIND_PATH(Xinerama_INCLUDE_DIR X11/extensions/Xinerama.h
${Xinerama_INC_SEARCH_PATH}) ${Xinerama_INC_SEARCH_PATH})
FIND_LIBRARY(Xinerama_LIBRARIES NAMES Xinerama PATH ${Xinerama_LIB_SEARCH_PATH}) find_library(Xinerama_LIBRARIES NAMES Xinerama PATH ${Xinerama_LIB_SEARCH_PATH})
IF (Xinerama_INCLUDE_DIR AND Xinerama_LIBRARIES) if(Xinerama_INCLUDE_DIR AND Xinerama_LIBRARIES)
SET(Xinerama_FOUND TRUE) set(Xinerama_FOUND TRUE)
ENDIF (Xinerama_INCLUDE_DIR AND Xinerama_LIBRARIES) endif(Xinerama_INCLUDE_DIR AND Xinerama_LIBRARIES)
IF (Xinerama_FOUND) if(Xinerama_FOUND)
INCLUDE(CheckLibraryExists) include(CheckLibraryExists)
CHECK_LIBRARY_EXISTS(${Xinerama_LIBRARIES} check_library_exists(${Xinerama_LIBRARIES}
"XineramaQueryScreens" "XineramaQueryScreens"
${Xinerama_LIBRARIES} ${Xinerama_LIBRARIES}
Xinerama_HAS_QUERY) Xinerama_HAS_QUERY)
IF (NOT Xinerama_HAS_QUERY AND Xinerama_FIND_REQUIRED) if(NOT Xinerama_HAS_QUERY AND Xinerama_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could NOT find Xinerama") message(FATAL_ERROR "Could NOT find Xinerama")
ENDIF (NOT Xinerama_HAS_QUERY AND Xinerama_FIND_REQUIRED) endif(NOT Xinerama_HAS_QUERY AND Xinerama_FIND_REQUIRED)
ENDIF (Xinerama_FOUND) endif(Xinerama_FOUND)
MARK_AS_ADVANCED( mark_as_advanced(Xinerama_INCLUDE_DIR Xinerama_LIBRARIES)
Xinerama_INCLUDE_DIR
Xinerama_LIBRARIES
)

View File

@ -3,56 +3,60 @@
# #
# Please see COPYING for details # Please see COPYING for details
# #
# Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) # Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) All rights
# All rights reserved. # reserved.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify it under
# it under the terms of the GNU General Public License as published by # the terms of the GNU General Public License as published by the Free Software
# the Free Software Foundation, either version 3 of the License, or # Foundation, either version 3 of the License, or (at your option) any later
# (at your option) any later version. # version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful, but WITHOUT
# but WITHOUT ANY WARRANTY; without even the implied warranty of # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# GNU General Public License for more details. # details. You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
function(wrap_tolua VAR FIL) function(wrap_tolua VAR FIL)
SET(INCL) set(INCL)
SET(${VAR}) set(${VAR})
GET_FILENAME_COMPONENT(ABS_FIL ${FIL} ABSOLUTE) get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
GET_FILENAME_COMPONENT(FIL_WE ${FIL} NAME_WE) get_filename_component(FIL_WE ${FIL} NAME_WE)
LIST(APPEND ${VAR} "${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c") list(APPEND ${VAR} "${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c")
if(DEFINED ARGV2) if(DEFINED ARGV2)
GET_FILENAME_COMPONENT(PATCH ${ARGV2} ABSOLUTE) get_filename_component(PATCH ${ARGV2} ABSOLUTE)
SET(TOLUA_OUT ${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}-orig.c) set(TOLUA_OUT ${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}-orig.c)
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c
COMMAND ${APP_PATCH} -s ${TOLUA_OUT} ${PATCH} -o ${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c COMMAND ${APP_PATCH} -s ${TOLUA_OUT} ${PATCH} -o
DEPENDS ${TOLUA_OUT} ${PATCH} ${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c
COMMENT "Patching lib${FIL_WE}-orig.c" DEPENDS ${TOLUA_OUT} ${PATCH}
VERBATIM) COMMENT "Patching lib${FIL_WE}-orig.c"
SET_SOURCE_FILES_PROPERTIES(${TOLUA_OUT} PROPERTIES GENERATED TRUE) VERBATIM)
else() set_source_files_properties(${TOLUA_OUT} PROPERTIES GENERATED TRUE)
SET(TOLUA_OUT ${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c) else()
endif(DEFINED ARGV2) set(TOLUA_OUT ${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c)
endif(DEFINED ARGV2)
# Call toluapp from 3rdparty/ path directly. # Call toluapp from 3rdparty/ path directly. The last argument to toluapp is
# The last argument to toluapp is the path to the tolua Lua sources. # the path to the tolua Lua sources.
ADD_CUSTOM_COMMAND( OUTPUT ${TOLUA_OUT} ${INCL} COMMAND add_custom_command(OUTPUT ${TOLUA_OUT} ${INCL}
toluapp -n COMMAND toluapp -n ${FIL_WE} -o ${TOLUA_OUT} ${ABS_FIL}
${FIL_WE} -o ${TOLUA_OUT} ${ABS_FIL} ${CMAKE_SOURCE_DIR}/3rdparty/toluapp/src/bin/lua/
${CMAKE_SOURCE_DIR}/3rdparty/toluapp/src/bin/lua/ DEPENDS ${ABS_FIL}
DEPENDS ${ABS_FIL} COMMENT "Running tolua++ on ${FIL}" COMMENT "Running tolua++ on ${FIL}"
VERBATIM ) VERBATIM)
SET_SOURCE_FILES_PROPERTIES(${${VAR}} ${INCL} PROPERTIES GENERATED TRUE) set_source_files_properties(${${VAR}} ${INCL} PROPERTIES GENERATED TRUE)
SET_SOURCE_FILES_PROPERTIES(${${VAR}} PROPERTIES COMPILE_FLAGS "-Wno-bad-function-cast -Wno-unused-parameter -Wno-cast-qual -Wno-error=pedantic") set_source_files_properties(
${${VAR}}
PROPERTIES
COMPILE_FLAGS
"-Wno-bad-function-cast -Wno-unused-parameter -Wno-cast-qual -Wno-error=pedantic"
)
set(${VAR} ${${VAR}} PARENT_SCOPE)
SET(${VAR} ${${VAR}} PARENT_SCOPE)
endfunction(wrap_tolua) endfunction(wrap_tolua)

View File

@ -1,16 +1,15 @@
# Run clang-tidy # Run clang-tidy
set(DO_CLANG_TIDY set(DO_CLANG_TIDY
"${CLANG_TIDY_BIN}" "${CLANG_TIDY_BIN}"
-format-style='{BasedOnStyle: google, IndentWidth: 2}' -format-style='{BasedOnStyle:
-checks=*,-clang-analyzer-alpha.* google,
-fix IndentWidth:
-fix-errors 2}'
) -checks=*,-clang-analyzer-alpha.*
-fix
-fix-errors)
if(CLANG_TIDY_BIN) if(CLANG_TIDY_BIN)
set_target_properties( set_target_properties(conky PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}")
conky PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif() endif()

View File

@ -3,43 +3,43 @@
# #
# Please see COPYING for details # Please see COPYING for details
# #
# Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) # Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) All rights
# All rights reserved. # reserved.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify it under
# it under the terms of the GNU General Public License as published by # the terms of the GNU General Public License as published by the Free Software
# the Free Software Foundation, either version 3 of the License, or # Foundation, either version 3 of the License, or (at your option) any later
# (at your option) any later version. # version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful, but WITHOUT
# but WITHOUT ANY WARRANTY; without even the implied warranty of # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# GNU General Public License for more details. # details. You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
if(BUILD_BUILTIN_CONFIG) if(BUILD_BUILTIN_CONFIG)
# generate defconfig # generate defconfig
if(BUILD_X11) if(BUILD_X11)
set(builtin_config conky.conf) set(builtin_config conky.conf)
else(BUILD_X11) else(BUILD_X11)
set(builtin_config conky_no_x11.conf) set(builtin_config conky_no_x11.conf)
endif(BUILD_X11) endif(BUILD_X11)
add_custom_command(OUTPUT defconfig.h COMMAND add_custom_command(OUTPUT defconfig.h
${CMAKE_SOURCE_DIR}/bin/text2c.sh ${CMAKE_CURRENT_SOURCE_DIR}/${builtin_config} COMMAND ${CMAKE_SOURCE_DIR}/bin/text2c.sh
defconfig.h defconfig DEPENDS ${builtin_config} ${CMAKE_CURRENT_SOURCE_DIR}/${builtin_config}
) defconfig.h defconfig
add_custom_target(defconfig ALL DEPENDS defconfig.h) DEPENDS ${builtin_config})
set_source_files_properties(defconfig.h PROPERTIES GENERATED TRUE) add_custom_target(defconfig ALL DEPENDS defconfig.h)
set_source_files_properties(defconfig.h PROPERTIES GENERATED TRUE)
endif(BUILD_BUILTIN_CONFIG) endif(BUILD_BUILTIN_CONFIG)
if(BUILD_OLD_CONFIG) if(BUILD_OLD_CONFIG)
add_custom_command(OUTPUT convertconf.h COMMAND add_custom_command(OUTPUT convertconf.h
${CMAKE_SOURCE_DIR}/bin/text2c.sh ${CMAKE_SOURCE_DIR}/extras/convert.lua COMMAND ${CMAKE_SOURCE_DIR}/bin/text2c.sh
convertconf.h convertconf DEPENDS ${CMAKE_SOURCE_DIR}/extras/convert.lua ${CMAKE_SOURCE_DIR}/extras/convert.lua
) convertconf.h convertconf
add_custom_target(convertconf ALL DEPENDS convertconf.h) DEPENDS ${CMAKE_SOURCE_DIR}/extras/convert.lua)
set_source_files_properties(convertconf.h PROPERTIES GENERATED TRUE) add_custom_target(convertconf ALL DEPENDS convertconf.h)
set_source_files_properties(convertconf.h PROPERTIES GENERATED TRUE)
endif(BUILD_OLD_CONFIG) endif(BUILD_OLD_CONFIG)

View File

@ -3,25 +3,24 @@
# #
# Please see COPYING for details # Please see COPYING for details
# #
# Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) # Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) All rights
# All rights reserved. # reserved.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify it under
# it under the terms of the GNU General Public License as published by # the terms of the GNU General Public License as published by the Free Software
# the Free Software Foundation, either version 3 of the License, or # Foundation, either version 3 of the License, or (at your option) any later
# (at your option) any later version. # version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful, but WITHOUT
# but WITHOUT ANY WARRANTY; without even the implied warranty of # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# GNU General Public License for more details. # details. You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
include(Docbook) include(Docbook)
if(MAINTAINER_MODE) if(MAINTAINER_MODE)
wrap_xsltproc(lua config_settings variables) wrap_xsltproc(lua config_settings variables)
wrap_man(docs) wrap_man(docs)
endif(MAINTAINER_MODE) endif(MAINTAINER_MODE)

View File

@ -3,19 +3,18 @@
# #
# Please see COPYING for details # Please see COPYING for details
# #
# Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) # Copyright (c) 2005-2018 Brenden Matthews, et. al. (see AUTHORS) All rights
# All rights reserved. # reserved.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify it under
# it under the terms of the GNU General Public License as published by # the terms of the GNU General Public License as published by the Free Software
# the Free Software Foundation, either version 3 of the License, or # Foundation, either version 3 of the License, or (at your option) any later
# (at your option) any later version. # version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful, but WITHOUT
# but WITHOUT ANY WARRANTY; without even the implied warranty of # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# GNU General Public License for more details. # details. You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
@ -25,66 +24,69 @@ add_definitions(-DTOLUA_RELEASE)
if(BUILD_X11) if(BUILD_X11)
if(BUILD_LUA_CAIRO) if(BUILD_LUA_CAIRO)
include_directories(${luacairo_includes} ${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${luacairo_includes} ${CMAKE_CURRENT_SOURCE_DIR})
# Need the directory for -lSM # Need the directory for -lSM
get_filename_component(X11_SM_LIB_PATH ${X11_SM_LIB} DIRECTORY) get_filename_component(X11_SM_LIB_PATH ${X11_SM_LIB} DIRECTORY)
link_directories(${X11_SM_LIB_PATH}) link_directories(${X11_SM_LIB_PATH})
# cairo_set_dash() needs this special hack to work properly # cairo_set_dash() needs this special hack to work properly if you have a
# if you have a better solution, please let me know # better solution, please let me know
wrap_tolua(luacairo_src cairo.pkg libcairo.patch) wrap_tolua(luacairo_src cairo.pkg libcairo.patch)
add_library(conky-cairo SHARED ${luacairo_src}) add_library(conky-cairo SHARED ${luacairo_src})
set_target_properties(conky-cairo PROPERTIES OUTPUT_NAME "cairo") set_target_properties(conky-cairo PROPERTIES OUTPUT_NAME "cairo")
target_link_libraries(conky-cairo ${luacairo_libs} toluapp_lib_static) target_link_libraries(conky-cairo ${luacairo_libs} toluapp_lib_static)
set(lua_libs ${lua_libs} conky-cairo) set(lua_libs ${lua_libs} conky-cairo)
print_target_properties(conky-cairo) print_target_properties(conky-cairo)
endif(BUILD_LUA_CAIRO) endif(BUILD_LUA_CAIRO)
if(BUILD_LUA_IMLIB2) if(BUILD_LUA_IMLIB2)
include_directories(${luaimlib2_includes} ${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${luaimlib2_includes} ${CMAKE_CURRENT_SOURCE_DIR})
wrap_tolua(luaimlib2_src imlib2.pkg) wrap_tolua(luaimlib2_src imlib2.pkg)
add_library(conky-imlib2 SHARED ${luaimlib2_src}) add_library(conky-imlib2 SHARED ${luaimlib2_src})
set_target_properties(conky-imlib2 PROPERTIES OUTPUT_NAME "imlib2") set_target_properties(conky-imlib2 PROPERTIES OUTPUT_NAME "imlib2")
target_link_libraries(conky-imlib2 ${luaimlib2_libs} toluapp_lib_static) target_link_libraries(conky-imlib2 ${luaimlib2_libs} toluapp_lib_static)
set(lua_libs ${lua_libs} conky-imlib2) set(lua_libs ${lua_libs} conky-imlib2)
print_target_properties(conky-imlib2) print_target_properties(conky-imlib2)
endif(BUILD_LUA_IMLIB2) endif(BUILD_LUA_IMLIB2)
if(BUILD_LUA_RSVG) if(BUILD_LUA_RSVG)
include_directories(${luarsvg_includes} ${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${luarsvg_includes} ${CMAKE_CURRENT_SOURCE_DIR})
wrap_tolua(luarsvg_src rsvg.pkg) wrap_tolua(luarsvg_src rsvg.pkg)
add_library(conky-rsvg SHARED ${luarsvg_src}) add_library(conky-rsvg SHARED ${luarsvg_src})
set_target_properties(conky-rsvg PROPERTIES OUTPUT_NAME "rsvg") set_target_properties(conky-rsvg PROPERTIES OUTPUT_NAME "rsvg")
target_link_libraries(conky-rsvg ${luarsvg_libs} toluapp_lib_static) target_link_libraries(conky-rsvg ${luarsvg_libs} toluapp_lib_static)
set(lua_libs ${lua_libs} conky-rsvg) set(lua_libs ${lua_libs} conky-rsvg)
print_target_properties(conky-rsvg)
endif(BUILD_LUA_RSVG)
if(BUILD_LUA_CAIRO AND BUILD_LUA_IMLIB2) print_target_properties(conky-rsvg)
include_directories(${luacairo_includes} ${luaimlib2_includes} ${CMAKE_CURRENT_SOURCE_DIR}) endif(BUILD_LUA_RSVG)
wrap_tolua(luacairo_imlib2_helper_src cairo_imlib2_helper.pkg)
add_library(conky-cairo_imlib2_helper SHARED ${luacairo_imlib2_helper_src}) if(BUILD_LUA_CAIRO AND BUILD_LUA_IMLIB2)
set_target_properties(conky-cairo_imlib2_helper PROPERTIES OUTPUT_NAME "cairo_imlib2_helper") include_directories(${luacairo_includes} ${luaimlib2_includes}
${CMAKE_CURRENT_SOURCE_DIR})
wrap_tolua(luacairo_imlib2_helper_src cairo_imlib2_helper.pkg)
target_link_libraries(conky-cairo_imlib2_helper ${luacairo_libs} ${luaimlib2_libs} toluapp_lib_static) add_library(conky-cairo_imlib2_helper SHARED ${luacairo_imlib2_helper_src})
set(lua_libs ${lua_libs} conky-cairo_imlib2_helper) set_target_properties(conky-cairo_imlib2_helper
endif(BUILD_LUA_CAIRO AND BUILD_LUA_IMLIB2) PROPERTIES OUTPUT_NAME "cairo_imlib2_helper")
target_link_libraries(conky-cairo_imlib2_helper
${luacairo_libs}
${luaimlib2_libs}
toluapp_lib_static)
set(lua_libs ${lua_libs} conky-cairo_imlib2_helper)
endif(BUILD_LUA_CAIRO AND BUILD_LUA_IMLIB2)
endif(BUILD_X11) endif(BUILD_X11)
install(TARGETS install(TARGETS ${lua_libs}
${lua_libs} LIBRARY DESTINATION ${LIB_INSTALL_DIR}/conky
LIBRARY DESTINATION ${LIB_INSTALL_DIR}/conky ARCHIVE DESTINATION ${LIB_INSTALL_DIR}/conky)
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}/conky
)