CMakeJavaInformation.cmake 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #=============================================================================
  2. # Copyright 2004-2009 Kitware, Inc.
  3. #
  4. # Distributed under the OSI-approved BSD License (the "License");
  5. # see accompanying file Copyright.txt for details.
  6. #
  7. # This software is distributed WITHOUT ANY WARRANTY; without even the
  8. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. # See the License for more information.
  10. #=============================================================================
  11. # (To distributed this file outside of CMake, substitute the full
  12. # License text for the above reference.)
  13. # This should be included before the _INIT variables are
  14. # used to initialize the cache. Since the rule variables
  15. # have if blocks on them, users can still define them here.
  16. # But, it should still be after the platform file so changes can
  17. # be made to those values.
  18. IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
  19. INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE})
  20. ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE)
  21. IF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
  22. INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX})
  23. ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
  24. # this is a place holder if java needed flags for javac they would go here.
  25. IF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
  26. # IF(WIN32)
  27. # SET(class_files_mask "*.class")
  28. # ELSE(WIN32)
  29. SET(class_files_mask ".")
  30. # ENDIF(WIN32)
  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 compling a *.java
  34. # file can create more than one *.class file...
  35. ENDIF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
  36. # compile a Java file into an object file
  37. IF(NOT CMAKE_Java_COMPILE_OBJECT)
  38. SET(CMAKE_Java_COMPILE_OBJECT
  39. "<CMAKE_Java_COMPILER> <FLAGS> <SOURCE> -d <OBJECT_DIR>")
  40. ENDIF(NOT CMAKE_Java_COMPILE_OBJECT)
  41. # set java include flag option and the separator for multiple include paths
  42. SET(CMAKE_INCLUDE_FLAG_Java "-classpath ")
  43. IF(WIN32 AND NOT CYGWIN)
  44. SET(CMAKE_INCLUDE_FLAG_SEP_Java ";")
  45. ELSE(WIN32 AND NOT CYGWIN)
  46. SET(CMAKE_INCLUDE_FLAG_SEP_Java ":")
  47. ENDIF(WIN32 AND NOT CYGWIN)