Skip to content

Commit 5c13c5a

Browse files
Clean up
1 parent 40ff3a5 commit 5c13c5a

File tree

6 files changed

+55
-49
lines changed

6 files changed

+55
-49
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.24)
33
project(
44
fplot
55
LANGUAGES Fortran
6-
VERSION 1.8.1
6+
VERSION 1.8.2
77
)
88

99
# Confgiure everything

examples/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,14 @@ target_link_libraries(correlation_plot_example fplot)
146146
# Example 37
147147
add_executable(margins_example margins_example.f90)
148148
target_link_libraries(margins_example fplot)
149+
150+
if (${BUILD_SHARED_LIBS} AND WIN32)
151+
add_custom_command(
152+
TARGET generic_2d_plot
153+
POST_BUILD
154+
COMMAND ${CMAKE_COMMAND} -E copy
155+
$<TARGET_RUNTIME_DLLS:generic_2d_plot>
156+
$<TARGET_FILE_DIR:generic_2d_plot>
157+
COMMAND_EXPAND_LISTS
158+
)
159+
endif()

fpm.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "fplot"
2-
version = "1.8.1"
2+
version = "1.8.2"
33
license = "GPL-3.0"
44
author = "Jason Christopherson"
55
maintainer = "Jason Christopherson"

src/CMakeLists.txt

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ set(FPLOT_SOURCES ${FPLOT_SOURCES} PARENT_SCOPE)
4949
include(FetchContent)
5050
find_package(ferror QUIET)
5151
find_package(collections QUIET)
52+
find_package(geompack QUIET)
53+
find_package(fstring QUIET)
5254
if (NOT ferror_FOUND)
5355
message(STATUS "FERROR could not be found. A reference version will be employed.")
5456
FetchContent_Declare(
@@ -78,12 +80,35 @@ else()
7880
set(BUILD_COLLECTIONS FALSE)
7981
endif()
8082

81-
FetchContent_Declare(
82-
geompack
83-
GIT_REPOSITORY "https://github.com/jchristopherson/geompack"
84-
GIT_TAG main
85-
)
86-
FetchContent_MakeAvailable(geompack)
83+
if (NOT geompack_FOUND)
84+
message(STATUS "GEOMPACK could not be found. A reference version will be employed.")
85+
FetchContent_Declare(
86+
geompack
87+
GIT_REPOSITORY "https://github.com/jchristopherson/geompack"
88+
GIT_TAG main
89+
)
90+
FetchContent_MakeAvailable(geompack)
91+
set(GEOMPACK_LIBRARIES geompack)
92+
set(BUILD_GEOMPACK TRUE)
93+
else()
94+
set(GEOMPACK_LIBRARIES geompack::geompack)
95+
set(BUILD_GEOMPACK FALSE)
96+
endif()
97+
98+
if (NOT fstring_FOUND)
99+
message(STATUS "FSTRING could not be found. A reference version will be employed.")
100+
FetchContent_Declare(
101+
fstring
102+
GIT_REPOSITORY "https://github.com/jchristopherson/fstring"
103+
GIT_TAG main
104+
)
105+
FetchContent_MakeAvailable(fstring)
106+
set(FSTRING_LIBRARIES fstring)
107+
set(BUILD_FSTRING TRUE)
108+
else()
109+
set(FSTRING_LIBRARIES fstring::fstring)
110+
set(BUILD_FSTRING FALSE)
111+
endif()
87112

88113
FetchContent_Declare(
89114
forcolormap
@@ -92,27 +117,20 @@ FetchContent_Declare(
92117
)
93118
FetchContent_MakeAvailable(forcolormap)
94119

95-
FetchContent_Declare(
96-
fstring
97-
GIT_REPOSITORY "https://github.com/jchristopherson/fstring"
98-
GIT_TAG main
99-
)
100-
FetchContent_MakeAvailable(fstring)
101-
102120
# Build
103121
add_library(${PROJECT_NAME} ${FPLOT_SOURCES})
104122
target_link_libraries(
105123
${PROJECT_NAME}
106124
PUBLIC
107125
${FERROR_LIBRARIES}
108-
${COLLECTIONS_LIBRARIES}
109126
)
110127
target_link_libraries(
111128
${PROJECT_NAME}
112129
PRIVATE
113-
$<BUILD_INTERFACE:geompack>
130+
${COLLECTIONS_LIBRARIES}
131+
${GEOMPACK_LIBRARIES}
132+
${FSTRING_LIBRARIES}
114133
$<BUILD_INTERFACE:forcolormap>
115-
$<BUILD_INTERFACE:fstring>
116134
)
117135

118136
set_target_properties(
@@ -155,3 +173,10 @@ if (${BUILD_COLLECTIONS} AND ${BUILD_SHARED_LIBS})
155173
install(IMPORTED_RUNTIME_ARTIFACTS ${COLLECTIONS_LIBRARIES})
156174
endif()
157175

176+
if (${BUILD_GEOMPACK} AND ${BUILD_SHARED_LIBS})
177+
install(IMPORTED_RUNTIME_ARTIFACTS ${GEOMPACK_LIBRARIES})
178+
endif()
179+
180+
if (${BUILD_FSTRING} AND ${BUILD_SHARED_LIBS})
181+
install(IMPORTED_RUNTIME_ARTIFACTS ${FSTRING_LIBRARIES})
182+
endif()

test/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
add_subdirectory(fortran_test_helper)
2-
31
set(fplot_test_sources
42
fplot_test.f90
53
fplot_3d_test.f90
64
fplot_arrow_test.f90
75
)
86

9-
find_package(fotran_test_helper QUIET)
7+
find_package(fortran_test_helper QUIET)
108
if (NOT fortran_test_helper_FOUND)
119
include(FetchContent)
1210
FetchContent_Declare(

test/fortran_test_helper/CMakeLists.txt

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)