~uhh-ssd/+junk/humidity_readout

« back to all changes in this revision

Viewing changes to plplot/plplot-5.9.9/bindings/qt_gui/CMakeLists.txt

  • 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
# bindings/qt_gui/CMakeLists.txt
 
2
### Process this file with cmake to produce Makefile
 
3
###
 
4
# Copyright (C) 2006 Alan W. Irwin
 
5
#
 
6
# This file is part of PLplot.
 
7
#
 
8
# PLplot is free software; you can redistribute it and/or modify
 
9
# it under the terms of the GNU Library General Public License as published
 
10
# by the Free Software Foundation; version 2 of the License.
 
11
#
 
12
# PLplot is distributed in the hope that it will be useful,
 
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
# GNU Library General Public License for more details.
 
16
#
 
17
# You should have received a copy of the GNU Library General Public License
 
18
# along with PLplot; if not, write to the Free Software
 
19
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 
20
 
 
21
if(ENABLE_qt)
 
22
  # Set up Qt4-based build environment.
 
23
  include(${QT_USE_FILE})
 
24
  if(NOT QT_LIBRARIES)
 
25
    message(FATAL_ERROR "include(${QT_USE_FILE}) failed in bindings/qt_gui subdirectory.")
 
26
  endif(NOT QT_LIBRARIES)
 
27
  set(qt_SOURCE plqt.cpp)
 
28
  include_directories(
 
29
    ${CMAKE_SOURCE_DIR}/include
 
30
    ${CMAKE_SOURCE_DIR}/lib/qsastime
 
31
    ${CMAKE_SOURCE_DIR}/lib/nistcd
 
32
    ${CMAKE_SOURCE_DIR}/drivers
 
33
    ${CMAKE_BINARY_DIR}
 
34
    ${CMAKE_BINARY_DIR}/include
 
35
    )
 
36
  if(qt_COMPILE_FLAGS)
 
37
    set_source_files_properties(
 
38
      ${qt_SOURCE}
 
39
      PROPERTIES COMPILE_FLAGS "${qt_COMPILE_FLAGS} -DUSINGDLL"
 
40
      )
 
41
    #message("qt_COMPILE_FLAGS = ${qt_COMPILE_FLAGS}")
 
42
  else(qt_COMPILE_FLAGS)
 
43
    set_source_files_properties(
 
44
      ${qt_SOURCE}
 
45
      PROPERTIES COMPILE_FLAGS "-DUSINGDLL"
 
46
      )
 
47
  endif(qt_COMPILE_FLAGS)
 
48
  if(ANY_QT_DEVICE)
 
49
    add_library(plplotqt${LIB_TAG} ${qt_SOURCE})
 
50
    add_dependencies(plplotqt${LIB_TAG} moc_outfile_generated)
 
51
  else(ANY_QT_DEVICE)
 
52
    message(FATAL_ERROR "Internal build system inconsistency between ENABLE_qt true and ANY_QT_DEVICE false.")
 
53
  endif(ANY_QT_DEVICE)
 
54
  target_link_libraries(
 
55
    plplotqt${LIB_TAG}
 
56
    plplot${LIB_TAG}
 
57
    ${MATH_LIB}
 
58
    ${QT_LIBRARIES}
 
59
    )
 
60
  # qt_RPATH set in cmake/modules/qt.cmake. This is only used for the 
 
61
  # install-tree rpath since cmake handles the build-tree rpath
 
62
  # automatically (so long as full pathnames to libraries are used).
 
63
  #message("qt_RPATH = ${qt_RPATH}")
 
64
  if(USE_RPATH)
 
65
    # Order is important here because of /usr/lib concerns.
 
66
    set(LIB_INSTALL_RPATH 
 
67
      ${LIB_DIR}
 
68
      ${qt_RPATH}
 
69
      ${libplplot${LIB_TAG}_RPATH}
 
70
      )
 
71
    #message("LIB_INSTALL_RPATH = ${LIB_INSTALL_RPATH}")
 
72
    set_target_properties(plplotqt${LIB_TAG}
 
73
      PROPERTIES
 
74
      SOVERSION ${plplotqt_SOVERSION}
 
75
      VERSION ${plplotqt_VERSION}
 
76
      INSTALL_RPATH "${LIB_INSTALL_RPATH}"
 
77
      INSTALL_NAME_DIR "${LIB_DIR}"
 
78
      )
 
