Skip to content

Commit 912a739

Browse files
Update Experimental CMAKE_IMPORT_STD Flags
In order to use the Experimental CMAKE_IMPORT_STD flags, the experimental guid was hard-coded into the cmake file. CMake has however updated this Guid twice now, making it impossible to use the Module functionality with newer cmake versions. I have added the corresponding Guids with some "Ifs" and "Elses" to match the CMake version number being used in order to make it a bit more resilient.
1 parent 6225211 commit 912a739

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
cmake_minimum_required(VERSION 3.14...3.29)
1+
cmake_minimum_required(VERSION 3.14...4.2)
22

3-
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.29.20240416")
3+
if(NOT CMAKE_EXPERIMENTAL_CXX_STD AND NOT CMAKE_CXX_MODULE_STD)
4+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30" AND VERSION_LESS_EQUAL "4.0")
45
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "0e5b6991-d74f-4b3d-a41c-cf096e0b2508")
5-
set(CMAKE_CXX_MODULE_STD 1)
6+
7+
elseif(CMAKE_VERSION VERSION_GREATER_EQUAL "4.0" AND VERSION_LESS "4.0.3")
8+
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "a9e1cf81-9932-4810-974b-6eccaf14e457")
9+
10+
elseif(CMAKE_VERSION VERSION_GREATER_EQUAL "4.0.3" AND VERSION LESS "4.3")
11+
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "d0edc3af-4c50-42ea-a356-e2862fe7a444")
12+
set(CMAKE_CXX_MODULE_STD 1)
13+
endif()
614
endif()
715

816
# When updating to a newer version of CMake, see if we can use the following

0 commit comments

Comments
 (0)