summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2021-05-19 16:22:10 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2021-05-19 19:14:52 +0900
commit71fb4a139179e9d27070f7f3e98971e3e029697f (patch)
tree92fbf03f1e546b3c99e6e06e98100b6ef8e4e2c6 /debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake
parent6eae1a16a1001287ef5129db86f4ef2145ace3ca (diff)
downloadextra-dependencies-71fb4a139179e9d27070f7f3e98971e3e029697f.tar.gz
extra-dependencies-71fb4a139179e9d27070f7f3e98971e3e029697f.zip
uncrustify: updated to version 0.73
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake')
-rw-r--r--debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/CodeCoverage.cmake33
-rw-r--r--debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/GenerateTokenNames.cmake37
-rw-r--r--debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/GenerateVersionHeader.cmake39
-rw-r--r--debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/Toolchain-mingw32.cmake28
-rw-r--r--debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/Toolchain-mingw64.cmake28
5 files changed, 165 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/CodeCoverage.cmake b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/CodeCoverage.cmake
new file mode 100644
index 00000000..670c5144
--- /dev/null
+++ b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/CodeCoverage.cmake
@@ -0,0 +1,33 @@
+#
+# Code Coverage
+#
+
+if ( NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
+ message( WARNING "Code coverage results with an optimised (non-Debug) build may be misleading" )
+endif ( NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
+
+if ( NOT DEFINED CODECOV_OUTPUTFILE )
+ set( CODECOV_OUTPUTFILE cmake_coverage.output )
+endif ( NOT DEFINED CODECOV_OUTPUTFILE )
+
+if ( NOT DEFINED CODECOV_HTMLOUTPUTDIR )
+ set( CODECOV_HTMLOUTPUTDIR coverage_results )
+endif ( NOT DEFINED CODECOV_HTMLOUTPUTDIR )
+
+if ( CMAKE_COMPILER_IS_GNUCXX )
+ find_program( CODECOV_LCOV lcov )
+ find_program( CODECOV_GENHTML genhtml )
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W -Wshadow \
+ -Wunused-variable -Wunused-parameter -Wunused-function -Wunused \
+ -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings \
+ -fprofile-arcs -ftest-coverage" )
+ link_libraries( gcov )
+ set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage" )
+ add_custom_target( coverage_init ALL ${CODECOV_LCOV} --base-directory ${PROJECT_SOURCE_DIR}/src
+ --directory ${CMAKE_BINARY_DIR} --output-file ${CODECOV_OUTPUTFILE} --no-external --capture --initial
+ DEPENDS ${CODECOVERAGE_DEPENDS})
+ add_custom_target( coverage ${CODECOV_LCOV} --base-directory ${PROJECT_SOURCE_DIR}/src
+ --directory ${CMAKE_BINARY_DIR} --output-file ${CODECOV_OUTPUTFILE} --no-external --capture)
+ add_custom_target( coverage_html ${CODECOV_GENHTML} -o ${CODECOV_HTMLOUTPUTDIR} ${CODECOV_OUTPUTFILE}
+ DEPENDS coverage )
+endif ( CMAKE_COMPILER_IS_GNUCXX )
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/GenerateTokenNames.cmake b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/GenerateTokenNames.cmake
new file mode 100644
index 00000000..02a6241a
--- /dev/null
+++ b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/GenerateTokenNames.cmake
@@ -0,0 +1,37 @@
+#
+# Generate token_names.h from token_enum.h
+#
+# This script is meant to be executed with `cmake -P` from a custom command,
+# and expects the variables `src_file` and `dst_file` to be set.
+#
+
+function(generate_token_names src_file dst_file)
+ set(tokens "")
+
+ file(READ "${src_file}" token_lines)
+ string(REGEX REPLACE ";|\\[|\\]" " " token_lines "${token_lines}")
+ string(REPLACE "\n" ";" token_lines "${token_lines}")
+
+ foreach(token_line ${token_lines})
+ if(${token_line} MATCHES "^[ \t]*CT_([A-Z0-9_]+),.*$")
+ list(APPEND tokens " \"${CMAKE_MATCH_1}\",\n")
+ endif()
+ endforeach()
+
+ file(WRITE "${dst_file}"
+ "/*\n"
+ " * Generated by CMake\n"
+ " */\n"
+ "#ifndef TOKEN_NAMES_H_INCLUDED\n"
+ "#define TOKEN_NAMES_H_INCLUDED\n"
+ "\n"
+ "const char *token_names[] =\n"
+ "{\n"
+ ${tokens}
+ "};\n"
+ "\n"
+ "#endif /* TOKEN_NAMES_H_INCLUDED */\n"
+ )
+endfunction()
+
+generate_token_names("${src_file}" "${dst_file}")
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/GenerateVersionHeader.cmake b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/GenerateVersionHeader.cmake
new file mode 100644
index 00000000..3d6d376b
--- /dev/null
+++ b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/GenerateVersionHeader.cmake
@@ -0,0 +1,39 @@
+#
+# Generate uncrustify_version.h from uncrustify_version.h.in
+#
+# This script is meant to be executed with `cmake -P` from a custom target,
+# and expects the variables `PYTHON_EXECUTABLE`, `SOURCE_DIR`, `INPUT`,
+# `OUTPUT` and `UNCRUSTIFY_VERSION` to be set.
+#
+
+
+execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} ${SOURCE_DIR}/scripts/make_version.py
+ WORKING_DIRECTORY ${SOURCE_DIR}
+ RESULT_VARIABLE make_version_error
+ OUTPUT_VARIABLE make_version_output
+)
+
+if (make_version_error)
+ # It's normal for make_version.py to fail when building from a tarball, so we
+ # want to avoid anything that looks too much like a scary error. Thus, report
+ # the error in an innocuous-looking fashion.
+ #
+ # If make_version.py is failing unexpectedly and needs to be debugged,
+ # uncomment the next few lines.
+ # string(STRIP "${make_version_output}" make_version_output)
+ # message(STATUS
+ # "scripts/make_version.py exited with code ${make_version_error}: "
+ # "${make_version_output}")
+
+ message(STATUS
+ "Unable to determine version from source tree; "
+ "fallback version '${UNCRUSTIFY_VERSION}' will be used")
+ message(STATUS
+ "(This is normal if you are building from a zip / tarball)")
+else()
+ string(STRIP ${make_version_output} UNCRUSTIFY_VERSION)
+ message(STATUS "Version: '${UNCRUSTIFY_VERSION}'")
+endif()
+
+configure_file("${INPUT}" "${OUTPUT}" @ONLY)
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/Toolchain-mingw32.cmake b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/Toolchain-mingw32.cmake
new file mode 100644
index 00000000..badd6994
--- /dev/null
+++ b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/Toolchain-mingw32.cmake
@@ -0,0 +1,28 @@
+#
+# Toolchain file for cross-compiling from Linux to Win32 using MinGW
+#
+
+set(CMAKE_SYSTEM_NAME Windows)
+
+if(NOT COMPILER_PREFIX)
+ if(EXISTS /usr/i686-w64-mingw32)
+ # mingw-w64
+ set(COMPILER_PREFIX "i686-w64-mingw32")
+ elseif(EXISTS /usr/i586-mingw32msvc)
+ # mingw
+ set(COMPILER_PREFIX "i586-mingw32msvc")
+ else()
+ message(FATAL_ERROR "Unable to detect cross-compiler prefix (COMPILER_PREFIX)")
+ endif()
+endif()
+
+find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc)
+find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++)
+find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres)
+
+set(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX})
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/Toolchain-mingw64.cmake b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/Toolchain-mingw64.cmake
new file mode 100644
index 00000000..399cc26b
--- /dev/null
+++ b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/cmake/Toolchain-mingw64.cmake
@@ -0,0 +1,28 @@
+#
+# Toolchain file for cross-compiling from Linux to Win64 using MinGW
+#
+
+set(CMAKE_SYSTEM_NAME Windows)
+
+if(NOT COMPILER_PREFIX)
+ if(EXISTS /usr/x86_64-w64-mingw32)
+ # mingw-w64
+ set(COMPILER_PREFIX "x86_64-w64-mingw32")
+ elseif(EXISTS /usr/amd64-mingw32msvc-gcc)
+ # mingw
+ set(COMPILER_PREFIX "amd64-mingw32msvc-gcc")
+ else()
+ message(FATAL_ERROR "Unable to detect cross-compiler prefix (COMPILER_PREFIX)")
+ endif()
+endif()
+
+find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc)
+find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++)
+find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres)
+
+set(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX})
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)