~uhh-ssd/+junk/humidity_readout

« back to all changes in this revision

Viewing changes to plplot/plplot-5.9.9/cmake/modules/java.cmake

  • Committer: Joachim Erfle
  • Date: 2013-07-24 13:53:41 UTC
  • Revision ID: joachim.erfle@desy.de-20130724135341-1qojpp701zsn009p
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# cmake/modules/java.cmake
 
2
#
 
3
# Java binding configuration
 
4
#
 
5
# Copyright (C) 2006  Andrew Ross
 
6
#
 
7
# This file is part of PLplot.
 
8
#
 
9
# PLplot is free software; you can redistribute it and/or modify
 
10
# it under the terms of the GNU Library General Public License as published
 
11
# by the Free Software Foundation; version 2 of the License.
 
12
#
 
13
# PLplot is distributed in the hope that it will be useful,
 
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
# GNU Library General Public License for more details.
 
17
#
 
18
# You should have received a copy of the GNU Library General Public License
 
19
# along with the file PLplot; if not, write to the Free Software
 
20
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 
21
 
 
22
# Module for determining Java bindings configuration options
 
23
 
 
24
# Options to enable Java bindings
 
25
if(DEFAULT_NO_BINDINGS)
 
26
  option(ENABLE_java "Enable Java bindings" OFF)
 
27
else(DEFAULT_NO_BINDINGS)
 
28
  option(ENABLE_java "Enable Java bindings" ON)
 
29
endif(DEFAULT_NO_BINDINGS)
 
30
 
 
31
if(ENABLE_java AND NOT BUILD_SHARED_LIBS)
 
32
  message(STATUS "WARNING: "
 
33
    "Java requires shared libraries. Disabling java bindings")
 
34
  set(ENABLE_java OFF CACHE BOOL "Enable Java bindings" FORCE)
 
35
endif(ENABLE_java AND NOT BUILD_SHARED_LIBS)
 
36
 
 
37
if(ENABLE_java AND NOT SWIG_FOUND)
 
38
  message(STATUS "WARNING: "
 
39
    "swig not found. Disabling java bindings")
 
40
  set(ENABLE_java OFF CACHE BOOL "Enable Java bindings" FORCE)
 
41
endif(ENABLE_java AND NOT SWIG_FOUND)
 
42
 
 
43
if(ENABLE_java AND NOT PLPLOT_Java_COMPILER_WORKS)
 
44
  workaround_9220(Java PLPLOT_Java_COMPILER_WORKS)
 
45
  if(NOT PLPLOT_Java_COMPILER_WORKS)
 
46
    message(STATUS "WARNING: no working Java compiler so disabling Java bindings and examples.")
 
47
    set(ENABLE_java OFF CACHE BOOL "Enable Java bindings" FORCE)
 
48
  endif(NOT PLPLOT_Java_COMPILER_WORKS)
 
49
endif(ENABLE_java AND NOT PLPLOT_Java_COMPILER_WORKS)
 
50
 
 
51
if(ENABLE_java)
 
52
  # Find and check Java compiler.
 
53
  enable_language(Java OPTIONAL)
 
54
  if(NOT CMAKE_Java_COMPILER_WORKS)
 
55
    message(STATUS "WARNING: no working Java compiler so disabling Java bindings and examples.")
 
56
    set(ENABLE_java OFF CACHE BOOL "Enable java bindings" FORCE)
 
57
  endif(NOT CMAKE_Java_COMPILER_WORKS)
 
58
endif(ENABLE_java)
 
59
 
 
60
if(ENABLE_java)
 
61
  if(NOT CMAKE_Java_ARCHIVE)
 
62
    message(STATUS "WARNING: java archiver (jar) not found. Disabling java bindings")
 
63
    set(ENABLE_java OFF CACHE BOOL "Enable Java bindings" FORCE)
 
64
  endif(NOT CMAKE_Java_ARCHIVE)
 
65
endif(ENABLE_java)
 
66
 
 
67
if(ENABLE_java)
 
68
  # Check for java environment
 
69
  find_package(JNI)
 
70
  # If CMake doesn't find jni.h you need set CMAKE_INCLUDE_PATH
 
71
  if(NOT JAVA_INCLUDE_PATH)
 
72
    message(STATUS
 
73
      "WARNING: jni.h header not found. Disabling Java bindings.\n" 
 
74
      "   Please install that header and/or set the environment variable\n"
 
75
      "   CMAKE_INCLUDE_PATH appropriately."
 
76
      )
 
77
    set(ENABLE_java OFF CACHE BOOL "Enable Java bindings" FORCE)
 
78
  endif(NOT JAVA_INCLUDE_PATH)
 
79
endif(ENABLE_java)
 
80
 
 
81
if(ENABLE_java)
 
82
  # Set up installation locations for java specific files.
 
83
  # Java .jar files.
 
84
  set(JAR_DIR ${CMAKE_INSTALL_DATADIR}/java
 
85
    CACHE PATH "PLplot jar file install location"
 
86
    )
 
87
  get_filename_component(JAVADATA_HARDDIR ${JAR_DIR} ABSOLUTE)
 
88
  # JNI .so files.
 
89
  set(JAVAWRAPPER_DIR ${LIB_DIR}/jni
 
90
    CACHE PATH "PLplot java plugin install location"
 
91
    )
 
92
  get_filename_component(JAVAWRAPPER_HARDDIR ${JAVAWRAPPER_DIR} ABSOLUTE)
 
93
  # Library name suffix is system dependent.  Tests have shown
 
94
  # that ${CMAKE_SHARED_LIBRARY_SUFFIX} gives the correct suffix on both
 
95
  # Linux and windows, and from CMAKEPREFIX/share/cmake-2.4/Modules/Platform
 
96
  # it appears this CMake variable is defined on Mac OS X and other platforms.
 
97
  set(PLPLOTJAVAC_WRAP_DLL plplotjavac_wrap${CMAKE_SHARED_LIBRARY_SUFFIX})
 
98
endif(ENABLE_java)