summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/AddCompileFlags.cmake (renamed from cmake/MacroAddCompileFlags.cmake)6
-rw-r--r--cmake/CmakeUninstall.cmake.in (renamed from cmake/cmake_uninstall.cmake.in)0
-rw-r--r--cmake/CompilerUtils.cmake2
-rw-r--r--cmake/FindProtobufC.cmake44
-rw-r--r--cmake/GitVersionGen.cmake58
5 files changed, 54 insertions, 56 deletions
diff --git a/cmake/MacroAddCompileFlags.cmake b/cmake/AddCompileFlags.cmake
index 41f3797c..8f3877d9 100644
--- a/cmake/MacroAddCompileFlags.cmake
+++ b/cmake/AddCompileFlags.cmake
@@ -3,10 +3,8 @@
# Copyright (c) 2006, Oswald Buddenhagen, <ossi@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-macro(MACRO_ADD_COMPILE_FLAGS _target _flg)
+macro(add_compile_flags _target _flg)
get_target_property(_flags ${_target} COMPILE_FLAGS)
if (_flags)
@@ -16,4 +14,4 @@ macro(MACRO_ADD_COMPILE_FLAGS _target _flg)
endif (_flags)
set_target_properties(${_target} PROPERTIES COMPILE_FLAGS "${_flags}")
-endmacro(MACRO_ADD_COMPILE_FLAGS)
+endmacro(add_compile_flags)
diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/CmakeUninstall.cmake.in
index 4c07dc7b..4c07dc7b 100644
--- a/cmake/cmake_uninstall.cmake.in
+++ b/cmake/CmakeUninstall.cmake.in
diff --git a/cmake/CompilerUtils.cmake b/cmake/CompilerUtils.cmake
index 5cea44b6..fb81b7e7 100644
--- a/cmake/CompilerUtils.cmake
+++ b/cmake/CompilerUtils.cmake
@@ -9,7 +9,7 @@ function(test_and_set_c_compiler_flag_global _flag)
message(STATUS "Compiler supports flag ${_flag}, added globally")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}" PARENT_SCOPE)
else(${_retval})
- message(STATUS "Compiler does not support flag ${_flag}, discarded")
+ message(STATUS "Compiler does not support flag ${_flag}, discarded")
endif()
endfunction(test_and_set_c_compiler_flag_global)
diff --git a/cmake/FindProtobufC.cmake b/cmake/FindProtobufC.cmake
index 6b81d751..ff532a46 100644
--- a/cmake/FindProtobufC.cmake
+++ b/cmake/FindProtobufC.cmake
@@ -1,22 +1,22 @@
function(PROTOBUF_GENERATE_C SRCS HDRS)
- if(NOT ARGN)
+ if (NOT ARGN)
message(SEND_ERROR "Error: PROTOBUF_GENERATE_C() called without any proto files")
return()
- endif()
+ endif ()
- if(PROTOBUF_GENERATE_C_APPEND_PATH)
+ if (PROTOBUF_GENERATE_C_APPEND_PATH)
# Create an include path for each file specified
- foreach(FIL ${ARGN})
+ foreach (FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(ABS_PATH ${ABS_FIL} PATH)
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
- if(${_contains_already} EQUAL -1)
- list(APPEND _protobuf_include_path -I ${ABS_PATH})
- endif()
- endforeach()
- else()
+ if (${_contains_already} EQUAL -1)
+ list(APPEND _protobuf_include_path -I ${ABS_PATH})
+ endif ()
+ endforeach ()
+ else ()
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
- endif()
+ endif ()
set(${SRCS})
set(${HDRS})
@@ -29,7 +29,7 @@ function(PROTOBUF_GENERATE_C SRCS HDRS)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb-c.c"
- "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb-c.h"
+ "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb-c.h"
COMMAND ${PROTOBUF_PROTOC_C_EXECUTABLE}
ARGS --c_out=${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_C_EXECUTABLE}
@@ -44,31 +44,31 @@ endfunction()
# By default have PROTOBUF_GENERATE_C macro pass -I to protoc
# for each directory where a proto file is referenced.
-if(NOT DEFINED PROTOBUF_GENERATE_C_APPEND_PATH)
+if (NOT DEFINED PROTOBUF_GENERATE_C_APPEND_PATH)
set(PROTOBUF_GENERATE_C_APPEND_PATH TRUE)
-endif()
+endif ()
# Find library
find_library(PROTOBUF_C_LIBRARY
- NAMES libprotobuf-c.so libprotobuf-c libprotobuf-c.dylib
-)
+ NAMES libprotobuf-c.so libprotobuf-c libprotobuf-c.dylib
+ )
mark_as_advanced(PROTOBUF_C_LIBRARY)
# Find the include directory
find_path(PROTOBUF_C_INCLUDE_DIR
- google/protobuf-c/protobuf-c.h
-)
+ google/protobuf-c/protobuf-c.h
+ )
mark_as_advanced(PROTOBUF_C_INCLUDE_DIR)
# Find the protoc-c Executable
find_program(PROTOBUF_PROTOC_C_EXECUTABLE
- NAMES protoc-c
- DOC "The Google Protocol Buffers C Compiler"
-)
+ NAMES protoc-c
+ DOC "The Google Protocol Buffers C Compiler"
+ )
mark_as_advanced(PROTOBUF_PROTOC_C_EXECUTABLE)
find_package(PackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ProtobufC DEFAULT_MSG
- PROTOBUF_C_LIBRARY PROTOBUF_C_INCLUDE_DIR PROTOBUF_PROTOC_C_EXECUTABLE)
+find_package_handle_standard_args(ProtobufC DEFAULT_MSG
+ PROTOBUF_C_LIBRARY PROTOBUF_C_INCLUDE_DIR PROTOBUF_PROTOC_C_EXECUTABLE)
set(PROTOBUF_C_INCLUDE_DIRS ${PROTOBUF_C_INCLUDE_DIR})
diff --git a/cmake/GitVersionGen.cmake b/cmake/GitVersionGen.cmake
index 53ac166d..718ec8a3 100644
--- a/cmake/GitVersionGen.cmake
+++ b/cmake/GitVersionGen.cmake
@@ -1,23 +1,23 @@
-macro(GIT_VERSION_GEN)
+macro(git_version_gen)
-include(FindGit)
-if(NOT GIT_FOUND)
- message(FATAL_ERROR "This is not a git repository")
-endif()
+ include(FindGit)
+ if (NOT GIT_FOUND)
+ message(FATAL_ERROR "This is not a git repository")
+ endif ()
-find_program(SORT "sort")
-mark_as_advanced(SORT)
-if (${SORT} STREQUAL "")
- message(FATAL_ERROR "Cannot find the sort executable")
-endif()
+ find_program(SORT "sort")
+ mark_as_advanced(SORT)
+ if (${SORT} STREQUAL "")
+ message(FATAL_ERROR "Cannot find the sort executable")
+ endif ()
-find_program(TAIL "tail")
-mark_as_advanced(TAIL)
-if (${TAIL} STREQUAL "")
- message(FATAL_ERROR "Cannot find the tail executable")
-endif()
+ find_program(TAIL "tail")
+ mark_as_advanced(TAIL)
+ if (${TAIL} STREQUAL "")
+ message(FATAL_ERROR "Cannot find the tail executable")
+ endif ()
-execute_process(
+ execute_process(
COMMAND ${GIT_EXECUTABLE} tag -l -n0
COMMAND ${SORT} -V
COMMAND ${TAIL} -n 1
@@ -25,19 +25,19 @@ execute_process(
OUTPUT_VARIABLE _git_tag
RESULT_VARIABLE _git_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
-if(NOT ${_git_result} EQUAL 0)
- message(FATAL_ERROR "Cannot fetch repository tag")
-endif()
-message(STATUS "Repository tag is: ${_git_tag}")
+ if (NOT ${_git_result} EQUAL 0)
+ message(FATAL_ERROR "Cannot fetch repository tag")
+ endif ()
+ message(STATUS "Repository tag is: ${_git_tag}")
-string(REGEX REPLACE
- "[^0-9]*([0-9]+)\\.[0-9]+.*" "\\1"
- _version_major "${_git_tag}")
-string(REGEX REPLACE
- "[^0-9]*[0-9]+\\.([0-9]+).*" "\\1"
- _version_minor "${_git_tag}")
+ string(REGEX REPLACE
+ "[^0-9]*([0-9]+)\\.[0-9]+.*" "\\1"
+ _version_major "${_git_tag}")
+ string(REGEX REPLACE
+ "[^0-9]*[0-9]+\\.([0-9]+).*" "\\1"
+ _version_minor "${_git_tag}")
-set(PACKAGE_VERSION_MAJOR "${_version_major}")
-set(PACKAGE_VERSION_MINOR "${_version_minor}")
+ set(PACKAGE_VERSION_MAJOR "${_version_major}")
+ set(PACKAGE_VERSION_MINOR "${_version_minor}")
-endmacro(GIT_VERSION_GEN)
+endmacro(git_version_gen)