Skip to content

Commit

Permalink
Reformat all CMake scripts using cmake-format
Browse files Browse the repository at this point in the history
  • Loading branch information
Nopey committed Nov 1, 2024
1 parent 4c30a8f commit de722b2
Show file tree
Hide file tree
Showing 14 changed files with 636 additions and 628 deletions.
363 changes: 188 additions & 175 deletions CMakeLists.txt

Large diffs are not rendered by default.

20 changes: 8 additions & 12 deletions cmake-scripts/ClangFormat.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ function(prefix_clangformat_setup prefix)
set(CLANGFORMAT_EXECUTABLE ${clangformat_executable_tmp})
unset(clangformat_executable_tmp)
else()
message(FATAL_ERROR "ClangFormat: ${CLANGFORMAT_EXECUTABLE} not found! Aborting")
message(
FATAL_ERROR "ClangFormat: ${CLANGFORMAT_EXECUTABLE} not found! Aborting"
)
endif()
endif()

Expand All @@ -25,17 +27,11 @@ function(prefix_clangformat_setup prefix)
list(APPEND clangformat_sources ${clangformat_source})
endforeach()

add_custom_target(${prefix}_clangformat
COMMAND
${CLANGFORMAT_EXECUTABLE}
-style=file
-i
${clangformat_sources}
WORKING_DIRECTORY
${CMAKE_SOURCE_DIR}
COMMENT
"Formatting ${prefix} with ${CLANGFORMAT_EXECUTABLE} ..."
)
add_custom_target(
${prefix}_clangformat
COMMAND ${CLANGFORMAT_EXECUTABLE} -style=file -i ${clangformat_sources}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Formatting ${prefix} with ${CLANGFORMAT_EXECUTABLE} ...")

if(TARGET clangformat)
add_dependencies(clangformat ${prefix}_clangformat)
Expand Down
43 changes: 19 additions & 24 deletions cmake-scripts/FindCUnit.cmake
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
set(CUNIT_SEARCH_PATHS /usr/local/ /usr /opt)

SET(CUNIT_SEARCH_PATHS
/usr/local/
/usr
/opt
)
find_path(
CUNIT_INCLUDE_DIR CUnit/CUnit.h
HINTS
PATH_SUFFIXES include
PATHS ${CUNIT_SEARCH_PATHS})
find_library(
CUNIT_LIBRARY cunit
HINTS
PATH_SUFFIXES lib64 lib bin
PATHS ${CUNIT_SEARCH_PATHS})

FIND_PATH(CUNIT_INCLUDE_DIR CUnit/CUnit.h
HINTS
PATH_SUFFIXES include
PATHS ${CUNIT_SEARCH_PATHS}
)
FIND_LIBRARY(CUNIT_LIBRARY cunit
HINTS
PATH_SUFFIXES lib64 lib bin
PATHS ${CUNIT_SEARCH_PATHS}
)
if(CUNIT_INCLUDE_DIR AND CUNIT_LIBRARY)
set(CUNIT_FOUND TRUE)
endif(CUNIT_INCLUDE_DIR AND CUNIT_LIBRARY)

IF (CUNIT_INCLUDE_DIR AND CUNIT_LIBRARY)
SET(CUNIT_FOUND TRUE)
ENDIF (CUNIT_INCLUDE_DIR AND CUNIT_LIBRARY)

IF (CUNIT_FOUND)
MESSAGE(STATUS "Found CUnit: ${CUNIT_LIBRARY}")
ELSE (CUNIT_FOUND)
MESSAGE(STATUS "Could not find CUnit. Tests will not be available.")
ENDIF (CUNIT_FOUND)
if(CUNIT_FOUND)
message(STATUS "Found CUnit: ${CUNIT_LIBRARY}")
else(CUNIT_FOUND)
message(STATUS "Could not find CUnit. Tests will not be available.")
endif(CUNIT_FOUND)

mark_as_advanced(CUNIT_INCLUDE_DIR CUNIT_LIBRARY CUNIT_SEARCH_PATHS)
44 changes: 22 additions & 22 deletions cmake-scripts/FindEpoxy.cmake
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
set(EPOXY_SEARCH_PATHS /usr/local /usr /opt)

find_path(EPOXY_INCLUDE_DIR epoxy/gl.h
HINTS
PATH_SUFFIXES include
PATHS ${EPOXY_SEARCH_PATHS}
)
find_library(EPOXY_LIBRARY epoxy
HINTS
PATH_SUFFIXES lib64 lib
PATHS ${EPOXY_SEARCH_PATHS}
)
find_path(
EPOXY_INCLUDE_DIR epoxy/gl.h
HINTS
PATH_SUFFIXES include
PATHS ${EPOXY_SEARCH_PATHS})
find_library(
EPOXY_LIBRARY epoxy
HINTS
PATH_SUFFIXES lib64 lib
PATHS ${EPOXY_SEARCH_PATHS})

if (EPOXY_INCLUDE_DIR AND EPOXY_LIBRARY)
set(EPOXY_FOUND TRUE)
endif ()
if(EPOXY_INCLUDE_DIR AND EPOXY_LIBRARY)
set(EPOXY_FOUND TRUE)
endif()

if (EPOXY_FOUND)
add_library(Epoxy::Main UNKNOWN IMPORTED)
set_target_properties(Epoxy::Main PROPERTIES
IMPORTED_LOCATION "${EPOXY_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${EPOXY_INCLUDE_DIR}")
message(STATUS "Found libepoxy: ${EPOXY_LIBRARY}")
else ()
message(WARNING "Could not find libepoxy")
endif ()
if(EPOXY_FOUND)
add_library(Epoxy::Main UNKNOWN IMPORTED)
set_target_properties(
Epoxy::Main PROPERTIES IMPORTED_LOCATION "${EPOXY_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${EPOXY_INCLUDE_DIR}")
message(STATUS "Found libepoxy: ${EPOXY_LIBRARY}")
else()
message(WARNING "Could not find libepoxy")
endif()

mark_as_advanced(EPOXY_INCLUDE_DIR EPOXY_LIBRARY EPOXY_SEARCH_PATHS)
Loading

0 comments on commit de722b2

Please sign in to comment.