Re: [CMake] Selectively adding source files and compiling assembly sources
On 28.05.2012 11:34, Alexander Neundorf wrote: >> the only solution I can think of is something like: >> >> # >> option(WITH_A ...) >> option(WITH_B ...) >> >> set(MySources always/present/files ...) >> >> if(WITH_A) >> list(APPEND MySources files/for/a ...) >> endif() >> >> if(WITH_B) >> list(APPEND MySources files/for/b ...) >> endif() >> >> add_executable(MyExec ${MySources}) > > Yes, that's the way t do it. Perfect, works nicely. >> I have never used assembler files, so I can't comment there, > > Did you enable the ASM language ? I had not. :-/ Thank you two very much! Best regards, Joe -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Why is Ninja generator disabled by default?
Please tack a lock at my builds tooAll of this errors are NOT caused by ninja!http://open.cdash.org/buildSummary.php?buildid=2315144But with ninja I get the same result.Some of the errors are caused by the fact that I use the current gcc47 compiler (build with macports), which does not understand the -arch options used by this tests!For the X11 error here is a patch which fix it (missing include)The others, no idea, but this is a makefile project, not ninja!With regards,Claus TestsX11HelloWorldX11.patch Description: Binary data On 22.05.2012, at 13:02, David Cole wrote:Please take a look at the CMake dashboard: http://open.cdash.org/index.php?project=CMakeI will allow the ninja generator to be enabled by default after interested parties fix all the failing tests in the "Nightly Expected" section related to the ninja generator submissions. Honestly, I was opposed to the ninja generator being merged to 'master' and enabled at all because of the failing tests on our dashboard. Luckily for all you ninja fans out there, I do not have dictator powers. ;-) DavidOn Mon, May 21, 2012 at 4:27 PM, Andreas Mohrwrote: Hi, On Mon, May 21, 2012 at 10:40:03AM -0400, cmake-requ...@cmake.org wrote: > From: David Cole > I agree with Bill here -- we cannot turn it on by default until it works > sufficiently for typical use cases. So, what would be needed to turn CMake on by default? 'cause it does not "work sufficiently for typical use cases" :->While there might be backwards compatibility reasons for only actually having Ninja truly enabled once it truly works (after all after some years certain user code may resort to merely checking whether the feature is provided or not, rather than doing sufficiently precise checks "well, in this CMake pre-beta it actually was still broken, and 3 days later they fixed it"), I cannot help but wonder whether this configuration (build-time disabling rather than a slightly special way of runtime disabling) is hindering progress a bit due to artificially limiting developer uptake. OTOH people who tend to like playing with certain bleeding edge things (like me) are actually able to enable it manually - it's just somewhat more effort: > For specialized use cases, if you know you want to turn it on, you can > easily re-build a CMake of your own that has it enabled. Simply turn on the > advanced cache option CMAKE_ENABLE_NINJA when configuring CMake. Andreas Mohr --Powered by www.kitware.comVisit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.htmlPlease keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQFollow this link to subscribe/unsubscribe:http://www.cmake.org/mailman/listinfo/cmake-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] a cmake install question
On Monday 28 May 2012, luxInteg wrote: > Greetings, > > A cmake install question:- > > When installing say an unknown package (one where only installation prefix > is described) appart from such $CMAKE_INSTALL_DIRECTORY (or prefix), > are there 'generic' swithes to fix other directories such as > --sysconfdir (normally /etc) --mandir (usually /usr/share/man) and -- > localstatedir (usually /var) ? > > Or does one have to make these settings either on the command line or in > the package; and in any case how so? In general, except CMAKE_INSTALL_PREFIX, providing such switches is up to each individual package. Since verrsion 2.8.5 cmake ships with a GNUInstallDirs.cmake, which provides a set of install location variables: http://www.cmake.org/cmake/help/v2.8.5/cmake.html#module:GNUInstallDirs So if a package uses this, those are the variables which can be set. Any KDE package using cmake uses a standard set of variables, which can all be set via -D or cmake-gui: http://api.kde.org/cmake/modules.html#module_FindKDE4Internal LIB_INSTALL_DIR, BIN_INSTALL_DIR etc. Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] a cmake install question
Greetings, A cmake install question:- When installing say an unknown package (one where only installation prefix is described) appart from such $CMAKE_INSTALL_DIRECTORY (or prefix), are there 'generic' swithes to fix other directories such as --sysconfdir (normally /etc) --mandir (usually /usr/share/man) and -- localstatedir (usually /var) ? Or does one have to make these settings either on the command line or in the package; and in any case how so? thanks in advance luxInteg -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Selectively adding source files and compiling assembly sources
On Monday 28 May 2012, Petr Kmoch wrote: > Hi Johannes, > > the only solution I can think of is something like: > > # > option(WITH_A ...) > option(WITH_B ...) > > set(MySources always/present/files ...) > > if(WITH_A) > list(APPEND MySources files/for/a ...) > endif() > > if(WITH_B) > list(APPEND MySources files/for/b ...) > endif() > > add_executable(MyExec ${MySources}) Yes, that's the way t do it. > I have never used assembler files, so I can't comment there, Did you enable the ASM language ? > and I don't think there's an option for better GUI grouping than string > prefixes. Yes, they are grouped by prefixes in their name. Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] the list parameter passed to function
On Sun, May 27, 2012 at 3:23 PM, Marmot Ken wrote: > Sorry. Copy-paste error kicks my ass. > > > Output expected : > > SRC_LIST : ./a.cpp;./c.cpp;./main.cpp > src_list_in : ./a.cpp;./c.cpp;./main.cpp > > Now i got the solution. > > invoke the function like this : > > AUX_SOURCE_DIRECTORY( . SRC_LIST ) > MESSAGE( SRC_LIST " : ${SRC_LIST} " ) > > Append_headers_to_src_list( SRC_LIST "${SRC_LIST}" > ${CMAKE_SOURCE_DIR}/include/test ) > > Question is : > Why? Because cmake is a text-based scripting language and for backward compatibility reasons, list elements (including in argument lists) can be separated either by space or semi-colon. Therefore, the call Append_headers_to_src_list(SRC_LIST ${SRC_LIST} ${CMAKE_SOURCE_DIR}/include/test) expands to: Append_headers_to_src_list(SRC_LIST ./a.cpp;./c.cpp;./main.cpp the_source_dir/include/test) (where the_source_dir is your value of CMAKE_SOURCE_DIR), which is equivalent to: Append_headers_to_src_list(SRC_LIST ./a.cpp ./c.cpp ./main.cpp the_source_dir/include/test) So the function paramteres are assigned as follows: src_list_out: SRC_LIST src_list_in: ./a.cpp header_file_path_in: ./c.cpp ARGN: ./main.cpp;the_source_dir/include/test (ARGN is the list of "arguments past last named parameter"). You have two solutions: one is the one you already use (pass the in-list quoted), the other would be to require the in-list to always be stored in a variable and pass only the name of the variable. Hope this helps, Petr > > > 2012/5/22 Petr Kmoch >> >> Hi, >> >> try as I might, I can't see a difference between the output and >> expected output. Perhaps a copy-paste error? >> >> Petr >> >> On Tue, May 22, 2012 at 3:07 AM, Marmot Ken wrote: >> > here is the function : >> > >> > FUNCTION( Append_headers_to_src_list src_list_out src_list_in >> > header_file_path_in ) >> > MESSAGE( src_list_in " : ${src_list_in}" ) >> > FILE( GLOB_RECURSE TEMP_LIST ${header_file_path_in}/*.h ) >> > SET( ${src_list_out} ${src_list_in} ${TEMP_LIST} PARENT_SCOPE ) >> > ENDFUNCTION( Append_headers_to_src_list >> > >> > >> > here is the place where the function is invoked: >> > >> > AUX_SOURCE_DIRECTORY( . SRC_LIST ) >> > MESSAGE( SRC_LIST " : ${SRC_LIST} " ) >> > >> > Append_headers_to_src_list( SRC_LIST ${SRC_LIST} >> > ${CMAKE_SOURCE_DIR}/include/test ) >> > >> > here is output : >> > >> > SRC_LIST : ./a.cpp;./c.cpp;./main.cpp >> > src_list_in : ./a.cpp >> > >> > Output expected : >> > >> > SRC_LIST : ./a.cpp;./c.cpp;./main.cpp >> > src_list_in : ./a.cpp >> > >> > Question: >> > <1> how to get expected Output ? >> > <2> why ? >> > >> > Thanks. >> > >> > -- >> > >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the CMake FAQ at: >> > http://www.cmake.org/Wiki/CMake_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://www.cmake.org/mailman/listinfo/cmake > > -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Selectively adding source files and compiling assembly sources
Hi Johannes, the only solution I can think of is something like: # option(WITH_A ...) option(WITH_B ...) set(MySources always/present/files ...) if(WITH_A) list(APPEND MySources files/for/a ...) endif() if(WITH_B) list(APPEND MySources files/for/b ...) endif() add_executable(MyExec ${MySources}) # I have never used assembler files, so I can't comment there, and I don't think there's an option for better GUI grouping than string prefixes. Petr On Sun, May 27, 2012 at 12:35 PM, Johannes Bauer wrote: > Hi list, > > I'm a total beginner to CMake as a developer (although I've used it in > the past for other projects before). Now I'm starting by converting a > rather large Automake-Project to CMake. I'm doing it from scratch. > > In the project, executables and a shared library are created from the > same objects. Which objects are chosen, however, depends on the > configuration. For example consider the following sources: > > featurea/obj1.c > featurea/obj2.c > featurea/obj3.c > featureb/obj1.c > featureb/obj2.c > featureb/obj3.c > common.c > > let's say I want to create a executable only from common.c, but it > should also compile and link featurea/*.c if the option WITH_A is set > and should also compile and link featureb/*.c if the option WITH_B is > set. These I've specified in the CMakeLists file: > > option(WITH_A "Enable FOO support" ON) > option(WITH_B "Enable BAR component" OFF) > > However, I see no way of adding features to the "add_executable" option > after it has been specified (something like add_source or the likes). > How can this be done? > > Another problem I've run into is that the project has some assembly > files ("*.s"), which even though I specify them in the add_executables > command are just ignored (leading to unresolved symbols, of course, at > link time). Any pointers for this? > > And is it maybe possible (not dramatic if it isn't) to group options > into subgroups so they're easier to configure using cmake-gui? There is > a "Grouped" checkbox, but it only uses the string representation (i.e. > FOO_BAR is group FOO, subitem BAR) and allows only one level of nesting. > Something like configuration of the linux kernel (with multiple levels > of configuration) maybe? > > Best regards, > Joe > -- > > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake