Skip to content

Commit aef2351

Browse files
committed
Update CMake files to find PLplot v5.13
1 parent ae567bf commit aef2351

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

CMake/FindPLplot.cmake

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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/
@@ -20,7 +20,7 @@
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

194214
else( PLplot_FOUND )

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ set( LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/usr/lib${LIB_SUFFIX}" )
5858

5959
# Find dependencies:
6060
find_package( PLplot REQUIRED )
61-
set( INCLUDE_FLAGS "-I${PLplot_INCLUDE_DIR}" ) # will be transferred to CompilerFlags
61+
set( INCLUDE_FLAGS "-I${PLplot_INCLUDES}" ) # will be transferred to CompilerFlags
6262

6363

6464
# Set source files:

0 commit comments

Comments
 (0)