diff --git a/cmake/cmkr.cmake b/cmake/cmkr.cmake index 06d2cbb..4bf9c40 100644 --- a/cmake/cmkr.cmake +++ b/cmake/cmkr.cmake @@ -2,15 +2,12 @@ include_guard() # Disable cmkr if no cmake.toml file is found if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cmake.toml) - message(STATUS "[cmkr] Not found: ${CMAKE_CURRENT_SOURCE_DIR}/cmake.toml") + message(AUTHOR_WARNING "[cmkr] Not found: ${CMAKE_CURRENT_SOURCE_DIR}/cmake.toml") macro(cmkr) endmacro() return() endif() -# Add a build-time dependency on the contents of cmake.toml to regenerate the CMakeLists.txt when modified -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake.toml ${CMAKE_CURRENT_BINARY_DIR}/cmake.toml COPYONLY) - # Helper macro to execute a process (COMMAND_ERROR_IS_FATAL ANY is 3.19 and higher) macro(cmkr_exec) execute_process(COMMAND ${ARGV} RESULT_VARIABLE CMKR_EXEC_RESULT) diff --git a/src/cmkrlib/gen.cpp b/src/cmkrlib/gen.cpp index 7f0faef..f16a293 100644 --- a/src/cmkrlib/gen.cpp +++ b/src/cmkrlib/gen.cpp @@ -334,8 +334,11 @@ int generate_cmake(const char *path, bool root) { } }; - comment("This file was generated automatically by cmkr.").endl(); // TODO: add link with proper documentation + comment("This file was generated automatically by cmkr.").endl(); + + comment("Create a configure-time dependency on cmake.toml to improve IDE support"); + cmd("configure_file")("cmake.toml", "cmake.toml", "COPYONLY").endl(); cmake::CMake cmake(path, false);