Skip to content

Commit 542564a

Browse files
committed
Check toolchain in config file.
1 parent abd69a4 commit 542564a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
@PACKAGE_INIT@
22

3+
# How this Matplot++ installation was built
34
set(MATPLOT_BUILT_SHARED "@BUILD_SHARED_LIBS@")
5+
set(MATPLOT_BUILT_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
6+
set(MATPLOT_BUILT_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
7+
8+
# Check if it matches the current toolchain
9+
if (NOT CMAKE_CXX_COMPILER_VERSION STREQUAL MATPLOT_BUILT_CXX_COMPILER_ID)
10+
message(WARNING "This installation of Matplot++ was built with ${MATPLOT_BUILT_CXX_COMPILER_ID}.")
11+
endif()
12+
13+
# Find dependencies
414
if(NOT ${MATPLOT_BUILT_SHARED})
515
include(CMakeFindDependencyMacro)
6-
716
list(APPEND CMAKE_MODULE_PATH ${MATPLOT_CONFIG_INSTALL_DIR})
817
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
918
find_dependency(Filesystem COMPONENTS Experimental Final)
1019
list(POP_BACK CMAKE_MODULE_PATH)
1120
endif()
1221

22+
# Create imported targets
1323
include("${CMAKE_CURRENT_LIST_DIR}/Matplot++Targets.cmake")
1424
check_required_components(Matplot++)

0 commit comments

Comments
 (0)