From 649ed3897345837fca0fb0dca441cf57ab05f226 Mon Sep 17 00:00:00 2001 From: Franziskus Kiefer Date: Wed, 30 Nov 2022 15:51:39 +0100 Subject: [PATCH] copy default config in cmake if not present --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc217e83..0887b0fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,14 @@ set(hacl_VERSION_TWEAK "") # This file must be generated before running cmake with ./mach.py --configure # If the build is invoked through ./mach.py, a separate configuration is not # needed. -include(build/config.cmake) +# If the file is not present, i.e. cmake was invoked directly, we copy the default +# config from config/default_config.cmake +if(NOT EXISTS ${PROJECT_SOURCE_DIR}/build/config.cmake) + configure_file(${PROJECT_SOURCE_DIR}/config/default_config.cmake ${PROJECT_SOURCE_DIR}/build/config.cmake COPYONLY) +endif() + +# Now include the config. +include(${PROJECT_SOURCE_DIR}/build/config.cmake) # Constants used throughout hacl and the build. include(config/constants.cmake)