Skip to content

Commit

Permalink
use TARGET_NAME_IF_EXISTS
Browse files Browse the repository at this point in the history
  • Loading branch information
wgtmac committed Jan 27, 2025
1 parent 426cb6f commit 9cbcdae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lang/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#
cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.12)

set (CMAKE_LEGACY_CYGWIN_WIN32 0)

Expand Down Expand Up @@ -205,7 +205,7 @@ if (AVRO_BUILD_TESTS)

macro (unittest name)
add_executable (${name} test/${name}.cc)
target_link_libraries (${name} avrocpp_s Boost::system ZLIB::ZLIB $<$<TARGET_EXISTS:Snappy::snappy>:Snappy::snappy>)
target_link_libraries (${name} avrocpp_s Boost::system ZLIB::ZLIB $<TARGET_NAME_IF_EXISTS:Snappy::snappy>)
add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name})
endmacro (unittest)
Expand Down

0 comments on commit 9cbcdae

Please sign in to comment.