<commit_before># bindings/f95/CMakeLists.txt
### Process this file with cmake to produce Makefile
###
# Copyright (C) 2006 <NAME>
#
# This file is part of PLplot.
#
# PLplot is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; version 2 of the License.
#
# PLplot is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA

if(ENABLE_f95)

# Set the include path
include_directories(
${CMAKE_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)

# Build plflt to determine KIND for PLFLT
set(plflt_SRC
plflt.c
)

add_executable(plflt ${plflt_SRC})

get_target_property(
plflt_LOCATION
plflt
LOCATION
)

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plflt.inc
  COMMAND ${CMAKE_CURRENT_BINARY_DIR}/plflt
  DEPENDS ${plflt_LOCATION}
)

set_source_files_properties(plflt.inc PROPERTIES GENERATED ON)

## Build C part of F95 bindings
set(plplotf95c${LIB_TAG}_LIB_SRCS
plstubs.h
sc3d.c
sccont.c
scstubs.c
)

add_library(plplotf95c${LIB_TAG} ${plplotf95c${LIB_TAG}_LIB_SRCS})

target_link_libraries(plplotf95c${LIB_TAG}  plplot${LIB_TAG})

if(USE_RPATH)
  get_target_property(LIB_INSTALL_RPATH plplot${LIB_TAG} INSTALL_RPATH)
  set_target_properties(plplotf95c${LIB_TAG}
  PROPERTIES
  SOVERSION ${plplotf95_SOVERSION}
  VERSION ${plplotf95_VERSION}
  INSTALL_RPATH "${LIB_INSTALL_RPATH}"
  INSTALL_NAME_DIR "${LIB_DIR}"
  )
else(USE_RPATH)
  set_target_properties(plplotf95c${LIB_TAG}
  PROPERTIES
  SOVERSION ${plplotf95_SOVERSION}
  VERSION ${plplotf95_VERSION}
  INSTALL_NAME_DIR "${LIB_DIR}"
  )
endif(USE_RPATH)

install(TARGETS plplotf95c${LIB_TAG}
ARCHIVE DESTINATION ${LIB_DIR}
LIBRARY DESTINATION ${LIB_DIR}
RUNTIME DESTINATION ${BIN_DIR}
)


## Build fortran part of F95 bindings
set(plplotf95${LIB_TAG}_LIB_SRCS
strutil.f90
configurable.f90
sfstubsf95.f90
sfstubs.h
)

if(WIN32 AND BUILD_SHARED_LIBS)
  SET(plplotf95${LIB_TAG}_LIB_SRCS ${plplotf95${LIB_TAG}_LIB_SRCS} plplotf95.def)
  SET_SOURCE_FILES_PROPERTIES(${plplotf95c${LIB_TAG}_LIB_SRCS}
      PROPERTIES COMPILE_FLAGS "-DMAKINGPLDLL" )
endif(WIN32 AND BUILD_SHARED_LIBS)

# Explicitly include dependencies for sfstubsf95.f90
include(AddFileDependencies)
add_file_dependencies(sfstubsf95.f90 ${CMAKE_CURRENT_BINARY_DIR}/plflt.inc)

add_library(plplotf95${LIB_TAG} ${plplotf95${LIB_TAG}_LIB_SRCS})

target_link_libraries(plplotf95${LIB_TAG}  plplotf95c${LIB_TAG})

if(USE_RPATH)
  set_target_properties(plplotf95${LIB_TAG}
  PROPERTIES
  SOVERSION ${plplotf95_SOVERSION}
  VERSION ${plplotf95_VERSION}
  INSTALL_RPATH "${LIB_INSTALL_RPATH}"
  INSTALL_NAME_DIR "${LIB_DIR}"
  )
else(USE_RPATH)
  set_target_properties(plplotf95${LIB_TAG}
  PROPERTIES
  SOVERSION ${plplotf95_SOVERSION}
  VERSION ${plplotf95_VERSION}
  INSTALL_NAME_DIR "${LIB_DIR}"
  )
endif(USE_RPATH)

# Set the path and the suffix for the (shared) libraries
if(CYGWIN)
  if(BUILD_SHARED_LIBS)
    set(SHLIB_DIR "${BIN_DIR}")
  endif(BUILD_SHARED_LIBS)
  set(VERSION_SUFFIX "-${plplotf95_VERSION}")
else(CYGWIN)
  set(VERSION_SUFFIX "")
endif(CYGWIN)

