<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p> Hi everyone,</p>
<p><br>
</p>
<p>i have the following code:</p>
<pre>set(ALL_LIBS "glad;glfw")</pre>
<pre># WITH_LIB_GLAD
option(WITH_LIB_GLAD 1)
option(WITH_LIB_GLAD_EXAMPLE_BASIC "Build the basic Glad example (default:0)" 1)
option(WITH_LIB_GLAD_EXAMPLE_SECOND "Build the second Glad example (default:0)" 1)
# WITH_LIB_GLFW
option(WITH_LIB_GLFW 1)
option(WITH_LIB_GLFW_EXAMPLE_CBASIC "Build the basic GLFW C example (default:1)" 1)
option(WITH_LIB_GLFW_EXAMPLE_CPPBASIC "Build the basic GLFW C example (default:1)" 1)</pre>
<p><br>
</p>
<pre>################
## bsBuildLib ##
################
macro(bsBuildLibs libs)
foreach(lib ${libs})
message(STATUS "Searching incude path for lib: <${lib}>")
bsIncludeLibs(${lib})
bsBuildLibExamples(${lib})
endforeach()
endmacro()
###################
## bsIncludeLibs ##
###################
macro(bsIncludeLibs lib)
message(STATUS "INCLUDE library ${lib}")
include("lib_${lib}")
endmacro()
########################
## bsBuildLibExamples ##
########################
macro(bsBuildLibExamples lib)
# get all examples
foreach(_var in VARIABLES)
string(TOUPPER ${lib} lib_upper)
if(_var MATCHES "WITH_LIB_${lib_upper}_EXAMPLE_([A-Za-z]+)")
message(STATUS "Found example: ${CMAKE_MATCH_0}")
endif()
endforeach()
endmacro()
</pre>
<p>The final result should be that i get the name of the examples,
like for glad BASIC and SECOND and for glfw CBASIC and CPPBASIC.</p>
<p><br>
</p>
<p>best regards!<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
</body>
</html>