File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -57,23 +57,26 @@ find_package_handle_standard_args(LZ4
5757
5858if (LZ4_FOUND)
5959 message (STATUS "Found LZ4: shared=${LZ4_SHARED_LIBRARY} , static=${LZ4_STATIC_LIBRARY} " )
60+ else ()
61+ message (WARNING "LZ4 not found" )
62+ return ()
6063endif ()
6164
62- mark_as_advanced (LZ4_INCLUDE_DIR LZ4_SHARED_LIBRARY LZ4_STATIC_LIBRARY)
63-
6465# Create imported targets
65- if (NOT TARGET LZ4::lz4_shared)
66+ if (NOT TARGET LZ4::lz4_shared AND LZ4_SHARED_LIBRARY )
6667 add_library (LZ4::lz4_shared SHARED IMPORTED GLOBAL )
6768 set_target_properties (LZ4::lz4_shared PROPERTIES
6869 IMPORTED_LOCATION "${LZ4_SHARED_LIBRARY} "
6970 INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIR} "
7071 )
7172endif ()
7273
73- if (NOT TARGET LZ4::lz4_static)
74+ if (NOT TARGET LZ4::lz4_static AND LZ4_STATIC_LIBRARY )
7475 add_library (LZ4::lz4_static STATIC IMPORTED GLOBAL )
7576 set_target_properties (LZ4::lz4_static PROPERTIES
7677 IMPORTED_LOCATION "${LZ4_STATIC_LIBRARY} "
7778 INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIR} "
7879 )
7980endif ()
81+
82+ mark_as_advanced (LZ4_INCLUDE_DIR LZ4_SHARED_LIBRARY LZ4_STATIC_LIBRARY)
Original file line number Diff line number Diff line change @@ -57,15 +57,15 @@ endif()
5757mark_as_advanced (ZSTD_INCLUDE_DIR ZSTD_SHARED_LIBRARY ZSTD_STATIC_LIBRARY)
5858
5959# Create imported targets
60- if (NOT TARGET zstd::libzstd_shared)
60+ if (NOT TARGET zstd::libzstd_shared AND ZSTD_SHARED_LIBRARY )
6161 add_library (zstd::libzstd_shared SHARED IMPORTED GLOBAL )
6262 set_target_properties (zstd::libzstd_shared PROPERTIES
6363 IMPORTED_LOCATION "${ZSTD_SHARED_LIBRARY} "
6464 INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIR} "
6565 )
6666endif ()
6767
68- if (NOT TARGET zstd::libzstd_static)
68+ if (NOT TARGET zstd::libzstd_static AND ZSTD_STATIC_LIBRARY )
6969 add_library (zstd::libzstd_static STATIC IMPORTED GLOBAL )
7070 set_target_properties (zstd::libzstd_static PROPERTIES
7171 IMPORTED_LOCATION "${ZSTD_STATIC_LIBRARY} "
You can’t perform that action at this time.
0 commit comments