Skip to content

Commit 4b7a857

Browse files
committed
cmake: Fix X_LIBRARY option for specifying name of 3rd party library.
Declaring it as PATH option was incorrect because then the option hanlding logic resolved it to an absolute path which is not what we want for this option which should be either a plain library name or a path relative to X_LIBRARY_DIR.
1 parent b0bc490 commit 4b7a857

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

cdk/cmake/config_options.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ function(add_config_option OPT TYPE)
100100
set(${OPT} $ENV{${OPT}})
101101
endif()
102102

103+
if(DEFINED ${OPT} AND NOT "${${OPT}}" STREQUAL "${default_value}")
104+
# message(STATUS "Option ${OPT} set explictily to: ${${OPT}}")
105+
set(${OPT}_SET true CACHE INTERNAL "")
106+
endif()
107+
103108
if(NOT DEFINED ${OPT} AND DEFINED default_value)
104109
set(${OPT} ${default_value})
105110
endif()
@@ -134,7 +139,7 @@ function(show_config_options)
134139

135140
foreach(opt ${CONFIG_OPTIONS})
136141

137-
if(NOT "${${opt}_ADVANCED}")
142+
if(${opt}_SET OR NOT "${${opt}_ADVANCED}")
138143
message(": ${opt}: ${${opt}}")
139144
message("${${opt}_DOC}\n")
140145
endif()

cdk/cmake/dependency.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function(add_ext NAME HEADER)
124124
"Path to ${EXT_LIB} bin directory."
125125
)
126126

127-
add_config_option(${EXT_LIB}_LIBRARY PATH ADVANCED
127+
add_config_option(${EXT_LIB}_LIBRARY STRING ADVANCED
128128
"${EXT_LIB} library name"
129129
)
130130

0 commit comments

Comments
 (0)