diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ef62f3..93db438 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.24) project( fplot LANGUAGES Fortran - VERSION 1.8.1 + VERSION 1.8.2 ) # Confgiure everything diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 6fbed93..4e184ab 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -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 + $ + $ + COMMAND_EXPAND_LISTS + ) +endif() \ No newline at end of file diff --git a/fpm.toml b/fpm.toml index 327b706..b15b1f9 100644 --- a/fpm.toml +++ b/fpm.toml @@ -1,5 +1,5 @@ name = "fplot" -version = "1.8.1" +version = "1.8.2" license = "GPL-3.0" author = "Jason Christopherson" maintainer = "Jason Christopherson" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b18c695..d12978d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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( @@ -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 @@ -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 - $ + ${COLLECTIONS_LIBRARIES} + ${GEOMPACK_LIBRARIES} + ${FSTRING_LIBRARIES} $ - $ ) set_target_properties( @@ -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() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 019a11b..8eb922d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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( diff --git a/test/fortran_test_helper/CMakeLists.txt b/test/fortran_test_helper/CMakeLists.txt deleted file mode 100644 index 92cd87f..0000000 --- a/test/fortran_test_helper/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -include(FetchContent) - -# Fetch the proper content -FetchContent_Declare( - fortran_test_helper - GIT_REPOSITORY "https://github.com/jchristopherson/fortran_test_helper" - GIT_TAG main -) - -FetchContent_MakeAvailable(fortran_test_helper) - -if (WIN32) - if (BUILD_SHARED_LIBS) - add_custom_command( - TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - $ - $