Hi everyone,
i have the following code: set(ALL_LIBS "glad;glfw") # 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) ################ ## 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() 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. best regards!
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake