@@ -79,7 +79,6 @@ BUILD_DIR := build
79
79
80
80
# Don't change these unless you know what you are doing.
81
81
BUILD_CONANINFO := ${BUILD_DIR}/conanbuildinfo.txt
82
- BUILD_CMAKECACHE := ${BUILD_DIR}/CMakeCache.txt
83
82
BUILD_LOCKFILE := ${BUILD_DIR}/conan.lock
84
83
85
84
# Default Conan build policy to use when installing Conan dependencies
@@ -202,8 +201,7 @@ ifeq (${BUILD_IN_SOURCE}, true)
202
201
$(call print_help_target, uneditable, "instruct Conan to use local cache")
203
202
echo
204
203
$(call print_help_target, all, "build the package", "[in-source]")
205
- $(call print_help_target, conan, "configure Conan and install dependencies", "[in-source]")
206
- $(call print_help_target, configure, "configure CMake package", "[in-source]")
204
+ $(call print_help_target, configure, "install dependencies and configure package", "[in-source]")
207
205
$(call print_help_target, test, "run CMake tests if they are available", "[in-source]")
208
206
$(call print_help_target, export-pkg, "export build artifacts to Conan cache", "[in-source]")
209
207
ifeq (${CLEAN_SOURCE_DIR}, true)
@@ -423,13 +421,16 @@ clean:
423
421
#
424
422
rm -rf " ${BUILD_DIR} "
425
423
rm -rf __pycache__
424
+ rm -f CMakeUserPresets.json
425
+ rm -f compile_commands.json
426
+ rm -f graph_info.json
426
427
ifeq (${CLEAN_SOURCE_DIR}, true)
427
428
[ "${SOURCE_DIR}" != "." ] && rm -rf "${SOURCE_DIR}"
428
429
endif
429
430
430
431
ifeq (${BUILD_IN_SOURCE}, false)
431
- .PHONY : all conan configure test export-pkg
432
- all conan configure test export-pkg ${SOURCE_DIR} ${SOURCE_CMAKELISTS} ${BUILD_CONANINFO} ${BUILD_CMAKECACHE } :
432
+ .PHONY : all configure test export-pkg
433
+ all configure test export-pkg ${SOURCE_DIR} ${SOURCE_CMAKELISTS} ${BUILD_CONANINFO} :
433
434
@echo " Error: [in-source] targets are not supported for this package."
434
435
@echo " Note: please use [conan-cache] targets, such as 'package'."
435
436
exit 1
@@ -440,11 +441,9 @@ all: ${BUILD_CONANINFO} | ${SOURCE_DIR}
440
441
#
441
442
conan build . --source-folder=" ${SOURCE_DIR} " --install-folder=" ${BUILD_DIR} "
442
443
443
- .PHONY : conan
444
- conan : ${BUILD_CONANINFO}
445
-
446
444
.PHONY : configure
447
- configure : ${BUILD_CMAKECACHE}
445
+ configure : ${BUILD_CONANINFO}
446
+ ln -rsf " $$ (dirname $$ (dirname $$ (jq -r '.include[0]' CMakeUserPresets.json)))/compile_commands.json"
448
447
449
448
.PHONY : test
450
449
test :
@@ -481,15 +480,11 @@ ${SOURCE_DIR}:
481
480
482
481
${SOURCE_CMAKELISTS} : | ${SOURCE_DIR}
483
482
484
- ${BUILD_CONANINFO} : ${SOURCE_CONANFILE} ${BUILD_LOCKFILE}
485
- # Install package dependencies and prepare in-source build.
483
+ ${BUILD_CONANINFO} : ${SOURCE_CONANFILE} ${BUILD_LOCKFILE} ${SOURCE_CMAKELISTS}
484
+ # Install package dependencies and configure in-source build.
486
485
#
487
486
mkdir -p " ${BUILD_DIR} "
488
487
conan install . ${PACKAGE_FQN} --install-folder=" ${BUILD_DIR} " --build=${BUILD_POLICY} ${ALL_OPTIONS}
489
- touch ${BUILD_CONANINFO}
490
-
491
- ${BUILD_CMAKECACHE} : ${SOURCE_CMAKELISTS} ${BUILD_CONANINFO}
492
- # Configure in-source build with CMake.
493
- #
494
488
conan build --configure . --source-folder=" ${SOURCE_DIR} " --install-folder=" ${BUILD_DIR} "
489
+ touch ${BUILD_CONANINFO}
495
490
endif
0 commit comments