79
  else(USE_RPATH)
 
80
    set_target_properties(plplotqt${LIB_TAG}
 
81
      PROPERTIES
 
82
      SOVERSION ${plplotqt_SOVERSION}
 
83
      VERSION ${plplotqt_VERSION}
 
84
      INSTALL_NAME_DIR "${LIB_DIR}"
 
85
      )
 
86
  endif(USE_RPATH)
 
87
  install(TARGETS plplotqt${LIB_TAG}
 
88
    EXPORT export_plplot
 
89
    ARCHIVE DESTINATION ${LIB_DIR}
 
90
    LIBRARY DESTINATION ${LIB_DIR}
 
91
    RUNTIME DESTINATION ${BIN_DIR}
 
92
    )
 
93
 
 
94
  # Transform "${QT_LIBRARIES}" to the standard pkg-config form.
 
95
  pkg_config_link_flags(
 
96
    libplplotqt${LIB_TAG}_LINK_FLAGS
 
97
    "${QT_LIBRARIES}"
 
98
    )
 
99
 
 
100
  # Configure pkg-config *.pc file corresponding to the compile and link
 
101
  # flags needed by a Qt GUI executable using extqt to gain access to PLplot.
 
102
  if(PKG_CONFIG_EXECUTABLE)
 
103
    if(LIB_TAG)
 
104
      set(PC_PRECISION "double")
 
105
    else(LIB_TAG)
 
106
      set(PC_PRECISION "single")
 
107
    endif(LIB_TAG)
 
108
    # Each list element must consist of a colon-separated string with the
 
109
    # following fields which are parsed out in the foreach loop below and
 
110
    # used to configure the corresponding pkg-config *.pc file.
 
111
    # BINDING             - ENABLE_${BINDING} keeps track of whether a
 
112
    #                       binding has been enabled (ON) or not (OFF).
 
113
    #                       Also, ${BINDING} used to determine PC_FILE_SUFFIX
 
114
    #                       which helps to determine name of configured 
 
115
    #                       *.pc file.
 
116
    # PC_SHORT_NAME       - Used in *.pc NAME: field
 
117
    # PC_LONG_NAME        - Used in *.pc Description: field
 
118
    # PC_LIBRARY_NAME     - Used in *.pc Libs: field
 
119
    #                         Also used to determine PC_LINK_FLAGS and
 
120
    #                         PC_COMPILE_FLAGS used in *.pc Libs: and Cflags:
 
121
    #                       fields.
 
122
    set(PC_DATA "qt:Qt:Qt4 bindings, :plplotqt${LIB_TAG}")
 
123
 
 
124
    string(REGEX REPLACE "^(.*):.*:.*:.*$" "\\1" BINDING ${PC_DATA})
 
125
    set(PC_FILE_SUFFIX "-${BINDING}")
 
126
    set(PC_REQUIRES "plplot${LIB_TAG}")
 
127
    string(REGEX REPLACE "^.*:(.*):.*:.*$" "\\1" PC_SHORT_NAME ${PC_DATA})
 
128
    string(REGEX REPLACE "^.*:.*:(.*):.*$" "\\1" PC_LONG_NAME ${PC_DATA})
 
129
    string(REGEX REPLACE "^.*:.*:.*:(.*)$" "\\1" PC_LIBRARY_NAME ${PC_DATA})
 
130
    set(PC_LINK_FLAGS "${lib${PC_LIBRARY_NAME}_LINK_FLAGS}")
 
131
    set(PC_COMPILE_FLAGS "${qt_COMPILE_FLAGS}")
 
132
    set(PC_LINK_FLAGS "-l${PC_LIBRARY_NAME} ${PC_LINK_FLAGS}")
 
133
    set(PC_CONFIGURED_FILE
 
134
      ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc
 
135
      )
 
136
    configure_file(
 
137
      ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake
 
138
      ${PC_CONFIGURED_FILE}
 
139
      @ONLY
 
140
      )
 
141
    install(FILES ${PC_CONFIGURED_FILE} DESTINATION ${PKG_CONFIG_DIR})
 
142
  endif(PKG_CONFIG_EXECUTABLE)
 
143
 
 
144
  add_subdirectory(pyqt4)
 
145
endif(ENABLE_qt)