Ver código fonte

Build: Use imported target `LibRHash::LibRHash` instead of variables

Alex Turbov 3 anos atrás
pai
commit
eeebf31e54
2 arquivos alterados com 2 adições e 3 exclusões
  1. 1 1
      Source/CMakeLists.txt
  2. 1 2
      Source/Modules/CMakeBuildUtilities.cmake

+ 1 - 1
Source/CMakeLists.txt

@@ -756,7 +756,7 @@ target_link_libraries(
     ZLIB::ZLIB
     ZLIB::ZLIB
     JsonCpp::JsonCpp
     JsonCpp::JsonCpp
     LibUV::LibUV
     LibUV::LibUV
-    ${CMAKE_LIBRHASH_LIBRARIES}
+    LibRHash::LibRHash
     ${CMake_KWIML_LIBRARIES}
     ${CMake_KWIML_LIBRARIES}
     ${CMAKE_THREAD_LIBS_INIT}
     ${CMAKE_THREAD_LIBS_INIT}
   )
   )

+ 1 - 2
Source/Modules/CMakeBuildUtilities.cmake

@@ -105,10 +105,9 @@ if(CMAKE_USE_SYSTEM_LIBRHASH)
     message(FATAL_ERROR
     message(FATAL_ERROR
       "CMAKE_USE_SYSTEM_LIBRHASH is ON but LibRHash is not found!")
       "CMAKE_USE_SYSTEM_LIBRHASH is ON but LibRHash is not found!")
   endif()
   endif()
-  set(CMAKE_LIBRHASH_LIBRARIES LibRHash::LibRHash)
 else()
 else()
-  set(CMAKE_LIBRHASH_LIBRARIES cmlibrhash)
   add_subdirectory(Utilities/cmlibrhash)
   add_subdirectory(Utilities/cmlibrhash)
+  add_library(LibRHash::LibRHash ALIAS cmlibrhash)
   CMAKE_SET_TARGET_FOLDER(cmlibrhash "Utilities/3rdParty")
   CMAKE_SET_TARGET_FOLDER(cmlibrhash "Utilities/3rdParty")
 endif()
 endif()