@@ -2,14 +2,16 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
22
33project (uthenticode)
44
5- # NOTE(ww): CMake has bad defaults for install prefixes.
6- # Instead of fussing over them, install everything to the build directory by default
7- # and let the user set CMAKE_INSTALL_PREFIX explicitly for their own needs.
8- if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
9- set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR} " CACHE PATH "Default install directory" FORCE)
5+ # NOTE(ww): CMake has bad defaults for install prefixes. Instead of fussing over
6+ # them, install everything to the build directory by default and let the user
7+ # set CMAKE_INSTALL_PREFIX explicitly for their own needs.
8+ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
9+ set (CMAKE_INSTALL_PREFIX
10+ "${CMAKE_BINARY_DIR} "
11+ CACHE PATH "Default install directory" FORCE)
1012endif ()
1113
12- if (MSVC )
14+ if (MSVC )
1315 set (CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON )
1416endif ()
1517
@@ -27,18 +29,17 @@ if(BUILD_SVCLI)
2729 add_subdirectory (src/svcli)
2830endif ()
2931
30- # gtest setup.
31- # Adapted roughly from the googletest README.
32+ # gtest setup. Adapted roughly from the googletest README.
3233if (BUILD_TESTS)
3334 set (gtest_cmake_in "${CMAKE_CURRENT_SOURCE_DIR} /cmake/gtest.cmake.in" )
34- set (gtest_cmake "${CMAKE_CURRENT_BINARY_DIR} /googletest-download/CMakeLists.txt" )
35+ set (gtest_cmake
36+ "${CMAKE_CURRENT_BINARY_DIR} /googletest-download/CMakeLists.txt" )
3537 configure_file ("${gtest_cmake_in} " "${gtest_cmake} " )
3638
3739 execute_process (
3840 COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR} " .
3941 RESULT_VARIABLE result
40- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /googletest-download
41- )
42+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /googletest-download)
4243
4344 if (result)
4445 message (FATAL_ERROR "CMake step for googletest failed: ${result} " )
@@ -47,27 +48,27 @@ if(BUILD_TESTS)
4748 execute_process (
4849 COMMAND ${CMAKE_COMMAND} --build .
4950 RESULT_VARIABLE result
50- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /googletest-download
51- )
51+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /googletest-download)
5252
5353 if (result)
5454 message (FATAL_ERROR "Build step for googletest failed: ${result} " )
5555 endif ()
5656
57- # Prevent overriding the parent project's compiler/linker
58- # settings on Windows
59- set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
60-
61- # Add googletest directly to our build. This defines
62- # the gtest and gtest_main targets.
63- add_subdirectory (${CMAKE_CURRENT_BINARY_DIR} /googletest-src
64- ${CMAKE_CURRENT_BINARY_DIR} /googletest-build
65- EXCLUDE_FROM_ALL )
66-
67- # The gtest/gtest_main targets carry header search path
68- # dependencies automatically when using CMake 2.8.11 or
69- # later. Otherwise we have to add them here ourselves.
70- if (CMAKE_VERSION VERSION_LESS 2.8.11)
57+ # Prevent overriding the parent project's compiler/linker settings on Windows
58+ set (gtest_force_shared_crt
59+ ON
60+ CACHE BOOL "" FORCE)
61+
62+ # Add googletest directly to our build. This defines the gtest and gtest_main
63+ # targets.
64+ add_subdirectory (
65+ ${CMAKE_CURRENT_BINARY_DIR} /googletest-src
66+ ${CMAKE_CURRENT_BINARY_DIR} /googletest-build EXCLUDE_FROM_ALL )
67+
68+ # The gtest/gtest_main targets carry header search path dependencies
69+ # automatically when using CMake 2.8.11 or later. Otherwise we have to add
70+ # them here ourselves.
71+ if (CMAKE_VERSION VERSION_LESS 2.8.11)
7172 include_directories ("${gtest_SOURCE_DIR} /include" )
7273 endif ()
7374
0 commit comments