Skip to content
Closed
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
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
### Matplot++ ###
#######################################################
# Project information
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.10)
project(matplotplusplus VERSION 1.0.1)
set(CMAKE_CXX_STANDARD 17)

Expand All @@ -14,7 +14,9 @@ include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
message("CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}")
option(CPM_USE_LOCAL_PACKAGES "Try `find_package` before downloading dependencies" ON)
include(cmake/CPM.cmake)
if (NOT ${CMAKE_VERSION} VERSION_LESS "3.14.0")
include(cmake/CPM.cmake)
endif ()

# Check if this is a master project or a subdirectory of another project
if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
Expand Down Expand Up @@ -119,4 +121,4 @@ if (BUILD_INSTALLER AND BUILD_PACKAGE)

# Always include CPack at last
include(CPack)
endif ()
endif ()
6 changes: 3 additions & 3 deletions matplot++-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ if(NOT ${MATPLOT_BUILT_SHARED})

list(APPEND CMAKE_MODULE_PATH ${MATPLOT_CONFIG_INSTALL_DIR})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
find_dependency(Filesystem)
list(POP_BACK CMAKE_MODULE_PATH)
find_dependency(Filesystem COMPONENTS Final Experimental)
list(REMOVE_ITEM CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
endif()

include("${CMAKE_CURRENT_LIST_DIR}/Matplot++Targets.cmake")
check_required_components(Matplot++)
check_required_components(Matplot++)
4 changes: 2 additions & 2 deletions source/matplot/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
find_package(Filesystem REQUIRED)
find_package(Filesystem COMPONENTS Final Experimental REQUIRED)

add_library(matplot
matplot.h
Expand Down Expand Up @@ -241,4 +241,4 @@ if (BUILD_INSTALLER)
NAMESPACE Matplot++::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Matplot++
)
endif()
endif()
10 changes: 6 additions & 4 deletions test/generate_examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
find_package(Filesystem REQUIRED)
add_executable(generate_examples main.cpp)
target_link_libraries(generate_examples std::filesystem)
target_compile_features(generate_examples PRIVATE cxx_std_17)
find_package(Filesystem COMPONENTS Final Experimental REQUIRED)
if (NOT CXX_FILESYSTEM_IS_EXPERIMENTAL)
add_executable(generate_examples main.cpp)
target_link_libraries(generate_examples std::filesystem)
target_compile_features(generate_examples PRIVATE cxx_std_17)
endif()