Skip to content

Commit

Permalink
Merge pull request ElektraInitiative#2690 from sanssecours/馃
Browse files Browse the repository at this point in the history
Style: Reformat Code With cmake format 0.5.4
  • Loading branch information
markus2330 committed Aug 2, 2019
2 parents d9a5a23 + 93865e1 commit c3ccde8
Show file tree
Hide file tree
Showing 254 changed files with 2,227 additions and 2,800 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Expand Up @@ -130,7 +130,7 @@ mac_task:
brew install python@2; brew link --overwrite python@2
brew install python || brew upgrade python
- | # Install Python packages
pip install cmake-format[yaml]==0.4.5
pip install cmake-format[yaml]==0.5.4
- | # Install Ruby
brew install ruby@2.5
- | # Install Ruby gems
Expand Down
7 changes: 6 additions & 1 deletion .cmake-format.yaml
@@ -1,8 +1,9 @@
always_wrap:
- add_plugin
bullet_char: '-'
command_case: lower
line_ending: unix
line_width: 140
max_subargs_per_line: 1
separate_ctrl_name_with_space: True
separate_fn_name_with_space: True
tab_size: 8
Expand Down Expand Up @@ -59,6 +60,10 @@ additional_commands:
WORKING_DIRECTORY: +
TIMEOUT: 1

add_msr_test:
kwargs:
REQUIRED_PLUGINS: +

download_project:
kwargs:
PROJ: 1
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -244,7 +244,7 @@ before_install:
sudo apt-get install libzmq3-dev
sudo apt-get install libxerces-c-dev
sudo apt-get install moreutils # contains `sponge` required by `reformat-cmake`
sudo pip install cmake-format[yaml]==0.4.5
sudo pip install cmake-format[yaml]==0.5.4
git clone --branch 2.7.1 --depth 1 https://github.com/taocpp/PEGTL.git && sudo cp -R PEGTL/include/tao /usr/local/include
mkdir -p "$HOME/bin" && cd "$HOME/bin" && \
curl -L "https://github.com/mvdan/sh/releases/download/v2.6.3/shfmt_v2.6.3_linux_amd64" -o shfmt && \
Expand Down
16 changes: 3 additions & 13 deletions CMakeLists.txt
Expand Up @@ -15,17 +15,9 @@ set (ELEKTRA_HOMEPAGE_URL "https://www.libelektra.org")
if (CMAKE_VERSION VERSION_LESS 3.9)
project (Elektra VERSION "${KDB_VERSION}")
elseif (CMAKE_VERSION VERSION_LESS 3.12)
project (Elektra
VERSION ${KDB_VERSION}
DESCRIPTION
${ELEKTRA_DESCRIPTION})
project (Elektra VERSION ${KDB_VERSION} DESCRIPTION ${ELEKTRA_DESCRIPTION})
else (CMAKE_VERSION VERSION_LESS 3.12)
project (Elektra
VERSION ${KDB_VERSION}
DESCRIPTION
${ELEKTRA_DESCRIPTION}
HOMEPAGE_URL
${ELEKTRA_HOMEPAGE_URL})
project (Elektra VERSION ${KDB_VERSION} DESCRIPTION ${ELEKTRA_DESCRIPTION} HOMEPAGE_URL ${ELEKTRA_HOMEPAGE_URL})
endif (CMAKE_VERSION VERSION_LESS 3.9)

# fix macOS RPATH issues
Expand Down Expand Up @@ -63,9 +55,7 @@ endif (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE
RelWithDebInfo
CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif (NOT CMAKE_BUILD_TYPE)

set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
Expand Down
20 changes: 12 additions & 8 deletions benchmarks/CMakeLists.txt
Expand Up @@ -4,15 +4,18 @@ add_headers (HDR_FILES)

macro (do_benchmark source)
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}")
set (SOURCES ${HDR_FILES} ${ADDITIONAL_SOURCES} benchmarks.c benchmarks.h ${source}.c)
set (SOURCES
${HDR_FILES}
${ADDITIONAL_SOURCES}
benchmarks.c
benchmarks.h
${source}.c)
add_executable (benchmark_${source} ${SOURCES})
add_dependencies (benchmark_${source} kdberrors_generated elektra_error_codes_generated)

target_link_elektra (benchmark_${source} elektra-kdb elektra-meta)

set_target_properties (benchmark_${source}
PROPERTIES COMPILE_DEFINITIONS
HAVE_KDBCONFIG_H)
set_target_properties (benchmark_${source} PROPERTIES COMPILE_DEFINITIONS HAVE_KDBCONFIG_H)

# ~~~
# Useful for debugging: COMMAND strace -o strace.out "${command}"
Expand All @@ -21,7 +24,10 @@ macro (do_benchmark source)
COMMAND rm -f *.out
COMMAND valgrind
--tool=callgrind
--callgrind-out-file=callgrind.out "$<TARGET_FILE:benchmark_${source}>" > output.out
--callgrind-out-file=callgrind.out
"$<TARGET_FILE:benchmark_${source}>"
>
output.out
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
endmacro (do_benchmark)

Expand All @@ -38,9 +44,7 @@ if (NOT WIN32)
endif (NOT WIN32)

# exclude the OPMPHM benchmarks from mingw
if (ENABLE_OPTIMIZATIONS
AND NOT
WIN32)
if (ENABLE_OPTIMIZATIONS AND NOT WIN32)

# set USE_OPENMP here and define it in opmphm.c
set (USE_OPENMP 0)
Expand Down
16 changes: 11 additions & 5 deletions cmake/CMakeLists.txt
Expand Up @@ -25,8 +25,7 @@ write_basic_package_version_file ("${CMAKE_CURRENT_BINARY_DIR}/ElektraConfigVers
VERSION ${KDB_VERSION}
COMPATIBILITY AnyNewerVersion)

install (FILES "${CMAKE_CURRENT_BINARY_DIR}/ElektraConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/ElektraConfigVersion.cmake"
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/ElektraConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/ElektraConfigVersion.cmake"
DESTINATION ${TARGET_CMAKE_FOLDER})

# pkg-config files
Expand All @@ -45,9 +44,16 @@ configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/elektra.pc.in" "${CMAKE_CURRENT_BIN
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/elektra.pc" DESTINATION lib${LIB_SUFFIX}/${TARGET_PKGCONFIG_FOLDER})

add_custom_target (uninstall
COMMAND "${CMAKE_COMMAND}" -D KDB_VERSION=${KDB_VERSION} -D CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -D
CMAKE_FIND_LIBRARY_PREFIXES=${CMAKE_FIND_LIBRARY_PREFIXES} -D
CMAKE_FIND_LIBRARY_SUFFIXES=${CMAKE_FIND_LIBRARY_SUFFIXES} -P
COMMAND "${CMAKE_COMMAND}"
-D
KDB_VERSION=${KDB_VERSION}
-D
CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-D
CMAKE_FIND_LIBRARY_PREFIXES=${CMAKE_FIND_LIBRARY_PREFIXES}
-D
CMAKE_FIND_LIBRARY_SUFFIXES=${CMAKE_FIND_LIBRARY_SUFFIXES}
-P
"${CMAKE_CURRENT_SOURCE_DIR}/ElektraUninstall.cmake"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
COMMENT "Uninstalling Elektra from system or DESTDIR")

0 comments on commit c3ccde8

Please sign in to comment.