Skip to content

Commit

Permalink
Update CMake files to find PLplot v5.13
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroFloyd committed Apr 2, 2018
1 parent ae567bf commit aef2351
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
28 changes: 24 additions & 4 deletions CMake/FindPLplot.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## This file is biased to finding Fortran libraries
## AstroFloyd, October 2010
##
## Copyright (c) 2010-2015 AstroFloyd - astrofloyd.org
## Copyright (c) 2010-2017 AstroFloyd - astrofloyd.org
##
## This file is part of the CMakeFiles package,
## see: http://cmakefiles.sf.net/
Expand All @@ -20,7 +20,7 @@
##
## This CMake module defines the following variables:
## PLplot_FOUND = Libraries and headers found; TRUE/FALSE
## PLplot_INCLUDE_DIR = Path to the PLplot header/module files
## PLplot_INCLUDES = Path to the PLplot header/module files
## PLplot_LIBRARIES = Path to all parts of the PLplot libraries
## PLplot_LIBRARY_DIRS = Path to the directories containing the PLplot libraries

Expand Down Expand Up @@ -87,6 +87,7 @@ if( PLplot_INCLUDE_DIR )
get_filename_component( PLplot_LIBRARY_DIRS ${PLplot_LIBRARY} PATH )
# Set uncached variables as per standard.
set( PLplot_FOUND TRUE )
set( PLplot_INCLUDES ${PLplot_INCLUDE_DIR} )
set( PLplot_LIBRARIES ${PLplot_LIBRARY} )

else( PLplot_LIBRARY )
Expand Down Expand Up @@ -164,6 +165,25 @@ if( PLplot_INCLUDE_DIR )
endif( PLplot_f95c_LIBRARY )


# Find F2008 bindings:
# Check for COMPILER-SPECIFIC libraries:
find_library( PLplot_fortran_LIBRARY
NAMES plplotfortran_${Fortran_COMPILER_NAME}
PATHS ${lib_locations}
)
# If not found, check for GENERAL libraries:
if( NOT PLplot_fortran_LIBRARY )
find_library( PLplot_fortran_LIBRARY
NAMES plplotfortran
PATHS ${lib_locations}
)
endif( NOT PLplot_fortran_LIBRARY )
if( PLplot_fortran_LIBRARY )
set( PLplot_LIBRARIES ${PLplot_LIBRARIES} ${PLplot_fortran_LIBRARY} )
get_filename_component( PLplot_LIBRARY_DIRS ${PLplot_LIBRARY} PATH )
endif( PLplot_fortran_LIBRARY )


# Find wxwidgets bindings:
find_library( PLplot_wxwidgets_LIBRARY
NAMES plplotwxwidgets plplotwxwidgetsd
Expand All @@ -187,8 +207,8 @@ if( PLplot_FOUND )

if( NOT PLplot_FIND_QUIETLY )
message( STATUS "Found components for PLplot:" )
message( STATUS "* PLplot_INCLUDE_DIR = ${PLplot_INCLUDE_DIR}" )
message( STATUS "* PLplot_LIBRARIES = ${PLplot_LIBRARIES}" )
message( STATUS "* PLplot_INCLUDES = ${PLplot_INCLUDES}" )
message( STATUS "* PLplot_LIBRARIES = ${PLplot_LIBRARIES}" )
endif( NOT PLplot_FIND_QUIETLY )

else( PLplot_FOUND )
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ set( LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/usr/lib${LIB_SUFFIX}" )

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


# Set source files:
Expand Down

0 comments on commit aef2351

Please sign in to comment.