@@ -14,13 +14,13 @@ set(CMAKE_CXX_EXTENSIONS OFF)
1414
1515set (LIBVIRTUALHID_IS_TOP_LEVEL OFF )
1616if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR )
17- set (LIBVIRTUALHID_IS_TOP_LEVEL ON )
17+ set (LIBVIRTUALHID_IS_TOP_LEVEL ON )
1818endif ()
1919
2020if (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 )
2424endif ()
2525
2626list (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.
4242function (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 ()
6161endfunction ()
6262
6363#
@@ -69,18 +69,18 @@ add_subdirectory(src)
6969# Examples, tests, and docs are top-level only
7070#
7171if (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 ()
8484endif ()
8585
8686#
0 commit comments