@@ -761,7 +761,11 @@ void generate_cmake(const char *path, const parser::Project *parent_project) {
761
761
cmd (" set_property" )(" GLOBAL" , " PROPERTY" , " USE_FOLDERS" , " ON" ).endl ();
762
762
763
763
comment (" Create a configure-time dependency on cmake.toml to improve IDE support" );
764
- cmd (" configure_file" )(" cmake.toml" , " cmake.toml" , " COPYONLY" );
764
+ if (project.cmake_minimum_version (3 , 0 )) {
765
+ cmd (" set_property" )(" DIRECTORY" , " APPEND" , " PROPERTY" , " CMAKE_CONFIGURE_DEPENDS" , " cmake.toml" );
766
+ } else {
767
+ cmd (" configure_file" )(" cmake.toml" , " cmake.toml" , " COPYONLY" );
768
+ }
765
769
766
770
if (project.project_msvc_runtime != parser::msvc_last) {
767
771
cmd (" if" )(" NOT" , " DEFINED" , " CMAKE_MSVC_RUNTIME_LIBRARY" );
@@ -785,12 +789,14 @@ void generate_cmake(const char *path, const parser::Project *parent_project) {
785
789
create_file (cmkr_include, resources::cmkr);
786
790
}
787
791
} else {
788
- // clang-format off
789
792
comment (" Create a configure-time dependency on cmake.toml to improve IDE support" );
790
793
cmd (" if" )(" CMKR_ROOT_PROJECT" );
794
+ if (project.cmake_minimum_version (3 , 0 )) {
795
+ cmd (" set_property" )(" DIRECTORY" , " APPEND" , " PROPERTY" , " CMAKE_CONFIGURE_DEPENDS" , " cmake.toml" );
796
+ } else {
791
797
cmd (" configure_file" )(" cmake.toml" , " cmake.toml" , " COPYONLY" );
798
+ }
792
799
cmd (" endif" )().endl ();
793
- // clang-format on
794
800
}
795
801
796
802
// TODO: remove support and replace with global compile-features
0 commit comments