Re: [CMake] General question about variable scope.

2019-06-14 Thread Chuck Atkins
So, a couple things: string(TOUPPER ${lib} lib_upper) > set(WITH_LIB_${lib_upper}_EXAMPLES "") > > This needs to be outside the foreach loop. It's getting reset to empty on every iteration rather than accumulating results list(APPEND

[CMake] General question about variable scope.

2019-06-04 Thread Steven Truppe
Hi everyone, i've the following code: macro(bsBuildLibExamples lib) # get all examples get_cmake_property(_vars VARIABLES) foreach(_var ${_vars}) string(TOUPPER ${lib} lib_upper) set(WITH_LIB_${lib_upper}_EXAMPLES "") if(_var MATCHES

Re: [CMake] General question about regex

2019-06-04 Thread Steven Truppe
Thanks alot. My other problem i have no how can i loop over the result, there are just variables and ${CMAKE_CATCH_COUNT) what command can i use the iterate over the result ?? best regrads! On 04.06.19 19:22, Kyle Edwards wrote: On Tue, 2019-06-04 at 19:19 +0200, Steven Truppe wrote: I found

Re: [CMake] General question about regex

2019-06-04 Thread Kyle Edwards via CMake
On Tue, 2019-06-04 at 19:19 +0200, Steven Truppe wrote: > I found the solution: >     get_cmake_property(_vars VARIABLES) >     foreach(_var ${_vars}) >         string(TOUPPER ${lib} lib_upper) >         if(_var MATCHES "^WITH_LIB_${lib_upper}_EXAMPLE_([A-Za- > z]+)$") >        

Re: [CMake] General question about regex

2019-06-04 Thread Steven Truppe
I found the solution:     get_cmake_property(_vars VARIABLES)    foreach(_var ${_vars})         string(TOUPPER ${lib} lib_upper)         if(_var MATCHES "^WITH_LIB_${lib_upper}_EXAMPLE_([A-Za-z]+)$")         message(STATUS "Number of examples found: ${CMAKE_MATCH_COUNT}")        

Re: [CMake] General question about regex

2019-06-04 Thread Kornel Benko
Am Dienstag, 4. Juni 2019, 18:10:19 CEST schrieb Steven Truppe: > Hello again, > > > i've the following variable defined: > > set(WITH_LIB_GLAD_EXAMPLE_BASIC 1) > > And the if the line > > > foreach(_var VARIABLES) > > if(_var MATCHES "WITH_LIB_GLAD_EXAMPLE_([A-Za-z]+)") > >

[CMake] General question about regex

2019-06-04 Thread Steven Truppe
Hello again, i've the following variable defined: set(WITH_LIB_GLAD_EXAMPLE_BASIC 1) And the if the line foreach(_var VARIABLES)     if(_var MATCHES "WITH_LIB_GLAD_EXAMPLE_([A-Za-z]+)")         message(STATUS "Found a match") endforeach() I never get the message "Found match", what am

[CMake] General question

2019-06-04 Thread Steven Truppe
    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

Re: [CMake] General question:

2019-06-04 Thread Kyle Edwards via CMake
On Tue, 2019-06-04 at 17:11 +0200, Steven Truppe wrote: > I want the output not to be 'in' but 'glade' ... > > > On 04.06.19 17:10, Steven Truppe wrote: > > > > Hi everyone again, > > > > > > i've the following code: > > > > https://paste.debian.net/1086040/ > > > > and i just try to

Re: [CMake] General question:

2019-06-04 Thread Steven Truppe
I want the output not to be 'in' but 'glade' ... On 04.06.19 17:10, Steven Truppe wrote: Hi everyone again, i've the following code: https://paste.debian.net/1086040/ and i just try to traverse a list and include files whose part of the name are the list entries. best regards! --

[CMake] General question:

2019-06-04 Thread Steven Truppe
Hi everyone again, i've the following code: https://paste.debian.net/1086040/ and i just try to traverse a list and include files whose part of the name are the list entries. best regards! -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at:

[CMake] general question on documenting modules using the new FooConfig.cmake files

2008-12-04 Thread Alexander Neundorf
Hi, I've got a general question. Regular cmake FindFoo.cmake modules are documented by putting the docs at the top of the file. This documentation should list the variables, macros etc. provided by that module. Now if I switch to using FooConfig.cmake files and just very simple FindFoo.cmake