File tree 2 files changed +7
-13
lines changed
2 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -7,22 +7,19 @@ BUILD_DIR := build
7
7
# The build type must be synchronized between Conan (host build type)
8
8
# and CMake, otherwise you will get strange and unhelpful errors.
9
9
BUILD_TYPE := Release
10
+ CMAKE_BUILD_TYPE := $(shell echo ${BUILD_TYPE} | tr '[:upper:]' '[:lower:]')
10
11
11
12
# This is the output that Conan generates when using
12
13
# `CMakeToolchain` generator AND the `cmake_layout` layout.
13
- TOOLCHAIN_FILE := ${BUILD_DIR}/generators/conan_toolchain.cmake
14
+ TOOLCHAIN_FILE := ${BUILD_DIR}/${BUILD_TYPE}/ generators/conan_toolchain.cmake
14
15
15
16
.PHONY : all clean
16
17
all : ${TOOLCHAIN_FILE}
17
- cmake --build ${BUILD_DIR }
18
+ cmake --build --preset= ${CMAKE_BUILD_TYPE }
18
19
19
20
${TOOLCHAIN_FILE} :
20
21
conan install . --build=missing --install-folder=${BUILD_DIR} -s:h build_type=${BUILD_TYPE}
21
- cmake -B ${BUILD_DIR} -S . \
22
- -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \
23
- -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
24
- -DCMAKE_EXPORT_COMPILE_COMMANDS=1
25
- cmake --build ${BUILD_DIR}
22
+ cmake --preset=${CMAKE_BUILD_TYPE} -DCMAKE_EXPORT_COMPILE_COMMANDS=1
26
23
27
24
clean :
28
25
-rm -r ${BUILD_DIR}
Original file line number Diff line number Diff line change @@ -7,22 +7,19 @@ BUILD_DIR := build
7
7
# The build type must be synchronized between Conan (host build type)
8
8
# and CMake, otherwise you will get strange and unhelpful errors.
9
9
BUILD_TYPE := Release
10
+ CMAKE_BUILD_TYPE := $(shell echo ${BUILD_TYPE} | tr '[:upper:]' '[:lower:]')
10
11
11
12
# This is the output that Conan generates when using
12
13
# `CMakeToolchain` generator AND the `cmake_layout` layout.
13
14
TOOLCHAIN_FILE := ${BUILD_DIR}/generators/conan_toolchain.cmake
14
15
15
16
.PHONY : all clean
16
17
all : ${TOOLCHAIN_FILE}
17
- cmake --build ${BUILD_DIR }
18
+ cmake --build --preset= ${CMAKE_BUILD_TYPE }
18
19
19
20
${TOOLCHAIN_FILE} :
20
21
conan install . --build=missing --install-folder=${BUILD_DIR} -s:h build_type=${BUILD_TYPE}
21
- cmake -B ${BUILD_DIR} -S . \
22
- -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \
23
- -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
24
- -DCMAKE_EXPORT_COMPILE_COMMANDS=1
25
- cmake --build ${BUILD_DIR}
22
+ cmake --preset=${CMAKE_BUILD_TYPE} -DCMAKE_EXPORT_COMPILE_COMMANDS=1
26
23
27
24
clean :
28
25
-rm -r ${BUILD_DIR}
You can’t perform that action at this time.
0 commit comments