Skip to content

Commit

Permalink
Merge branch 'cmake_update' of https://github.com/LLNL/units into cma…
Browse files Browse the repository at this point in the history
…ke_update
  • Loading branch information
phlptp committed Oct 1, 2024
2 parents 6ed2662 + 2e12742 commit 8226de7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 13 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,14 @@ set(UNITS_NAMESPACE
CACHE STRING "Top-level namespace name. Default is `units`."
)

if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND NOT UNITS_BINARY_ONLY_INSTALL)
option(UNITS_INSTALL "Generate and install cmake package files and shared library if built" ON)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND NOT UNITS_BINARY_ONLY_INSTALL)
option(UNITS_INSTALL
"Generate and install cmake package files and shared library if built" ON
)
else()
option(UNITS_INSTALL "Generate and install cmake package files and shared library if built" OFF)
option(UNITS_INSTALL
"Generate and install cmake package files and shared library if built" OFF
)
endif()

mark_as_advanced(UNITS_INSTALL)
Expand Down
33 changes: 24 additions & 9 deletions config/AddGoogletest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,41 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#
# Add make check, as well, which gives output on failed tests without having to set an environment
# variable.
# Add make check, as well, which gives output on failed tests without having to set an
# environment variable.
#
include(extraMacros)
set(CMAKE_WARN_DEPRECATED OFF CACHE INTERNAL "" FORCE)
set(gtest_force_shared_crt ON CACHE INTERNAL "")
set(CMAKE_WARN_DEPRECATED
OFF
CACHE INTERNAL "" FORCE
)
set(gtest_force_shared_crt
ON
CACHE INTERNAL ""
)

set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "")
set(HAVE_STD_REGEX ON CACHE INTERNAL "")
set(BUILD_SHARED_LIBS
OFF
CACHE INTERNAL ""
)
set(HAVE_STD_REGEX
ON
CACHE INTERNAL ""
)

set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS 1 CACHE INTERNAL "")
set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS
1
CACHE INTERNAL ""
)

add_subdirectory(
${CMAKE_SOURCE_DIR}/ThirdParty/googletest ${CMAKE_BINARY_DIR}/ThirdParty/googletest
EXCLUDE_FROM_ALL
)

if(NOT MSVC)
# target_Compile_options(gtest PRIVATE "-Wno-undef") target_Compile_options(gmock PRIVATE
# "-Wno-undef") target_Compile_options(gtest_main PRIVATE "-Wno-undef")
# target_Compile_options(gtest PRIVATE "-Wno-undef") target_Compile_options(gmock
# PRIVATE "-Wno-undef") target_Compile_options(gtest_main PRIVATE "-Wno-undef")
# target_Compile_options(gmock_main PRIVATE "-Wno-undef")
endif()

Expand Down
2 changes: 1 addition & 1 deletion config/spelling_ignorelines.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ThirdParty
ThirdParty

0 comments on commit 8226de7

Please sign in to comment.