Skip to content

Commit d75ccee

Browse files
committed
add cmake 3.10 support
1 parent d83e3f1 commit d75ccee

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
### Matplot++ ###
33
#######################################################
44
# Project information
5-
cmake_minimum_required(VERSION 3.14)
5+
cmake_minimum_required(VERSION 3.10)
66
project(matplotplusplus VERSION 1.0.1)
77
set(CMAKE_CXX_STANDARD 17)
88

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

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

120122
# Always include CPack at last
121123
include(CPack)
122-
endif ()
124+
endif ()

matplot++-config.cmake.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ if(NOT ${MATPLOT_BUILT_SHARED})
66

77
list(APPEND CMAKE_MODULE_PATH ${MATPLOT_CONFIG_INSTALL_DIR})
88
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
9-
find_dependency(Filesystem)
10-
list(POP_BACK CMAKE_MODULE_PATH)
9+
find_dependency(Filesystem COMPONENTS Final Experimental)
10+
list(REMOVE_ITEM CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
1111
endif()
1212

1313
include("${CMAKE_CURRENT_LIST_DIR}/Matplot++Targets.cmake")
14-
check_required_components(Matplot++)
14+
check_required_components(Matplot++)

source/matplot/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
find_package(Filesystem REQUIRED)
1+
find_package(Filesystem COMPONENTS Final Experimental REQUIRED)
22

33
add_library(matplot
44
matplot.h
@@ -241,4 +241,4 @@ if (BUILD_INSTALLER)
241241
NAMESPACE Matplot++::
242242
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Matplot++
243243
)
244-
endif()
244+
endif()

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
add_subdirectory(generate_examples)
2-
add_subdirectory(backends)
2+
add_subdirectory(backends)
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
find_package(Filesystem REQUIRED)
2-
add_executable(generate_examples main.cpp)
3-
target_link_libraries(generate_examples std::filesystem)
4-
target_compile_features(generate_examples PRIVATE cxx_std_17)
1+
find_package(Filesystem COMPONENTS Final Experimental REQUIRED)
2+
if (NOT CXX_FILESYSTEM_IS_EXPERIMENTAL)
3+
add_executable(generate_examples main.cpp)
4+
target_link_libraries(generate_examples std::filesystem)
5+
target_compile_features(generate_examples PRIVATE cxx_std_17)
6+
endif()

0 commit comments

Comments
 (0)