swipl/104-fix-prolog_in_java.patch
2024-11-23 17:56:19 +01:00

47 lines
1.7 KiB
Diff

---
packages/jpl/cmake/JUnit.cmake | 33 ++++++++++++++++++++++-----------
1 file changed, 22 insertions(+), 11 deletions(-)
--- a/packages/jpl/cmake/JUnit.cmake
+++ b/packages/jpl/cmake/JUnit.cmake
@@ -16,17 +16,28 @@
# Unfortunately GLOB ? means exactly one, so cannot use it to make the - optional!
## GLOB EXPRESSION: https://facelessuser.github.io/wcmatch/glob/
if(NOT JUNIT_JAR)
- file(GLOB JUNIT_JAR
- ${JAVA_LIB_INSTALL_DIR}/junit4.jar
- ${JAVA_LIB_INSTALL_DIR}/junit-4*.jar
- /usr/share/java/junit4.jar
- /usr/share/java/junit-4*.jar
- /usr/share/java/junit.jar
- /opt/local/share/java/junit.jar # Macport
- /opt/local/share/java/junit4.jar
- /opt/local/share/java/junit-4*.jar
- /usr/local/share/java/junit4.jar
- /usr/local/share/java/junit-4*.jar)
+ file(GLOB F_JUNIT_JAR
+ ${JAVA_LIB_INSTALL_DIR}/junit4.jar
+ ${JAVA_LIB_INSTALL_DIR}/junit-4*.jar
+ /usr/share/java/junit4.jar
+ /usr/share/java/junit-4*.jar
+ /opt/local/share/java/junit4.jar
+ /opt/local/share/java/junit-4*.jar
+ /usr/local/share/java/junit4.jar
+ /usr/local/share/java/junit-4*.jar)
+ if(NOT F_JUNIT_JAR)
+ file(GLOB F_JUNIT_JAR
+ /usr/share/java/junit.jar
+ /opt/local/share/java/junit.jar)
+ endif()
+ if(F_JUNIT_JAR)
+ list(GET F_JUNIT_JAR 0 F_JUNIT_JAR)
+ message("Found junit at ${F_JUNIT_JAR}")
+ else()
+ message("Could not find junit.jar.")
+ endif()
+ set(JUNIT_JAR ${F_JUNIT_JAR} CACHE FILEPATH
+ "junit4 jar file")
endif()
MARK_AS_ADVANCED(JUNIT_JAR)
find_file(HAMCREST