Skip to content
Merged
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.1
VERSION 1.8.2
)

# Confgiure everything
Expand Down
11 changes: 11 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,14 @@ target_link_libraries(correlation_plot_example fplot)
# Example 37
add_executable(margins_example margins_example.f90)
target_link_libraries(margins_example fplot)

if (${BUILD_SHARED_LIBS} AND WIN32)
add_custom_command(
TARGET generic_2d_plot
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_RUNTIME_DLLS:generic_2d_plot>
$<TARGET_FILE_DIR:generic_2d_plot>
COMMAND_EXPAND_LISTS
)
endif()
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.1"
version = "1.8.2"
license = "GPL-3.0"
author = "Jason Christopherson"
maintainer = "Jason Christopherson"
Expand Down
57 changes: 41 additions & 16 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ set(FPLOT_SOURCES ${FPLOT_SOURCES} PARENT_SCOPE)
include(FetchContent)
find_package(ferror QUIET)
find_package(collections QUIET)
find_package(geompack QUIET)
find_package(fstring QUIET)
if (NOT ferror_FOUND)
message(STATUS "FERROR could not be found. A reference version will be employed.")
FetchContent_Declare(
Expand Down Expand Up @@ -78,12 +80,35 @@ else()
set(BUILD_COLLECTIONS FALSE)
endif()

FetchContent_Declare(
geompack
GIT_REPOSITORY "https://github.com/jchristopherson/geompack"
GIT_TAG main
)
FetchContent_MakeAvailable(geompack)
if (NOT geompack_FOUND)
message(STATUS "GEOMPACK could not be found. A reference version will be employed.")
FetchContent_Declare(
geompack
GIT_REPOSITORY "https://github.com/jchristopherson/geompack"
GIT_TAG main
)
FetchContent_MakeAvailable(geompack)
set(GEOMPACK_LIBRARIES geompack)
set(BUILD_GEOMPACK TRUE)
else()
set(GEOMPACK_LIBRARIES geompack::geompack)
set(BUILD_GEOMPACK FALSE)
endif()

if (NOT fstring_FOUND)
message(STATUS "FSTRING could not be found. A reference version will be employed.")
FetchContent_Declare(
fstring
GIT_REPOSITORY "https://github.com/jchristopherson/fstring"
GIT_TAG main
)
FetchContent_MakeAvailable(fstring)
set(FSTRING_LIBRARIES fstring)
set(BUILD_FSTRING TRUE)
else()
set(FSTRING_LIBRARIES fstring::fstring)
set(BUILD_FSTRING FALSE)
endif()

FetchContent_Declare(
forcolormap
Expand All @@ -92,27 +117,20 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(forcolormap)

FetchContent_Declare(
fstring
GIT_REPOSITORY "https://github.com/jchristopherson/fstring"
GIT_TAG main
)
FetchContent_MakeAvailable(fstring)

# Build
add_library(${PROJECT_NAME} ${FPLOT_SOURCES})
target_link_libraries(
${PROJECT_NAME}
PUBLIC
${FERROR_LIBRARIES}
${COLLECTIONS_LIBRARIES}
)
target_link_libraries(
${PROJECT_NAME}
PRIVATE
$<BUILD_INTERFACE:geompack>
${COLLECTIONS_LIBRARIES}
${GEOMPACK_LIBRARIES}
${FSTRING_LIBRARIES}
$<BUILD_INTERFACE:forcolormap>
$<BUILD_INTERFACE:fstring>
)

set_target_properties(
Expand Down Expand Up @@ -155,3 +173,10 @@ if (${BUILD_COLLECTIONS} AND ${BUILD_SHARED_LIBS})
install(IMPORTED_RUNTIME_ARTIFACTS ${COLLECTIONS_LIBRARIES})
endif()

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

if (${BUILD_FSTRING} AND ${BUILD_SHARED_LIBS})
install(IMPORTED_RUNTIME_ARTIFACTS ${FSTRING_LIBRARIES})
endif()
4 changes: 1 addition & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
add_subdirectory(fortran_test_helper)

set(fplot_test_sources
fplot_test.f90
fplot_3d_test.f90
fplot_arrow_test.f90
)

find_package(fotran_test_helper QUIET)
find_package(fortran_test_helper QUIET)
if (NOT fortran_test_helper_FOUND)
include(FetchContent)
FetchContent_Declare(
Expand Down
28 changes: 0 additions & 28 deletions test/fortran_test_helper/CMakeLists.txt

This file was deleted.