Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Style: Format code with cmake format 0.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sanssecours committed Aug 2, 2019
1 parent 4c49e2d commit 93865e1
Show file tree
Hide file tree
Showing 246 changed files with 2,211 additions and 2,790 deletions.
16 changes: 3 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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")
Loading

0 comments on commit 93865e1

Please sign in to comment.