Skip to content

Commit 3ea2ae0

Browse files
author
Louis Fréneau
committed
Fix build error when not using preset
1 parent b6b3c96 commit 3ea2ae0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CMakePresets.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"generator": "Unix Makefiles",
1313
"binaryDir": "${sourceDir}/_build/${presetName}",
1414
"cacheVariables": {
15-
"UVG_LOG_LEVEL": "INFO",
15+
"UVG_LOG_LEVEL_PRESET": "INFO",
1616
"BUILD_SHARED_LIBS": true,
1717
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
1818
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
@@ -27,7 +27,7 @@
2727
"name": "Release",
2828
"inherits": "base-config",
2929
"cacheVariables": {
30-
"UVG_LOG_LEVEL": "INFO",
30+
"UVG_LOG_LEVEL_PRESET": "INFO",
3131
"CMAKE_BUILD_TYPE": "Release",
3232
"ENABLE_TESTING": true,
3333
"ENABLE_CI_TESTING": true,
@@ -38,7 +38,7 @@
3838
"name": "RelWithDebInfo",
3939
"inherits": "base-config",
4040
"cacheVariables": {
41-
"UVG_LOG_LEVEL": "DEBUG",
41+
"UVG_LOG_LEVEL_PRESET": "DEBUG",
4242
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
4343
"ENABLE_TESTING": true,
4444
"ENABLE_CI_TESTING": true
@@ -48,7 +48,7 @@
4848
"name": "Debug",
4949
"inherits": "base-config",
5050
"cacheVariables": {
51-
"UVG_LOG_LEVEL": "DEBUG",
51+
"UVG_LOG_LEVEL_PRESET": "DEBUG",
5252
"CMAKE_BUILD_TYPE": "Debug",
5353
"ENABLE_TESTING": true,
5454
"ENABLE_CI_TESTING": true

src/lib/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ message(DEBUG "./src/lib/cmake")
22

33
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include)
44

5-
add_compile_definitions(UVG_LOG_LEVEL=LogLevel::${UVG_LOG_LEVEL})
5+
if(UVG_LOG_LEVEL_PRESET)
6+
add_compile_definitions(UVG_LOG_LEVEL=LogLevel::${UVG_LOG_LEVEL_PRESET})
7+
endif()
68

79
configure_file(version.cpp.in version.cpp)
810

0 commit comments

Comments
 (0)