1# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2# file Copyright.txt or https://cmake.org/licensing for details.
3
4
5# This should be included before the _INIT variables are
6# used to initialize the cache.  Since the rule variables
7# have if blocks on them, users can still define them here.
8# But, it should still be after the platform file so changes can
9# be made to those values.
10
11if(CMAKE_USER_MAKE_RULES_OVERRIDE)
12  # Save the full path of the file so try_compile can use it.
13  include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
14  set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
15endif()
16
17if(CMAKE_USER_MAKE_RULES_OVERRIDE_Java)
18  # Save the full path of the file so try_compile can use it.
19  include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Java} RESULT_VARIABLE _override)
20  set(CMAKE_USER_MAKE_RULES_OVERRIDE_Java "${_override}")
21endif()
22
23# this is a place holder if java needed flags for javac they would go here.
24if(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
25#  if(WIN32)
26#    set(class_files_mask "*.class")
27#  else()
28    set(class_files_mask ".")
29#  endif()
30
31  set(CMAKE_Java_CREATE_STATIC_LIBRARY
32      "<CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}")
33    # "${class_files_mask}" should really be "<OBJECTS>" but compiling a *.java
34    # file can create more than one *.class file...
35endif()
36
37# compile a Java file into an object file
38if(NOT CMAKE_Java_COMPILE_OBJECT)
39  set(CMAKE_Java_COMPILE_OBJECT
40    "<CMAKE_Java_COMPILER> <FLAGS> <SOURCE> -d <OBJECT_DIR>")
41endif()
42
43# set java include flag option and the separator for multiple include paths
44set(CMAKE_INCLUDE_FLAG_Java "-classpath ")
45if(WIN32 AND NOT CYGWIN)
46  set(CMAKE_INCLUDE_FLAG_SEP_Java ";")
47else()
48  set(CMAKE_INCLUDE_FLAG_SEP_Java ":")
49endif()
50