33## This file is biased to finding Fortran libraries
44## AstroFloyd, October 2010
55##
6- ## Copyright (c) 2010-2015 AstroFloyd - astrofloyd.org
6+ ## Copyright (c) 2010-2017 AstroFloyd - astrofloyd.org
77##
88## This file is part of the CMakeFiles package,
99## see: http://cmakefiles.sf.net/
2020##
2121## This CMake module defines the following variables:
2222## PLplot_FOUND = Libraries and headers found; TRUE/FALSE
23- ## PLplot_INCLUDE_DIR = Path to the PLplot header/module files
23+ ## PLplot_INCLUDES = Path to the PLplot header/module files
2424## PLplot_LIBRARIES = Path to all parts of the PLplot libraries
2525## PLplot_LIBRARY_DIRS = Path to the directories containing the PLplot libraries
2626
@@ -87,6 +87,7 @@ if( PLplot_INCLUDE_DIR )
8787 get_filename_component ( PLplot_LIBRARY_DIRS ${PLplot_LIBRARY} PATH )
8888 # Set uncached variables as per standard.
8989 set ( PLplot_FOUND TRUE )
90+ set ( PLplot_INCLUDES ${PLplot_INCLUDE_DIR} )
9091 set ( PLplot_LIBRARIES ${PLplot_LIBRARY} )
9192
9293 else ( PLplot_LIBRARY )
@@ -164,6 +165,25 @@ if( PLplot_INCLUDE_DIR )
164165 endif ( PLplot_f95c_LIBRARY )
165166
166167
168+ # Find F2008 bindings:
169+ # Check for COMPILER-SPECIFIC libraries:
170+ find_library ( PLplot_fortran_LIBRARY
171+ NAMES plplotfortran_${Fortran_COMPILER_NAME}
172+ PATHS ${lib_locations}
173+ )
174+ # If not found, check for GENERAL libraries:
175+ if ( NOT PLplot_fortran_LIBRARY )
176+ find_library ( PLplot_fortran_LIBRARY
177+ NAMES plplotfortran
178+ PATHS ${lib_locations}
179+ )
180+ endif ( NOT PLplot_fortran_LIBRARY )
181+ if ( PLplot_fortran_LIBRARY )
182+ set ( PLplot_LIBRARIES ${PLplot_LIBRARIES} ${PLplot_fortran_LIBRARY} )
183+ get_filename_component ( PLplot_LIBRARY_DIRS ${PLplot_LIBRARY} PATH )
184+ endif ( PLplot_fortran_LIBRARY )
185+
186+
167187 # Find wxwidgets bindings:
168188 find_library ( PLplot_wxwidgets_LIBRARY
169189 NAMES plplotwxwidgets plplotwxwidgetsd
@@ -187,8 +207,8 @@ if( PLplot_FOUND )
187207
188208 if ( NOT PLplot_FIND_QUIETLY )
189209 message ( STATUS "Found components for PLplot:" )
190- message ( STATUS "* PLplot_INCLUDE_DIR = ${PLplot_INCLUDE_DIR } " )
191- message ( STATUS "* PLplot_LIBRARIES = ${PLplot_LIBRARIES} " )
210+ message ( STATUS "* PLplot_INCLUDES = ${PLplot_INCLUDES } " )
211+ message ( STATUS "* PLplot_LIBRARIES = ${PLplot_LIBRARIES} " )
192212 endif ( NOT PLplot_FIND_QUIETLY )
193213
194214else ( PLplot_FOUND )
0 commit comments