All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cvc5-cvc5-1.2.0.cmake.FindJUnit.cmake Maven / Gradle / Ivy

The newest version!
###############################################################################
# Top contributors (to current version):
#   Mudathir Mohamed, Mathias Preiner
#
# This file is part of the cvc5 project.
#
# Copyright (c) 2009-2024 by the authors listed in the file AUTHORS
# in the top-level source directory and their institutional affiliations.
# All rights reserved.  See the file COPYING in the top-level source
# directory for licensing information.
# #############################################################################
#
# Find JUnit
# JUnit_FOUND - should be true for testing
# JUnit_JAR   - absolute path to JUnit5 jar file
##

include(deps-helper)

find_jar(JUnit_JAR junit-platform-console-standalone
  PATHS
    ${DEPS_BASE}/share/java
    $ENV{PATH} $ENV{HOME} $ENV{CLASSPATH} $ENV{JUNIT_HOME}
)

set(JUnit_FOUND_SYSTEM FALSE)
if(JUnit_JAR)
  set(JUnit_FOUND_SYSTEM TRUE)
endif()

if(NOT JUnit_FOUND_SYSTEM)
  check_auto_download("JUnit" "")
  set(JUNIT_VERSION 1.7.1)
  include(ExternalProject)

  # Download junit generator jar
  ExternalProject_Add(
    JUnit-EP-jar
    PREFIX ${DEPS_PREFIX}
    URL https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone/${JUNIT_VERSION}/junit-platform-console-standalone-${JUNIT_VERSION}.jar
    URL_HASH SHA256=e588d4dab5c8898b241c2a25938bf0b933ab77518626f14028cce403df7ce33d
    DOWNLOAD_NO_EXTRACT ON
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ""
    INSTALL_COMMAND ${CMAKE_COMMAND} -E copy
      /../junit-platform-console-standalone-${JUNIT_VERSION}.jar
      /share/java/junit-platform-console-standalone-${JUNIT_VERSION}.jar
    BUILD_BYPRODUCTS /share/java/junit-platform-console-standalone-${JUNIT_VERSION}.jar
  )

  set(JUnit_JAR "${DEPS_BASE}/share/java/junit-platform-console-standalone-${JUNIT_VERSION}.jar")
endif()

set(JUnit_FOUND TRUE)

mark_as_advanced(JUnit_JAR)
mark_as_advanced(JUnit_FOUND)

if(JUnit_FOUND_SYSTEM)
  message(STATUS "Found JUnit: ${JUnit_JAR}")
else()
  message(STATUS "Downloading JUnit: ${JUnit_JAR}")
endif()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy