diff --git a/CMakeLists.txt b/CMakeLists.txt index f631296..26afa07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,15 @@ option(BUILD_TESTS "when set to ON, build unit tests" OFF) include_directories(.) if(BUILD_TESTS) -include(import/FetchGoogleTest.cmake) + +find_package(googletest QUIET) +include(FetchContent) +FetchContent_Declare( + googletest + URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip +) +set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +FetchContent_MakeAvailable(googletest) if(UNIX) add_compile_options(-Wall -Wextra -Weffc++) diff --git a/README.md b/README.md index 3246605..5431cc1 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ lib.open("./dynamic_lib", dylib::extension); Load a dynamic library into the object. If a dynamic library was already opened, it will be unloaded and replaced `close` -Close the dynamic library currently loaded in the object. This function will be automatically called by the class destructor +Unload the dynamic library currently loaded in the object. This function will be automatically called by the class destructor ```c++ // Load ./dynamic_lib.so @@ -56,7 +56,7 @@ dylib lib("./dynamic_lib.so"); lib.open("./other_dynamic_lib.so"); -// Close ./other_dynamic_lib.so +// Unload ./other_dynamic_lib.so lib.close(); ``` diff --git a/import/FetchGoogleTest.cmake b/import/FetchGoogleTest.cmake deleted file mode 100644 index 4cd9fde..0000000 --- a/import/FetchGoogleTest.cmake +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.14) - -find_package(googletest QUIET) - -include(FetchContent) - -FetchContent_Declare( - googletest - URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip -) - -set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) -FetchContent_MakeAvailable(googletest)