Skip to content

Commit 34f04b7

Browse files
Fix cmake lint
1 parent c366dd6 commit 34f04b7

3 files changed

Lines changed: 37 additions & 37 deletions

File tree

CMakeLists.txt

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ set(CMAKE_CXX_EXTENSIONS OFF)
1414

1515
set(LIBVIRTUALHID_IS_TOP_LEVEL OFF)
1616
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
17-
set(LIBVIRTUALHID_IS_TOP_LEVEL ON)
17+
set(LIBVIRTUALHID_IS_TOP_LEVEL ON)
1818
endif()
1919

2020
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
21-
message(STATUS "Setting build type to 'Release' as none was specified.")
22-
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
23-
"Choose the type of build." FORCE)
21+
message(STATUS "Setting build type to 'Release' as none was specified.")
22+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
23+
"Choose the type of build." FORCE)
2424
endif()
2525

2626
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@@ -40,24 +40,24 @@ include(GNUInstallDirs)
4040

4141
# Copy MinGW runtime DLLs beside a target when using GNU toolchains on Windows.
4242
function(libvirtualhid_copy_mingw_runtime target_name)
43-
if(NOT WIN32 OR NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
44-
return()
45-
endif()
46-
47-
get_filename_component(lvh_compiler_dir "${CMAKE_CXX_COMPILER}" DIRECTORY)
48-
foreach(lvh_runtime_dll IN ITEMS
49-
libgcc_s_seh-1.dll
50-
libstdc++-6.dll
51-
libwinpthread-1.dll)
52-
set(lvh_runtime_path "${lvh_compiler_dir}/${lvh_runtime_dll}")
53-
if(EXISTS "${lvh_runtime_path}")
54-
add_custom_command(TARGET "${target_name}" POST_BUILD
55-
COMMAND ${CMAKE_COMMAND} -E copy_if_different
56-
"${lvh_runtime_path}"
57-
"$<TARGET_FILE_DIR:${target_name}>"
58-
COMMENT "Copying MinGW runtime ${lvh_runtime_dll}")
43+
if(NOT WIN32 OR NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
44+
return()
5945
endif()
60-
endforeach()
46+
47+
get_filename_component(lvh_compiler_dir "${CMAKE_CXX_COMPILER}" DIRECTORY)
48+
foreach(lvh_runtime_dll IN ITEMS
49+
libgcc_s_seh-1.dll
50+
libstdc++-6.dll
51+
libwinpthread-1.dll)
52+
set(lvh_runtime_path "${lvh_compiler_dir}/${lvh_runtime_dll}")
53+
if(EXISTS "${lvh_runtime_path}")
54+
add_custom_command(TARGET "${target_name}" POST_BUILD
55+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
56+
"${lvh_runtime_path}"
57+
"$<TARGET_FILE_DIR:${target_name}>"
58+
COMMENT "Copying MinGW runtime ${lvh_runtime_dll}")
59+
endif()
60+
endforeach()
6161
endfunction()
6262

6363
#
@@ -69,18 +69,18 @@ add_subdirectory(src)
6969
# Examples, tests, and docs are top-level only
7070
#
7171
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
72-
if(BUILD_DOCS)
73-
add_subdirectory(third-party/doxyconfig docs)
74-
endif()
75-
76-
if(BUILD_EXAMPLES)
77-
add_subdirectory(examples)
78-
endif()
79-
80-
if(BUILD_TESTS)
81-
enable_testing()
82-
add_subdirectory(tests)
83-
endif()
72+
if(BUILD_DOCS)
73+
add_subdirectory(third-party/doxyconfig docs)
74+
endif()
75+
76+
if(BUILD_EXAMPLES)
77+
add_subdirectory(examples)
78+
endif()
79+
80+
if(BUILD_TESTS)
81+
enable_testing()
82+
add_subdirectory(tests)
83+
endif()
8484
endif()
8585

8686
#

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
1919
OUTPUT_NAME virtualhid)
2020

2121
if(MSVC)
22-
target_compile_options(${PROJECT_NAME} PRIVATE /W4)
22+
target_compile_options(${PROJECT_NAME} PRIVATE /W4)
2323
else()
24-
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic)
24+
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic)
2525
endif()
2626

2727
install(TARGETS ${PROJECT_NAME}

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
set(INSTALL_GTEST OFF)
55
set(INSTALL_GMOCK OFF)
66
if(WIN32)
7-
set(gtest_force_shared_crt ON CACHE BOOL # cmake-lint: disable=C0103
8-
"Always use msvcrt.dll" FORCE)
7+
set(gtest_force_shared_crt ON CACHE BOOL # cmake-lint: disable=C0103
8+
"Always use msvcrt.dll" FORCE)
99
endif()
1010

1111
include(GoogleTest)

0 commit comments

Comments
 (0)