install(TARGETS plplotf95${LIB_TAG}
ARCHIVE DESTINATION ${LIB_DIR}
LIBRARY DESTINATION ${LIB_DIR}
RUNTIME DESTINATION ${BIN_DIR}
)

# Yuk! All Makefiles are run from the top level build directory and
# so the f90 .mod files end up there rather than in the bindings/f95
# directory. Ifort and pgf90 both have a -module command line option to
# override this location, but I'm not sure how portable that?
install(
FILES ${CMAKE_BINARY_DIR}/plplot.mod ${CMAKE_BINARY_DIR}/plplotp.mod ${CMAKE_BINARY_DIR}/plplot_flt.mod
DESTINATION ${F95_MOD_DIR}
)

# Configure pkg-config *.pc file corresponding to libplplotf95${LIB_TAG}
if(PKG_CONFIG_EXECUTABLE)
  if(LIB_TAG)
    set(PC_PRECISION "double")
  else(LIB_TAG)
    set(PC_PRECISION "single")
  endif(LIB_TAG)
  # Each list element must consist of a colon-separated string with the
  # following fields which are parsed out in the foreach loop below and
  # used to configure the corresponding pkg-config *.pc file.
  # BINDING 	      	  - ENABLE_${BINDING} keeps track of whether a
  # 			    binding has been enabled (ON) or not (OFF).
  #			    Also, ${BINDING} used to determine PC_FILE_SUFFIX
  #			    which helps to determine name of configured
  #			    *.pc file.
  # PC_SHORT_NAME	  - Used in *.pc NAME: field<commit_msg>There is a different location in the build tree for PLplot fortran modules which depends on CMake version.  Adjust for this different location when installing the PLplot fortran modules.<commit_after># bindings/f95/CMakeLists.txt
### Process this file with cmake to produce Makefile
###
# Copyright (C) 2006 <NAME>
#
# This file is part of PLplot.
#
# PLplot is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; version 2 of the License.
#
# PLplot is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA

if(ENABLE_f95)

# Set the include path
include_directories(
${CMAKE_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)

# Build plflt to determine KIND for PLFLT
set(plflt_SRC
plflt.c
)

add_executable(plflt ${plflt_SRC})

get_target_property(
plflt_LOCATION
plflt
LOCATION
)

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plflt.inc
  COMMAND ${CMAKE_CURRENT_BINARY_DIR}/plflt
  DEPENDS ${plflt_LOCATION}
)

set_source_files_properties(plflt.inc PROPERTIES GENERATED ON)

## Build C part of F95 bindings
set(plplotf95c${LIB_TAG}_LIB_SRCS
plstubs.h
sc3d.c
sccont.c
scstubs.c
)

add_library(plplotf95c${LIB_TAG} ${plplotf95c${LIB_TAG}_LIB_SRCS})

target_link_libraries(plplotf95c${LIB_TAG}  plplot${LIB_TAG})

if(USE_RPATH)
  get_target_property(LIB_INSTALL_RPATH plplot${LIB_TAG} INSTALL_RPATH)
  set_target_properties(plplotf95c${LIB_TAG}
  PROPERTIES
  SOVERSION ${plplotf95_SOVERSION}
  VERSION ${plplotf95_VERSION}
  INSTALL_RPATH "${LIB_INSTALL_RPATH}"
  INSTALL_NAME_DIR "${LIB_DIR}"
  )
else(USE_RPATH)
  set_target_properties(plplotf95c${LIB_TAG}
  PROPERTIES
  SOVERSION ${plplotf95_SOVERSION}
  VERSION ${plplotf95_VERSION}
  INSTALL_NAME_DIR "${LIB_DIR}"
  )
endif(USE_RPATH)

install(TARGETS plplotf95c${LIB_TAG}
ARCHIVE DESTINATION ${LIB_DIR}
LIBRARY DESTINATION ${LIB_DIR}
RUNTIME DESTINATION ${BIN_DIR}
)


## Build fortran part of F95 bindings
set(plplotf95${LIB_TAG}_LIB_SRCS
strutil.f90
configurable.f90
sfstubsf95.f90
sfstubs.h
)

if(WIN32 AND BUILD_SHARED_LIBS)
  SET(plplotf95${LIB_TAG}_LIB_SRCS ${plplotf95${LIB_TAG}_LIB_SRCS} plplotf95.def)
  SET_SOURCE_FILES_PROPERTIES(${plplotf95c${LIB_TAG}_LIB_SRCS}
      PROPERTIES COMPILE_FLAGS "-DMAKINGPLDLL" )
endif(WIN32 AND BUILD_SHARED_LIBS)

# Explicitly include dependencies for sfstubsf95.f90
include(AddFileDependencies)
add_file_dependencies(sfstubsf95.f90 ${CMAKE_CURRENT_BINARY_DIR}/plflt.inc)

add_library(plplotf95${LIB_TAG} ${plplotf95${LIB_TAG}_LIB_SRCS})

target_link_libraries(plplotf95${LIB_TAG}  plplotf95c${LIB_TAG})

if(USE_RPATH)
  set_target_properties(plplotf95${LIB_TAG}
  PROPERTIES
  SOVERSION ${plplotf95_SOVERSION}
  VERSION ${plplotf95_VERSION}
  INSTALL_RPATH "${LIB_INSTALL_RPATH}"
  INSTALL_NAME_DIR "${LIB_DIR}"
  )
else(USE_RPATH)
  set_target_properties(plplotf95${LIB_TAG}
  PROPERTIES
  SOVERSION ${plplotf95_SOVERSION}
  VERSION ${plplotf95_VERSION}
  INSTALL_NAME_DIR "${LIB_DIR}"
  )
endif(USE_RPATH)

# Set the path and the suffix for the (shared) libraries
if(CYGWIN)
  if(BUILD_SHARED_LIBS)
    set(SHLIB_DIR "${BIN_DIR}")
  endif(BUILD_SHARED_LIBS)
  set(VERSION_SUFFIX "-${plplotf95_VERSION}")
else(CYGWIN)
  set(VERSION_SUFFIX "")
endif(CYGWIN)

install(TARGETS plplotf95${LIB_TAG}
ARCHIVE DESTINATION ${LIB_DIR}
LIBRARY DESTINATION ${LIB_DIR}
RUNTIME DESTINATION ${BIN_DIR}
)

if(CMAKE_CACHE_MAJOR_VERSION EQUAL 2 AND CMAKE_CACHE_MINOR_VERSION EQUAL 4)
  # Yuk! All Makefiles are run from the top level build directory and
  # so the f90 .mod files end up there rather than in the bindings/f95
  # directory. Ifort and pgf90 both have a -module command line option to
  # override this location, but I'm not sure how portable that?
  install(
  FILES
  ${CMAKE_BINARY_DIR}/plplot.mod
  ${CMAKE_BINARY_DIR}/plplotp.mod
  ${CMAKE_BINARY_DIR}/plplot_flt.mod
  DESTINATION ${F95_MOD_DIR}
  )
else(CMAKE_CACHE_MAJOR_VERSION EQUAL 2 AND CMAKE_CACHE_MINOR_VERSION EQUAL 4)
  # For the current cvs version of CMake, the module files are created by
  # default during the library build in the more logical bindings/f95 
  # directory.
  install(
  FILES
  ${CMAKE_BINARY_DIR}/bindings/f95/plplot.mod
  ${CMAKE_BINARY_DIR}/bindings/f95/plplotp.mod
  ${CMAKE_BINARY_DIR}/bindings/f95/plplot_flt.mod
  DESTINATION ${F95_MOD_DIR}
  )
endif(CMAKE_CACHE_MAJOR_VERSION EQUAL 2 AND CMAKE_CACHE_MINOR_VERSION EQUAL 4)

# Configure pkg-config *.pc file corresponding to libplplotf95${LIB_TAG}
if(PKG_CONFIG_EXECUTABLE)
  if(LIB_TAG)
    set(PC_PRECISION "double")
  else(LIB_TAG)
    set(PC_PRECISION "single")
  endif(LIB_TAG)
  # Each list element must consist of a colon-separated string with the
  # following fields which are parsed out in the foreach loop below and
  # used to configure the corresponding pkg-config *.pc file.
  # BINDING 	      	  - ENABLE_${BINDING} keeps track of whether a
  # 			    binding has been enabled (ON) or not (OFF).
  #			    Also, ${BINDING} used to determine PC_FILE_SUFFIX
  #			    which helps to determine name of configured
  #			    *.pc file.
  # PC_SHORT_NAME	  - Used in *.pc NAME: field
{'fraction_non_alphanumeric': 0.08787849842391823, 'fraction_numerical': 0.02273378546183972, 'mean_word_length': 5.614024005053696, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '92061', 'n_tokens_mistral': 4092, 'n_tokens_neox': 3844, 'n_words': 949}