Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.24)
project(
fplot
LANGUAGES Fortran
VERSION 1.8.9
VERSION 1.8.10
)

# Confgiure everything
Expand Down
9 changes: 9 additions & 0 deletions configure/template.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
@PACKAGE_INIT@

# For static libraries, consumers need to find dependencies
if(NOT BUILD_SHARED_LIBS)
include(CMakeFindDependencyMacro)
find_dependency(ferror QUIET)
find_dependency(collections QUIET)
find_dependency(geompack QUIET)
find_dependency(fstring QUIET)
endif()

if(NOT TARGET "@PROJECT_NAME@::@PROJECT_NAME@")
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake")
endif()
5 changes: 1 addition & 4 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
find_package(fstring QUIET)

# Example 1
add_executable(generic_2d_plot generic_2d_plot.f90)
target_link_libraries(generic_2d_plot fplot)
Expand Down Expand Up @@ -131,7 +129,6 @@ target_link_libraries(arrow_example fplot)
# Example 33
add_executable(custom_colormap_example custom_colormap_example.f90)
target_link_libraries(custom_colormap_example fplot)
target_link_libraries(custom_colormap_example forcolormap)

# Example 34
add_executable(variable_point_size_2d_example variable_point_size_2d_example.f90)
Expand All @@ -151,7 +148,7 @@ target_link_libraries(margins_example fplot)

# Example 38
add_executable(box_whisker_example box_whisker_example.f90)
target_link_libraries(box_whisker_example fplot fstring::fstring)
target_link_libraries(box_whisker_example fplot)

# Example 39
add_executable(jitter_plot_example jitter_plot_example.f90)
Expand Down
2 changes: 1 addition & 1 deletion fpm.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "fplot"
version = "1.8.9"
version = "1.8.10"
license = "GPL-3.0"
author = "Jason Christopherson"
maintainer = "Jason Christopherson"
Expand Down
38 changes: 30 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ target_link_libraries(
${PROJECT_NAME}
PUBLIC
${FERROR_LIBRARIES}
)
target_link_libraries(
${PROJECT_NAME}
PRIVATE
${COLLECTIONS_LIBRARIES}
${GEOMPACK_LIBRARIES}
${FSTRING_LIBRARIES}
Expand Down Expand Up @@ -167,18 +163,44 @@ install(
)
install(DIRECTORY ${FPLOT_MOD_DIR} DESTINATION ${CMAKE_INSTALL_MODULEDIR})

if (${BUILD_FERROR} AND ${BUILD_SHARED_LIBS})
# For static libraries, install dependency libraries
if(NOT BUILD_SHARED_LIBS)
# Install fetched dependency libraries if they were built
if(${BUILD_FERROR})
install(TARGETS ${FERROR_LIBRARIES}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
if(${BUILD_COLLECTIONS})
install(TARGETS ${COLLECTIONS_LIBRARIES}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
if(${BUILD_GEOMPACK})
install(TARGETS ${GEOMPACK_LIBRARIES}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
if(${BUILD_FSTRING})
install(TARGETS ${FSTRING_LIBRARIES}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
endif()

# For shared libraries, install runtime artifacts
if(${BUILD_FERROR} AND ${BUILD_SHARED_LIBS})
install(IMPORTED_RUNTIME_ARTIFACTS ${FERROR_LIBRARIES})
endif()

if (${BUILD_COLLECTIONS} AND ${BUILD_SHARED_LIBS})
if(${BUILD_COLLECTIONS} AND ${BUILD_SHARED_LIBS})
install(IMPORTED_RUNTIME_ARTIFACTS ${COLLECTIONS_LIBRARIES})
endif()

if (${BUILD_GEOMPACK} AND ${BUILD_SHARED_LIBS})
if(${BUILD_GEOMPACK} AND ${BUILD_SHARED_LIBS})
install(IMPORTED_RUNTIME_ARTIFACTS ${GEOMPACK_LIBRARIES})
endif()

if (${BUILD_FSTRING} AND ${BUILD_SHARED_LIBS})
if(${BUILD_FSTRING} AND ${BUILD_SHARED_LIBS})
install(IMPORTED_RUNTIME_ARTIFACTS ${FSTRING_LIBRARIES})
endif()
Loading