From Arjen.Markus at deltares.nl Fri May 1 02:56:52 2015 From: Arjen.Markus at deltares.nl (Arjen Markus) Date: Fri, 1 May 2015 06:56:52 +0000 Subject: [CMake] Problem with Fortran conditionals In-Reply-To: <5542A700.3000308@trialphaenergy.com> References: <5542A700.3000308@trialphaenergy.com> Message-ID: <8CF085736108634681FD03EC36E6A0723D9BA8F9@V-EXC-C02.DIRECTORY.INTRA> Hi Nikolaus, I think the parser for Fortran sources indeed does not take care of such conditionals (they are also compiler-dependent, COCO never really got off the ground). A workaround might be to define a dummy module by that name. As for the selection of the Fortran compiler, you might check the name of the compiler once it has been found and if it is not the one you support, issue an informative message. Regards, Arjen > -----Original Message----- > From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Nikolaus Rath > Sent: Friday, May 01, 2015 12:05 AM > To: CMake > Subject: [CMake] Problem with Fortran conditionals > > Hello, > > I am in the process of converting a bigger project from pure GNU Make to CMake - > mostly because managing dependencies for the Fortran sources has become too > painful. > > Things seem to be mostly working, but I'm hitting one problem. When trying to run > the (CMake-generated) Makefile, it fails with: > > $ make VERBOSE=1 > [...] > make[2]: Entering directory `/home/nrath/Q2D/LamyRidge/src/model/build' > /home/nrath/.local/stow/cmake/bin/cmake -E cmake_copy_f90_mod > dagmg_allroutines CMakeFiles/LR_model.dir/dagmg_allroutines.mod.stamp Intel > /home/nrath/.local/stow/cmake/bin/cmake -E cmake_copy_f90_mod dagmg_mem > CMakeFiles/LR_model.dir/dagmg_mem.mod.stamp Intel > /home/nrath/.local/stow/cmake/bin/cmake -E cmake_copy_f90_mod dagmg_pardiso > CMakeFiles/LR_model.dir/dagmg_pardiso.mod.stamp Intel Error copying Fortran > module "dagmg_pardiso". Tried "DAGMG_PARDISO.mod" > and "dagmg_pardiso.mod". > make[2]: *** > [CMakeFiles/LR_model.dir/home/nrath/Q2D/LamyRidge/src/comm/agmg- > seq/dagmg.f90.o.provides.build] > Error 1 > make[2]: Leaving directory `/home/nrath/Q2D/LamyRidge/src/model/build' > make[1]: *** [CMakeFiles/LR_model.dir/all] Error 2 > make[1]: Leaving directory `/home/nrath/Q2D/LamyRidge/src/model/build' > make: *** [all] Error 2 > > I am not sure why CMake is trying to copy module files around, but when I looked at > the file that provides the "dagmg_pardiso" module, I found this code: > > !DEC$ IF DEFINED(_MKL_) > MODULE dagmg_PARDISO > USE dagmg_PARDISSO > INTERFACE > [...] > END INTERFACE > END MODULE dagmg_PARDISO > !DEC$ ENDIF > !----------------------------------------------------------------------- > !DEC$ IF .NOT. DEFINED(_MKL_) > SUBROUTINE PARDISO( PT, MAXFCT, MNUM, MTYPE, PHASE, N, A, IA, JA > & > , PERM, NRHS, IPARM, MSGLVL, B, X, ERROR ) [...] > END SUBROUTINE PARDISO > !DEC$ ENDIF > > I do not define __MKL__. Is it possible that the CMake dependency parser doesn't > understand this way of defining conditionals, and thus looks for a module that does > not exist? > > If so, what would be the best way to work around this? > > (The code is from a third-party library, so unfortunately I cannot easily change it). > > > Best, > -Nikolaus > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain confidential and privileged information. If you are not the intended recipient please notify the sender immediately and destroy this message. Unauthorized use, disclosure or copying of this message is strictly prohibited. The foundation 'Stichting Deltares', which has its seat at Delft, The Netherlands, Commercial Registration Number 41146461, is not liable in any way whatsoever for consequences and/or damages resulting from the improper, incomplete and untimely dispatch, receipt and/or content of this e-mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: From irwin at beluga.phys.uvic.ca Fri May 1 06:25:09 2015 From: irwin at beluga.phys.uvic.ca (Alan W. Irwin) Date: Fri, 1 May 2015 03:25:09 -0700 (PDT) Subject: [CMake] Chicken and egg problem with cmake_minimum_required(...), project(...), and CMAKE_SYSTEM_NAME Message-ID: Hi Brad: I am trying to conform to your strong advice that for the top-level CMakeLists.txt file, the cmake_minimum_required(...) command should come before the project(...) command. However, I have just encountered a problem with that approach where I want to specify a different minimum version for Linux compared to other platforms. The only way you can detect Linux that I am aware of is with the test if(CMAKE_SYSTEM_NAME STREQUAL "Linux") but it turns out for some reason that CMAKE_SYSTEM_NAME is not defined before the project command is executed. To break this "chicken and egg" issue, I have tried the following: # First call to project so that CMAKE_SYSTEM_NAME is defined project(plplot NONE) if(CMAKE_SYSTEM_NAME STREQUAL "Linux") cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) else(CMAKE_SYSTEM_NAME STREQUAL "Linux") cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") # "Real" call to project project(plplot C) This double call of project (with the first one enabling no languages) appears to work without any obvious complaints, but can you forsee any problems with this approach, i.e., is this the way you would recommend to choose minimum versions depending on platform? Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ From DLRdave at aol.com Fri May 1 06:28:22 2015 From: DLRdave at aol.com (David Cole) Date: Fri, 1 May 2015 06:28:22 -0400 Subject: [CMake] Set Fortran compiler in CMakeLists.txt? In-Reply-To: References: <55425DD0.2020806@trialphaenergy.com> <55426D8D.6060005@kitware.com> <5542798E.5090005@trialphaenergy.com> <5542AC5A.6040801@kitware.com> <5542AF44.5000606@trialphaenergy.com> Message-ID: You could also "encourage" the use of the FC env var by adding this to the very top of your CMakeLists file, before the project command: if(NOT "$ENV{FC}" MATCHES "ifort") message(FATAL_ERROR "please set the environment variable FC to the full path to ifort before running CMake") endif() Or, if you know the full path to ifort already, perhaps set(ENV{FC} "/full/path/to/ifort") would work in that same location... If you take the set ENV{FC} route, I would issue a status message saying you're doing it so users can figure it out... HTH, David C. On Thu, Apr 30, 2015 at 11:06 PM, Jean-Christophe Fillion-Robin wrote: > Hi Nikolaus, > > May you could ask your user to invoke cmake with the -C argument allowing to > specify an initial cache file with value specific to the environment ? > > It would for example contain: > > set(FC "ifort" CACHE PATH "Intel Fortran compiler") > > See http://www.cmake.org/cmake/help/v3.1/manual/cmake.1.html > > Hth > Jc > > On Thu, Apr 30, 2015 at 6:40 PM, Nikolaus Rath > wrote: >> >> On 04/30/2015 03:27 PM, Bill Hoffman wrote: >> > On 4/30/2015 2:50 PM, Nikolaus Rath wrote: >> >> Hmm. My situation is a bit different. We have different Fortran >> >> compilers installed, but this specific one needs to be compiled using >> >> the intel compiler. But by default, CMake selects gfortran. >> >> >> >> At the moment I abort the build if FC != ifort, but this is not exactly >> >> a good user experience. Imagine: >> >> >> >> $ cmake .. >> >> Unsupported! Please set FC=ifort >> >> $ FC=ifort cmake .. >> >> >> >> For the user, this raises the question: if the build system knows what >> >> compiler it needs, why doesn't it just use it instead of telling me to >> >> tell it to use it?:-) >> > >> > I suppose the CMake way to do this would be to test for the "feature" >> > that you need from the compiler. Then complain that the compiler picked >> > does not support "feature N". This would be done with a try_compile. >> > That way if the user has a compiler that supports what you need intel or >> > gfortran it will work. >> >> >> In practice this still means that the user still has to manually choose >> ifort, and that the error message is now almost deliberately obfuscated >> ("please use ifort" is much easier to understand than "your compiler >> does not support x, y, z and a. Please switch to a different compiler"). >> >> I know what compilers we have installed, what features they have, and >> which one's are compatible with the code. Is there really no way to >> encode that knowledge in the build system? >> >> Best, >> -Nikolaus >> >> -- >> >> 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: >> http://public.kitware.com/mailman/listinfo/cmake > > > > > -- > +1 919 869 8849 > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake From DLRdave at aol.com Fri May 1 06:41:50 2015 From: DLRdave at aol.com (David Cole) Date: Fri, 1 May 2015 06:41:50 -0400 Subject: [CMake] Chicken and egg problem with cmake_minimum_required(...), project(...), and CMAKE_SYSTEM_NAME In-Reply-To: References: Message-ID: I would strongly recommend NOT having different minimum versions for Linux vs. everywhere else. What happens when developers "everywhere else" use newer CMake features? They CAN'T unless they conditionalize the use based on Linux or not... Choose the highest minimum you need, and use it everywhere. You don't want your build system to be the thing that's hard to reason and think about in your project. You want your project people working on project stuff, not worrying about whether their CMake changes are going to break somewhere else..... Just my opinion, but I would hate to work on a project with logic like that in it. D On Fri, May 1, 2015 at 6:25 AM, Alan W. Irwin wrote: > Hi Brad: > > I am trying to conform to your strong advice that for the top-level > CMakeLists.txt file, the cmake_minimum_required(...) command should > come before the project(...) command. > > However, I have just encountered a problem with that approach where > I want to specify a different minimum version for Linux compared > to other platforms. The only way you can detect Linux that I > am aware of is with the test > > if(CMAKE_SYSTEM_NAME STREQUAL "Linux") > > but it turns out for some reason that CMAKE_SYSTEM_NAME is not defined > before the project > command is executed. > > To break this "chicken and egg" issue, I have tried the following: > > # First call to project so that CMAKE_SYSTEM_NAME is defined > project(plplot NONE) > if(CMAKE_SYSTEM_NAME STREQUAL "Linux") > cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) > else(CMAKE_SYSTEM_NAME STREQUAL "Linux") > cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) > endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") > # "Real" call to project > project(plplot C) > > This double call of project (with the first one enabling no languages) > appears to work without any obvious complaints, but can you forsee any > problems with this approach, i.e., is this the way you would recommend > to choose minimum versions depending on platform? > > Alan > __________________________ > Alan W. Irwin > > Astronomical research affiliation with Department of Physics and Astronomy, > University of Victoria (astrowww.phys.uvic.ca). > > Programming affiliations with the FreeEOS equation-of-state > implementation for stellar interiors (freeeos.sf.net); the Time > Ephemerides project (timeephem.sf.net); PLplot scientific plotting > software package (plplot.sf.net); the libLASi project > (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); > and the Linux Brochure Project (lbproject.sf.net). > __________________________ > > Linux-powered Science > __________________________ > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake From brad.king at kitware.com Fri May 1 08:37:47 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 01 May 2015 08:37:47 -0400 Subject: [CMake] Problem with Fortran conditionals In-Reply-To: <8CF085736108634681FD03EC36E6A0723D9BA8F9@V-EXC-C02.DIRECTORY.INTRA> References: <5542A700.3000308@trialphaenergy.com> <8CF085736108634681FD03EC36E6A0723D9BA8F9@V-EXC-C02.DIRECTORY.INTRA> Message-ID: <5543739B.9040602@kitware.com> On 05/01/2015 02:56 AM, Arjen Markus wrote: > On 04/30/2015 06:04 PM, Nikolaus Rath wrote: >> I am not sure why CMake is trying to copy module files around It is copying the module to a timestamp file so that dependents don't have to rebuild if the module content didn't really change. Even if CMake didn't try to copy the module it would still be recording a dependency on a file that is not generated and the build would stop a bit later. >> I looked at the file that provides the "dagmg_pardiso" module, I found >> this code: >> >> !DEC$ IF DEFINED(_MKL_) >> MODULE dagmg_PARDISO > > I think the parser for Fortran sources indeed does not take care > of such conditionals Correct. That kind of conditional looks like a Fortran comment to the CMake parser because it is a compiler-specific extension. CMake does handle standard conditional blocks. If anyone wants to try to teach CMake's parser about this kind of conditional, the entry point to parsing is here: http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmDependsFortran.cxx;hb=v3.2.2#l172 and the lexer and parser generator sources are here: http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmDependsFortranLexer.in.l;hb=v3.2.2 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmDependsFortranParser.y;hb=v3.2.2 -Brad From post at hendrik-sattler.de Fri May 1 08:38:15 2015 From: post at hendrik-sattler.de (Hendrik Sattler) Date: Fri, 01 May 2015 14:38:15 +0200 Subject: [CMake] Chicken and egg problem with cmake_minimum_required(...), project(...), and CMAKE_SYSTEM_NAME In-Reply-To: References: Message-ID: <3C90AE51-5E2B-4647-98C3-E0BB7A863C34@hendrik-sattler.de> Am 1. Mai 2015 12:41:50 MESZ, schrieb David Cole via CMake : >I would strongly recommend NOT having different minimum versions for >Linux vs. everywhere else. I did something similar one but based on the generator. It might makes sense when you generally want to support an older version but some cases are broken. For me it was AUTO_DEPENDS. However a new version might be problematic in combination with other things. HS From brad.king at kitware.com Fri May 1 08:47:17 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 01 May 2015 08:47:17 -0400 Subject: [CMake] Chicken and egg problem with cmake_minimum_required(...), project(...), and CMAKE_SYSTEM_NAME In-Reply-To: References: Message-ID: <554375D5.3010503@kitware.com> On 05/01/2015 06:25 AM, Alan W. Irwin wrote: > # First call to project so that CMAKE_SYSTEM_NAME is defined > project(plplot NONE) > if(CMAKE_SYSTEM_NAME STREQUAL "Linux") > cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) > else(CMAKE_SYSTEM_NAME STREQUAL "Linux") > cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) > endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") > # "Real" call to project > project(plplot C) You don't need another project(). You can use enable_language(C). Others have advised against having a different minimum, but if you have good reasons for it then: cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) project(plplot NONE) if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) endif() enable_language(C) Note that this will cause policy settings to differ on Linux versus elsewhere. -Brad From rcdailey.lists at gmail.com Fri May 1 10:29:11 2015 From: rcdailey.lists at gmail.com (Robert Dailey) Date: Fri, 1 May 2015 09:29:11 -0500 Subject: [CMake] find_library while cross compiling? In-Reply-To: References: Message-ID: Should I override these variables in the android toolchain file? On Thu, Apr 30, 2015 at 9:43 PM, Parag Chandra wrote: > Hi Robert, > > I encountered a similar problem when I was cross-compiling for NaCl on > Windows. You need to set various CMake variables that explicitly override > things like the library suffix/prefix. For example, in my case I needed to > set the following: > > set (CMAKE_STATIC_LIBRARY_PREFIX "lib") > set (CMAKE_STATIC_LIBRARY_SUFFIX ".a") > set (CMAKE_EXECUTABLE_SUFFIX ".pexe" CACHE STRING "" FORCE) > set (CMAKE_SHARED_LIBRARY_PREFIX "lib") > set (CMAKE_SHARED_LIBRARY_SUFFIX ".so") > > Hope this helps. > > > > > Parag Chandra > Senior Software Engineer, Mobile Team > Mobile: +1.919.824.1410 > > > > Ionic Security Inc. > 1170 Peachtree St. NE STE 400, Atlanta, GA 30309 > > > > > > > > > > > > On 4/30/15, 4:34 PM, "Robert Dailey" wrote: > >>I'm on Windows and I am cross compiling for Android NDK. I use >>find_library() with PATHS to hunt down some libssl.a files, plus a few >>others. >> >>However, find_library() says it can't find them. I'm assuming this is >>because I'm on Windows and it doesn't recognize *.a files as a valid >>library on that platform. Is there a way to make CMake search >>libraries based on the platform the target is being compiled for? >>-- >> >>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: >>http://public.kitware.com/mailman/listinfo/cmake > From rcdailey.lists at gmail.com Fri May 1 10:37:19 2015 From: rcdailey.lists at gmail.com (Robert Dailey) Date: Fri, 1 May 2015 09:37:19 -0500 Subject: [CMake] CMake, Android, and Eclipse ADT Integration In-Reply-To: References: Message-ID: Honestly I hadn't set any expectations for the response I was going to get here. Your response is surprisingly hopeful IMHO. So basically the goal is to treat C++ completely separate from Java from a development, workflow, and build system perspective. In other words, if we need to debug native code, we use Visual Studio + GDB toolchain of sorts, all controlled and generated by CMake? And for the Java side, we switch over to Android Studio? Also launching on device or emulator, we initiate that from Android Studio as well I imagine (simply to deploy the APK to the device, not really for debugging). This won't be controlled by CMake at all. I guess this means the only missing piece is how the Gradle scripts find the *.so files from native code so it can be packaged up in the APK. I assume this means a post-build event on the CMake side for shared library targets that copies the files to "libs/armeabi/libfoo.so"? Or is that not the way to do it anymore with gradle? I have only used the ant + ndkbuild method, so I'm not sure how things would change. But it seems like the general direction is this: 1. Check out source code 2. Generate native project with CMake + android toolchain 3. Build the native libraries with the project generated by CMake 4. The build completes by installing all *.so files to corresponding paths in the source tree so Gradle/Android Studio can find them 5. Open Android Studio & build everything 6. Deploy to device Does this sound about right? On Thu, Apr 30, 2015 at 10:11 PM, Parag Chandra wrote: > Hi Robert, > > This will be a bit long-winded, so bear with me. I?m also cross-compiling > for Android with CMake, and am currently using Eclipse ADT for much of my > development. I have tried hard to make Eclipse work for both the Java and > the C++ portions of my libraries and applications, but gave up after a few > months when it became apparent that Eclipse?s support for Android?s C++ > toolchain is horribly broken. Essentially, I got it to work for brief > periods of time, with concurrent Java/C++ debugging, but then Eclipse > would inexplicably forget all of the library/include paths, display > thousands of red squiggles all over my code, and then refuse to launch my > application. The only ?solution? was to completely strip the project of > its C++ nature, add it back in, and then reconfigure all the > library/include paths, at which point everything would work again for a > few hours or a couple of days. Add to this the fact that Google has > officially deprecated Ant+Eclipse in favor of IntelliJ+Gradle, and it?s > become clear that my time will be better spent migrating to Android Studio. > > Of course, Android Studio has absolutely no support for C/C++ at the > moment, but at least it won?t get in the way like Eclipse did. So I think > a near-term solution is to use Android Studio for all of the Java code, in > conjunction with one of several different Visual Studio-based offerings > for all the C++ code: > > Visual Studio 2015 > WinGDB > VisualGDB > Android++ > > Somewhere around the CMake 3.1 timeframe, they introduced a small feature > that enables the Visual Studio generator to support any arbitrary > cross-toolchain, instead of just a few hardcoded ones. I?ve been using > this to generate VS solutions that target Native Client as well as Windows > Phone. Although I haven?t yet had a chance to play around with any of the > offerings I mentioned previously, I believe you will be able to use this > same feature to target Android, after you have installed one of these > plug-ins in Visual Studio. > > Probably not the answer you wanted to hear, but I thought I would share my > experience and hopefully save you some trouble. > > Parag Chandra > Senior Software Engineer, Mobile Team > Mobile: +1.919.824.1410 > > > > Ionic Security Inc. > 1170 Peachtree St. NE STE 400, Atlanta, GA 30309 > > > > > > > > > > > > On 4/30/15, 4:46 PM, "Robert Dailey" wrote: > >>On Wed, Mar 11, 2015 at 11:42 AM, Robert Dailey >> wrote: >>> I am implementing support for Android in my CMake scripts by using >>> custom commands to invoke 'ant' to build the final APK. If I do it >>> this way, and I generate for eclipse, how can I make sure it will >>> integrate with the ADT plugin? >>> >>> Basically I want to be able to right-click my project in Eclipse >>> (generated by CMake) and "Run as Android Application" and have it >>> deploy to the device. What is required to make this happen? >>> >>> Also any idea how debugging will be impacted? >>> >>> Thanks. >> >>No help or advice on this? >>-- >> >>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: >>http://public.kitware.com/mailman/listinfo/cmake > From parag at ionicsecurity.com Fri May 1 10:51:20 2015 From: parag at ionicsecurity.com (Parag Chandra) Date: Fri, 1 May 2015 14:51:20 +0000 Subject: [CMake] find_library while cross compiling? In-Reply-To: References: Message-ID: Yes, you need to set them in the toolchain file - at least, that is how I did it for NaCl. Parag Chandra Senior Software Engineer, Mobile Team Mobile: +1.919.824.1410 Ionic Security Inc. 1170 Peachtree St. NE STE 400, Atlanta, GA 30309 On 5/1/15, 10:29 AM, "Robert Dailey" wrote: >Should I override these variables in the android toolchain file? > >On Thu, Apr 30, 2015 at 9:43 PM, Parag Chandra >wrote: >> Hi Robert, >> >> I encountered a similar problem when I was cross-compiling for NaCl on >> Windows. You need to set various CMake variables that explicitly >>override >> things like the library suffix/prefix. For example, in my case I needed >>to >> set the following: >> >> set (CMAKE_STATIC_LIBRARY_PREFIX "lib") >> set (CMAKE_STATIC_LIBRARY_SUFFIX ".a") >> set (CMAKE_EXECUTABLE_SUFFIX ".pexe" CACHE STRING "" FORCE) >> set (CMAKE_SHARED_LIBRARY_PREFIX "lib") >> set (CMAKE_SHARED_LIBRARY_SUFFIX ".so") >> >> Hope this helps. >> >> >> >> >> Parag Chandra >> Senior Software Engineer, Mobile Team >> Mobile: +1.919.824.1410 >> >> >> >> Ionic Security Inc. >> 1170 Peachtree St. NE STE 400, Atlanta, GA 30309 >> >> >> >> >> >> >> >> >> >> >> >> On 4/30/15, 4:34 PM, "Robert Dailey" wrote: >> >>>I'm on Windows and I am cross compiling for Android NDK. I use >>>find_library() with PATHS to hunt down some libssl.a files, plus a few >>>others. >>> >>>However, find_library() says it can't find them. I'm assuming this is >>>because I'm on Windows and it doesn't recognize *.a files as a valid >>>library on that platform. Is there a way to make CMake search >>>libraries based on the platform the target is being compiled for? >>>-- >>> >>>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: >>>http://public.kitware.com/mailman/listinfo/cmake >> From parag at ionicsecurity.com Fri May 1 11:30:47 2015 From: parag at ionicsecurity.com (Parag Chandra) Date: Fri, 1 May 2015 15:30:47 +0000 Subject: [CMake] CMake, Android, and Eclipse ADT Integration In-Reply-To: References: Message-ID: Yes, that?s pretty much the workflow I?m implementing, with the exception that Gradle drives everything, including CMake; not the other way around. Gradle is, in my opinion, somewhat more general purpose than CMake, which is laser-focused on dealing with native code, so I have structured our multi-platform builds (Android included) in a layered approach: 1. At the lowest level, developers get the IDE projects that they?re used to working with, so that their development workflows are largely unaffected. 2. CMake scripts to generate the various *native-code* build systems - in other words, I only use it for producing Visual Studio projects, Xcode workspaces, and Makefiles that are needed to work with C/C++/Obj-C/Obj-C++ code. I still create Eclipse/IntelliJ projects by hand. 3. At the highest level, Gradle scripts to orchestrate the entire workflow This yields a common set of high-level Gradle targets, e.g. ?clean?, ?build?, ?package?, ?test?, that any developer/continuous integration system can execute to produce artifacts for the seven different platforms we?re targeting. Getting back to Android specifically - Android Studio seems to use Gradle scripts directly, so I don?t think it's a bifurcated approach like we had in Eclipse, where the Ant scripts were completely independent of the Eclipse projects and had to be maintained separately. These Gradle scripts are very flexible, so while Android Studio itself doesn?t directly support C++ with the usual notions of debugging/IntelliSense/etc., you can still specify your native dependencies in the Gradle scripts, and when you build from Android Studio, it will pick them up and package them appropriately before deployment. Here?s a related link: http://www.shaneenishry.com/blog/2014/08/17/ndk-with-android-studio/ Once you get a good workflow with Android Studio in place, you should be able to simply hit ?Debug? from the IDE, which will build/deploy your application and seamlessly attach its debugger to the Java side of your code. When you hit a breakpoint on the Java side, your application will pause and you will be able to manually attach a second debugger from Visual Studio, to the native side of your code. This is what I did with Eclipse, and what I still do when I debug JNI on Mac OSX, but replace Visual Studio with Xcode. Now you can concurrently debug both sides of JNI. Hope this helps. Parag Chandra Senior Software Engineer, Mobile Team Mobile: +1.919.824.1410 Ionic Security Inc. 1170 Peachtree St. NE STE 400, Atlanta, GA 30309 On 5/1/15, 10:37 AM, "Robert Dailey" wrote: >Honestly I hadn't set any expectations for the response I was going to >get here. Your response is surprisingly hopeful IMHO. > >So basically the goal is to treat C++ completely separate from Java >from a development, workflow, and build system perspective. In other >words, if we need to debug native code, we use Visual Studio + GDB >toolchain of sorts, all controlled and generated by CMake? > >And for the Java side, we switch over to Android Studio? Also >launching on device or emulator, we initiate that from Android Studio >as well I imagine (simply to deploy the APK to the device, not really >for debugging). This won't be controlled by CMake at all. > >I guess this means the only missing piece is how the Gradle scripts >find the *.so files from native code so it can be packaged up in the >APK. I assume this means a post-build event on the CMake side for >shared library targets that copies the files to >"libs/armeabi/libfoo.so"? Or is that not the way to do it anymore with >gradle? I have only used the ant + ndkbuild method, so I'm not sure >how things would change. But it seems like the general direction is >this: > >1. Check out source code >2. Generate native project with CMake + android toolchain >3. Build the native libraries with the project generated by CMake >4. The build completes by installing all *.so files to corresponding >paths in the source tree so Gradle/Android Studio can find them >5. Open Android Studio & build everything >6. Deploy to device > >Does this sound about right? > >On Thu, Apr 30, 2015 at 10:11 PM, Parag Chandra >wrote: >> Hi Robert, >> >> This will be a bit long-winded, so bear with me. I?m also >>cross-compiling >> for Android with CMake, and am currently using Eclipse ADT for much of >>my >> development. I have tried hard to make Eclipse work for both the Java >>and >> the C++ portions of my libraries and applications, but gave up after a >>few >> months when it became apparent that Eclipse?s support for Android?s C++ >> toolchain is horribly broken. Essentially, I got it to work for brief >> periods of time, with concurrent Java/C++ debugging, but then Eclipse >> would inexplicably forget all of the library/include paths, display >> thousands of red squiggles all over my code, and then refuse to launch >>my >> application. The only ?solution? was to completely strip the project of >> its C++ nature, add it back in, and then reconfigure all the >> library/include paths, at which point everything would work again for a >> few hours or a couple of days. Add to this the fact that Google has >> officially deprecated Ant+Eclipse in favor of IntelliJ+Gradle, and it?s >> become clear that my time will be better spent migrating to Android >>Studio. >> >> Of course, Android Studio has absolutely no support for C/C++ at the >> moment, but at least it won?t get in the way like Eclipse did. So I >>think >> a near-term solution is to use Android Studio for all of the Java code, >>in >> conjunction with one of several different Visual Studio-based offerings >> for all the C++ code: >> >> Visual Studio 2015 >> WinGDB >> VisualGDB >> Android++ >> >> Somewhere around the CMake 3.1 timeframe, they introduced a small >>feature >> that enables the Visual Studio generator to support any arbitrary >> cross-toolchain, instead of just a few hardcoded ones. I?ve been using >> this to generate VS solutions that target Native Client as well as >>Windows >> Phone. Although I haven?t yet had a chance to play around with any of >>the >> offerings I mentioned previously, I believe you will be able to use this >> same feature to target Android, after you have installed one of these >> plug-ins in Visual Studio. >> >> Probably not the answer you wanted to hear, but I thought I would share >>my >> experience and hopefully save you some trouble. >> >> Parag Chandra >> Senior Software Engineer, Mobile Team >> Mobile: +1.919.824.1410 >> >> >> >> Ionic Security Inc. >> 1170 Peachtree St. NE STE 400, Atlanta, GA 30309 >> >> >> >> >> >> >> >> >> >> >> >> On 4/30/15, 4:46 PM, "Robert Dailey" wrote: >> >>>On Wed, Mar 11, 2015 at 11:42 AM, Robert Dailey >>> wrote: >>>> I am implementing support for Android in my CMake scripts by using >>>> custom commands to invoke 'ant' to build the final APK. If I do it >>>> this way, and I generate for eclipse, how can I make sure it will >>>> integrate with the ADT plugin? >>>> >>>> Basically I want to be able to right-click my project in Eclipse >>>> (generated by CMake) and "Run as Android Application" and have it >>>> deploy to the device. What is required to make this happen? >>>> >>>> Also any idea how debugging will be impacted? >>>> >>>> Thanks. >>> >>>No help or advice on this? >>>-- >>> >>>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: >>>http://public.kitware.com/mailman/listinfo/cmake >> From steveire at gmail.com Fri May 1 13:56:59 2015 From: steveire at gmail.com (Stephen Kelly) Date: Fri, 01 May 2015 19:56:59 +0200 Subject: [CMake] C++Now / BoostCon / Boost 2.0 References: <1430225256313-7590405.post@n2.nabble.com> Message-ID: Robert Ramey wrote: > all things boost - which will touch upon CMake/CTest/CDash. I have > recommended CMake... for boost - like projects and would like to see it > more widely accepted. http://rrsd.com/blincubator.com/tools_cmak/ There are many typos on the page (and even in the url). You might want to proof-read/copy-edit it in a text editor before publishing it more-widely. > I'm > aware that in the past there was a large effort to switch boost to CMake > from Boost Build which ended in failure. The CMake solution didn't result in interest from Boost. It's the approach that uses modern CMake features though (including features designed and implemented specifically for Boost), so it's likely the better approach if Boost decides to make use of CMake at all. Enjoy the conference, Steve. From irwin at beluga.phys.uvic.ca Fri May 1 14:28:20 2015 From: irwin at beluga.phys.uvic.ca (Alan W. Irwin) Date: Fri, 1 May 2015 11:28:20 -0700 (PDT) Subject: [CMake] Chicken and egg problem with cmake_minimum_required(...), project(...), and CMAKE_SYSTEM_NAME In-Reply-To: <3C90AE51-5E2B-4647-98C3-E0BB7A863C34@hendrik-sattler.de> References: <3C90AE51-5E2B-4647-98C3-E0BB7A863C34@hendrik-sattler.de> Message-ID: On 2015-05-01 14:38+0200 Hendrik Sattler wrote: > > > Am 1. Mai 2015 12:41:50 MESZ, schrieb David Cole via CMake : >> I would strongly recommend NOT having different minimum versions for >> Linux vs. everywhere else. > > I did something similar one but based on the generator. > It might makes sense when you generally want to support an older version but some cases are broken. For me it was AUTO_DEPENDS. However a new version might be problematic in combination with other things. > To Hendrik, David, and Brad: I think we all agree that different minimum versions for different platforms are far from ideal, but as Hendrik has said there are sometimes exceptions. For the present exceptional case the combination of specific reasons are (1) my desire to move to CMP0026 NEW now rather than waiting a couple of years until our minimum version on Linux is 3.2; (2) a bug in permissions for file(GENERATE..) only fixed in 3.2; (3) a build-time workaround for that bug readily available only as a GNU extension of chmod; and (4) a "political" desire on our part to use a minimum CMake version of 3.0.2 on Linux so that our many users who build the latest PLplot on that platform can generally use the system version of CMake rather than being forced to build the latest CMake. My big thanks to Brad for recommending a general solution for the case where different minimum versions are needed on different platforms. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ From nrath at trialphaenergy.com Fri May 1 17:56:48 2015 From: nrath at trialphaenergy.com (Nikolaus Rath) Date: Fri, 1 May 2015 14:56:48 -0700 Subject: [CMake] Control CMake Verbosity? Message-ID: <5543F6A0.40509@trialphaenergy.com> Hello, Is there a way to adjust the amount or level of detail of the CMake progress messages? Especially with parallel make, the output isn't exactly pretty. For example: Scanning dependencies of target LR_shift [ 1%] [ 6%] [ 6%] [ 6%] [ 8%] [ 10%] [ 13%] [ 13%] Building Fortran object CMakeFiles/LR_shift.dir/home/nrath/Q2D/LamyRidge/src/comm/numeric_kinds.f90.o Building Fortran object CMakeFiles/LR_shift.dir/home/nrath/Q2D/LamyRidge/src/comm/coil_type.f.o Building Fortran object CMakeFiles/LR_shift.dir/home/nrath/Q2D/LamyRidge/src/comm/serv.f.o Building Fortran object CMakeFiles/LR_shift.dir/home/nrath/Q2D/LamyRidge/src/comm/circ.f.o Building Fortran object CMakeFiles/LR_shift.dir/home/nrath/Q2D/LamyRidge/src/comm/pcon.f.o Building Fortran object CMakeFiles/LR_shift.dir/home/nrath/Q2D/LamyRidge/src/comm/acoil_type.f.o Building Fortran object CMakeFiles/LR_shift.dir/home/nrath/Q2D/LamyRidge/src/comm/wall_type.f.o Building Fortran object CMakeFiles/LR_shift.dir/home/nrath/Q2D/utils/src/taehdf5.f90.o [ 15%] [ 22%] [ 22%] [ 22%] [ 23%] [ 23%] Building Fortran object CMakeFiles/LR_shift.dir/home/nrath/Q2D/P-state/fortran/src/sort.f.o It would be great if CMake could print out only the percentages, or maybe at least omit the super-long path from the messages. Best, -Nikolaus From rob.a.mcdonald at gmail.com Sat May 2 11:22:37 2015 From: rob.a.mcdonald at gmail.com (Rob McDonald) Date: Sat, 2 May 2015 08:22:37 -0700 Subject: [CMake] Statically link OpenMP on Mac gcc In-Reply-To: References: Message-ID: On a Mac, using GCC's global -static is bad, so that doesn't work out. However, as it turns out, -static-libgcc implies all parts of libgcc, including libgomp. So, building with -static-libgcc -static-libstdc++ looks like the best solution. Rob On Thu, Apr 30, 2015 at 2:19 PM, Rob McDonald wrote: > I'm using MacPorts GCC 4.8 and CMake 3.2. > > I use 'FIND_PACKAGE( OpenMP )', and then use OpenMP_C_FLAGS and > OpenMP_CXX_FLAGS appropriately. > > My application works on the machine that I build on. However, users > without MacPorts GCC installed can't find libgomp.1.dylib on their > machine. > > I'd like to tell GCC to statically link libgomp. I think the global > -static flag may do this, but it seems like a fairly brutish way of > getting the job done. > > Is there a way to get CMake to tell GCC to statically link libgomp? > Or to have more fine grained control over which libraries are static > vs. dynamic? > > Is there any reason to not want to use the global -static? > > FindOpenMP.cmake isn't like most other Find*.cmake scripts -- instead > of searching for a *.h, *.a, *.so, or *.dylib file, it checks various > flags to the compiler -fopenmp, /openmp, etc. From that, it > determines the appropriate flags, but there isn't any > ${OPENMP_LIBRARIES} to use in a later TARGET_LINK_LIBRARIES later on. > > Thanks, > > Rob From tommaso.vinci at polytechnique.edu Sat May 2 19:48:18 2015 From: tommaso.vinci at polytechnique.edu (Tommaso Vinci) Date: Sun, 3 May 2015 01:48:18 +0200 Subject: [CMake] bundle problem (Qt + Python) Message-ID: <55456242.80107@polytechnique.edu> Dear all, I'm a bit new to cmake (scared about it!) but start to love it. I have a problem when creating a dmg from my app Qt + Python (two lovely beasts to link together...) Here is a tgz of the sources https://filesender.renater.fr/?vid=6c173e95-d045-55c9-dbbd-00001517609e I'm on OSX and I have most of the developper stuff installed via mcaports. I can compile it and create a nice .app But since when I added the Python dependency, I got issues in the CPack bundle generator. I've digged a bit and found out a weird stuff: inside the .app I link on the Framework Python (so far so good), but this framework has inside a Python.app application /opt/local/Library/Frameworks/Python.framework//Versions/2.7/Resources/Python.app (which is probably just a helper to run the python scripts and have WM feedback) and this fools the cmake/cpack scripts when it dig the .app folder searching for executables. i.e. inside function(get_bundle_all_executables bundle exes_var) of the file /opt/local/share/cmake-3.2/Modules/BundleUtilities.cmake it does this command /usr/bin/find /Users/tommaso/local/src/hw/_CPack_Packages/OSX/DragNDrop/hw-0.1.0/hw.app -type f ( -perm -0100 -o -perm -0010 -o -perm -0001 ) and then filters the executables which returns also the /Users/tommaso/local/src/hw/_CPack_Packages/OSX/DragNDrop/hw-0.1.0/hw.app/Contents/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python It looks like a deep mess because I don't know how to tell the real executable : /Users/tommaso/local/src/hw/_CPack_Packages/OSX/DragNDrop/hw-0.1.0/hw.app/Contents/MacOS/hw from the python one: /Users/tommaso/local/src/hw/_CPack_Packages/OSX/DragNDrop/hw-0.1.0/hw.app/Contents/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python any advice? someone fell in this mess? many thanks! -- Tommaso Vinci tommaso.vinci at polytechnique.edu +33 1 69335427 LULI - Ecole Polytechnique 91128 Palaiseu From zhongle.wu at gmail.com Sun May 3 00:20:53 2015 From: zhongle.wu at gmail.com (Zhongle Wu) Date: Sun, 3 May 2015 00:20:53 -0400 Subject: [CMake] What's the best practice for a large project using multiple versions of package dependencies Message-ID: Dear CMakers: I'd like to have your advice for setting up CMakeLists files in a large project where I want a top level CMakeLists.txt manages the whole build hierarchical structure. Suppose I have some parallel sub-projects where one sub-project depends on VTK v5 and another sub-project depends on VTK v6, or different version of boost library, these sub-projects may also dependent on common sub-projects. I think it would be a common scenario in a large project that sub-projects or modules may dependent on different version of packages, and during the project lifetime, when a dependent package upgrades, not all of these sub projects have to upgrade the package version at the same time. I think that find_xxx commands are not very friendly into detect and use parallel versions of a package due to the global cache variables. FindQt.cmake seems support different version though. The ExternalProject_Add for super-build is very flexible. Although as it's name, it was designed initially for building external packages, it can be used to manage your own sub projects too. Using ExternalProject_Add for these sub-projects, I can specify different version of external packages. But I think it is not as elegant as add_subdirectory to manage the hierarchical structure in a single build. Instead of using the ExternalProject_Add, some people has successfully used python script to manage these build dependencies. But using external script language create other inconvenient issues such as the need of sharing some configuration variables between the external script and cmake. So what's the best practice in a build using multiple versions of packages under a top level CMakeLists, or simply just don't do that but splitting your sub-projects into multiple top level CMakeLists files? Thanks! Zhongle -------------- next part -------------- An HTML attachment was scrubbed... URL: From sumygin at gmail.com Sun May 3 12:02:50 2015 From: sumygin at gmail.com (Yakov S) Date: Mon, 4 May 2015 02:02:50 +1000 Subject: [CMake] VS 2015 RC and Android projects Message-ID: Recently Microsoft announced, that Visual Studio 2015 will support Android platform. It actually already works in vs 2015 RC, available for download. It's possible to create new project and debug it on device or emulator. Anybody knows, how to adapt existing cmake project for it or it's not yet available? -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Sun May 3 17:12:12 2015 From: DLRdave at aol.com (David Cole) Date: Sun, 3 May 2015 17:12:12 -0400 Subject: [CMake] What's the best practice for a large project using multiple versions of package dependencies In-Reply-To: References: Message-ID: The best practice is obviously not to have multiple version of the same sub-project within your large project... And if you really really have to, then ExternalProject is definitely your friend, because you should completely and totally isolate the two different versions of the sub-project, which would not even be close to easy-to-do if you were incorporating sub-projects with add_subdirectory. I'll leave the rest to others on this mailing list to give advice, because if I was involved in a project which even suggested multiple versions of sub-projects simultaneously, I would run in the opposite direction as fast as I could. ( ha ha :-) ... reminds me of my all-time favorite (and most-down-voted ever) stackoverflow.com answer: http://stackoverflow.com/questions/8153519/how-to-automatically-download-c-dependencies-in-a-cross-platform-way-cmake/8351140#8351140 ) D On Sun, May 3, 2015 at 12:20 AM, Zhongle Wu wrote: > Dear CMakers: > > I'd like to have your advice for setting up CMakeLists files in a large > project where I want a top level CMakeLists.txt manages the whole build > hierarchical structure. Suppose I have some parallel sub-projects where one > sub-project depends on VTK v5 and another sub-project depends on VTK v6, or > different version of boost library, these sub-projects may also dependent on > common sub-projects. I think it would be a common scenario in a large > project that sub-projects or modules may dependent on different version of > packages, and during the project lifetime, when a dependent package > upgrades, not all of these sub projects have to upgrade the package version > at the same time. > > I think that find_xxx commands are not very friendly into detect and use > parallel versions of a package due to the global cache variables. > FindQt.cmake seems support different version though. > > The ExternalProject_Add for super-build is very flexible. Although as it's > name, it was designed initially for building external packages, it can be > used to manage your own sub projects too. Using ExternalProject_Add for > these sub-projects, I can specify different version of external packages. > But I think it is not as elegant as add_subdirectory to manage the > hierarchical structure in a single build. > > Instead of using the ExternalProject_Add, some people has successfully used > python script to manage these build dependencies. But using external script > language create other inconvenient issues such as the need of sharing some > configuration variables between the external script and cmake. > > So what's the best practice in a build using multiple versions of packages > under a top level CMakeLists, or simply just don't do that but splitting > your sub-projects into multiple top level CMakeLists files? > > Thanks! > Zhongle > > > > > > > > > > > > > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake From parag at ionicsecurity.com Sun May 3 21:54:53 2015 From: parag at ionicsecurity.com (Parag Chandra) Date: Mon, 4 May 2015 01:54:53 +0000 Subject: [CMake] VS 2015 RC and Android projects In-Reply-To: References: Message-ID: I'm very interested in this capability myself. Although I have not yet tried it, I believe you will want to take advantage of a relatively new feature in CMake described here: http://public.kitware.com/Bug/view.php?id=14673 This seemingly innocuous change opens up CMake to pretty much any platform that Visual Studio can support. Since 3.1, I've been using it to generate solutions for both Windows Phone and Native Client. So my guess is you would use some combination of CMAKE_GENERATOR_PLATFORM and CMAKE_SYSTEM_NAME to select the new Android toolchain. I'm having some trouble with my Windows VMs at the moment, so if you try it our yourself, I would be very interested in hearing your results. Parag Chandra Senior Software Engineer, Mobile Team Mobile: +1.919.824.1410 [https://www.ionicsecurity.com/IonicSigHz.png] Ionic Security Inc. 1170 Peachtree St. NE STE 400, Atlanta, GA 30309 From: Yakov S > Date: Sunday, May 3, 2015 at 12:02 PM To: "cmake at cmake.org" > Subject: [CMake] VS 2015 RC and Android projects Recently Microsoft announced, that Visual Studio 2015 will support Android platform. It actually already works in vs 2015 RC, available for download. It's possible to create new project and debug it on device or emulator. Anybody knows, how to adapt existing cmake project for it or it's not yet available? -------------- next part -------------- An HTML attachment was scrubbed... URL: From benpope81 at gmail.com Sun May 3 21:58:22 2015 From: benpope81 at gmail.com (Ben Pope) Date: Mon, 04 May 2015 09:58:22 +0800 Subject: [CMake] find_library while cross compiling? In-Reply-To: References: Message-ID: On Friday, May 01, 2015 04:34 AM, Robert Dailey wrote: > I'm on Windows and I am cross compiling for Android NDK. I use > find_library() with PATHS to hunt down some libssl.a files, plus a few > others. > > However, find_library() says it can't find them. I'm assuming this is > because I'm on Windows and it doesn't recognize *.a files as a valid > library on that platform. Is there a way to make CMake search > libraries based on the platform the target is being compiled for? I haven' tried developing in the above scenario, but you'll also want to check out CMAKE_FIND_ROOT_PATH and friends when cross-compiling. Ben From matze999 at gmail.com Mon May 4 07:59:01 2015 From: matze999 at gmail.com (matzeNOTAVAILABLE .) Date: Mon, 4 May 2015 04:59:01 -0700 Subject: [CMake] find_package In-Reply-To: <553E91DE.4090003@gmx.de> References: <553E91DE.4090003@gmx.de> Message-ID: Hi, unset(Boost_INCLUDE_DIR CACHE) does not work either. I have also tried to unset the following: unset(Boost_INCLUDE_DIR CACHE) unset(Boost_INCLUDE_DIR) unset(Boost_INCLUDE_DIRS CACHE) unset(Boost_INCLUDE_DIRS) unset(Boost_FOUND CACHE) unset(Boost_FOUND) unset(Boost_LIBRARIES CACHE) unset(Boost_LIBRARIES) unset(Boost_LIBRARYDIR CACHE) unset(Boost_LIBRARYDIR) unset(Boost_VERSION CACHE) unset(Boost_VERSION) unset(Boost_NAMESPACE CACHE) unset(Boost_NAMESPACE) All to no avail. Not sure where to go from here (except debug it). My cmake version is 2.8.12.2. Regards, Matt On Mon, Apr 27, 2015 at 9:45 PM, Nagger wrote: > Hi, > > After this fails, if i delete CMakeCache.txt and rerun the script, it >> works. In fact it seems to be related to the line: >> Boost_INCLUDE_DIR:PATH=/usr/include >> which is in CMakeCache.txt. >> > > Than just delete that cache variable (before the second call of > find_package): > unset(Boost_INCLUDE_DIR CACHE) > > http://www.cmake.org/cmake/help/v3.1/command/unset.html > > Greetings, > Marc > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhirvonen at elucideye.com Mon May 4 14:12:02 2015 From: dhirvonen at elucideye.com (David Hirvonen) Date: Mon, 4 May 2015 14:12:02 -0400 Subject: [CMake] cmake iOS application + framework link error In-Reply-To: References: Message-ID: Thanks for the response. I've moved to a more standard *nix layout for all platforms, and will rely on a post-build step to create my framework (for now). If I find a fix, I'll be sure to share it here. On Wed, Apr 29, 2015 at 5:22 AM, Eric Wing wrote: > On 4/25/15, David Hirvonen wrote: > > I'm hitting a link error when linking an iOS application with an > internally > > created framework/library using the the CMake Xcode generator and an iOS > > toolchain. I've put together a minimal CMakeLists.txt example here: > > > > https://github.com/headupinclouds/cmake_framework_test/ > > > > The problem is described in detail in the the README, and reproduced here > > in the email for completeness. > > > > The repository is intended as a simple unit test to illustrate an > apparent > > link and build location mismatch when linking a framework to an iOS > > application using the "standard" iOS toolchain > > (I realize this toolchain isn't > > provided with CMake). I've included the ios toolchain in this repository > to > > make it easy to reproduce the issue. I've include both the iOS > application > > that reproduces the link error, and an OS X application, which links to > the > > library in correct framework location. I'm looking for a CMakeLists.txt > fix > > or possible workaround. There are two top level convenience bash scripts > > for building the applications with cmake using an xcode generator. The > > CMake version is 3.2.1. > > > > cmake --version > > cmake version 3.2.1 > > > > < > https://github.com/headupinclouds/cmake_framework_test/blob/master/README.md#ios-framework-and-application-error > >iOS > > framework and application error: > > > > bash -fx ./test-ios.sh > > + NAME=_builds/ios > > + cmake -GXcode -H. -B_builds/ios -DCMAKE_TOOLCHAIN_FILE=iOS.cmake > > > > > > clang: error: no such file or directory: > > > '/Users/dhirvonen/devel/cmake_framework_test/_builds/ios/Debug-iphoneos/TF.framework/Versions/A/TF' > > ** BUILD FAILED ** > > The following build commands failed: > > Ld _builds/ios/Debug-iphoneos/testa.app/testa normal armv7 > > (1 failure) > > library path: _builds/ios/Debug-iphoneos/TF.framework/TF > > > > This produces a flat framework layout (ignoring the FRAMEWORK_VERSION > > property (which is fine with me if I can get it to work)). It looks like > > this: > > > > tree _builds/ios/Debug-iphoneos/TF.framework > > _builds/ios/Debug-iphoneos/TF.framework > > ??? Info.plist > > ??? TF > > ??? _CodeSignature > > ??? CodeResources > > > > But when it reaches the link command for the ios application: > > > > target_link_libraries(testa TF) > > > > it fails, since it seems to expect the library to be two directories down > > within a versioned framework layout: > > > > TF.framework/Versions/A/TF > > > > instead the directory is here: > > > > TF.framework/TF > > > > I'm looking for a solution to either: > > > > - correct the TF link path to use the actual (non versioned) framework > > layout that is currently generated, or > > - correct the framework so that it uses the versioned layout to make > > that consistent with the link path > > > > < > https://github.com/headupinclouds/cmake_framework_test/blob/master/README.md#os-x-framework-and-application-success > >OS > > X framework and application success: > > > > When I build this for OS X it seems to work fine. > > > > bash -fx ./test-osx.sh > > + NAME=_builds/osx > > + cmake -GXcode -H. -B_builds/osx > > > > ** BUILD SUCCEEDED ** > > library path: _builds/osx/Debug/TF.framework/Versions/A/TF > > > > This produces a framework with the following layout: > > > > tree _builds/osx/Debug/ > > _builds/osx/Debug/ > > ??? TF.framework > > ? ??? Resources -> Versions/Current/Resources > > ? ??? TF -> Versions/Current/TF > > ? ??? Versions > > ? ??? A > > ? ? ??? Resources > > ? ? ? ??? Info.plist > > ? ? ??? TF > > ? ? ??? _CodeSignature > > ? ? ??? CodeResources > > ? ??? Current -> A > > ??? testb > > > > and the call to > > > > target_link_libraries(testb TF) > > > > picks up the TF library in the correct location. > > > > I'm curious if there is a variable or property that needs to be set for > the > > iOS example to give the same framework layout. > > > > > I have not tried this (yet), but my guess is that CMake needs to be > patched to understand iOS frameworks. iOS frameworks are new as of iOS > 8. 3rd parties were not allowed to make frameworks before that. > Additionally, CMake's framework support was implemented for Mac like a > decade ago. Because the iOS framework structure (and .app structure > for another matter) is different, CMake will likely need to be taught > how to make a proper structure for iOS. > > If you do any work on this, I am interested in your results. > Eventually, I would like to support iOS frameworks, though I'm > probably at least 6 months from that since I need iOS 7 to drop off > the face of the earth, which means after iOS 9 is released. > > (Note to non-iOS developers reading this: iOS does not allow flat > .dylib files for shared libraries. You must build a framework.) > > -Eric > -- > Beginning iPhone Games Development > http://playcontrol.net/iphonegamebook/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mpercossi at zenaud.io Mon May 4 15:07:21 2015 From: mpercossi at zenaud.io (Martin Percossi) Date: Mon, 4 May 2015 21:07:21 +0200 Subject: [CMake] Example of creating OSX application? Message-ID: Hello, Could someone point me to a recent example CMakeLists.txt for creation of an application (i.e., .app directory structure) under OSX? Ideally, it should have its own custom framework included in the @executable_path/../Frameworks directory, as well as resources. In short, it should be reasonably full-featured. TIA, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From dank at kegel.com Mon May 4 15:13:27 2015 From: dank at kegel.com (Dan Kegel) Date: Mon, 4 May 2015 12:13:27 -0700 Subject: [CMake] Example of creating OSX application? In-Reply-To: References: Message-ID: On Mon, May 4, 2015 at 12:07 PM, Martin Percossi wrote: > Could someone point me to a recent example CMakeLists.txt for creation of an > application (i.e., .app directory structure) under OSX? Ideally, it should > have its own custom framework included in the @executable_path/../Frameworks > directory, as well as resources. In short, it should be reasonably > full-featured. http://www.cmake.org/Wiki/BundleUtilitiesExample is in theory what you want. I'm just learning this myself, and for now I ignore that and just do SET_TARGET_PROPERTIES(foo PROPERTIES MACOSX_BUNDLE TRUE) to get cmake to create the .app directory structure; all the rest of the munging I'm doing by hand (libcef is a bitch on the mac). From marc.chevrier at sap.com Tue May 5 04:35:05 2015 From: marc.chevrier at sap.com (CHEVRIER, Marc) Date: Tue, 5 May 2015 08:35:05 +0000 Subject: [CMake] Alias of imported target Message-ID: Hi, Currently it is not possible to create an alias target for an imported target (I.e. add_library with ALIAS keyword). But I don?t understand what is the technical constraint or semantic reason behind this limitation. If anybody can explain this limitation, it will be nice. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergey.nikulov at gmail.com Tue May 5 05:19:24 2015 From: sergey.nikulov at gmail.com (Sergei Nikulov) Date: Tue, 5 May 2015 12:19:24 +0300 Subject: [CMake] ExternalProject_Add // git shallow clone Message-ID: Hello All, Is it possible to provide git depth option for ExternalProject_Add command? I see no such option for GIT_... parameters in documentation. Thank you. -- Best Regards, Sergei Nikulov -------------- next part -------------- An HTML attachment was scrubbed... URL: From iss at nesono.com Tue May 5 06:31:16 2015 From: iss at nesono.com (Jochen Issing) Date: Tue, 5 May 2015 12:31:16 +0200 Subject: [CMake] find_library does not find libcurl for ios simulator Message-ID: <86271995-4A0B-4589-B98E-A2C01CC1E903@nesono.com> Hi, I am running 3.2.2 and also get the error with 3.1.0 on a mac. I have the particular curl library in a custom path. The following snippet fetches the library correctly for mac and iOS, but not for iOS-simulator. I also tried to change find_library to find_path using the real (platform dependent) library name. TARGET_OS is our custom string for switching between different target platforms. message(STATUS "Searching for CURL library in ${SEARCH_BASE}/lib") unset(CURL_LIBRARY CACHE) if(TARGET_OS MATCHES "macosx.*" OR TARGET_OS MATCHES "ios.*") message(STATUS "Mac/iOS method find_library") find_library(CURL_LIBRARY NAMES curl PATHS ${SEARCH_BASE} PATH_SUFFIXES lib NO_DEFAULT_PATH) else(TARGET_OS MATCHES "macosx.*" OR TARGET_OS MATCHES "ios.*") message(STATUS "Non-Mac method find_library") find_library(CURL_LIBRARY NAMES curl PATHS ${SEARCH_BASE} PATH_SUFFIXES lib NO_CMAKE_FIND_ROOT_PATH) endif(TARGET_OS MATCHES "macosx.*" OR TARGET_OS MATCHES "ios.*") message(STATUS "Curl Library: ${CURL_LIBRARY}") if(CURL_LIBRARY) message(STATUS "Curl library found") list(APPEND CURL_LIBRARIES ${CURL_LIBRARY} z) else(CURL_LIBRARY) message(STATUS "Curl library not found") endif(CURL_LIBRARY) When running cmake in the console, I get the following (for iOS Simulator only): -- Searching for CURL library in /Users/blaschnas/src/project/build/ios-x86-clang-libcxx/libs/curl/lib -- Mac/iOS method find_library -- Curl Library: CURL_LIBRARY-NOTFOUND -- Curl library not found When I look into the directory of the library, I can see libcurl.a lying exactly there. Does find_library test for architecture, like deeply inspect the library or is it basically composing the correct prefix and suffix and then behaves like find_path? Thanks for your help. /jochen -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: Message signed with OpenPGP using GPGMail URL: From mpercossi at zenaud.io Tue May 5 06:36:59 2015 From: mpercossi at zenaud.io (Martin Percossi) Date: Tue, 5 May 2015 12:36:59 +0200 Subject: [CMake] Does fixup_bundle() functionality work with xcodebuild? Message-ID: Hello, My understanding is that in order to compile .xib's into .nibs, I need to use xcodebuild. So my next question is: is fixup_bundle() "compatible" with xcodebuild? I note that when I build the example QtTest using > cmake -GXcode .. > xcodebuild -project QtTest.xcodeproj from within a freshly created `build' subdirectory, the relevant libraries and plugins are *not* copied into the app bundle. Or am I missing some command? Kind regards, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From sjaak10101 at gmail.com Tue May 5 07:34:35 2015 From: sjaak10101 at gmail.com (Sjaak Zwart) Date: Tue, 5 May 2015 13:34:35 +0200 Subject: [CMake] separating unit tests and performance tests Message-ID: Dear all, Could somebody give me some advice on how unit tests and performance tests can/should be organized? I'm quite new to cmake (and c++). Currently, for performance tests I do: add_executable (mybenchmarks ${MYBENCHMARKS_CPP} (as I don't want these to run by default) While for unit tests I do: add_test (mytests mytests) add_executable (mytests ${MYTESTS_CPP}) I can then manually start the performance test by running the executable, and use 'make test' or 'ctest' to start the normal tests. I wonder if I can do better, maybe there's standard support for this already? Ideally, I think I would like to replace add_test by something like add_performance_test and then launch ctest with some special flag? Another idea perhaps, maybe I could use a regular expression to run only the performance tests, i.e., something like *PerfTest. But could I then also run the unit tests still, i.e., everything that doesn't match *PerfTest? Thanks, Sjaak. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.noulard at gmail.com Tue May 5 07:51:52 2015 From: eric.noulard at gmail.com (Eric Noulard) Date: Tue, 5 May 2015 13:51:52 +0200 Subject: [CMake] separating unit tests and performance tests In-Reply-To: References: Message-ID: 2015-05-05 13:34 GMT+02:00 Sjaak Zwart : > Dear all, > > Could somebody give me some advice on how unit tests and performance tests > can/should be organized? I'm quite new to cmake (and c++). > > Currently, for performance tests I do: > add_executable (mybenchmarks ${MYBENCHMARKS_CPP} > (as I don't want these to run by default) > > While for unit tests I do: > add_test (mytests mytests) > add_executable (mytests ${MYTESTS_CPP}) > > I can then manually start the performance test by running the executable, > and use 'make test' or 'ctest' to start the normal tests. > > I wonder if I can do better, maybe there's standard support for this > already? > > Ideally, I think I would like to replace add_test by something like > add_performance_test and then launch ctest with some special flag? > > Another idea perhaps, maybe I could use a regular expression to run only > the performance tests, i.e., something like *PerfTest. But could I then > also run the unit tests still, i.e., everything that doesn't match > *PerfTest? > Yes you can do that. You can run ctest using either: -L , --label-regex = Run tests with labels matching regular expression. -R , --tests-regex = Run tests matching regular expression. -E , --exclude-regex = Exclude tests matching regular expression. -LE , --label-exclude = Exclude tests with labels matching regular expression. -R -E works with the name of the test whereas -L and -LE work with the LABEL of a test that may be set using set_property(TEST mybenchmarks PROPERTY LABELS perf) set_property(TEST mytests PROPERTY LABELS unit) note that "make test" will run all the test whereas ctest -R/-E/-L/-LE .... will run the appropriate subset. > > Thanks, > Sjaak. > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -- Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Tue May 5 09:12:57 2015 From: DLRdave at aol.com (David Cole) Date: Tue, 5 May 2015 09:12:57 -0400 Subject: [CMake] ExternalProject_Add // git shallow clone In-Reply-To: References: Message-ID: It's possible to do anything you want if you provide your own custom DOWNLOAD_COMMAND. I'm not aware of any depth options exposed via ExternalProject_Add, though. HTH, David > On May 5, 2015, at 5:19 AM, Sergei Nikulov wrote: > > Hello All, > > Is it possible to provide git depth option for ExternalProject_Add command? > I see no such option for GIT_... parameters in documentation. > > > Thank you. > > > -- > Best Regards, > Sergei Nikulov > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake From DLRdave at aol.com Tue May 5 09:13:50 2015 From: DLRdave at aol.com (David Cole) Date: Tue, 5 May 2015 09:13:50 -0400 Subject: [CMake] ExternalProject_Add // git shallow clone In-Reply-To: References: Message-ID: <3E357F8F-DAB7-4571-9291-251ECF3B4AA1@aol.com> It's possible to do anything you want if you provide your own custom DOWNLOAD_COMMAND. I'm not aware of any depth options exposed via ExternalProject_Add, though. HTH, David C. > On May 5, 2015, at 5:19 AM, Sergei Nikulov wrote: > > Hello All, > > Is it possible to provide git depth option for ExternalProject_Add command? > I see no such option for GIT_... parameters in documentation. > > > Thank you. > > > -- > Best Regards, > Sergei Nikulov > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake From sergey.nikulov at gmail.com Tue May 5 10:05:52 2015 From: sergey.nikulov at gmail.com (Sergei Nikulov) Date: Tue, 5 May 2015 17:05:52 +0300 Subject: [CMake] ExternalProject_Add // git shallow clone In-Reply-To: <3E357F8F-DAB7-4571-9291-251ECF3B4AA1@aol.com> References: <3E357F8F-DAB7-4571-9291-251ECF3B4AA1@aol.com> Message-ID: Hello David, Thank you for answer. It could be useful feature for ExternalProject.cmake What do your think? 2015-05-05 16:13 GMT+03:00 David Cole : > It's possible to do anything you want if you provide your own custom > DOWNLOAD_COMMAND. > > I'm not aware of any depth options exposed via ExternalProject_Add, though. > > > HTH, > David C. > > > > On May 5, 2015, at 5:19 AM, Sergei Nikulov > wrote: > > > > Hello All, > > > > Is it possible to provide git depth option for ExternalProject_Add > command? > > I see no such option for GIT_... parameters in documentation. > > > > > > Thank you. > > > > > > -- > > Best Regards, > > Sergei Nikulov > > -- > > > > 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: > > http://public.kitware.com/mailman/listinfo/cmake > -- Best Regards, Sergei Nikulov -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.savenkov at gmail.com Tue May 5 10:39:59 2015 From: max.savenkov at gmail.com (Max Savenkov) Date: Tue, 5 May 2015 17:39:59 +0300 Subject: [CMake] Set Visual Studio parameters not supported directly by CMake Message-ID: Is there any way to set a parameter of a Visual Studio project that is not directly supported by a CMake property or keyword? This is especially important for the new platforms in Visual Studio, like Android or Emscripten. There are a lot of fields I'd like to set, like "Debuggable" flag, "JAR Dependencies" etc., but so far, CMake doesn't know about them. It would help, if CMake could do some post-processing on generated project files, or would support adding property sheets to projects (I'd be able to configure a property sheet and add it to project with all the necessary settings). But maybe I'm missing something? It's just that I try to move away from writing Android makefiles by hand to generating Tegra Nsight projects for them, but right now I have to set 4 or 5 settings by hand after each CMakeLists.txt change, because there is no way to set them from CMake. From parag at ionicsecurity.com Tue May 5 10:54:01 2015 From: parag at ionicsecurity.com (Parag Chandra) Date: Tue, 5 May 2015 14:54:01 +0000 Subject: [CMake] Set Visual Studio parameters not supported directly by CMake In-Reply-To: References: Message-ID: <6B35BEBA-83A3-4F5B-B14B-419D5401B06A@ionicsecurity.com> I asked about this a while back; I think it comes up repeatedly. The short answer seems to be that this is not supported, by design, so I have simply taken to post-processing the generated solutions with Python/Gradle scripts. Not ideal, but it has been working well enough for me. Parag Chandra Senior Software Engineer, Mobile Team Mobile: +1.919.824.1410 Ionic Security Inc. 1170 Peachtree St. NE STE 400, Atlanta, GA 30309 On 5/5/15, 2:39 PM, "Max Savenkov" wrote: >Is there any way to set a parameter of a Visual Studio project that is >not directly supported by a CMake property or keyword? > >This is especially important for the new platforms in Visual Studio, >like Android or Emscripten. There are a lot of fields I'd like to set, >like "Debuggable" flag, "JAR Dependencies" etc., but so far, CMake >doesn't know about them. > >It would help, if CMake could do some post-processing on generated >project files, or would support adding property sheets to projects >(I'd be able to configure a property sheet and add it to project with >all the necessary settings). > >But maybe I'm missing something? It's just that I try to move away >from writing Android makefiles by hand to generating Tegra Nsight >projects for them, but right now I have to set 4 or 5 settings by hand >after each CMakeLists.txt change, because there is no way to set them >from CMake. >-- > >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: >http://public.kitware.com/mailman/listinfo/cmake From Lucas.Pettey at engilitycorp.com Tue May 5 12:13:43 2015 From: Lucas.Pettey at engilitycorp.com (Lucas.Pettey at engilitycorp.com) Date: Tue, 5 May 2015 16:13:43 +0000 Subject: [CMake] Cray wrappers and Intel compilers Message-ID: <45BF0169B950CD4A97DC5223BB2B44B33A52EBB2@VACH-MX1.EGL.ENGILITYCORP.COM> Hello, I have been trying to use Cmake 3.2.2 on a Cray XC30 with the Intel compilers loaded. I encounter the following error: /opt/cray/craype/2.2.0/bin/cc -o CMakeFiles/cmTryCompileExec2303156381.dir/testCCompiler.c.o -c /p/home/lpettey/adh/parmetis-4.0.3/build/Linux-x86_64/CMakeFiles/CMakeTmp/testCCompiler.c Linking C executable cmTryCompileExec2303156381 /p/home/lpettey/cmake-3.2.2/install/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2303156381.dir/link.txt --verbose=1 /opt/cray/craype/2.2.0/bin/cc CMakeFiles/cmTryCompileExec2303156381.dir/testCCompiler.c.o -o cmTryCompileExec2303156381 -rdynamic ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../lib64/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie Is there any way to ask Cmake not to add the -rdynamic to the link line? I believe this is what is causing the error. Thanks, Lucas Pettey, PhD HPCMP PETTT EQM CTA Lead ERDC-DSRC OnSite Vicksburg, MS 512-297-9833 Mobile (preferred) 601-634-2980 Office lucas.pettey at engilitycorp.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From steveire at gmail.com Tue May 5 13:01:05 2015 From: steveire at gmail.com (Stephen Kelly) Date: Tue, 05 May 2015 19:01:05 +0200 Subject: [CMake] Alias of imported target References: Message-ID: CHEVRIER, Marc wrote: > > Hi, > > Currently it is not possible to create an alias target for an imported > target (I.e. add_library with ALIAS keyword). But I don?t understand what > is the technical constraint or semantic reason behind this limitation. If > anybody can explain this limitation, it will be nice. It was designed with as many restrictions as I could think of (everything which was not part of the need to add it at all): http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=370bf554 The restrictions are there because they are easy to lift later when a need arises without breaking user code. It also means that design considerations which were not known or understood two years ago can be considered in designing new interfaces. Do you have a need for ALIAS IMPORTED libraries? Can you describe it? Thanks, Steve. From kgt at lanl.gov Tue May 5 12:42:30 2015 From: kgt at lanl.gov (Thompson, KT) Date: Tue, 5 May 2015 16:42:30 +0000 Subject: [CMake] Cray wrappers and Intel compilers In-Reply-To: <45BF0169B950CD4A97DC5223BB2B44B33A52EBB2@VACH-MX1.EGL.ENGILITYCORP.COM> References: <45BF0169B950CD4A97DC5223BB2B44B33A52EBB2@VACH-MX1.EGL.ENGILITYCORP.COM> Message-ID: <0458DF31F610EF42BFC78C497E806C7B4588F45E@ECS-EXG-P-MB03.win.lanl.gov> Lucas, When using CMake on our Cray environments (XE6, Intel compilers under the Cray wrappers), I do the following: 1. Create CMakeCache.txt in the build directory with these contents: CMAKE_SYSTEM_NAME:STRING=Catamount CMAKE_C_COMPILER:FILEPATH=cc CMAKE_CXX_COMPILER:FILEPATH=CC CMAKE_Fortran_COMPILER:FILEPATH=ftn 2. cmake /path/to/source Maybe the CMake experts on the list can tell us a better way. -kt From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Lucas.Pettey at engilitycorp.com Sent: Tuesday, May 05, 2015 10:14 AM To: cmake ?[cmake at cmake.org]? Subject: [CMake] Cray wrappers and Intel compilers Hello, I have been trying to use Cmake 3.2.2 on a Cray XC30 with the Intel compilers loaded. I encounter the following error: /opt/cray/craype/2.2.0/bin/cc -o CMakeFiles/cmTryCompileExec2303156381.dir/testCCompiler.c.o -c /p/home/lpettey/adh/parmetis-4.0.3/build/Linux-x86_64/CMakeFiles/CMakeTmp/testCCompiler.c Linking C executable cmTryCompileExec2303156381 /p/home/lpettey/cmake-3.2.2/install/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2303156381.dir/link.txt --verbose=1 /opt/cray/craype/2.2.0/bin/cc CMakeFiles/cmTryCompileExec2303156381.dir/testCCompiler.c.o -o cmTryCompileExec2303156381 -rdynamic ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../lib64/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie Is there any way to ask Cmake not to add the -rdynamic to the link line? I believe this is what is causing the error. Thanks, Lucas Pettey, PhD HPCMP PETTT EQM CTA Lead ERDC-DSRC OnSite Vicksburg, MS 512-297-9833 Mobile (preferred) 601-634-2980 Office lucas.pettey at engilitycorp.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim.gallagher at gatech.edu Tue May 5 13:43:04 2015 From: tim.gallagher at gatech.edu (Tim Gallagher) Date: Tue, 5 May 2015 13:43:04 -0400 (EDT) Subject: [CMake] Cray wrappers and Intel compilers In-Reply-To: <0458DF31F610EF42BFC78C497E806C7B4588F45E@ECS-EXG-P-MB03.win.lanl.gov> Message-ID: <1675297743.29180690.1430847784117.JavaMail.root@mail.gatech.edu> We use a toolchain file to do the same thing: # the name of the target operating system SET(CMAKE_SYSTEM_NAME Catamount) # set the compiler set(CMAKE_C_COMPILER cc) set(CMAKE_CXX_COMPILER CC) set(CMAKE_Fortran_COMPILER ftn) There is more info on it if you search around: http://www.cmake.org/cmake/help/v3.0/manual/cmake-toolchains.7.html http://www.vtk.org/Wiki/CMake_Cross_Compiling Tim ----- Original Message ----- From: "KT Thompson" To: "Lucas Pettey" , "cmake ?[cmake at cmake.org]?" Sent: Tuesday, May 5, 2015 12:42:30 PM Subject: Re: [CMake] Cray wrappers and Intel compilers Lucas, When using CMake on our Cray environments (XE6, Intel compilers under the Cray wrappers), I do the following: 1. Create CMakeCache.txt in the build directory with these contents: CMAKE_SYSTEM_NAME:STRING=Catamount CMAKE_C_COMPILER:FILEPATH=cc CMAKE_CXX_COMPILER:FILEPATH=CC CMAKE_Fortran_COMPILER:FILEPATH=ftn 2. cmake /path/to/source Maybe the CMake experts on the list can tell us a better way. -kt From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Lucas.Pettey at engilitycorp.com Sent: Tuesday, May 05, 2015 10:14 AM To: cmake ?[cmake at cmake.org]? Subject: [CMake] Cray wrappers and Intel compilers Hello, I have been trying to use Cmake 3.2.2 on a Cray XC30 with the Intel compilers loaded. I encounter the following error: /opt/cray/craype/2.2.0/bin/cc -o CMakeFiles/cmTryCompileExec2303156381.dir/testCCompiler.c.o -c /p/home/lpettey/adh/parmetis-4.0.3/build/Linux-x86_64/CMakeFiles/CMakeTmp/testCCompiler.c Linking C executable cmTryCompileExec2303156381 /p/home/lpettey/cmake-3.2.2/install/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2303156381.dir/link.txt --verbose=1 /opt/cray/craype/2.2.0/bin/cc CMakeFiles/cmTryCompileExec2303156381.dir/testCCompiler.c.o -o cmTryCompileExec2303156381 -rdynamic ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../lib64/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie Is there any way to ask Cmake not to add the -rdynamic to the link line? I believe this is what is causing the error. Thanks, Lucas Pettey, PhD HPCMP PETTT EQM CTA Lead ERDC-DSRC OnSite Vicksburg, MS 512-297-9833 Mobile (preferred) 601-634-2980 Office lucas.pettey at engilitycorp.com -- 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: http://public.kitware.com/mailman/listinfo/cmake -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at recursivedream.com Tue May 5 14:26:44 2015 From: tom at recursivedream.com (Tom Davis) Date: Tue, 05 May 2015 14:26:44 -0400 Subject: [CMake] CMAKE_INSTALL_PREFIX not being used? In-Reply-To: <87bni52vn6.fsf@recursivedream.com> References: <87bni52vn6.fsf@recursivedream.com> Message-ID: <87pp6e284b.fsf@recursivedream.com> I now believe this is related to a thread back in December: http://public.kitware.com/pipermail/cmake/2014-December/059298.html It's super easy to reproduce: make a CMakeLists.txt file with set(CMAKE_INSTALL_PREFIX "foo") and watch it get written to cmake_install.cmake regardless of any command-line arguments or cache entries. Tom Davis writes: > I'm trying to install a project to /home/tom/usr/local instead of the standard > /usr/local. I have tried the following: > > $ mkdir build && cd build > $ cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/tom .. > > At this point, I have a CMakeCache.txt file that contains the correct path. I > have a cmake_install.cmake with the lines: > > if(NOT DEFINED CMAKE_INSTALL_PREFIX) > set(CMAKE_INSTALL_PREFIX "foo") > endif() > > Where "foo" is found in the project's CMakeLists.txt as a default install prefix > via `set(CMAKE_INSTALL_PREFIX ${CMAKE_PROJECT_NAME})`. Unfortunately, when I run > `make install`, the project is still being installed to `build/foo/`. My > apparently incorrect understanding is that passing the value on the command line > initially would override whatever was set() in the project's CMakeLists.txt, but > that isn't the case. > > Since I'm actually installing this project using ExternalProject_Add(), how can > I override the set() in the project's CMakeLists.txt, if not by using the extra > argument during the CONFIGURE step? From veredz72 at gmail.com Tue May 5 17:14:05 2015 From: veredz72 at gmail.com (Zvi Vered) Date: Wed, 6 May 2015 00:14:05 +0300 Subject: [CMake] cmake 3.2.2 ignores toolchain file Message-ID: Hello, I?m running cmake 3.2.2 under win7-64. I used the following toolchain file; ************************************* INCLUDE(CMakeForceCompiler) SET(CMAKE_SYSTEM_NAME Generic) SET(CMAKE_CROSSCOMPILING TRUE) SET(CMAKE_FORCE_C_COMPILER chc12 MetrowerksHicross) #SET(CMAKE_C_COMPILER D:/WorkBench_3_3_2/diab/5.9.1.0/WIN32/bin/dcc) SET(CMAKE_C_FLAGS -g) SET(CMAKE_AR D:/WorkBench_3_3_2/diab/5.9.1.0/WIN32/bin/dar) SET(CMAKE_COMPILER_IS_GNUCC FALSE) SET(CMAKE_C_COMPILER_ID 0) # search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) **************************************** Then I ran: cmake ../libssh-0.6.4 -DCMAKE_TOOLCHAIN_FILE=toolchain.txt And got: D:\zvi_vered\library\libssh\libssh\build>cmake ../libssh-0.6.4 -DCMAKE_TOOLCHAIN_FILE=toolchain.txt -- Building for: Visual Studio 9 2008 -- The C compiler identification is MSVC 15.0.30729.1 -- Check for working C compiler using: Visual Studio 9 2008 -- Check for working C compiler using: Visual Studio 9 2008 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done CMake Error at C:/cmake-3.2.2-win32-x86/share/cmake-3.2/Modules/FindPackageHandl Could NOT find ZLIB (missing: ZLIB_INCLUDE_DIR ZLIB_LIBRARY) Call Stack (most recent call first): C:/cmake-3.2.2-win32-x86/share/cmake-3.2/Modules/FindPackageHandleStandardArgs cmake/Modules/FindZLIB.cmake:112 (find_package_handle_standard_args) CMakeLists.txt:44 (find_package) It seems CMake ignores my toolchain file. Why does it insist "Building for Visual Studio 9 2008" ? I also tried entering a full path of toolchain.txt When I entered an invalid path I got the same output. Best regards, Zvika -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Tue May 5 22:23:07 2015 From: DLRdave at aol.com (David Cole) Date: Tue, 5 May 2015 22:23:07 -0400 Subject: [CMake] ExternalProject_Add // git shallow clone In-Reply-To: References: <3E357F8F-DAB7-4571-9291-251ECF3B4AA1@aol.com> Message-ID: Of course. It would be useful. Perhaps you could propose a patch to add it? On Tuesday, May 5, 2015, Sergei Nikulov wrote: > Hello David, > > Thank you for answer. > > It could be useful feature for ExternalProject.cmake > What do your think? > > > 2015-05-05 16:13 GMT+03:00 David Cole >: > >> It's possible to do anything you want if you provide your own custom >> DOWNLOAD_COMMAND. >> >> I'm not aware of any depth options exposed via ExternalProject_Add, >> though. >> >> >> HTH, >> David C. >> >> >> > On May 5, 2015, at 5:19 AM, Sergei Nikulov > > wrote: >> > >> > Hello All, >> > >> > Is it possible to provide git depth option for ExternalProject_Add >> command? >> > I see no such option for GIT_... parameters in documentation. >> > >> > >> > Thank you. >> > >> > >> > -- >> > Best Regards, >> > Sergei Nikulov >> > -- >> > >> > 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: >> > http://public.kitware.com/mailman/listinfo/cmake >> > > > > -- > Best Regards, > Sergei Nikulov > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.chevrier at sap.com Wed May 6 02:51:12 2015 From: marc.chevrier at sap.com (CHEVRIER, Marc) Date: Wed, 6 May 2015 06:51:12 +0000 Subject: [CMake] Alias of imported target In-Reply-To: References: Message-ID: <578B2208-D921-45B6-8886-A0342E4D0B0B@sap.com> My need is the following: I have two imported targets, let say, IMPORTED::TARGET and IMPORTED::STATIC::TARGET And I have a project which can be customised, through an option, by selecting which imported target will be used (shared or static). So I tried, at first place: if (USE_IMPORTED_STATIC) add_library (MY_IMPORTED_TARGET ALIAS IMPORTED::STATIC::TARGET) else() add_library (MY_IMPORTED_TARGET ALIAS IMPORTED::TARGET) endif() So, after, I do not longer take care of which imported target is selected! For now, I rely on a variable storing selected imported target but it is, by far, less elegant and coherent with target handling. On 05/05/15 19:01, "Stephen Kelly" wrote: >CHEVRIER, Marc wrote: > >> >> Hi, >> >> Currently it is not possible to create an alias target for an imported >> target (I.e. add_library with ALIAS keyword). But I don?t understand what >> is the technical constraint or semantic reason behind this limitation. If >> anybody can explain this limitation, it will be nice. > >It was designed with as many restrictions as I could think of (everything >which was not part of the need to add it at all): > > http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=370bf554 > >The restrictions are there because they are easy to lift later when a need >arises without breaking user code. It also means that design considerations >which were not known or understood two years ago can be considered in >designing new interfaces. > >Do you have a need for ALIAS IMPORTED libraries? Can you describe it? > >Thanks, > >Steve. > > >-- > >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: >http://public.kitware.com/mailman/listinfo/cmake From cedric.doucet at inria.fr Wed May 6 07:07:30 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Wed, 6 May 2015 13:07:30 +0200 (CEST) Subject: [CMake] Correct usage of the find_path command In-Reply-To: <228001886.3205704.1430909721490.JavaMail.zimbra@inria.fr> Message-ID: <1438718480.3209342.1430910450605.JavaMail.zimbra@inria.fr> Hello, I try to create my first FindXXX.cmake and use find_package inside. My goal is to check that a repository exists: it's always the same because it come from the ExternalProject_add command. However, I don't manage to write a first very simple version. I can't find the path I want. I would like to check that /usr/local/bibliotheques/eigen/3.2.4/include/eigen3/Eigen/Core exists. My file organization is the following: project/ CMakeLists.txt build/ modules/ FindEigen.cmake The CMakeLists.txt contains the following lines: ## cmake_minimum_required (VERSION 2.6) project (example CXX) set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/modules) find_package(Eigen) ## The FindEigen.cmake file contains these lines: ## find_path(EIGEN_INCLUDE_DIR Eigen/Core HINTS "/usr/local/bibliotheques/eigen/3.2.4/include/eigen3/" NO_DEFAULT_PATH) if(EIGEN_FOUND) message(STATUS "Eigen found (include: ${EIGEN_INCLUDE_DIRS})") else(EIGEN_FOUND) message(STATUS "Eigen NOT found (include: ${EIGEN_INCLUDE_DIRS})") endif(EIGEN_FOUND) ## >From the "build" directory, I type "cmake .." in a terminal and get: -- Eigen NOT found (include: ) -- Configuring done -- Generating done -- Build files have been written to: project/find_package/build Could explain me what I am doing wrong? Thank you very much! C?dric -------------- next part -------------- An HTML attachment was scrubbed... URL: From iacovelli_mail at yahoo.it Wed May 6 13:44:13 2015 From: iacovelli_mail at yahoo.it (Saverio Iacovelli) Date: Wed, 6 May 2015 17:44:13 +0000 (UTC) Subject: [CMake] problems in building opencv (zlib.h: No such file or directory) Message-ID: <260006844.2329990.1430934253449.JavaMail.yahoo@mail.yahoo.com> Hi, I have serious problems in installing OpenCV 2.4 on my Ubuntu Linux machine (Linux 2.6.32-24-generic #43-Ubuntu SMP ... x86_64 GNU/Linux). Firstly I use cmake as below: cmake -D CMAKE_INSTALL_PREFIX:PATH=/pathwherebuilding /path-to-source ?Secondly I use make but there are the following errors: [? 0%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfPxr24Compressor.cpp.o /shared/sav/opencv-2.4.11/3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp:75:18: zlib.h: No such file or directory /shared/sav/opencv-2.4.11/3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp: In member function `int Imf::Pxr24Compressor::compress(const char*, int, Imath::Box2i, const char*&)':.........make[2]: *** [3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfPxr24Compressor.cpp.o] Error 1 make[1]: *** [3rdparty/openexr/CMakeFiles/IlmImf.dir/all] Error 2 make: *** [all] Error 2 I am completly stuck and I do not know how to proceed.How can I solve this problem? Thank you, Saverio -------------- next part -------------- An HTML attachment was scrubbed... URL: From buckshag at gmail.com Wed May 6 18:10:32 2015 From: buckshag at gmail.com (John van der Burg) Date: Thu, 7 May 2015 00:10:32 +0200 Subject: [CMake] Making the export function output relative paths Message-ID: Hi, I'm trying to get my head around CMake config files to use in combination with find_package. So currently I have a given library target setup. Then I call a configure_package_config_file to generate some TargetConfig.cmake. After that I call an export on the target. The files are generated fine, and it looks fine, except for one thing, which is that the libraries it imports use absolute paths. The export command generates the cmake file which imports targets, but it does it like this, using absolute paths: set_target_properties(MCore PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" IMPORTED_LOCATION_PROFILE *"C:/Test/Lib/MCore_Debug.lib"* ) As I cannot ship the config files using absolute paths I need to make them use relative paths. However I cannot get the export command to output a relative path. Does anyone know how I should do this? Or using some prefix variable and then relative to that. I currently export like this: -------------- configure_package_config_file( "MCoreConfig.cmake.in" "${CMAKE_BINARY_DIR}/MCoreConfig.cmake" INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} PATH_VARS INCLUDE_DIR CONF_RELATIVE_DIR CUSTOM_ROOT) export( TARGETS MCore FILE "${CMAKE_BINARY_DIR}/MCoreTargets.cmake" ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/MCoreConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/MCoreTargets.cmake" DESTINATION "${CUSTOM_ROOT}/CMake" ) ----------- I basically need everything relative to the ${CUSTOM_ROOT} folder. Any hints/help would be appreciated :) Thanks, - John -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruslan_baratov at yahoo.com Thu May 7 08:57:31 2015 From: ruslan_baratov at yahoo.com (Ruslan Baratov) Date: Thu, 07 May 2015 15:57:31 +0300 Subject: [CMake] Alias of imported target In-Reply-To: References: Message-ID: <554B613B.6050509@yahoo.com> On 05-May-15 20:01, Stephen Kelly wrote: > CHEVRIER, Marc wrote: > >> Hi, >> >> Currently it is not possible to create an alias target for an imported >> target (I.e. add_library with ALIAS keyword). But I don?t understand what >> is the technical constraint or semantic reason behind this limitation. If >> anybody can explain this limitation, it will be nice. > It was designed with as many restrictions as I could think of (everything > which was not part of the need to add it at all): > > http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=370bf554 > > The restrictions are there because they are easy to lift later when a need > arises without breaking user code. It also means that design considerations > which were not known or understood two years ago can be considered in > designing new interfaces. > > Do you have a need for ALIAS IMPORTED libraries? Can you describe it? > > Thanks, > > Steve. > > It may be helpful in situations when you build package with examples. In case when you want examples to work both as a part of a project (add_subdirectory) or stand-alone (find_package). For instance: if(TARGET bar) # bar and boo targets in the same project add_library(Foo::bar ALIAS bar) else() # boo installed first, bar build as a stand-alone project find_package(Foo CONFIG REQUIRED) # target Foo::bar endif() target_link_libraries(boo Foo::bar) If ALIAS will be allowed for imported targets we can write: if(NOT TARGET bar) find_package(Foo CONFIG REQUIRED) add_libarary(bar ALIAS Foo::bar) endif() target_link_libraries(boo bar) We are not saving any space here and it's not critical feature, but this symmetry looks reasonable. Ruslo From w.bekker at vdgsecurity.com Thu May 7 11:00:37 2015 From: w.bekker at vdgsecurity.com (Wim Bekker) Date: Thu, 07 May 2015 17:00:37 +0200 Subject: [CMake] Qt help cannot find google analytics Message-ID: <554B7E15.4070400@vdgsecurity.com> Hi, I've just downloaded and installed the 3.2 QtHelp documentation. Wheneven I want to see the help for something (say add_executable) the Qt help comes with a large list to choose a topic from. Every topic I choose comes with a page "Host www.google-analytics.com not found". Only the very first time I got an actual help page. Is that something in Qt-creator or in the cmake QtHelp? How to solve this and see the real help pages? Thanks, Wim From soonhok at cs.cmu.edu Thu May 7 12:27:50 2015 From: soonhok at cs.cmu.edu (Soonho Kong) Date: Thu, 7 May 2015 12:27:50 -0400 Subject: [CMake] When is UPDATE_COMMAND executed in External Project? Message-ID: I'm using ExternalProject_Add in my CMakeList.txt file and I'm wondering when it's executed. Ideally, I want to execute this whenever a user is running a build command (i.e. make/ninja). However, it seems that this is not the case for now. Is there a way to achieve this goal? Best, Soonho -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.king at kitware.com Thu May 7 14:16:56 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 07 May 2015 14:16:56 -0400 Subject: [CMake] Qt help cannot find google analytics In-Reply-To: <554B7E15.4070400@vdgsecurity.com> References: <554B7E15.4070400@vdgsecurity.com> Message-ID: <554BAC18.7040503@kitware.com> On 05/07/2015 11:00 AM, Wim Bekker wrote: > I've just downloaded and installed the 3.2 QtHelp documentation. > Every topic I choose comes with a page "Host www.google-analytics.com > not found". That was a problem with the way the file was generated that is now fixed. Please download a fresh copy and try again. Make sure your browser cache doesn't give you the same file again. -Brad From w.bekker at vdgsecurity.com Fri May 8 03:22:16 2015 From: w.bekker at vdgsecurity.com (Wim Bekker) Date: Fri, 08 May 2015 09:22:16 +0200 Subject: [CMake] Qt help cannot find google analytics In-Reply-To: <554BAC18.7040503@kitware.com> References: <554B7E15.4070400@vdgsecurity.com> <554BAC18.7040503@kitware.com> Message-ID: <554C6428.4050604@vdgsecurity.com> Thanks. Works fine now. Brad King schreef op 2015-05-07 om 20-16: > On 05/07/2015 11:00 AM, Wim Bekker wrote: >> I've just downloaded and installed the 3.2 QtHelp documentation. >> Every topic I choose comes with a page "Host www.google-analytics.com >> not found". > That was a problem with the way the file was generated that is now > fixed. Please download a fresh copy and try again. Make sure your > browser cache doesn't give you the same file again. > > -Brad > From sachin.kernel at gmail.com Fri May 8 08:54:41 2015 From: sachin.kernel at gmail.com (Sachin Gaikwad) Date: Fri, 8 May 2015 18:24:41 +0530 Subject: [CMake] Cmake: VS2013: General -> Whole Program Optimization (/LTCG) Message-ID: Hi all, I am using: - cmake-3.0.2 - Visual Studio 2013 (Update 4) I get this log message in build logs when I build any target in my Visual Studio solution: "MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance" I read online on this and found this Microsoft link ( https://msdn.microsoft.com/en-us/library/xbf3tbeh.aspx) which suggests that I should set "Whole Program Optimization" under "General" properties to "Use Link Time Code Generation" (/LTCG). I am not able to figure out which cmake variables I should set this in? I tried setting this flag in following variables, but it did not work. CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS Thanks, Sachin -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.kreuzberger at procitec.de Fri May 8 09:02:26 2015 From: j.kreuzberger at procitec.de (=?utf-8?Q?J=C3=B6rg_Kreuzberger?=) Date: Fri, 8 May 2015 15:02:26 +0200 Subject: [CMake] =?utf-8?q?find=5Ffile_unexpected_finds?= Message-ID: Hi! i have a problem with find_file, finding files in directory structures not part of the PATHS option and no other CMAKE VARIABLES relevant to find_file set. I use find_file to find external libraries in different versions, they are located in different git repos. each repo has its find script E.g. /libexternv1/cmake/FindLibExternV1.cmake /libexternv1/lib/win/alib.lib /libexternv2/cmake/FindLibExternV2.cmake /libexternv2/lib/win/alib.lib /project/CMakeLists.txt -> the CMAKE_SOURCE_DIR the project now includes the correct FinLibExternV2.cmake (using include( ../libexternv1/cmake/FindLibExternV2.cmake ) in FindLibExternV2, the lib search with findfile find_file( alib.lib PATHS ${CMAKE_CURRENT_LIST_DIR}/../lib/win/alib.lib ) My problem is: it always finds the lib from the libexternv1 directory, seems to ignore the PATHS hint. FindLibExternV1.cmake is never included. Environment: CMAKE 3.2.2 and Visual Studio Generator 2013 x64 on Win7 From nilsgladitz at gmail.com Fri May 8 09:26:06 2015 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Fri, 08 May 2015 15:26:06 +0200 Subject: [CMake] find_file unexpected finds In-Reply-To: References: Message-ID: <554CB96E.3060707@gmail.com> On 05/08/2015 03:02 PM, J?rg Kreuzberger wrote: > the project now includes the correct FinLibExternV2.cmake (using include( ../libexternv1/cmake/FindLibExternV2.cmake ) > in FindLibExternV2, the lib search with findfile include() for find modules? Find modules that are part of the package which they are meant to locate? That sounds suspiciously like your find modules are trying to be package configuration files. Assuming the packages are under your control you might want to switch to actual package configuration files [1]. > > find_file( alib.lib PATHS ${CMAKE_CURRENT_LIST_DIR}/../lib/win/alib.lib ) > > My problem is: it always finds the lib from the libexternv1 directory, seems to ignore the PATHS hint. FindLibExternV1.cmake is never included. For libraries you normally want find_library() rather than find_file(). PATHS and HINTS are expected to be directory paths not file paths. Given that you already know location and name of the library why even use find_*()? Is it possible that is already set in CMakeCache.txt? find_file() is a noop if has already been set to a path from an earlier run. Nils [1] http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html#using-packages From jchris.fillionr at kitware.com Fri May 8 11:05:43 2015 From: jchris.fillionr at kitware.com (Jean-Christophe Fillion-Robin) Date: Fri, 8 May 2015 11:05:43 -0400 Subject: [CMake] problems in building opencv (zlib.h: No such file or directory) In-Reply-To: <260006844.2329990.1430934253449.JavaMail.yahoo@mail.yahoo.com> References: <260006844.2329990.1430934253449.JavaMail.yahoo@mail.yahoo.com> Message-ID: Hi Saverio, Make sure you install zlib dev package. That way the header will be found on the system. On Ubuntu 14.04, you could do it using the following command: $ sudo apt-get install zlib1g-dev See http://packages.ubuntu.com/trusty/zlib1g-dev Hth Jc On Wed, May 6, 2015 at 1:44 PM, Saverio Iacovelli wrote: > Hi, > > I have serious problems in installing OpenCV 2.4 on my Ubuntu Linux > machine (Linux 2.6.32-24-generic #43-Ubuntu SMP ... x86_64 GNU/Linux). > > Firstly I use cmake as below: > > cmake -D CMAKE_INSTALL_PREFIX:PATH=/pathwherebuilding /path-to-source > > Secondly I use make but there are the following errors: > > [ 0%] Building CXX object > 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfPxr24Compressor.cpp.o > /shared/sav/opencv-2.4.11/3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp:75:18: > zlib.h: No such file or directory > /shared/sav/opencv-2.4.11/3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp: > In member function `int Imf::Pxr24Compressor::compress(const char*, int, > Imath::Box2i, const char*&)': > ... > ... > ... > make[2]: *** > [3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfPxr24Compressor.cpp.o] > Error 1 > make[1]: *** [3rdparty/openexr/CMakeFiles/IlmImf.dir/all] Error 2 > make: *** [all] Error 2 > > I am completly stuck and I do not know how to proceed. > How can I solve this problem? > > Thank you, > Saverio > > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -- +1 919 869 8849 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mpercossi at zenaud.io Fri May 8 11:16:00 2015 From: mpercossi at zenaud.io (Martin Percossi) Date: Fri, 8 May 2015 17:16:00 +0200 Subject: [CMake] Create package for specific application bundle Message-ID: Hello, My situation is as follows. I'm creating an OSX application with MACOSX_BUNDLE for my main target. In addition, my project creates a helper application (also a bundle), and this is copied into the PlugIns directory of the main target using an INSTALL command. So my CMake project contains two subdirectories, one for the "application" target, and one for the "helper" target. So far, so good. The problem is that now I want to package this. For now, I'm using a simple tar.gz package generator, although I'd also like to package to a .dmg or installer (not sure which yet). The default package command, of course, packages the "helper" app _next to_ the application in the tarball -- this is not what I want, since I have already packaged the helper app into the main applications app bundle. I've tried using components, by setting the INSTALL commands for the helper to "helper_component", and the commands for the main application to "application_component", and then specifying that I only want a package for application_component via *CPACK_COMPONENTS_ALL. *Unfortunately, that still packages both. I've also tried the approach of creating separate sub-projects for each of the application and helper targets, and attempting: set(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_INSTALL_PREFIX}" "application" "ALL" "/" ) include(CPack) in the top-level CMakeLists.txt. In this case, CPack fails entirely to create a package: CPack: Create package using STGZ CPack: Install projects CPack: - Run preinstall target for: application CPack Error: Problem running install command: "/usr/bin/make" "preinstall" Please check /Users/mpercossi/zenAud.io/src/zenAud.io/build/ninja/_CPack_Packages/Darwin/STGZ/PreinstallOutput.log for errors CPack Error: Error when generating package: zenAud.io make: *** [package] Error 1 Surely what I'm trying to do is reasonably typical? I simply want to exclude a target (and associated INSTALL commands) from packaging. Could someone point me to the correct approach, whether with COMPONENT declarations for the INSTALL commands, or subprojects? Kind regards, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From soonhok at cs.cmu.edu Fri May 8 11:25:24 2015 From: soonhok at cs.cmu.edu (Soonho Kong) Date: Fri, 8 May 2015 11:25:24 -0400 Subject: [CMake] when is UPDATE_COMMAND executed in External Project? In-Reply-To: References: Message-ID: By re-reading my previous message, I realized that the question was mis-leading. The following is what I wanted to know: 1. When is "UPDATE_COMMAND" of external projects executed in cmake's workflow? 2. How to make UPDATE_COMMAND running every time a user is running 'make/ninja'? Best, Soonho On Thu, May 7, 2015 at 11:03 AM, Soonho Kong wrote: > Hi, > > I'm using ExternalProject_Add in my CMakeList.txt file and I'm wondering > when it's executed. Ideally, I want to execute this whenever a user is > running a build command (i.e. make/ninja). However, it seems that this is > not the case for now. Is there a way to achieve this goal? > > Best, > Soonho From soonhok at cs.cmu.edu Fri May 8 15:18:54 2015 From: soonhok at cs.cmu.edu (Soonho Kong) Date: Fri, 8 May 2015 19:18:54 +0000 (UTC) Subject: [CMake] =?utf-8?q?When_is_UPDATE=5FCOMMAND_executed_in_External_P?= =?utf-8?q?roject=3F?= References: Message-ID: Soonho Kong writes: > I'm using ExternalProject_Add in my?CMakeList.txt file?and?I'm > wondering when it's executed. Ideally, I want to execute this > whenever a user is running a build command (i.e. make/ninja). > However, it seems that this is not the case for now. Is there a way > to achieve this goal? > > Best,Soonho > By re-reading my previous message, I realized that the question was misleading. The following is what I wanted to ask: 1. When is "UPDATE_COMMAND" of external projects executed in cmake's workflow? 2. How to make UPDATE_COMMAND running every time a user is running 'make/ninja'? Best, Soonho From paul at lightunobscured.com Fri May 8 15:51:21 2015 From: paul at lightunobscured.com (Paul Annetts) Date: Fri, 8 May 2015 20:51:21 +0100 Subject: [CMake] Cmake: VS2013: General -> Whole Program Optimization (/LTCG) In-Reply-To: References: Message-ID: It's a linker flag, so for a target of "MyTarget" use: set_target_properties(MyTarget PROPERTIES LINK_FLAGS "/LTCG") (I had to do this for this exact flag, so I know this should work) Hope that helps, Paul. From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Sachin Gaikwad Sent: 08 May 2015 13:55 To: cmake at cmake.org Subject: [CMake] Cmake: VS2013: General -> Whole Program Optimization (/LTCG) Hi all, I am using: - cmake-3.0.2 - Visual Studio 2013 (Update 4) I get this log message in build logs when I build any target in my Visual Studio solution: "MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance" I read online on this and found this Microsoft link (https://msdn.microsoft.com/en-us/library/xbf3tbeh.aspx) which suggests that I should set "Whole Program Optimization" under "General" properties to "Use Link Time Code Generation" (/LTCG). I am not able to figure out which cmake variables I should set this in? I tried setting this flag in following variables, but it did not work. CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS Thanks, Sachin -------------- next part -------------- An HTML attachment was scrubbed... URL: From eldlistmailingz at tropicsoft.com Sat May 9 01:27:32 2015 From: eldlistmailingz at tropicsoft.com (Edward Diener) Date: Sat, 09 May 2015 01:27:32 -0400 Subject: [CMake] Using the FindBoost package Message-ID: The code is not mine but I am trying to get it to work. On Windows the code is calling into the FindBoost.cmake package via a find_package call. Before calling find_package the code sets the Boost_INCLUDE_DIR and Boost_LIBRARY_DIR to the respective Boost 'boost' and Boost 'libs' subdirectories of a Boost installation under Windows. This causes a failure because FindBoost looks for the version.h file as Boost_INCLUDE_DIR/boost/version.h. This implies that the Boost_INCLUDE_DIR ios supposed to be the top-level installation directory, but when it is set to that I get errors saying that none of the Boost libraries can be found. It seems as if FindBoost.cmake is not meant to work on Windows, but only on Linux. How can I make the call to FindBoost work successfully ? From mjklaim at gmail.com Sat May 9 06:22:22 2015 From: mjklaim at gmail.com (=?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?=) Date: Sat, 9 May 2015 12:22:22 +0200 Subject: [CMake] Using the FindBoost package In-Reply-To: References: Message-ID: I might be wrong but maybe you mixed up BOOST_INCLUDEDIR and Boost_INCLUDE_DIR? (note the additional underscore) >From the documentation the first one is read to deduce the second one. Their name is unfortunately very close. I never tried to use BOOST_INCLUDEDIR directly, I only set a BOOST_ROOT and BOOST_LIBRARYDIR on windows. On Sat, May 9, 2015 at 7:27 AM, Edward Diener < eldlistmailingz at tropicsoft.com> wrote: > The code is not mine but I am trying to get it to work. On Windows the > code is calling into the FindBoost.cmake package via a find_package call. > Before calling find_package the code sets the Boost_INCLUDE_DIR and > Boost_LIBRARY_DIR to the respective Boost 'boost' and Boost 'libs' > subdirectories of a Boost installation under Windows. This causes a failure > because FindBoost looks for the version.h file as > Boost_INCLUDE_DIR/boost/version.h. This implies that the Boost_INCLUDE_DIR > ios supposed to be the top-level installation directory, but when it is set > to that I get errors saying that none of the Boost libraries can be found. > It seems as if FindBoost.cmake is not meant to work on Windows, but only on > Linux. > > How can I make the call to FindBoost work successfully ? > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjklaim at gmail.com Sat May 9 06:23:33 2015 From: mjklaim at gmail.com (=?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?=) Date: Sat, 9 May 2015 12:23:33 +0200 Subject: [CMake] Using the FindBoost package In-Reply-To: References: Message-ID: On Sat, May 9, 2015 at 12:22 PM, Klaim - Jo?l Lamotte wrote: > I might be wrong but maybe you mixed up BOOST_INCLUDEDIR > and Boost_INCLUDE_DIR? (note the additional underscore) > From the documentation the first one is read to deduce the second one. > To clarify: BOOST_INCLUDEDIR is listed in input variables while Boost_INCLUDE_DIR is listed in output variables. http://www.cmake.org/cmake/help/v3.2/module/FindBoost.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From Miroslav.Ilias at umb.sk Sat May 9 06:28:36 2015 From: Miroslav.Ilias at umb.sk (Ilias Miroslav) Date: Sat, 9 May 2015 10:28:36 +0000 Subject: [CMake] ctest not sending xlm-files to dashboard Message-ID: <0EC91541DFCC614DB6B36C4BAE80AB6E0FDE0A77@MAILBOX3.umb.sk> Dear experts, I found that ctest is not sending resulting xml-files to the CDash-board. This is the ctest of version 3.2.0-rc1 on Windows server 2012. With the "ctest -D ExperimentalSubmit" command in the bat-script, which is launched automatically during the night by the Task Scheduler (when the user -me - is logged out), the report looks like: -------------------------------------------------------------------------------------------------- Site: CHEMIA Build name: WinS12_MinGW64_i8_OpenBLAS_parallel_cloned Create new tag: 20150509-0037 - Miro Submit files (using http) Send to track: Miro Using HTTP submit method Drop site:http://testboard.org/cdash/submit.php?project=DIRAC Submission successful ------------------------------------------------------------------------------------------------------ I don't understand why the ctest above created the new tag, "20150509-0037 - Miro", because the desired xml-files are ready in the other subdirectory, "20150508-2152": ---------------------------------------------------------- Directory of C:\Users\milias\Documents\work\software\dirac\trunk_cloned\build_mingw64_i8_tests\Testing\20150508-2152 05/09/2015 02:37 AM . 05/09/2015 02:37 AM .. 05/09/2015 12:24 AM 32,103 Build.xml 05/08/2015 11:52 PM 4,244 Configure.xml 05/09/2015 02:37 AM 179,765 Test.xml 3 File(s) 216,112 bytes 2 Dir(s) 25,267,957,760 bytes free C:\Users\milias\Documents\work\software\dirac\trunk_cloned\build_mingw64_i8_tests\Testing\20150508-2152> -------------------------------------------------------------------------------------------------------------------- Any help, please ? This night build spanned 05/08/2015 and 05/09/2015. Yours, Miro From Miroslav.Ilias at umb.sk Sun May 10 00:37:53 2015 From: Miroslav.Ilias at umb.sk (Ilias Miroslav) Date: Sun, 10 May 2015 04:37:53 +0000 Subject: [CMake] ctest not sending xlm-files to dashboard In-Reply-To: <0EC91541DFCC614DB6B36C4BAE80AB6E0FDE0A77@MAILBOX3.umb.sk> References: <0EC91541DFCC614DB6B36C4BAE80AB6E0FDE0A77@MAILBOX3.umb.sk> Message-ID: <0EC91541DFCC614DB6B36C4BAE80AB6E0FDE0C12@MAILBOX3.umb.sk> Hi again, I upgraded ctest to version 3.2.2, the problem remains. It seems the problem is related to re-creating new tag at the end of tests, what is happening the next day after midnight. Here we have log at the beginning of the test, 09/05/2015: configure step is done now you need to compile the sources: $ cd build_mingw64_i8_tests $ make Site: CHEMIA Build name: WinS12_MinGW64_i8_OpenBLAS_parallel_cloned Create new tag: 20150509-2153 - Miro Configure project with the proper directory name, containing xlm-files ready for output: Directory of C:\Users\milias\Documents\work\software\dirac\trunk_cloned\build_mingw64_i8_tests\Testing\20150509-2153 05/10/2015 02:38 AM . 05/10/2015 02:38 AM .. 05/10/2015 12:28 AM 32,099 Build.xml 05/09/2015 11:53 PM 4,236 Configure.xml 05/10/2015 02:38 AM 180,342 Test.xml but again, at the end of the test (on 10/05/2015) it creates new tag "20150510-0038 - Miro", but there is no Testing\20150510-0038 subdirectory with corresponding xml-files: Site: CHEMIA Build name: WinS12_MinGW64_i8_OpenBLAS_parallel_cloned Create new tag: 20150510-0038 - Miro Submit files (using http) Send to track: Miro Using HTTP submit method Drop site:http://testboard.org/cdash/submit.php?project=DIRAC Submission successful maybe I should replace individual ctest commands ctest -D ExperimentalConfigure --track Miro 1>>%LOG% 2>&1 ctest -j 2 -D ExperimentalBuild --track Miro 1>>%LOG% 2>&1 ctest -j 2 -D ExperimentalTest --track Miro 1>>%LOG% 2>&1 ctest -D ExperimentalSubmit --track Miro 1>>%LOG% 2>&1 by one "do-it-all command": ctest -j 2 -D Experimental --track Miro 1>>%LOG% 2>&1 Best, Miro ________________________________________ From: Ilias Miroslav Sent: Saturday, May 09, 2015 12:28 PM To: cmake at cmake.org Subject: ctest not sending xlm-files to dashboard Dear experts, I found that ctest is not sending resulting xml-files to the CDash-board. This is the ctest of version 3.2.0-rc1 on Windows server 2012. With the "ctest -D ExperimentalSubmit" command in the bat-script, which is launched automatically during the night by the Task Scheduler (when the user -me - is logged out), the report looks like: -------------------------------------------------------------------------------------------------- Site: CHEMIA Build name: WinS12_MinGW64_i8_OpenBLAS_parallel_cloned Create new tag: 20150509-0037 - Miro Submit files (using http) Send to track: Miro Using HTTP submit method Drop site:http://testboard.org/cdash/submit.php?project=DIRAC Submission successful ------------------------------------------------------------------------------------------------------ I don't understand why the ctest above created the new tag, "20150509-0037 - Miro", because the desired xml-files are ready in the other subdirectory, "20150508-2152": ---------------------------------------------------------- Directory of C:\Users\milias\Documents\work\software\dirac\trunk_cloned\build_mingw64_i8_tests\Testing\20150508-2152 05/09/2015 02:37 AM . 05/09/2015 02:37 AM .. 05/09/2015 12:24 AM 32,103 Build.xml 05/08/2015 11:52 PM 4,244 Configure.xml 05/09/2015 02:37 AM 179,765 Test.xml 3 File(s) 216,112 bytes 2 Dir(s) 25,267,957,760 bytes free C:\Users\milias\Documents\work\software\dirac\trunk_cloned\build_mingw64_i8_tests\Testing\20150508-2152> -------------------------------------------------------------------------------------------------------------------- Any help, please ? This night build spanned 05/08/2015 and 05/09/2015. Yours, Miro From fw at deneb.enyo.de Sun May 10 07:09:37 2015 From: fw at deneb.enyo.de (Florian Weimer) Date: Sun, 10 May 2015 13:09:37 +0200 Subject: [CMake] CHECK_C_SOURCE_COMPILES and include_directories Message-ID: <87sib4lmdq.fsf@mid.deneb.enyo.de> I have this in my CMakeLists.file: | find_path ( | NSS_INCLUDE_DIR pk11pub.h | PATH_SUFFIXES include/nss include/nss3 | ) | | find_path ( | NSPR_INCLUDE_DIR prtypes.h | PATH_SUFFIXES include/nspr include/nspr4 | ) | | find_path ( | PQ_INCLUDE_DIR libpq-fe.h | PATH_SUFFIXES include include/postgresql | ) | | include_directories ( | ${PROJECT_SOURCE_DIR}/include | ${NSS_INCLUDE_DIR} | ${NSPR_INCLUDE_DIR} | ${PQ_INCLUDE_DIR} | ${CMAKE_CURRENT_BINARY_DIR} | ) | | CHECK_C_SOURCE_COMPILES ("#include | int main() { PGRES_SINGLE_TUPLE; return 0; } | " | HAVE_PG_SINGLE_TUPLE | ) However, I can see that is invoked without the include directories: /usr/bin/cc -DHAVE_PG_SINGLE_TUPLE -o CMakeFiles/cmTryCompileExec3118615492.dir/src.c.o -c /home/fw/src/symboldb/build/CMakeFiles/CMakeTmp/src.c Is there a way to make CHECK_C_SOURCE_COMPILES honor the discovered include directories? From eike at sf-mail.de Sun May 10 07:38:57 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Sun, 10 May 2015 13:38:57 +0200 Subject: [CMake] CHECK_C_SOURCE_COMPILES and include_directories In-Reply-To: <87sib4lmdq.fsf@mid.deneb.enyo.de> References: <87sib4lmdq.fsf@mid.deneb.enyo.de> Message-ID: <3702747.qGRlXZz5J8@eto> Florian Weimer wrote: > Is there a way to make CHECK_C_SOURCE_COMPILES honor the discovered > include directories? cmake --help-module CheckCSourceCompiles The following variables may be set before calling this macro to modify the way the check is run: [?] CMAKE_REQUIRED_INCLUDES = list of include directories Eike -- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From fw at deneb.enyo.de Sun May 10 07:42:19 2015 From: fw at deneb.enyo.de (Florian Weimer) Date: Sun, 10 May 2015 13:42:19 +0200 Subject: [CMake] CHECK_C_SOURCE_COMPILES and include_directories In-Reply-To: <3702747.qGRlXZz5J8@eto> (Rolf Eike Beer's message of "Sun, 10 May 2015 13:38:57 +0200") References: <87sib4lmdq.fsf@mid.deneb.enyo.de> <3702747.qGRlXZz5J8@eto> Message-ID: <87bnhsacbo.fsf@mid.deneb.enyo.de> * Rolf Eike Beer: > Florian Weimer wrote: > >> Is there a way to make CHECK_C_SOURCE_COMPILES honor the discovered >> include directories? > > cmake --help-module CheckCSourceCompiles > > The following variables may be set before calling this macro to modify > the way the check is run: > [?] > CMAKE_REQUIRED_INCLUDES = list of include directories I saw that, but I thought this happens behind the scenes. Do I have to set this variable in addition to the include_directories directive? From eike at sf-mail.de Sun May 10 07:54:18 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Sun, 10 May 2015 13:54:18 +0200 Subject: [CMake] CHECK_C_SOURCE_COMPILES and include_directories In-Reply-To: <87bnhsacbo.fsf@mid.deneb.enyo.de> References: <87sib4lmdq.fsf@mid.deneb.enyo.de> <3702747.qGRlXZz5J8@eto> <87bnhsacbo.fsf@mid.deneb.enyo.de> Message-ID: <1775766.rv0vCg2FZ1@eto> Florian Weimer wrote: > * Rolf Eike Beer: > > Florian Weimer wrote: > >> Is there a way to make CHECK_C_SOURCE_COMPILES honor the discovered > >> include directories? > >> > > cmake --help-module CheckCSourceCompiles > > > > The following variables may be set before calling this macro to modify > > the way the check is run: > > [?] > > > > CMAKE_REQUIRED_INCLUDES = list of include directories > > I saw that, but I thought this happens behind the scenes. Do I have > to set this variable in addition to the include_directories directive? Yes, include_directories() only affects target, i.e. add_executable and friends, but not macros like CHECK_C_SOURCE_COMPILES. Those will explicitely look at those variables. Eike -- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From DLRdave at aol.com Sun May 10 08:43:16 2015 From: DLRdave at aol.com (David Cole) Date: Sun, 10 May 2015 08:43:16 -0400 Subject: [CMake] ctest not sending xlm-files to dashboard In-Reply-To: <0EC91541DFCC614DB6B36C4BAE80AB6E0FDE0C12@MAILBOX3.umb.sk> References: <0EC91541DFCC614DB6B36C4BAE80AB6E0FDE0A77@MAILBOX3.umb.sk> <0EC91541DFCC614DB6B36C4BAE80AB6E0FDE0C12@MAILBOX3.umb.sk> Message-ID: You've answered your own question... Do it all with a single command, and the submit step will have the same tag as all the other steps. On Sun, May 10, 2015 at 12:37 AM, Ilias Miroslav wrote: > Hi again, > > I upgraded ctest to version 3.2.2, the problem remains. It seems the problem is related to re-creating new tag at the end of tests, what is happening the next day after midnight. > > Here we have log at the beginning of the test, 09/05/2015: > > configure step is done > now you need to compile the sources: > $ cd build_mingw64_i8_tests > $ make > Site: CHEMIA > Build name: WinS12_MinGW64_i8_OpenBLAS_parallel_cloned > Create new tag: 20150509-2153 - Miro > Configure project > > with the proper directory name, containing xlm-files ready for output: > Directory of C:\Users\milias\Documents\work\software\dirac\trunk_cloned\build_mingw64_i8_tests\Testing\20150509-2153 > > 05/10/2015 02:38 AM . > 05/10/2015 02:38 AM .. > 05/10/2015 12:28 AM 32,099 Build.xml > 05/09/2015 11:53 PM 4,236 Configure.xml > 05/10/2015 02:38 AM 180,342 Test.xml > > but again, at the end of the test (on 10/05/2015) it creates new tag "20150510-0038 - Miro", but there is no Testing\20150510-0038 subdirectory with corresponding xml-files: > > Site: CHEMIA > Build name: WinS12_MinGW64_i8_OpenBLAS_parallel_cloned > Create new tag: 20150510-0038 - Miro > Submit files (using http) > Send to track: Miro > Using HTTP submit method > Drop site:http://testboard.org/cdash/submit.php?project=DIRAC > Submission successful > > maybe I should replace individual ctest commands > > ctest -D ExperimentalConfigure --track Miro 1>>%LOG% 2>&1 > ctest -j 2 -D ExperimentalBuild --track Miro 1>>%LOG% 2>&1 > ctest -j 2 -D ExperimentalTest --track Miro 1>>%LOG% 2>&1 > ctest -D ExperimentalSubmit --track Miro 1>>%LOG% 2>&1 > > by one "do-it-all command": > > ctest -j 2 -D Experimental --track Miro 1>>%LOG% 2>&1 > > > Best, Miro > ________________________________________ > From: Ilias Miroslav > Sent: Saturday, May 09, 2015 12:28 PM > To: cmake at cmake.org > Subject: ctest not sending xlm-files to dashboard > > Dear experts, > > I found that ctest is not sending resulting xml-files to the CDash-board. > > This is the ctest of version 3.2.0-rc1 on Windows server 2012. > > With the "ctest -D ExperimentalSubmit" command in the bat-script, which is launched automatically during the night by the Task Scheduler (when the user -me - is logged out), the report looks like: > -------------------------------------------------------------------------------------------------- > Site: CHEMIA > Build name: WinS12_MinGW64_i8_OpenBLAS_parallel_cloned > Create new tag: 20150509-0037 - Miro > Submit files (using http) > Send to track: Miro > Using HTTP submit method > Drop site:http://testboard.org/cdash/submit.php?project=DIRAC > Submission successful > ------------------------------------------------------------------------------------------------------ > > I don't understand why the ctest above created the new tag, "20150509-0037 - Miro", because the desired xml-files are ready in the other subdirectory, "20150508-2152": > ---------------------------------------------------------- > Directory of C:\Users\milias\Documents\work\software\dirac\trunk_cloned\build_mingw64_i8_tests\Testing\20150508-2152 > > 05/09/2015 02:37 AM . > 05/09/2015 02:37 AM .. > 05/09/2015 12:24 AM 32,103 Build.xml > 05/08/2015 11:52 PM 4,244 Configure.xml > 05/09/2015 02:37 AM 179,765 Test.xml > 3 File(s) 216,112 bytes > 2 Dir(s) 25,267,957,760 bytes free > > C:\Users\milias\Documents\work\software\dirac\trunk_cloned\build_mingw64_i8_tests\Testing\20150508-2152> > -------------------------------------------------------------------------------------------------------------------- > > Any help, please ? This night build spanned 05/08/2015 and 05/09/2015. > > Yours, > > Miro > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake From rahul at ismu.ac.in Sun May 10 12:18:13 2015 From: rahul at ismu.ac.in (Rahul K Soni) Date: Sun, 10 May 2015 09:18:13 -0700 (PDT) Subject: [CMake] Switching configuration to icc Message-ID: <1431274692702.b94cc407@Nodemailer> Hello everyone I am trying to configure vtk with cmake-3.2.2 in suse-hpc cluster. Prefeerred compiler in that cluster is intel. But I don't know why when Cmake is always configuring things for gcc when it is having icc also. Please help, how to switch the configuration to icc. ? Rahul Kumar Soni ScientistCSIR-IMMT Sent from iPad Rahul -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.kacvinsky at vectorcast.com Sun May 10 12:34:11 2015 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Sun, 10 May 2015 12:34:11 -0400 Subject: [CMake] Switching configuration to icc In-Reply-To: <1431274692702.b94cc407@Nodemailer> References: <1431274692702.b94cc407@Nodemailer> Message-ID: CC=icc cmake should do the trick > On May 10, 2015, at 12:18, Rahul K Soni wrote: > > Hello everyone > > I am trying to configure vtk with cmake-3.2.2 in suse-hpc cluster. Prefeerred compiler in that cluster is intel. But I don't know why when Cmake is always configuring things for gcc when it is having icc also. > > Please help, how to switch the configuration to icc. > > ? > Rahul Kumar Soni > Scientist > CSIR-IMMT > > Sent from iPad Rahul > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake From rahul at ismu.ac.in Sun May 10 12:57:29 2015 From: rahul at ismu.ac.in (Rahul K Soni) Date: Sun, 10 May 2015 09:57:29 -0700 (PDT) Subject: [CMake] Switching configuration to icc In-Reply-To: References: Message-ID: <1431277048540.87a8bb1b@Nodemailer> No Tom, thats not working.? I did ccmake CC=icc /path/to/vtk But the result is same.? ? Rahul Kumar Soni ScientistCSIR-IMMT Sent from iPad Rahul On Sun, May 10, 2015 at 10:04 PM, Tom Kacvinsky wrote: > CC=icc cmake should do the trick >> On May 10, 2015, at 12:18, Rahul K Soni wrote: >> >> Hello everyone >> >> I am trying to configure vtk with cmake-3.2.2 in suse-hpc cluster. Prefeerred compiler in that cluster is intel. But I don't know why when Cmake is always configuring things for gcc when it is having icc also. >> >> Please help, how to switch the configuration to icc. >> >> ? >> Rahul Kumar Soni >> Scientist >> CSIR-IMMT >> >> Sent from iPad Rahul >> -- >> >> 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: >> http://public.kitware.com/mailman/listinfo/cmake -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.kacvinsky at vectorcast.com Sun May 10 13:00:48 2015 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Sun, 10 May 2015 13:00:48 -0400 Subject: [CMake] Switching configuration to icc In-Reply-To: <1431277048540.87a8bb1b@Nodemailer> References: <1431277048540.87a8bb1b@Nodemailer> Message-ID: You need to set CC before invoking cmake so that cmake will know to use the Intel compilers > On May 10, 2015, at 12:57, Rahul K Soni wrote: > > No Tom, thats not working. > > I did ccmake CC=icc /path/to/vtk > > But the result is same. > > ? > Rahul Kumar Soni > Scientist > CSIR-IMMT > > Sent from iPad Rahul > > >> On Sun, May 10, 2015 at 10:04 PM, Tom Kacvinsky wrote: >> CC=icc cmake should do the trick >> >> >> >> > On May 10, 2015, at 12:18, Rahul K Soni wrote: >> > >> > Hello everyone >> > >> > I am trying to configure vtk with cmake-3.2.2 in suse-hpc cluster. Prefeerred compiler in that cluster is intel. But I don't know why when Cmake is always configuring things for gcc when it is having icc also. >> > >> > Please help, how to switch the configuration to icc. >> > >> > ? >> > Rahul Kumar Soni >> > Scientist >> > CSIR-IMMT >> > >> > Sent from iPad Rahul >> > -- >> > >> > 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: >> > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From petr.kmoch at gmail.com Sun May 10 13:02:37 2015 From: petr.kmoch at gmail.com (Petr Kmoch) Date: Sun, 10 May 2015 19:02:37 +0200 Subject: [CMake] Switching configuration to icc In-Reply-To: References: <1431277048540.87a8bb1b@Nodemailer> Message-ID: And you need to do with in a *totally clean* binary directory. The compiler cannot be changed once the buildsystem has been configured at least once. Simply delete the buildsystem and start over, with the proper CC (and CXX) environment variable(s). Petr On Sun, May 10, 2015 at 7:00 PM, Tom Kacvinsky wrote: > You need to set CC before invoking cmake so that cmake will know to use > the Intel compilers > > > > On May 10, 2015, at 12:57, Rahul K Soni wrote: > > No Tom, thats not working. > > I did ccmake CC=icc /path/to/vtk > > But the result is same. > > ? > Rahul Kumar Soni > Scientist > CSIR-IMMT > > Sent from iPad Rahul > > > On Sun, May 10, 2015 at 10:04 PM, Tom Kacvinsky < > tom.kacvinsky at vectorcast.com> wrote: > >> CC=icc cmake should do the trick >> >> >> >> > On May 10, 2015, at 12:18, Rahul K Soni wrote: >> > >> > Hello everyone >> > >> > I am trying to configure vtk with cmake-3.2.2 in suse-hpc cluster. >> Prefeerred compiler in that cluster is intel. But I don't know why when >> Cmake is always configuring things for gcc when it is having icc also. >> > >> > Please help, how to switch the configuration to icc. >> > >> > ? >> > Rahul Kumar Soni >> > Scientist >> > CSIR-IMMT >> > >> > Sent from iPad Rahul >> > -- >> > >> > 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: >> > http://public.kitware.com/mailman/listinfo/cmake >> > > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rahul at ismu.ac.in Sun May 10 13:03:42 2015 From: rahul at ismu.ac.in (Rahul K Soni) Date: Sun, 10 May 2015 10:03:42 -0700 (PDT) Subject: [CMake] Switching configuration to icc In-Reply-To: References: Message-ID: <1431277420490.00539fbd@Nodemailer> I am really sorry Tom. I am very new to all these things. Can you just exaplain in just one or two lines, how to do that.? I will really appreciate your help. I am struggling with all these from several days.? ? Rahul Kumar Soni ScientistCSIR-IMMT Sent from iPad Rahul On Sun, May 10, 2015 at 10:30 PM, Tom Kacvinsky wrote: > You need to set CC before invoking cmake so that cmake will know to use the Intel compilers >> On May 10, 2015, at 12:57, Rahul K Soni wrote: >> >> No Tom, thats not working. >> >> I did ccmake CC=icc /path/to/vtk >> >> But the result is same. >> >> ? >> Rahul Kumar Soni >> Scientist >> CSIR-IMMT >> >> Sent from iPad Rahul >> >> >>> On Sun, May 10, 2015 at 10:04 PM, Tom Kacvinsky wrote: >>> CC=icc cmake should do the trick >>> >>> >>> >>> > On May 10, 2015, at 12:18, Rahul K Soni wrote: >>> > >>> > Hello everyone >>> > >>> > I am trying to configure vtk with cmake-3.2.2 in suse-hpc cluster. Prefeerred compiler in that cluster is intel. But I don't know why when Cmake is always configuring things for gcc when it is having icc also. >>> > >>> > Please help, how to switch the configuration to icc. >>> > >>> > ? >>> > Rahul Kumar Soni >>> > Scientist >>> > CSIR-IMMT >>> > >>> > Sent from iPad Rahul >>> > -- >>> > >>> > 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: >>> > http://public.kitware.com/mailman/listinfo/cmake >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From rahul at ismu.ac.in Sun May 10 13:16:44 2015 From: rahul at ismu.ac.in (Rahul K Soni) Date: Sun, 10 May 2015 10:16:44 -0700 (PDT) Subject: [CMake] Switching configuration to icc In-Reply-To: References: Message-ID: <1431278203983.9985b38f@Nodemailer> Hi Petr Is deleting the buildsysystem means deleting the CMakeCache.txt file. How to set CC and CXX before configuring.? Thanks a lot in advance.? ? Rahul Kumar Soni ScientistCSIR-IMMT Sent from iPad Rahul On Sun, May 10, 2015 at 10:32 PM, Petr Kmoch wrote: > And you need to do with in a *totally clean* binary directory. The compiler > cannot be changed once the buildsystem has been configured at least once. > Simply delete the buildsystem and start over, with the proper CC (and CXX) > environment variable(s). > Petr > On Sun, May 10, 2015 at 7:00 PM, Tom Kacvinsky > wrote: >> You need to set CC before invoking cmake so that cmake will know to use >> the Intel compilers >> >> >> >> On May 10, 2015, at 12:57, Rahul K Soni wrote: >> >> No Tom, thats not working. >> >> I did ccmake CC=icc /path/to/vtk >> >> But the result is same. >> >> ? >> Rahul Kumar Soni >> Scientist >> CSIR-IMMT >> >> Sent from iPad Rahul >> >> >> On Sun, May 10, 2015 at 10:04 PM, Tom Kacvinsky < >> tom.kacvinsky at vectorcast.com> wrote: >> >>> CC=icc cmake should do the trick >>> >>> >>> >>> > On May 10, 2015, at 12:18, Rahul K Soni wrote: >>> > >>> > Hello everyone >>> > >>> > I am trying to configure vtk with cmake-3.2.2 in suse-hpc cluster. >>> Prefeerred compiler in that cluster is intel. But I don't know why when >>> Cmake is always configuring things for gcc when it is having icc also. >>> > >>> > Please help, how to switch the configuration to icc. >>> > >>> > ? >>> > Rahul Kumar Soni >>> > Scientist >>> > CSIR-IMMT >>> > >>> > Sent from iPad Rahul >>> > -- >>> > >>> > 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: >>> > http://public.kitware.com/mailman/listinfo/cmake >>> >> >> >> -- >> >> 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: >> http://public.kitware.com/mailman/listinfo/cmake >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.kacvinsky at vectorcast.com Sun May 10 13:36:57 2015 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Sun, 10 May 2015 13:36:57 -0400 Subject: [CMake] Switching configuration to icc In-Reply-To: <1431278203983.9985b38f@Nodemailer> References: <1431278203983.9985b38f@Nodemailer> Message-ID: <19CD6BEF-A16F-4CFE-8652-2C329280DA64@vectorcast.com> > On May 10, 2015, at 13:16, Rahul K Soni wrote: > > Hi Petr > > Is deleting the buildsysystem means deleting the CMakeCache.txt file. How to set CC and CXX before configuring. > > Thanks a lot in advance. Shoot, I had top posted. Yes, you need to delete the bus directory as cmake caches settings after the initial run. Once the build directory is deleted, you need to run cmake as follows: CC=icc CXX=icpc cmake From rahul at ismu.ac.in Sun May 10 14:19:48 2015 From: rahul at ismu.ac.in (Rahul K Soni) Date: Sun, 10 May 2015 11:19:48 -0700 (PDT) Subject: [CMake] Switching configuration to icc In-Reply-To: <19CD6BEF-A16F-4CFE-8652-2C329280DA64@vectorcast.com> References: <19CD6BEF-A16F-4CFE-8652-2C329280DA64@vectorcast.com> Message-ID: <1431281987660.efbdb0ce@Nodemailer> When I run like that it says CC=icc command not found.? ? Rahul Kumar Soni ScientistCSIR-IMMT Sent from iPad Rahul On Sun, May 10, 2015 at 11:06 PM, Tom Kacvinsky wrote: >> On May 10, 2015, at 13:16, Rahul K Soni wrote: >> >> Hi Petr >> >> Is deleting the buildsysystem means deleting the CMakeCache.txt file. How to set CC and CXX before configuring. >> >> Thanks a lot in advance. > Shoot, I had top posted. Yes, you need to delete the bus directory as cmake caches settings after the initial run. Once the build directory is deleted, you need to run cmake as follows: > CC=icc CXX=icpc cmake -------------- next part -------------- An HTML attachment was scrubbed... URL: From rahul at ismu.ac.in Sun May 10 14:25:06 2015 From: rahul at ismu.ac.in (Rahul K Soni) Date: Sun, 10 May 2015 11:25:06 -0700 (PDT) Subject: [CMake] Switching configuration to icc In-Reply-To: <11BF309F-CB86-4DF7-9D26-E042BFAA8607@vectorcast.com> References: <11BF309F-CB86-4DF7-9D26-E042BFAA8607@vectorcast.com> Message-ID: <1431282305008.f874fdde@Nodemailer> Its like a ssh remote control of cluster from putty.? ? Rahul Kumar Soni ScientistCSIR-IMMT Sent from iPad Rahul On Sun, May 10, 2015 at 11:53 PM, Tom Kacvinsky wrote: >> On May 10, 2015, at 14:19, Rahul K Soni wrote: >> >> When I run like that it says CC=icc command not found. > Which she'll are you using? If you're using bash, that should work. If you're using csh/tcsh, precede the CC with env, as follows: > env CC=icc cmake >> ? >> Rahul Kumar Soni >> Scientist >> CSIR-IMMT >> >> Sent from iPad Rahul >> >> >>> On Sun, May 10, 2015 at 11:06 PM, Tom Kacvinsky wrote: >>> >>> >>> >>> >>> > On May 10, 2015, at 13:16, Rahul K Soni wrote: >>> > >>> > Hi Petr >>> > >>> > Is deleting the buildsysystem means deleting the CMakeCache.txt file. How to set CC and CXX before configuring. >>> > >>> > Thanks a lot in advance. >>> >>> Shoot, I had top posted. Yes, you need to delete the bus directory as cmake caches settings after the initial run. Once the build directory is deleted, you need to run cmake as follows: >>> >>> CC=icc CXX=icpc cmake >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From calebwherry at gmail.com Sun May 10 14:25:36 2015 From: calebwherry at gmail.com (J. Caleb Wherry) Date: Sun, 10 May 2015 14:25:36 -0400 Subject: [CMake] Switching configuration to icc In-Reply-To: <1431281987660.efbdb0ce@Nodemailer> References: <19CD6BEF-A16F-4CFE-8652-2C329280DA64@vectorcast.com> <1431281987660.efbdb0ce@Nodemailer> Message-ID: Just to be explicit, CC and CXX are shell variables that CMake reads. So invoke like below to make for sure they are getting set correctly: export CC=icc; export CXX=icc; cmake Caleb On Sunday, May 10, 2015, Rahul K Soni > wrote: > When I run like that it says CC=icc command not found. > > -- > Rahul Kumar Soni > Scientist > CSIR-IMMT > > Sent from iPad Rahul > > > On Sun, May 10, 2015 at 11:06 PM, Tom Kacvinsky < > tom.kacvinsky at vectorcast.com> wrote: > >> >> >> >> >> > On May 10, 2015, at 13:16, Rahul K Soni wrote: >> > >> > Hi Petr >> > >> > Is deleting the buildsysystem means deleting the CMakeCache.txt file. >> How to set CC and CXX before configuring. >> > >> > Thanks a lot in advance. >> >> Shoot, I had top posted. Yes, you need to delete the bus directory as >> cmake caches settings after the initial run. Once the build directory is >> deleted, you need to run cmake as follows: >> >> CC=icc CXX=icpc cmake >> >> > -- Sent from my iPhone 4s -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Sun May 10 14:58:04 2015 From: DLRdave at aol.com (David Cole) Date: Sun, 10 May 2015 14:58:04 -0400 Subject: [CMake] Switching configuration to icc In-Reply-To: References: <19CD6BEF-A16F-4CFE-8652-2C329280DA64@vectorcast.com> <1431281987660.efbdb0ce@Nodemailer> Message-ID: And if icc is not in the path, or in a standard location that CMake looks in, you should specify the full path. i.e. export CC=/usr/bin/icc ... On Sunday, May 10, 2015, J. Caleb Wherry wrote: > Just to be explicit, CC and CXX are shell variables that CMake reads. So > invoke like below to make for sure they are getting set correctly: > > export CC=icc; export CXX=icc; cmake > > Caleb > > On Sunday, May 10, 2015, Rahul K Soni wrote: > >> When I run like that it says CC=icc command not found. >> >> ? >> Rahul Kumar Soni >> Scientist >> CSIR-IMMT >> >> Sent from iPad Rahul >> >> >> On Sun, May 10, 2015 at 11:06 PM, Tom Kacvinsky < >> tom.kacvinsky at vectorcast.com> wrote: >> >>> >>> >>> >>> >>> > On May 10, 2015, at 13:16, Rahul K Soni wrote: >>> > >>> > Hi Petr >>> > >>> > Is deleting the buildsysystem means deleting the CMakeCache.txt file. >>> How to set CC and CXX before configuring. >>> > >>> > Thanks a lot in advance. >>> >>> Shoot, I had top posted. Yes, you need to delete the bus directory as >>> cmake caches settings after the initial run. Once the build directory is >>> deleted, you need to run cmake as follows: >>> >>> CC=icc CXX=icpc cmake >>> >>> >> > > -- > Sent from my iPhone 4s > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fw at deneb.enyo.de Mon May 11 03:12:15 2015 From: fw at deneb.enyo.de (Florian Weimer) Date: Mon, 11 May 2015 09:12:15 +0200 Subject: [CMake] CHECK_C_SOURCE_COMPILES and include_directories In-Reply-To: <1775766.rv0vCg2FZ1@eto> (Rolf Eike Beer's message of "Sun, 10 May 2015 13:54:18 +0200") References: <87sib4lmdq.fsf@mid.deneb.enyo.de> <3702747.qGRlXZz5J8@eto> <87bnhsacbo.fsf@mid.deneb.enyo.de> <1775766.rv0vCg2FZ1@eto> Message-ID: <87bnhry4ds.fsf@mid.deneb.enyo.de> * Rolf Eike Beer: >> > CMAKE_REQUIRED_INCLUDES = list of include directories >> >> I saw that, but I thought this happens behind the scenes. Do I have >> to set this variable in addition to the include_directories directive? > > Yes, include_directories() only affects target, i.e. add_executable > and friends, but not macros like CHECK_C_SOURCE_COMPILES. Those will > explicitely look at those variables. Thanks, this does indeed. (I'm not sure if my initial confusion is specific to me, or if the documentation could be improved. But I don't really see where to put this information so that it is easily discovered.) From rahulsoni at immt.res.in Mon May 11 05:16:18 2015 From: rahulsoni at immt.res.in (Rahul Kumar Soni) Date: Mon, 11 May 2015 14:46:18 +0530 Subject: [CMake] Switching configuration to icc In-Reply-To: References: <19CD6BEF-A16F-4CFE-8652-2C329280DA64@vectorcast.com> <1431281987660.efbdb0ce@Nodemailer> Message-ID: I am very much thankful Cole, Gobbi, Wherry and Tom for your valuable suggestions. It worked like a charm with the following syntax: [Inside Build Directory] > env CC=icc CXX=icpc ccmake [path-to-source-directory] -Wno-dev -- Sincerely Rahul Kumar Soni Scientist, Institute of Minerals & Materials Technology Council of Scientific & Industrial Research, Govt. of India On Mon, May 11, 2015 at 12:28 AM, David Cole wrote: > And if icc is not in the path, or in a standard location that CMake looks > in, you should specify the full path. i.e. export CC=/usr/bin/icc ... > > > On Sunday, May 10, 2015, J. Caleb Wherry wrote: > >> Just to be explicit, CC and CXX are shell variables that CMake reads. So >> invoke like below to make for sure they are getting set correctly: >> >> export CC=icc; export CXX=icc; cmake >> >> Caleb >> >> On Sunday, May 10, 2015, Rahul K Soni wrote: >> >>> When I run like that it says CC=icc command not found. >>> >>> -- >>> Rahul Kumar Soni >>> Scientist >>> CSIR-IMMT >>> >>> Sent from iPad Rahul >>> >>> >>> On Sun, May 10, 2015 at 11:06 PM, Tom Kacvinsky < >>> tom.kacvinsky at vectorcast.com> wrote: >>> >>>> >>>> >>>> >>>> >>>> > On May 10, 2015, at 13:16, Rahul K Soni wrote: >>>> > >>>> > Hi Petr >>>> > >>>> > Is deleting the buildsysystem means deleting the CMakeCache.txt file. >>>> How to set CC and CXX before configuring. >>>> > >>>> > Thanks a lot in advance. >>>> >>>> Shoot, I had top posted. Yes, you need to delete the bus directory as >>>> cmake caches settings after the initial run. Once the build directory is >>>> deleted, you need to run cmake as follows: >>>> >>>> CC=icc CXX=icpc cmake >>>> >>>> >>> >> >> -- >> Sent from my iPhone 4s >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From d3ck0r at gmail.com Mon May 11 12:46:13 2015 From: d3ck0r at gmail.com (J Decker) Date: Mon, 11 May 2015 09:46:13 -0700 Subject: [CMake] install/strip target doesn't exist? Message-ID: command: cmake.exe --build . --config "release" --target "install/strip" -- output: mingw32-make.exe: *** No rule to make target 'install\strip'. Stop. It reverses the slash? install doesn't always strip? does package strip? -------------- next part -------------- An HTML attachment was scrubbed... URL: From wesley.hoke at gmail.com Mon May 11 12:54:01 2015 From: wesley.hoke at gmail.com (Wesley Smith) Date: Mon, 11 May 2015 09:54:01 -0700 Subject: [CMake] FindCuda compiler flag problems Message-ID: Hi, I'm trying to compile w/ CUDA on Centos6 using Cuda7 and C++11. When I have host propagate flags on, the CXX flags get mangles with escapes like this: ,\"-fPIE\",\"--std=c++11\",\"-DGLM_FORCE_RADIANS\",\"-g\" which causes a ton of errors. If I turn host propagate flags off, I then have to manually add --std=c++11 to the NVCC flags. The problem is that since I have CUDA_SEPARABLE_COMPILATION ON, the linker step also gets --std=c++11, which is an error and compilation fails as a result. So, how do I resolve this? Is there a way to have NVCC flags only for compilation and not for linking? Alternatively, is there a way to avoid the crazy string escapes on the CXX flags passed to NVCC? thanks, wes From post at hendrik-sattler.de Mon May 11 13:36:25 2015 From: post at hendrik-sattler.de (Hendrik Sattler) Date: Mon, 11 May 2015 19:36:25 +0200 Subject: [CMake] install/strip target doesn't exist? In-Reply-To: References: Message-ID: <90EFB9F8-327B-4B6B-A85E-B67DD03BC32E@hendrik-sattler.de> Am 11. Mai 2015 18:46:13 MESZ, schrieb J Decker : >command: > cmake.exe --build . --config "release" --target "install/strip" -- >output: > mingw32-make.exe: *** No rule to make target 'install\strip'. Stop. > >It reverses the slash? >install doesn't always strip? >does package strip? Is there actually anything to strip from a windows executable? Even on Linux: stripping a binary without debug symbols? HS From d3ck0r at gmail.com Mon May 11 13:44:12 2015 From: d3ck0r at gmail.com (J Decker) Date: Mon, 11 May 2015 10:44:12 -0700 Subject: [CMake] install/strip target doesn't exist? In-Reply-To: <90EFB9F8-327B-4B6B-A85E-B67DD03BC32E@hendrik-sattler.de> References: <90EFB9F8-327B-4B6B-A85E-B67DD03BC32E@hendrik-sattler.de> Message-ID: yes. running strip on DLLs can take a 24k dll and make it 10k. https://drive.google.com/folderview?id=0B812EYiKwtkkfkc5bDI1RUZOaEtyV1VicUpva0Nkd09pN2V2YjFCODdNajRYNWRWZ2psZkE It has a lot of extra data even building with CMAKE_BUILD_TYPE=release On Mon, May 11, 2015 at 10:36 AM, Hendrik Sattler wrote: > > > Am 11. Mai 2015 18:46:13 MESZ, schrieb J Decker : > >command: > > cmake.exe --build . --config "release" --target "install/strip" -- > >output: > > mingw32-make.exe: *** No rule to make target 'install\strip'. Stop. > > > >It reverses the slash? > >install doesn't always strip? > >does package strip? > > Is there actually anything to strip from a windows executable? > > Even on Linux: stripping a binary without debug symbols? > > HS > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.petruchik at gmail.com Mon May 11 18:05:04 2015 From: alexey.petruchik at gmail.com (Alexey Petruchik) Date: Tue, 12 May 2015 01:05:04 +0300 Subject: [CMake] Tiny cmake question Message-ID: Is it possible to rewrite: if (${OPENSSL_FOUND}) option(USE_OUR_OWN_MD5 "Build using own md5 implementation" OFF) else() option(USE_OUR_OWN_MD5 "Build using own md5 implementation" ON) endif() in one line? Something like: option(USE_OUR_OWN_MD5 "Build using own md5 implementation" NOT OPENSSL_FOUND) Regards, Alexey -------------- next part -------------- An HTML attachment was scrubbed... URL: From d3ck0r at gmail.com Mon May 11 21:32:58 2015 From: d3ck0r at gmail.com (J Decker) Date: Mon, 11 May 2015 18:32:58 -0700 Subject: [CMake] Tiny cmake question In-Reply-To: References: Message-ID: On Mon, May 11, 2015 at 3:05 PM, Alexey Petruchik < alexey.petruchik at gmail.com> wrote: > Is it possible to rewrite: > > if (${OPENSSL_FOUND}) > option(USE_OUR_OWN_MD5 "Build using own md5 implementation" OFF) > else() > option(USE_OUR_OWN_MD5 "Build using own md5 implementation" ON) > endif() > > in one line? Something like: > > maybe ? math( EXPR NOT_OPENSSL_FOUND !OPENSSL_FOUND ) option(USE_OUR_OWN_MD5 "Build using own md5 implementation" ${NOT_OPENSSL_FOUND) > > Regards, Alexey > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jamesbigler at gmail.com Tue May 12 00:42:36 2015 From: jamesbigler at gmail.com (James Bigler) Date: Mon, 11 May 2015 22:42:36 -0600 Subject: [CMake] FindCuda compiler flag problems In-Reply-To: References: Message-ID: The issue is that nvcc doesn't accept host compiler flags that are C++ only. It does understand a version of the command directly (-std c++11). There should be a fix for this in TOT. See if you can grab a nightly and test it out. James On Mon, May 11, 2015 at 10:54 AM, Wesley Smith wrote: > Hi, > I'm trying to compile w/ CUDA on Centos6 using Cuda7 and C++11. When > I have host propagate flags on, the CXX flags get mangles with escapes > like this: > > ,\"-fPIE\",\"--std=c++11\",\"-DGLM_FORCE_RADIANS\",\"-g\" > > > which causes a ton of errors. If I turn host propagate flags off, I > then have to manually add --std=c++11 to the NVCC flags. The problem > is that since I have CUDA_SEPARABLE_COMPILATION ON, the linker step > also gets --std=c++11, which is an error and compilation fails as a > result. So, how do I resolve this? Is there a way to have NVCC flags > only for compilation and not for linking? Alternatively, is there a > way to avoid the crazy string escapes on the CXX flags passed to NVCC? > > > thanks, > wes > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elfring at users.sourceforge.net Tue May 12 03:24:27 2015 From: elfring at users.sourceforge.net (SF Markus Elfring) Date: Tue, 12 May 2015 09:24:27 +0200 Subject: [CMake] When is escaping of space characters in parameters really needed? Message-ID: <5551AAAB.5090804@users.sourceforge.net> Hello, I would like to construct a custom command for the tool "Latexmk". http://www.cmake.org/cmake/help/v3.2/command/add_custom_command.html The corresponding Perl script can handle a parameter like "pdflatex". If I omit the parameter "VERBATIM", the current CMake software will add backslashes before space characters. Example: ? -pdf -pdflatex='/usr/bin/pdflatex\ -halt-on-error\ --shell-escape\ %O\ %S' ? Can such "an adjustment" of the really desired string value be avoided anyhow? Should the value work also without the shown escaping? Regards, Markus From masariello+cmake.org at gmail.com Tue May 12 07:28:27 2015 From: masariello+cmake.org at gmail.com (Alessio) Date: Tue, 12 May 2015 12:28:27 +0100 Subject: [CMake] EXCLUDE_FROM_DEFAULT_BUILD: a solution that works for both interactive and unattended builds Message-ID: Hi All (similar questions have been asked before, but none has quite hit the mark) Is there any way to force MSVC to build custom targets marked with EXCLUDE_FROM_DEFAULT_BUILD? Using cmake --build . --target SOME_EXCLUDED_TARGET --config Release will produce the well known message Project not selected to build for this solution configuration I could find the following two ways to get the targets to build, but they all have drawbacks: 1. Use a BATCH_BUILD variable that will disable the setting of EXCLUDE_FROM_DEFAULT_BUILD on the targets. 2. Define a set of build configurations on which EXCLUDE_FROM_DEFAULT_BUILD_ is not set (e.g. Release_ALL is identical to Release, except it has no build exclusions) Option 1 has the drawback of producing solutions that do not work well for interactive development Option 2 is rather cumbersome and would require the users to build separate sets of binaries. I could not quite figure out a way to make the Release_ALL packaging commands reference the Release target binaries. Has anyone figured out a way to get the full monty, i.e. a way to generate an MSVC solution that works well for both interactive and command line builds? Thank you so much for any feedback you can provide on this -alessio -------------- next part -------------- An HTML attachment was scrubbed... URL: From csiga.biga at aol.com Tue May 12 09:52:03 2015 From: csiga.biga at aol.com (=?utf-8?Q?Nagy-Egri_MC!tC)_Ferenc?=) Date: Tue, 12 May 2015 13:52:03 +0000 Subject: [CMake] =?utf-8?q?EXCLUDE=5FFROM=5FDEFAULT=5FBUILD=3A_a_solution_?= =?utf-8?q?that_works_for_both_interactive_and_unattended_builds?= In-Reply-To: References: Message-ID: I am also interested in this. Not because I couldn?t do 2 seperate build directories for CLI and IDE building, but because VS projects are still the best shot at getting parallel builds on Windows. NMake batch support is not implemented, and Ninja has never built any of my projects without errors. Felad?: Alessio Elk?ldve: ?kedd?, ?2015?. ?m?jus? ?12?. ?13?:?28 C?mzett: cmake at cmake.org Hi All (similar questions have been asked before, but none has quite hit the mark) Is there any way to force MSVC to build custom targets marked with EXCLUDE_FROM_DEFAULT_BUILD? Using cmake --build . --target SOME_EXCLUDED_TARGET --config Release will produce the well known message Project not selected to build for this solution configuration I could find the following two ways to get the targets to build, but they all have drawbacks: Use a BATCH_BUILD variable that will disable the setting of EXCLUDE_FROM_DEFAULT_BUILD on the targets. Define a set of build configurations on which EXCLUDE_FROM_DEFAULT_BUILD_ is not set (e.g. Release_ALL is identical to Release, except it has no build exclusions) Option 1 has the drawback of producing solutions that do not work well for interactive development Option 2 is rather cumbersome and would require the users to build separate sets of binaries. I could not quite figure out a way to make the Release_ALL packaging commands reference the Release target binaries. Has anyone figured out a way to get the full monty, i.e. a way to generate an MSVC solution that works well for both interactive and command line builds? Thank you so much for any feedback you can provide on this -alessio -------------- next part -------------- An HTML attachment was scrubbed... URL: From renumaphy at gmail.com Tue May 12 11:02:48 2015 From: renumaphy at gmail.com (Uma Devi) Date: Tue, 12 May 2015 20:32:48 +0530 Subject: [CMake] (no subject) Message-ID: dear cmake user i am not able to updaate the cmake in one of my linux system. how can i update the cmake in centos -------------- next part -------------- An HTML attachment was scrubbed... URL: From d3ck0r at gmail.com Tue May 12 11:47:24 2015 From: d3ck0r at gmail.com (J Decker) Date: Tue, 12 May 2015 08:47:24 -0700 Subject: [CMake] install/strip target doesn't exist? In-Reply-To: References: <90EFB9F8-327B-4B6B-A85E-B67DD03BC32E@hendrik-sattler.de> Message-ID: I'm actually glad it doesn't auto strip though... in this case I'm appending signature data to the exe and it would be bad if that was stripped; and strip does do a good job of removing that also. I am curious why I can't specify the target on the command line... like why there's an automatic translation of slashes; would really think that it's up to the user to specify the correct direction of slashes. There's nothing in the windows file system that doesn't like forward or backward slash (it accepts either), just applications. (as in) cmake.exe --build . --config "release" --target "install/strip" -- which gets the / reversed before make is called. On Mon, May 11, 2015 at 10:44 AM, J Decker wrote: > yes. running strip on DLLs can take a 24k dll and make it 10k. > > > https://drive.google.com/folderview?id=0B812EYiKwtkkfkc5bDI1RUZOaEtyV1VicUpva0Nkd09pN2V2YjFCODdNajRYNWRWZ2psZkE > > It has a lot of extra data even building with CMAKE_BUILD_TYPE=release > > > > On Mon, May 11, 2015 at 10:36 AM, Hendrik Sattler > wrote: > >> >> >> Am 11. Mai 2015 18:46:13 MESZ, schrieb J Decker : >> >command: >> > cmake.exe --build . --config "release" --target "install/strip" -- >> >output: >> > mingw32-make.exe: *** No rule to make target 'install\strip'. Stop. >> > >> >It reverses the slash? >> >install doesn't always strip? >> >does package strip? >> >> Is there actually anything to strip from a windows executable? >> >> Even on Linux: stripping a binary without debug symbols? >> >> HS >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fifteenknots505 at gmail.com Tue May 12 16:17:33 2015 From: fifteenknots505 at gmail.com (Martin Weber) Date: Tue, 12 May 2015 22:17:33 +0200 Subject: [CMake] (no subject) In-Reply-To: References: Message-ID: <4854879.a8hcCRvT6o@linux> Am Dienstag, 12. Mai 2015, 20:32:48 schrieb Uma Devi: > dear cmake user > i am not able to updaate the cmake in one of my linux system. how can i > update the cmake in centos Maybe because CentOS is still at cmake v 2.6? Martin -- Cd wrttn wtht vwls s mch trsr. From calebwherry at gmail.com Tue May 12 16:28:56 2015 From: calebwherry at gmail.com (J. Caleb Wherry) Date: Tue, 12 May 2015 16:28:56 -0400 Subject: [CMake] (no subject) In-Reply-To: <4854879.a8hcCRvT6o@linux> References: <4854879.a8hcCRvT6o@linux> Message-ID: Uma, There are a few ways to do this. As Martin said, CentOS has an ancient version of CMake that ships with it and you can't update it with yum. So, you have 3 options: 1. Use the version shipped with CentOS and deal with it being old. 2. Download the latest binary release script/tarball: http://www.cmake.org/download/ 3. Download, compile, and install from source: http://www.cmake.org/install/ I usually go with option 2 and get the shell script from the download page for my architecture, it works pretty well. Hope that helps! -Caleb On Tue, May 12, 2015 at 4:17 PM, Martin Weber wrote: > Am Dienstag, 12. Mai 2015, 20:32:48 schrieb Uma Devi: > > dear cmake user > > i am not able to updaate the cmake in one of my linux system. how can i > > update the cmake in centos > > Maybe because CentOS is still at cmake v 2.6? > > Martin > > -- > Cd wrttn wtht vwls s mch trsr. > > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -- J. Caleb Wherry *Scientific Software Engineer* http://www.calebwherry.com +1 (615) 708-5651 calebwherry at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From SNijsure at mocana.com Tue May 12 21:10:56 2015 From: SNijsure at mocana.com (Subodh Nijsure) Date: Tue, 12 May 2015 18:10:56 -0700 Subject: [CMake] How to add swig output file to SRC file list Message-ID: Hello, I have following cmake file, I am using cmake 3.2 SET_SOURCE_FILES_PROPERTIES(${MYSRC}/myapi.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(${MYSRC}/myapi.i PROPERTIES SWIG_FLAGS "-ignoremissing") SWIG_ADD_MODULE(myapi_swig python ${MYSRC}/myapi.i} set(MYLIBSRC_FILES ${MYSRC}/file1.cpp ${MYSRC}/file2.cpp ) add_library(atlas_client ${MYLIBSRC_FILES} ) Now I want to add the cpp file that swig created to list of files that go into my library? Basically what I want to do is include file myapiPYTHON_wrap.cxx that swig generates to MYLIBSRC_FILES I see that currently by default SWIG ADD MODULE is creating a .so file, which I don?t want to create. Would appreciate any help/pointers. -Subodh -------------- next part -------------- An HTML attachment was scrubbed... URL: From laasunde at hotmail.com Wed May 13 09:19:41 2015 From: laasunde at hotmail.com (Lars) Date: Wed, 13 May 2015 15:19:41 +0200 Subject: [CMake] Target_link_libraries imported library Message-ID: Hello, We have an internal software product foo which is exported. A typical component: add_library(foo_library SHARED ...) target_link_libraries(foo_library foo_common foo_comp ${Boost_LIBRARIES}) When building the exported package a file name FooDepends-release.cmake is produced which contains; set_target_properties(foo_library PROPERTIES IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/foo_library.lib" IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "foo_common;foo_comp;c:\boost\lib\boost_filesystem-vc110-mt-1_55.lib;") In another software product we use Find_Package command to find foo. Linking also works; add_library(bar-library SHARED ...) target_link_libraries(bar-library foo_library ${Boost_LIBRARIES}) There is one problem with this setup and that is the IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE contains a static path to a boost lib. So the "c:\boost\lib\boost_filesystem-vc110-mt-1_55.lib" is appended to the linking of "bar-library" and this will fail if the path is incorrect. We cannot guarantee that boost is located at the same path on all Windows system. So how can we remove or update the boost path? Using CMake 2.8.12 on Windows 7. -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc_j_bourhis at mac.com Thu May 14 08:02:57 2015 From: luc_j_bourhis at mac.com (Luc J. Bourhis) Date: Thu, 14 May 2015 05:02:57 -0700 (MST) Subject: [CMake] [CPACK] [RPM] Using %if in %file section Message-ID: <1431604977008-7590576.post@n2.nabble.com> I would like to end up with the following in the specs file: I tried to use CPACK_RPM_USER_FILELIST as but this results in which is not quite right. Is there something I am missing? Or is it a fundamental limitation of CPack RPM generator? If so, would there be any workaround? Thanks in advance for any help. ----- -- Luc J. Bourhis -- View this message in context: http://cmake.3232098.n2.nabble.com/CPACK-RPM-Using-if-in-file-section-tp7590576.html Sent from the CMake mailing list archive at Nabble.com. From luc_j_bourhis at mac.com Thu May 14 08:05:46 2015 From: luc_j_bourhis at mac.com (Luc J. Bourhis) Date: Thu, 14 May 2015 05:05:46 -0700 (MST) Subject: [CMake] [CPACK] [RPM] Using %if in %file section In-Reply-To: <1431604977008-7590576.post@n2.nabble.com> References: <1431604977008-7590576.post@n2.nabble.com> Message-ID: <1431605146831-7590577.post@n2.nabble.com> I forgot to mention this is with cpack version 3.2.1 ----- -- Luc J. Bourhis -- View this message in context: http://cmake.3232098.n2.nabble.com/CPACK-RPM-Using-if-in-file-section-tp7590576p7590577.html Sent from the CMake mailing list archive at Nabble.com. From eike at sf-mail.de Thu May 14 08:11:31 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Thu, 14 May 2015 14:11:31 +0200 Subject: [CMake] [CPACK] [RPM] Using %if in %file section In-Reply-To: <1431604977008-7590576.post@n2.nabble.com> References: <1431604977008-7590576.post@n2.nabble.com> Message-ID: <3277938.MiOxiDqzbx@caliban.sf-tec.de> Am Donnerstag, 14. Mai 2015, 05:02:57 schrieb Luc J. Bourhis: > I would like to end up with the following in the specs file: > > > > I tried to use CPACK_RPM_USER_FILELIST as > > > > but this results in > > which is not quite right. Well, yes, this is just one newline instead of 3. Try adding \n\n. Or use a mail client that doesn't mangle what you send, so we can actually help you ;) Eike -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From csiga.biga at aol.com Thu May 14 07:01:38 2015 From: csiga.biga at aol.com (=?utf-8?Q?Nagy-Egri_M=C3=A1t=C3=A9_Ferenc?=) Date: Thu, 14 May 2015 11:01:38 +0000 Subject: [CMake] =?utf-8?q?FindModules=2Ecmake_quality_+_Kitware_propositi?= =?utf-8?q?on?= Message-ID: This is more of a remark, or something to get the ball rolling, rather than anything else. I recently came across various FindModule.cmake files (FindOpenCL, FindOpenGL, FindGLEW, FindGLM, FindSFML) as a sideeffect of a project I am developing, but have had my share with quite a few others (FindQt, RustCMake, FindOpenAL, FindBoost, ?). My overall impression is that the quality of these modules is highly fluctuating to say the least. While generally the FindModules shipping with CMake as built-in scripts are usable, there is a fair amount of room for improvement. FindGLEW.cmake for eg. is terrible. I have never imagined that such a widely used library has a 7 line FindModule script. On Windows it is practically useless. As for nearly all other FindModule scripts, nearly none of them use target_include_libraries() that would allow for end-users of the scripts to not have to worry about include directories. Some projects strive at being cross-platform, but compiling them on Windows (mostly the GNU projects that aim on being Windows friendly) is massive pain. libJPEG to name just one provides nmake makefiles that are capable of producing Visual Studio 2010 project files at best (huuraay), and have undocumented external dependencies. These projects (and their users) cry out for CMake support. Here is a proposition to consider: Kitware generally has the philosphy with CMake being: do it yourself or hire us to do it. While on a corporate basis this is a legitimate approach, I as a poor academic fellow do not have 10.000$ to spare for a feature I so wish, neither do I have the time to educate myself in the internal ways of CMake to contribute. So all I do is hack, hack, hack all day. The Chocolatey project (a package manager for Windows) recently won a massive Kickstarter campaign that aimed solely increasing the overall quality of the project. With this campaign they aimed on growing from an ?interesting idea? to begin ?mainstream?. With the money they won, they hired full time package moderators, developed automated scripts of facilitating authoring, wrote tutorials, created templates, and even managed to get the ball rolling with OneGet (Powershell 5.0 package manager manager) to adopt Chocolatey as the first supported public repo. I would suggest Kitware start a similar community funded project to increase the overall quality of the software. While I do not have 10 grands to buy a feature, I do have 10 dollars pocket money to contribute (as do MANY others). As several levels of goals, the stock FindModules scripts could be brought to a homogenous quality, identical naming conventions (no more MYLIB_INC_DIR, MYLIB_INCLUDE_DIRS, MyLib_INCLUDE_DIR), high quality templates for new adopters, make the CMake Guide freely available online (epub, pdf, docx, whatever), convert 10 GNU projects to CMake, convert 50 GNU projects to CMake, create Snappy back-end of CPack, or my personal favorite (the feature I do not have 10.000 dollars for) is NMake batch mode support for multicore build, etc. There are so many places CMake itself can be improved, and so many users who really should be adopting, but have not started due to lacking man power. (These are the projects that would benefit the most from a freely available tutorial, because truth be told: writing capable, high-quality CMake scripts is no easy task.) If I were a charmismatic spokesperson I?d say: I RAISE 10 DOLLARS, WHO?S WITH ME?! But because I?m not, I?ll just leave it here as a suggestion. Ideas? -------------- next part -------------- An HTML attachment was scrubbed... URL: From steveire at gmail.com Thu May 14 12:06:13 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 14 May 2015 18:06:13 +0200 Subject: [CMake] Target_link_libraries imported library References: Message-ID: Lars wrote: > > There is one problem with this setup and that is the > IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE contains a static path to a > boost lib. So the "c:\boost\lib\boost_filesystem-vc110-mt-1_55.lib" is > appended to the linking of "bar-library" and this will fail if the path is > incorrect. We cannot guarantee that boost is located at the same path on > all Windows system. So how can we remove or update the boost path? The cmake-packages(7) manual in master describes this case (and used to mention Boost explicitly) http://www.cmake.org/cmake/help/git-master/manual/cmake-packages.7.html#creating-relocatable-packages http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3af13782 Another option not listed at the end there would be to create IMPORTED targets for Boost yourself and maintain that. You could create a wrapper around FindBoost. The ideal situation would be for Boost to ship cmake-config-packages itself, but that suggestion doesn't get much support from Boost devs (probably because they are not cmake fans :) ). Thanks, Steve. From steveire at gmail.com Thu May 14 12:08:20 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 14 May 2015 18:08:20 +0200 Subject: [CMake] FindModules.cmake quality + Kitware proposition References: <20150514150932.8C750A8FFB@public.kitware.com> Message-ID: Nagy-Egri M?t? Ferenc via CMake wrote: > ... NMake batch mode support for multicore build, etc. I suggest you look into 'jom'. Thanks, Steve. From niels_dekker_address_until_2018 at xs4all.nl Thu May 14 12:18:24 2015 From: niels_dekker_address_until_2018 at xs4all.nl (Niels Dekker - address until 2018) Date: Thu, 14 May 2015 18:18:24 +0200 Subject: [CMake] CMAKE_CXX_COMPILER_VERSION quite a useful variable, right? Message-ID: <5554CAD0.5040606@xs4all.nl> When CMake (current version: 3.2.2) generates project files for Visual Studio, it appears to define an undocumented variable that seems quite useful to me: CMAKE_CXX_COMPILER_VERSION. It appears to be the full compiler version. For example, for my VS2010 installation, CMAKE_CXX_COMPILER_VERSION is "16.0.40219.1", and for my VS2013 installation, CMAKE_CXX_COMPILER_VERSION is "18.0.31101.0". It seems useful to me to pass this CMake variable to the resource compiler, which does not have direct access to the macro's predefined by the C++ compiler (like _MSC_FULL_VER and _MSC_BUILD), for example by adding a "-D" flag: add_definitions(-DMY_COMPILER_VERSION="${CMAKE_CXX_COMPILER_VERSION}") Do you agree that it would be a good idea to add CMAKE_CXX_COMPILER_VERSION to the list of useful CMake variables, at http://www.cmake.org/Wiki/CMake_Useful_Variables ? Kind regards, Niels -- Niels Dekker Scientific programmer at LKEB Leiden University Medical Center From petr.kmoch at gmail.com Thu May 14 12:31:39 2015 From: petr.kmoch at gmail.com (Petr Kmoch) Date: Thu, 14 May 2015 18:31:39 +0200 Subject: [CMake] CMAKE_CXX_COMPILER_VERSION quite a useful variable, right? In-Reply-To: <5554CAD0.5040606@xs4all.nl> References: <5554CAD0.5040606@xs4all.nl> Message-ID: Hi Niels. I can't comment on the "useful variable" list, but I'd just like to point out that the variable is not undocumented. It's listed normally in the "variables for languages" section ( http://www.cmake.org/cmake/help/v3.2/manual/cmake-variables.7.html#variables-for-languages) of the documentation as CMAKE__COMPILER_VERSION; that's because it can be set for all enabled languages, not just CXX. http://www.cmake.org/cmake/help/v3.2/variable/CMAKE_LANG_COMPILER_VERSION.html Petr On Thu, May 14, 2015 at 6:18 PM, Niels Dekker - address until 2018 < niels_dekker_address_until_2018 at xs4all.nl> wrote: > When CMake (current version: 3.2.2) generates project files for Visual > Studio, it appears to define an undocumented variable that seems quite > useful to me: CMAKE_CXX_COMPILER_VERSION. It appears to be the full > compiler version. For example, for my VS2010 installation, > CMAKE_CXX_COMPILER_VERSION is "16.0.40219.1", and for my VS2013 > installation, CMAKE_CXX_COMPILER_VERSION is "18.0.31101.0". > > It seems useful to me to pass this CMake variable to the resource > compiler, which does not have direct access to the macro's predefined by > the C++ compiler (like _MSC_FULL_VER and _MSC_BUILD), for example by adding > a "-D" flag: > > add_definitions(-DMY_COMPILER_VERSION="${CMAKE_CXX_COMPILER_VERSION}") > > Do you agree that it would be a good idea to add > CMAKE_CXX_COMPILER_VERSION to the list of useful CMake variables, at > http://www.cmake.org/Wiki/CMake_Useful_Variables ? > > > Kind regards, Niels > -- > Niels Dekker > Scientific programmer at LKEB > Leiden University Medical Center > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eike at sf-mail.de Thu May 14 12:31:51 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Thu, 14 May 2015 18:31:51 +0200 Subject: [CMake] CMAKE_CXX_COMPILER_VERSION quite a useful variable, right? In-Reply-To: <5554CAD0.5040606@xs4all.nl> References: <5554CAD0.5040606@xs4all.nl> Message-ID: <7351079.hGYzLnpTYK@caliban.sf-tec.de> Am Donnerstag, 14. Mai 2015, 18:18:24 schrieb Niels Dekker - address until 2018: > When CMake (current version: 3.2.2) generates project files for Visual > Studio, it appears to define an undocumented variable that seems quite > useful to me: CMAKE_CXX_COMPILER_VERSION. It appears to be the full > compiler version. For example, for my VS2010 installation, > CMAKE_CXX_COMPILER_VERSION is "16.0.40219.1", and for my VS2013 > installation, CMAKE_CXX_COMPILER_VERSION is "18.0.31101.0". > > It seems useful to me to pass this CMake variable to the resource > compiler, which does not have direct access to the macro's predefined > by the C++ compiler (like _MSC_FULL_VER and _MSC_BUILD), for example > by adding a "-D" flag: > > add_definitions(-DMY_COMPILER_VERSION="${CMAKE_CXX_COMPILER_VERSION}") > > Do you agree that it would be a good idea to add > CMAKE_CXX_COMPILER_VERSION to the list of useful CMake variables, at > http://www.cmake.org/Wiki/CMake_Useful_Variables ? $ cmake --help-variable 'CMAKE__COMPILER_VERSION' CMAKE__COMPILER_VERSION ----------------------------- Compiler version string. Compiler version in major[.minor[.patch[.tweak]]] format. This variable is not guaranteed to be defined for all compilers or languages. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From niels_dekker_address_until_2018 at xs4all.nl Thu May 14 12:43:40 2015 From: niels_dekker_address_until_2018 at xs4all.nl (Niels Dekker - address until 2018) Date: Thu, 14 May 2015 18:43:40 +0200 Subject: [CMake] CMAKE_CXX_COMPILER_VERSION quite a useful variable, right? In-Reply-To: References: <5554CAD0.5040606@xs4all.nl> Message-ID: <5554D0BC.40504@xs4all.nl> Thanks to both Rolf Eike Beer and Petr Kmoch for showing me that the variable is documented as "CMAKE__COMPILER_VERSION". :-) Kind regards, Niels From luc_j_bourhis at mac.com Thu May 14 12:50:52 2015 From: luc_j_bourhis at mac.com (Luc J. Bourhis) Date: Thu, 14 May 2015 09:50:52 -0700 (MST) Subject: [CMake] [CPACK] [RPM] Using %if in %file section In-Reply-To: <3277938.MiOxiDqzbx@caliban.sf-tec.de> References: <1431604977008-7590576.post@n2.nabble.com> <3277938.MiOxiDqzbx@caliban.sf-tec.de> Message-ID: <1431622252740-7590586.post@n2.nabble.com> Ok, sorry, I used the online nabble interface to cmake mailing list actually but here is my original message without any formatting, after the marker -----. I'll take the opportunity to explain the rationales. I found out that the time spent by CPack running rpmbuild is only a very small portion of the total runtime and I need to build the same package on different platforms. So I thought of simply running CPack once and then copying over the _CPack_Packages/... directory and run rpmbuild directly. --------------- I would like to end up with the following in the specs file: ... %file ... %if 0%{fedora} >= 14 "/path/to/some/file" %endif I tried to use CPACK_RPM_USER_FILELIST as set(CPACK_RPM_USER_FILELIST ${CPACK_RPM_USER_FILELIST} "%if 0%{fedora} >= 14" "/path/to/some/file" "%endif" ) but this results in %if "0%{fedora} >= 14" "/path/to/some/file" %endif "%endif" which is not quite right. Is there something I am missing? Or is it a fundamental limitation of CPack RPM generator? If so, would there be any workaround? Thanks in advance for any help. ----- -- Luc J. Bourhis -- View this message in context: http://cmake.3232098.n2.nabble.com/CPACK-RPM-Using-if-in-file-section-tp7590576p7590586.html Sent from the CMake mailing list archive at Nabble.com. From steveire at gmail.com Thu May 14 13:11:57 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 14 May 2015 19:11:57 +0200 Subject: [CMake] Making the export function output relative paths References: Message-ID: John van der Burg wrote: > I basically need everything relative to the ${CUSTOM_ROOT} folder. > > Any hints/help would be appreciated :) Use install(EXPORT) instead: http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f79d6025 Thanks, Steve. From steveire at gmail.com Thu May 14 13:14:46 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 14 May 2015 19:14:46 +0200 Subject: [CMake] Alias of imported target References: <554B613B.6050509@yahoo.com> Message-ID: Ruslan Baratov via CMake wrote: > It may be helpful in situations when you build package with examples. In > case when you want examples to work both as a part of a project > (add_subdirectory) or stand-alone (find_package). I expect external_project may lead to more readability for this case, though the case you described also makes sense. Thanks, Steve. From steveire at gmail.com Thu May 14 13:16:42 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 14 May 2015 19:16:42 +0200 Subject: [CMake] Alias of imported target References: <578B2208-D921-45B6-8886-A0342E4D0B0B@sap.com> Message-ID: CHEVRIER, Marc wrote: > > My need is the following: > I have two imported targets, let say, IMPORTED::TARGET and > IMPORTED::STATIC::TARGET > > > And I have a project which can be customised, through an option, by > selecting which imported target will be used (shared or static). > > So I tried, at first place: > if (USE_IMPORTED_STATIC) > add_library (MY_IMPORTED_TARGET ALIAS IMPORTED::STATIC::TARGET) > else() > add_library (MY_IMPORTED_TARGET ALIAS IMPORTED::TARGET) > endif() > > So, after, I do not longer take care of which imported target is selected! This makes sense to me, thanks. I filed http://public.kitware.com/Bug/view.php?id=15569 to track it. Thanks, Steve. From csiga.biga at aol.com Thu May 14 15:44:53 2015 From: csiga.biga at aol.com (=?utf-8?Q?Nagy-Egri_MC!tC)_Ferenc?=) Date: Thu, 14 May 2015 19:44:53 +0000 Subject: [CMake] =?utf-8?q?FindModules=2Ecmake_quality_+_Kitware_propositi?= =?utf-8?q?on?= In-Reply-To: References: <20150514150932.8C750A8FFB@public.kitware.com>, Message-ID: Tried jom years ago. Still chokes on Unicode paths. Thanks, M?t? ps.: I had a feeling this is as much feedback as I?ll get. Felad?: Stephen Kelly Elk?ldve: ?cs?t?rt?k?, ?2015?. ?m?jus? ?14?. ?18?:?08 C?mzett: cmake at cmake.org Nagy-Egri M?t? Ferenc via CMake wrote: > ... NMake batch mode support for multicore build, etc. I suggest you look into 'jom'. Thanks, Steve. -- 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: http://public.kitware.com/mailman/listinfo/cmake -------------- next part -------------- An HTML attachment was scrubbed... URL: From steveire at gmail.com Thu May 14 15:51:05 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 14 May 2015 21:51:05 +0200 Subject: [CMake] FindModules.cmake quality + Kitware proposition References: <20150514150932.8C750A8FFB@public.kitware.com> <20150514194652.5FD30AE75C@public.kitware.com> Message-ID: Nagy-Egri MC!tC\) Ferenc via CMake wrote: > Tried jom years ago. Still chokes on Unicode paths. Ok, I guess the jom developers are the ones to discuss that issue with. Thanks, Steve. From ruslan_baratov at yahoo.com Thu May 14 15:24:18 2015 From: ruslan_baratov at yahoo.com (Ruslan Baratov) Date: Thu, 14 May 2015 22:24:18 +0300 Subject: [CMake] FindModules.cmake quality + Kitware proposition In-Reply-To: <20150514150932.99665A93DE@public.kitware.com> References: <20150514150932.99665A93DE@public.kitware.com> Message-ID: <5554F662.2020708@yahoo.com> On 14-May-15 14:01, Nagy-Egri M?t? Ferenc via CMake wrote: > This is more of a remark, or something to get the ball rolling, rather > than anything else. > > I recently came across various FindModule.cmake files (FindOpenCL, > FindOpenGL, FindGLEW, FindGLM, FindSFML) as a sideeffect of a project > I am developing, but have had my share with quite a few others > (FindQt, RustCMake, FindOpenAL, FindBoost, ?). My overall impression > is that the quality of these modules is highly fluctuating to say the > least. While generally the FindModules shipping with CMake as built-in > scripts are usable, there is a fair amount of room for improvement. > > FindGLEW.cmake for eg. is terrible. I have never imagined that such a > widely used library has a 7 line FindModule script. On Windows it is > practically useless. > > As for nearly all other FindModule scripts, nearly none of them use > target_include_libraries() that would allow for end-users of the > scripts to not have to worry about include directories. > > Some projects strive at being cross-platform, but compiling them on > Windows (mostly the GNU projects that aim on being Windows friendly) > is massive pain. libJPEG to name just one provides nmake makefiles > that are capable of producing Visual Studio 2010 project files at best > (huuraay), and have undocumented external dependencies. These projects > (and their users) cry out for CMake support. > > Here is a proposition to consider: This sounds like a workaround for the existing problems. What we really need to do to solve this issue completely is to use automatically generated Find-like modules - Config.cmake. See: http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html#creating-packages > > Kitware generally has the philosphy with CMake being: do it yourself > or hire us to do it. While on a corporate basis this is a legitimate > approach, I as a poor academic fellow do not have 10.000$ to spare for > a feature I so wish, neither do I have the time to educate myself in > the internal ways of CMake to contribute. So all I do is hack, hack, > hack all day. > > The Chocolatey project (a package manager for Windows) recently won a > massive Kickstarter campaign that aimed solely increasing the overall > quality of the project. With this campaign they aimed on growing from > an ?interesting idea? to begin ?mainstream?. With the money they won, > they hired full time package moderators, developed automated scripts > of facilitating authoring, wrote tutorials, created templates, and > even managed to get the ball rolling with OneGet (Powershell 5.0 > package manager manager) to adopt Chocolatey as the first supported > public repo. > > I would suggest Kitware start a similar community funded project to > increase the overall quality of the software. While I do not have 10 > grands to buy a feature, I do have 10 dollars pocket money to > contribute (as do MANY others). > > As several levels of goals, the stock FindModules scripts could be > brought to a homogenous quality, identical naming conventions (no more > MYLIB_INC_DIR, MYLIB_INCLUDE_DIRS, MyLib_INCLUDE_DIR), high quality > templates for new adopters, make the CMake Guide freely available > online (epub, pdf, docx, whatever), convert 10 GNU projects to CMake, > convert 50 GNU projects to CMake, create Snappy back-end of CPack, or > my personal favorite (the feature I do not have 10.000 dollars for) is > NMake batch mode support for multicore build, etc. > > There are so many places CMake itself can be improved, and so many > users who really should be adopting, but have not started due to > lacking man power. (These are the projects that would benefit the most > from a freely available tutorial, because truth be told: writing > capable, high-quality CMake scripts is no easy task.) > > If I were a charmismatic spokesperson I?d say: I RAISE 10 DOLLARS, > WHO?S WITH ME?! But because I?m not, I?ll just leave it here as a > suggestion. > > Ideas? Have you seen https://www.bountysource.com/ ? Ruslo -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike.jackson at bluequartz.net Thu May 14 16:47:11 2015 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Thu, 14 May 2015 16:47:11 -0400 Subject: [CMake] Trouble getting install script to actually run during packaging Message-ID: I have a bit of Cmake code that I can not seem to figure out how to get to actually run during cpack. HEre is the code: GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) configure_file("${SELF_DIR}/Deploy_ITK_Libs.sh.in" "${DREAM3DProj_BINARY_DIR}/Deploy_ITK_Libs.sh" @ONLY IMMEDIATE) FILE(WRITE "${DREAM3DProj_BINARY_DIR}/Deploy_ITK_Libs.cmake" "execute_process(COMMAND \"/bin/bash ${DREAM3DProj_BINARY_DIR}/Deploy_ITK_Libs.sh \${CMAKE_INSTALL_PREFIX}\")" ) FILE(APPEND "${DREAM3DProj_BINARY_DIR}/Deploy_ITK_Libs.cmake" "\n\nMESSAGE(STATUS \"@@@@@@@@@@@@@@@@@ THIS IS DONE @@@@@@@@@@@\")\n") INSTALL(CODE "execute_process(COMMAND \"/bin/bash ${DREAM3DProj_BINARY_DIR}/Deploy_ITK_Libs.sh \${CMAKE_INSTALL_PREFIX}\")" COMPONENT Applications) install(SCRIPT "${DREAM3DProj_BINARY_DIR}/Deploy_ITK_Libs.cmake" COMPONENT Applications) After I build I run "cpack" from the command line. I see _other_ scripts that I have configured run but not _this_ script. I have verified that the cmake code is actually executing as I get a new script file each time I run cmake. I am sure I am missing something simple at this point but I just can not see it. This is on Linux Mint 17.x with CMake 3.1.0. Thanks for any help _________________________________________________________ Mike Jackson mike.jackson at bluequartz.net BlueQuartz Software www.bluequartz.net Principal Software Engineer Dayton, Ohio -------------- next part -------------- An HTML attachment was scrubbed... URL: From domen.vrankar at gmail.com Thu May 14 17:00:10 2015 From: domen.vrankar at gmail.com (Domen Vrankar) Date: Thu, 14 May 2015 23:00:10 +0200 Subject: [CMake] [CPACK] [RPM] Using %if in %file section In-Reply-To: <1431622252740-7590586.post@n2.nabble.com> References: <1431604977008-7590576.post@n2.nabble.com> <3277938.MiOxiDqzbx@caliban.sf-tec.de> <1431622252740-7590586.post@n2.nabble.com> Message-ID: > I would like to end up with the following in the specs file: > > ... > %file > ... > %if 0%{fedora} >= 14 > "/path/to/some/file" > %endif > > I tried to use CPACK_RPM_USER_FILELIST as > > set(CPACK_RPM_USER_FILELIST ${CPACK_RPM_USER_FILELIST} > "%if 0%{fedora} >= 14" > "/path/to/some/file" > "%endif" > ) > > but this results in > > %if "0%{fedora} >= 14" > "/path/to/some/file" > %endif "%endif" > which is not quite right. > > Is there something I am missing? Or is it a fundamental limitation of CPack > RPM generator? This seems to be a bug in CPackRPM. Please report it in bug tracker. > If so, would there be any workaround? Thanks in advance for > any help. You could either fix it in CPackRPM.cmake and provide a patch. Alternatively you could simply copy spec file template from CPackRPM.cmake, save it into your own spec template file and extend it with your own CPACK_* variable that will be substituted during packaging. Then use CPACK_RPM_USER_BINARY_SPECFILE or CPACK_RPM__USER_BINARY_SPECFILE for component packages. See documentation of this variable for details: http://www.cmake.org/cmake/help/v3.2/module/CPackRPM.html Regards, Domen From paul at mad-scientist.net Thu May 14 17:24:16 2015 From: paul at mad-scientist.net (Paul Smith) Date: Thu, 14 May 2015 17:24:16 -0400 Subject: [CMake] OSX xcodebuild not rebuilding objects? Message-ID: <1431638656.3092.156.camel@mad-scientist.net> Has anyone else run into errors rebuilding objects using the Xcode generator? I imagine it would be a bug in xcodebuild, not cmake. We've been using incremental builds, rather than clean builds, for years with cmake on GNU/Linux (make), OSX (Xcode), and Windows (MSVC) and this is the first time I've ever seen this. One of our C++ unit tests got a bus error on OSX and while debugging it became clear that one of our object files was not rebuilt after a header file had changed (obviously very bad). Looking at the build directory, the object file was definitely NOT rebuilt when it should have been: the object file's time-last-modified was April 29, the object file's ".d" file contained the fully-qualified path to the header file in question, and the time-last-modified on the header file was May 12. The build log shows other object files being rebuilt, but not this one. There's absolutely nothing special about this file: it's just a standard C++ source file and appears in a list of similar C++ files in my CMakeLists.txt file. I've never seen this happen before, has anyone else run into it? This makes me very concerned! $ cmake --version cmake version 3.1.0 $ xcodebuild -version Xcode 6.2 Build version 6C131e $ sw_vers ProductName: Mac OS X ProductVersion: 10.9.5 BuildVersion: 13F1066 From paul at mad-scientist.net Thu May 14 17:53:22 2015 From: paul at mad-scientist.net (Paul Smith) Date: Thu, 14 May 2015 17:53:22 -0400 Subject: [CMake] Where do all the extra clang flags come from in Xcode? Message-ID: <1431640402.3092.169.camel@mad-scientist.net> I was comparing the command line used when we choose an Xcode generator on our OSX systems, vs. the command line used when we choose a Makefile generator. We certainly have nothing in our CMakeLists.txt which sets compiler flags based on the type of generator, only based on the type of compiler (GCC, Clang, etc.) But, when I look at the compiler and flags used by the Makefile generator it uses /usr/bin/c++ (which is clang++ underneath) and it's basically only the the compiler flags that we provided. When I look at the compiler and flags used by the Xcode generator, not only does it use a different path to the compiler (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++) but, more concerning (because I assume that /usr/bin/clang++ eventually gets down to the same actual compiler as above) but it contains a huge number of extra flags, for example it appears to disable all sorts of warnings (that we don't want disabled): -Wno-missing-prototypes, -Wno-return-type, -Wno-non-virtual-dtor, -Wno-overloaded-virtual, etc. etc. This means people who build on OSX using Makefile generators see extra warnings that people who build on OSX using Xcode don't see. Where are these extra flags all coming from? Is it from Xcode itself somehow? Can I keep them from being added? I don't want peoples' personal Xcode settings to disable warnings during compilation! Note these are build servers and so no one is actually invoking Xcode: we log in via SSH, use cmake to generate the Xcode project files, then use cmake -build (which runs xcodebuild) to run the build itself. From csiga.biga at aol.com Fri May 15 08:51:44 2015 From: csiga.biga at aol.com (=?utf-8?Q?Nagy-Egri_M=C3=A1t=C3=A9_Ferenc?=) Date: Fri, 15 May 2015 12:51:44 +0000 Subject: [CMake] =?utf-8?q?FindModules=2Ecmake_quality_+_Kitware_propositi?= =?utf-8?q?on?= In-Reply-To: <5554F662.2020708@yahoo.com> References: <20150514150932.99665A93DE@public.kitware.com>, <5554F662.2020708@yahoo.com> Message-ID: Auto-generating things seems like a good idea, as most CMake scripting feels like boilerplate. The majority of the projects do the same things, so it only makes sense to try getting some automation working. Perhaps it might go all the way to obtaining sources if not found on the computer, similar to what Cargo does with Rust. As for the bountysource.com page, it is a good initiative. Perhaps a link to it on the CMake website would be useful. Cheers, M?t? Felad?: cmake at cmake.org Elk?ldve: ?cs?t?rt?k?, ?2015?. ?m?jus? ?14?. ?21?:?24 C?mzett: cmake at cmake.org On 14-May-15 14:01, Nagy-Egri M?t? Ferenc via CMake wrote: This is more of a remark, or something to get the ball rolling, rather than anything else. I recently came across various FindModule.cmake files (FindOpenCL, FindOpenGL, FindGLEW, FindGLM, FindSFML) as a sideeffect of a project I am developing, but have had my share with quite a few others (FindQt, RustCMake, FindOpenAL, FindBoost, ?). My overall impression is that the quality of these modules is highly fluctuating to say the least. While generally the FindModules shipping with CMake as built-in scripts are usable, there is a fair amount of room for improvement. FindGLEW.cmake for eg. is terrible. I have never imagined that such a widely used library has a 7 line FindModule script. On Windows it is practically useless. As for nearly all other FindModule scripts, nearly none of them use target_include_libraries() that would allow for end-users of the scripts to not have to worry about include directories. Some projects strive at being cross-platform, but compiling them on Windows (mostly the GNU projects that aim on being Windows friendly) is massive pain. libJPEG to name just one provides nmake makefiles that are capable of producing Visual Studio 2010 project files at best (huuraay), and have undocumented external dependencies. These projects (and their users) cry out for CMake support. Here is a proposition to consider: This sounds like a workaround for the existing problems. What we really need to do to solve this issue completely is to use automatically generated Find-like modules - Config.cmake. See: http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html#creating-packages Kitware generally has the philosphy with CMake being: do it yourself or hire us to do it. While on a corporate basis this is a legitimate approach, I as a poor academic fellow do not have 10.000$ to spare for a feature I so wish, neither do I have the time to educate myself in the internal ways of CMake to contribute. So all I do is hack, hack, hack all day. The Chocolatey project (a package manager for Windows) recently won a massive Kickstarter campaign that aimed solely increasing the overall quality of the project. With this campaign they aimed on growing from an ?interesting idea? to begin ?mainstream?. With the money they won, they hired full time package moderators, developed automated scripts of facilitating authoring, wrote tutorials, created templates, and even managed to get the ball rolling with OneGet (Powershell 5.0 package manager manager) to adopt Chocolatey as the first supported public repo. I would suggest Kitware start a similar community funded project to increase the overall quality of the software. While I do not have 10 grands to buy a feature, I do have 10 dollars pocket money to contribute (as do MANY others). As several levels of goals, the stock FindModules scripts could be brought to a homogenous quality, identical naming conventions (no more MYLIB_INC_DIR, MYLIB_INCLUDE_DIRS, MyLib_INCLUDE_DIR), high quality templates for new adopters, make the CMake Guide freely available online (epub, pdf, docx, whatever), convert 10 GNU projects to CMake, convert 50 GNU projects to CMake, create Snappy back-end of CPack, or my personal favorite (the feature I do not have 10.000 dollars for) is NMake batch mode support for multicore build, etc. There are so many places CMake itself can be improved, and so many users who really should be adopting, but have not started due to lacking man power. (These are the projects that would benefit the most from a freely available tutorial, because truth be told: writing capable, high-quality CMake scripts is no easy task.) If I were a charmismatic spokesperson I?d say: I RAISE 10 DOLLARS, WHO?S WITH ME?! But because I?m not, I?ll just leave it here as a suggestion. Ideas? Have you seen https://www.bountysource.com/ ? Ruslo -------------- next part -------------- An HTML attachment was scrubbed... URL: From taylor at braun-jones.org Fri May 15 11:48:32 2015 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Fri, 15 May 2015 11:48:32 -0400 Subject: [CMake] Export environment variables in generated Makefile Message-ID: Is it possible for CMake to generate a Makefile that exports environment variables whenever a target is executed? I want all invocations of gcc to see the environment variables COVFILE=xxx and COVSRCDIR=xxx Thanks, Taylor -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.kacvinsky at vectorcast.com Fri May 15 11:50:03 2015 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Fri, 15 May 2015 11:50:03 -0400 Subject: [CMake] Problem with multiple expressions with if() Message-ID: Here is a simple CMakeList.txt: # ====================================================[ cmake_minimum_required(VERSION 2.8) project(vectorcast) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64") set(LINUX64 1) else() set(LINUX32 1) endif() endif() if ((${CMAKE_SYSTEM_NAME} MATCHES "SunOS") or (DEFINED LINUX64)) message(STATUS "On Solaris or 64 bit Linux") endif() # ====================================================[ I'm using cmake version 2.8.11.2 built from source on Linux localhost.localdomain 2.6.18-8.el5 #1 SMP Thu Mar 15 19:46:53 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux This doesn't work. I get this error message is: CMake Error at CMakeLists.txt:12 (if): if given arguments: "(" "Linux" "MATCHES" "SunOS" ")" "or" "(" "DEFINED" "LINUX64" ")" Unknown arguments specified What am I doing wrong? Is this syntax not supported until the 3.x series? Thanks, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From domen.vrankar at gmail.com Fri May 15 12:12:50 2015 From: domen.vrankar at gmail.com (Domen Vrankar) Date: Fri, 15 May 2015 18:12:50 +0200 Subject: [CMake] Problem with multiple expressions with if() In-Reply-To: References: Message-ID: > if ((${CMAKE_SYSTEM_NAME} MATCHES "SunOS") or (DEFINED LINUX64)) > message(STATUS "On Solaris or 64 bit Linux") > endif() > # ====================================================[ > > I'm using cmake version 2.8.11.2 built from source on > > Linux localhost.localdomain 2.6.18-8.el5 #1 SMP Thu Mar 15 19:46:53 EDT 2007 > x86_64 x86_64 x86_64 GNU/Linux > > This doesn't work. I get this error message is: > > CMake Error at CMakeLists.txt:12 (if): > if given arguments: > > "(" "Linux" "MATCHES" "SunOS" ")" "or" "(" "DEFINED" "LINUX64" ")" > > Unknown arguments specified > > > What am I doing wrong? Is this syntax not supported until the 3.x series? Commands are case sensitive so OR should be upper cased. Also I would recommand you either use "${var_name}" or var_name as the command expects either a string or a variable. Regards, Domen From tom.kacvinsky at vectorcast.com Fri May 15 13:05:31 2015 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Fri, 15 May 2015 13:05:31 -0400 Subject: [CMake] Problem with multiple expressions with if() In-Reply-To: References: Message-ID: On Fri, May 15, 2015 at 12:12 PM, Domen Vrankar wrote: > > if ((${CMAKE_SYSTEM_NAME} MATCHES "SunOS") or (DEFINED LINUX64)) > > message(STATUS "On Solaris or 64 bit Linux") > > endif() > > # ====================================================[ > > > > I'm using cmake version 2.8.11.2 built from source on > > > > Linux localhost.localdomain 2.6.18-8.el5 #1 SMP Thu Mar 15 19:46:53 EDT > 2007 > > x86_64 x86_64 x86_64 GNU/Linux > > > > This doesn't work. I get this error message is: > > > > CMake Error at CMakeLists.txt:12 (if): > > if given arguments: > > > > "(" "Linux" "MATCHES" "SunOS" ")" "or" "(" "DEFINED" "LINUX64" ")" > > > > Unknown arguments specified > > > > > > What am I doing wrong? Is this syntax not supported until the 3.x > series? > > Commands are case sensitive so OR should be upper cased. > Also I would recommand you either use "${var_name}" or var_name as the > command expects either a string or a variable. > > Regards, > Domen > Ah, that did it. Changing to uppercase OR fixed the issue. Many thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.kacvinsky at vectorcast.com Fri May 15 14:07:01 2015 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Fri, 15 May 2015 14:07:01 -0400 Subject: [CMake] Problem with multiple expressions with if() In-Reply-To: References: Message-ID: On Fri, May 15, 2015 at 1:05 PM, Tom Kacvinsky wrote: > On Fri, May 15, 2015 at 12:12 PM, Domen Vrankar > wrote: > >> > if ((${CMAKE_SYSTEM_NAME} MATCHES "SunOS") or (DEFINED LINUX64)) >> > message(STATUS "On Solaris or 64 bit Linux") >> > endif() >> > # ====================================================[ >> > >> > I'm using cmake version 2.8.11.2 built from source on >> > >> > Linux localhost.localdomain 2.6.18-8.el5 #1 SMP Thu Mar 15 19:46:53 EDT >> 2007 >> > x86_64 x86_64 x86_64 GNU/Linux >> > >> > This doesn't work. I get this error message is: >> > >> > CMake Error at CMakeLists.txt:12 (if): >> > if given arguments: >> > >> > "(" "Linux" "MATCHES" "SunOS" ")" "or" "(" "DEFINED" "LINUX64" ")" >> > >> > Unknown arguments specified >> > >> > >> > What am I doing wrong? Is this syntax not supported until the 3.x >> series? >> >> Commands are case sensitive so OR should be upper cased. >> Also I would recommand you either use "${var_name}" or var_name as the >> command expects either a string or a variable. >> >> Regards, >> Domen >> > > Ah, that did it. Changing to uppercase OR fixed the issue. Many thanks. > > Well, shoot. I had made a typeo that fooled cmake into thinking what I had done is OK. Here is what I have now: if ((${CMAKE_SYSTEM_NAME} MATCHES "SunOS") OR ${LINUX64}) and I still get a complaint: CMake Error at CMakeLists.txt:164 (if): if given arguments: "(" "Linux" "MATCHES" "SunOS" ")" "OR" -------------- next part -------------- An HTML attachment was scrubbed... URL: From petr.kmoch at gmail.com Fri May 15 14:17:21 2015 From: petr.kmoch at gmail.com (Petr Kmoch) Date: Fri, 15 May 2015 20:17:21 +0200 Subject: [CMake] Problem with multiple expressions with if() In-Reply-To: References: Message-ID: `if(${LINUX64})` will expand to `if()` if LINUX64 is either not defined, or holds an empty string. In both cases, it's a syntax error. If you want to check whether LINUX64 is set to a truthy value, either quote it, or don't dereference it: if((CMAKE_SYSTEM_NAME MATCHES "SunOS") OR LINUX64) Note that you don't have to dereference the left-hand argument of MATCHES either. In fact, it's safer to either not dereference it, or put quotes around the dereference. Petr On Fri, May 15, 2015 at 8:07 PM, Tom Kacvinsky wrote: > > > On Fri, May 15, 2015 at 1:05 PM, Tom Kacvinsky < > tom.kacvinsky at vectorcast.com> wrote: > >> On Fri, May 15, 2015 at 12:12 PM, Domen Vrankar >> wrote: >> >>> > if ((${CMAKE_SYSTEM_NAME} MATCHES "SunOS") or (DEFINED LINUX64)) >>> > message(STATUS "On Solaris or 64 bit Linux") >>> > endif() >>> > # ====================================================[ >>> > >>> > I'm using cmake version 2.8.11.2 built from source on >>> > >>> > Linux localhost.localdomain 2.6.18-8.el5 #1 SMP Thu Mar 15 19:46:53 >>> EDT 2007 >>> > x86_64 x86_64 x86_64 GNU/Linux >>> > >>> > This doesn't work. I get this error message is: >>> > >>> > CMake Error at CMakeLists.txt:12 (if): >>> > if given arguments: >>> > >>> > "(" "Linux" "MATCHES" "SunOS" ")" "or" "(" "DEFINED" "LINUX64" ")" >>> > >>> > Unknown arguments specified >>> > >>> > >>> > What am I doing wrong? Is this syntax not supported until the 3.x >>> series? >>> >>> Commands are case sensitive so OR should be upper cased. >>> Also I would recommand you either use "${var_name}" or var_name as the >>> command expects either a string or a variable. >>> >>> Regards, >>> Domen >>> >> >> Ah, that did it. Changing to uppercase OR fixed the issue. Many thanks. >> >> > Well, shoot. I had made a typeo that fooled cmake into thinking what I > had done is OK. Here is what I have now: > > if ((${CMAKE_SYSTEM_NAME} MATCHES "SunOS") OR ${LINUX64}) > > and I still get a complaint: > > CMake Error at CMakeLists.txt:164 (if): > if given arguments: > > "(" "Linux" "MATCHES" "SunOS" ")" "OR" > > > > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From irwin at beluga.phys.uvic.ca Fri May 15 14:26:02 2015 From: irwin at beluga.phys.uvic.ca (Alan W. Irwin) Date: Fri, 15 May 2015 11:26:02 -0700 (PDT) Subject: [CMake] Chicken and egg problem with cmake_minimum_required(...), project(...), and CMAKE_SYSTEM_NAME In-Reply-To: <554375D5.3010503@kitware.com> References: <554375D5.3010503@kitware.com> Message-ID: On 2015-05-01 08:47-0400 Brad King wrote: > On 05/01/2015 06:25 AM, Alan W. Irwin wrote: >> # First call to project so that CMAKE_SYSTEM_NAME is defined >> project(plplot NONE) >> if(CMAKE_SYSTEM_NAME STREQUAL "Linux") >> cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) >> else(CMAKE_SYSTEM_NAME STREQUAL "Linux") >> cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) >> endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") >> # "Real" call to project >> project(plplot C) > > You don't need another project(). You can use enable_language(C). > Others have advised against having a different minimum, but if > you have good reasons for it then: > > cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) > project(plplot NONE) > if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") > cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) > endif() > enable_language(C) > > Note that this will cause policy settings to differ on Linux > versus elsewhere. One further issue. The maximum version of CMake that is packaged for Cygwin is 3.1.2 so the 3.2 permissions fix for file(GENERATE...) is not available on Cygwin yet (unless you build your own version of CMake there). Thus, our actual current use case is we want to support older CMake versions on both Linux and Cygwin, and I also want to include some logic to make us use the same policies regardless of the choice of minimum version. So our logic attempted to follow what you suggest above but ended up as follows: ########################## function(plplot_cmake_minimum_required) cmake_minimum_required(${ARGV}) # MAINTENANCE # This should be one more than the maximum policy of 3.0.2. set(minimum_old_policy 51) # This should be the maximum policy of 3.2.2 set(maximum_old_policy 56) foreach(policy RANGE ${minimum_old_policy} ${maximum_old_policy}) if(POLICY CMP00${policy}) message(STATUS "Explicitly setting policy CMP00${policy} to OLD") cmake_policy(SET CMP00${policy} OLD) endif(POLICY CMP00${policy}) endforeach(policy RANGE ${minimum_old_policy} ${maximum_old_policy}) endfunction(plplot_cmake_minimum_required) plplot_cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) project(plplot NONE) if(NOT (CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL "Linux") ) plplot_cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) endif(NOT (CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL "Linux") ) enable_language(C) message(STATUS "CMake version = ${CMAKE_VERSION}") message(STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}") ########################## This works fine on Linux, but I have a second-hand report this generates the spurious warning on Cygwin (our last instance of this spurious warning so I would really like to get rid of it!): "CMake Warning at /usr/share/cmake-3.1.2/Modules/Platform/CYGWIN.cmake:15 (message): CMake no longer defines WIN32 on Cygwin! [...]" >From various experiments the reporter of this issue has found that the problem is with the function command itself which apparently cannot occur (on Cygwin) before cmake_minimum_required is called. In fact, he simplified the problem down to this 4-line test: function(plplot_cmake_minimum_required) cmake_minimum_required(${ARGV}) endfunction(plplot_cmake_minimum_required) plplot_cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) which generates the spurious warning on Cygwin while the single-line test, cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) (as expected) does not. Can you confirm with your own experiments using the above 4-line test on Cygwin that a function should not be used in this situation? Or is there some CMake bug on Cygwin that is generating the spurious error message? In any case to work around this issue I am thinking of adjusting our above PLplot build system logic as follows: ########################## cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) function(set_plplot_policies) # MAINTENANCE # This should be one more than the maximum policy of 3.0.2. set(minimum_old_policy 51) # This should be the maximum policy of 3.2.2 set(maximum_old_policy 56) foreach(policy RANGE ${minimum_old_policy} ${maximum_old_policy}) if(POLICY CMP00${policy}) message(STATUS "Explicitly setting policy CMP00${policy} to OLD") cmake_policy(SET CMP00${policy} OLD) endif(POLICY CMP00${policy}) endforeach(policy RANGE ${minimum_old_policy} ${maximum_old_policy}) endfunction(set_plplot_policies) project(plplot NONE) set_plplot_polices() if(NOT (CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL "Linux") ) cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) set_plplot_polices() endif(NOT (CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL "Linux") ) enable_language(C) message(STATUS "CMake version = ${CMAKE_VERSION}") message(STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}") ########################## Do you think this is a safe way (i.e., no more spurious Cygwin warnings) to implement platform-dependent minimum versions or is there some better approach I should be taking? Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ From brad.king at kitware.com Fri May 15 14:48:54 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 15 May 2015 14:48:54 -0400 Subject: [CMake] Chicken and egg problem with cmake_minimum_required(...), project(...), and CMAKE_SYSTEM_NAME In-Reply-To: References: <554375D5.3010503@kitware.com> Message-ID: <55563F96.5020806@kitware.com> On 05/15/2015 02:26 PM, Alan W. Irwin wrote: > function(plplot_cmake_minimum_required) > cmake_minimum_required(${ARGV}) > endfunction(plplot_cmake_minimum_required) Help: Document behavior of cmake_minimum_required in a function http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e5f8ead5 -Brad From tom.kacvinsky at vectorcast.com Fri May 15 16:29:18 2015 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Fri, 15 May 2015 16:29:18 -0400 Subject: [CMake] Problem with multiple expressions with if() In-Reply-To: References: Message-ID: On Fri, May 15, 2015 at 2:17 PM, Petr Kmoch wrote: > `if(${LINUX64})` will expand to `if()` if LINUX64 is either not defined, > or holds an empty string. In both cases, it's a syntax error. If you want > to check whether LINUX64 is set to a truthy value, either quote it, or > don't dereference it: > > if((CMAKE_SYSTEM_NAME MATCHES "SunOS") OR LINUX64) > > Note that you don't have to dereference the left-hand argument of MATCHES > either. In fact, it's safer to either not dereference it, or put quotes > around the dereference. > > Petr > > Petr, I see where things went wrong now. I've taken your advice and that indeed fixed the issue. Tom > On Fri, May 15, 2015 at 8:07 PM, Tom Kacvinsky < > tom.kacvinsky at vectorcast.com> wrote: > >> >> >> On Fri, May 15, 2015 at 1:05 PM, Tom Kacvinsky < >> tom.kacvinsky at vectorcast.com> wrote: >> >>> On Fri, May 15, 2015 at 12:12 PM, Domen Vrankar >> > wrote: >>> >>>> > if ((${CMAKE_SYSTEM_NAME} MATCHES "SunOS") or (DEFINED LINUX64)) >>>> > message(STATUS "On Solaris or 64 bit Linux") >>>> > endif() >>>> > # ====================================================[ >>>> > >>>> > I'm using cmake version 2.8.11.2 built from source on >>>> > >>>> > Linux localhost.localdomain 2.6.18-8.el5 #1 SMP Thu Mar 15 19:46:53 >>>> EDT 2007 >>>> > x86_64 x86_64 x86_64 GNU/Linux >>>> > >>>> > This doesn't work. I get this error message is: >>>> > >>>> > CMake Error at CMakeLists.txt:12 (if): >>>> > if given arguments: >>>> > >>>> > "(" "Linux" "MATCHES" "SunOS" ")" "or" "(" "DEFINED" "LINUX64" ")" >>>> > >>>> > Unknown arguments specified >>>> > >>>> > >>>> > What am I doing wrong? Is this syntax not supported until the 3.x >>>> series? >>>> >>>> Commands are case sensitive so OR should be upper cased. >>>> Also I would recommand you either use "${var_name}" or var_name as the >>>> command expects either a string or a variable. >>>> >>>> Regards, >>>> Domen >>>> >>> >>> Ah, that did it. Changing to uppercase OR fixed the issue. Many thanks. >>> >>> >> Well, shoot. I had made a typeo that fooled cmake into thinking what I >> had done is OK. Here is what I have now: >> >> if ((${CMAKE_SYSTEM_NAME} MATCHES "SunOS") OR ${LINUX64}) >> >> and I still get a complaint: >> >> CMake Error at CMakeLists.txt:164 (if): >> if given arguments: >> >> "(" "Linux" "MATCHES" "SunOS" ")" "OR" >> >> >> >> >> -- >> >> 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: >> http://public.kitware.com/mailman/listinfo/cmake >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From irwin at beluga.phys.uvic.ca Fri May 15 16:37:50 2015 From: irwin at beluga.phys.uvic.ca (Alan W. Irwin) Date: Fri, 15 May 2015 13:37:50 -0700 (PDT) Subject: [CMake] Chicken and egg problem with cmake_minimum_required(...), project(...), and CMAKE_SYSTEM_NAME In-Reply-To: <55563F96.5020806@kitware.com> References: <554375D5.3010503@kitware.com> <55563F96.5020806@kitware.com> Message-ID: On 2015-05-15 14:48-0400 Brad King wrote: > On 05/15/2015 02:26 PM, Alan W. Irwin wrote: >> function(plplot_cmake_minimum_required) >> cmake_minimum_required(${ARGV}) >> endfunction(plplot_cmake_minimum_required) > > Help: Document behavior of cmake_minimum_required in a function > http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e5f8ead5 Thanks for inserting that clarification in the documentation. Since it appears from that new documentation that using cmake_minimum_version inside a function is problematic, and I just realized in any case I can use cmake_policy(VERSION 3.0.2) to set uniform policy, our implementation of different CMake minimum versions (but with uniform policy) for different platforms now boils down to cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) cmake_policy(VERSION 3.0.2) project(plplot NONE) if(NOT (CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL "Linux") ) # Latest CMake version as of 2015-05 for all platforms # other than Cygwin or Linux. cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) # Keep policy consistent for all platforms. cmake_policy(VERSION 3.0.2) endif(NOT (CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL "Linux") ) enable_language(C) This form of startup logic appears to work fine on Linux, but I will have to wait for a report from a PLplot developer with access to Cygwin to confirm this form gets rid of the last of the Cygwin spurious warnings. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ From taylor at braun-jones.org Sat May 16 11:44:32 2015 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Sat, 16 May 2015 11:44:32 -0400 Subject: [CMake] Export environment variables in generated Makefile In-Reply-To: References: Message-ID: Here's a little more context to help understand the use case: I'm using the BullseyeCoverage as a compiler interceptor. So I have CMAKE_CXX_COMPILER=/opt/bullseye/bin/g++ Which is symlink that looks like this: /opt ??? bullseye ??? bin ??? covc ??? g++ -> covc covc is the BullseyeCoverage compiler interceptor that injects the code coverage instrumentation before invoking the real /usr/bin/g++ compiler. So what I really want is for covc to see the environment variables I mentioned. There are also some other BullseyeCoverage tools that get invoked via custom CMake targets that need to see these environment variables as well. What I'm hoping exists is a way for me to configure CMake to produce a Makefile (or build.ninja ...) that exports an environment variable before executing the build steps for any target. Or just for certain targets, but for the sake of simplicity, I'd prefer to just export the environment variable for any target and not worry about polluting the environment for targets that don't need/care about the special environment variables. Thanks again, Taylor On Fri, May 15, 2015 at 11:48 AM, Taylor Braun-Jones wrote: > Is it possible for CMake to generate a Makefile that exports environment > variables whenever a target is executed? I want all invocations of gcc to > see the environment variables COVFILE=xxx and COVSRCDIR=xxx > > Thanks, > Taylor > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dank at kegel.com Sat May 16 12:18:38 2015 From: dank at kegel.com (Dan Kegel) Date: Sat, 16 May 2015 09:18:38 -0700 Subject: [CMake] Export environment variables in generated Makefile In-Reply-To: References: Message-ID: Write a wrapper script that sets the variables and invokes the compiler, and tell cmake that's your compiler. From taylor at braun-jones.org Sun May 17 00:35:17 2015 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Sun, 17 May 2015 00:35:17 -0400 Subject: [CMake] Export environment variables in generated Makefile In-Reply-To: References: Message-ID: On May 16, 2015 12:18 PM, "Dan Kegel" wrote: > Write a wrapper script that sets the variables and invokes the compiler, > and tell cmake that's your compiler. > Ya, I thought about this but aside from having an interceptor for an interceptor there are also other complexities like: (1) One of the values contains the path to the build dir so now I'd need to _generate_ the interceptor script that I want to use as my CMAKE_CXX_COMPILER. (2) I also want the environment variables to be visible to the executables that get invoked when building various other targets. Since the paths to these executables get discovered by CMake (they are not necessarily in the system PATH) I'd be stuck generating several wrapper/interceptor scripts. These issues could likely be overcome with workarounds, but I'm trying hard to keep the build simple and understandable. Since CMake already has an ENVIRONMENT property for tests[1] it seemed like a reasonable and symmetric feature would be to support an ENVIRONMENT property for targets as well. Taylor [1] http://www.cmake.org/cmake/help/v3.2/manual/cmake-properties.7.html#properties-on-tests -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruslan_baratov at yahoo.com Sun May 17 08:43:59 2015 From: ruslan_baratov at yahoo.com (Ruslan Baratov) Date: Sun, 17 May 2015 14:43:59 +0200 Subject: [CMake] Where do all the extra clang flags come from in Xcode? In-Reply-To: <1431640402.3092.169.camel@mad-scientist.net> References: <1431640402.3092.169.camel@mad-scientist.net> Message-ID: <55588D0F.5090308@yahoo.com> On 14-May-15 23:53, Paul Smith wrote: > I was comparing the command line used when we choose an Xcode generator > on our OSX systems, vs. the command line used when we choose a Makefile > generator. We certainly have nothing in our CMakeLists.txt which sets > compiler flags based on the type of generator, only based on the type of > compiler (GCC, Clang, etc.) > > But, when I look at the compiler and flags used by the Makefile > generator it uses /usr/bin/c++ (which is clang++ underneath) and it's > basically only the the compiler flags that we provided. > > When I look at the compiler and flags used by the Xcode generator, not > only does it use a different path to the compiler > (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++) but, more concerning (because I assume that /usr/bin/clang++ eventually gets down to the same actual compiler as above) but it contains a huge number of extra flags, for example it appears to disable all sorts of warnings (that we don't want disabled): -Wno-missing-prototypes, -Wno-return-type, -Wno-non-virtual-dtor, -Wno-overloaded-virtual, etc. etc. > > This means people who build on OSX using Makefile generators see extra > warnings that people who build on OSX using Xcode don't see. > > Where are these extra flags all coming from? Is it from Xcode itself > somehow? Can I keep them from being added? I don't want peoples' > personal Xcode settings to disable warnings during compilation! > > Note these are build servers and so no one is actually invoking Xcode: > we log in via SSH, use cmake to generate the Xcode project files, then > use cmake -build (which runs xcodebuild) to run the build itself. > As far as I know extra flags set by Xcode itself. You can use XCODE_ATTRIBUTE_* target properties to enable/disable warnings. This table can be helpful: https://github.com/ruslo/leathers/wiki/List#xcodeclang-table Cheers, Ruslo From paul at mad-scientist.net Mon May 18 00:50:24 2015 From: paul at mad-scientist.net (Paul Smith) Date: Mon, 18 May 2015 00:50:24 -0400 Subject: [CMake] Where do all the extra clang flags come from in Xcode? In-Reply-To: <55588D0F.5090308@yahoo.com> References: <1431640402.3092.169.camel@mad-scientist.net> <55588D0F.5090308@yahoo.com> Message-ID: <1431924624.22116.99.camel@mad-scientist.net> On Sun, 2015-05-17 at 14:43 +0200, Ruslan Baratov via CMake wrote: > As far as I know extra flags set by Xcode itself. You can use > XCODE_ATTRIBUTE_* target properties to enable/disable warnings. This > table can be helpful: > https://github.com/ruslo/leathers/wiki/List#xcodeclang-table Thanks for your reply... but I don't quite understand what this table is telling me. As mentioned, these builds are performed on build servers running OSX, where basically the code is retrieved via Git, then cmake is run, then cmake -build is run (which invokes xcodebuild via the command line), all using SSH commands from a build control server. At no time is Xcode itself invoked. So, if the properties you describe are Xcode settings that need to be tweaked then do you know if there is some command-line way to do it, that I could encode into my build scripts for example? Thanks! From cedric.doucet at inria.fr Mon May 18 05:48:52 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Mon, 18 May 2015 11:48:52 +0200 (CEST) Subject: [CMake] What is the correct way to manage a possibly user-defined directory? In-Reply-To: <1708008871.5539725.1431941550257.JavaMail.zimbra@inria.fr> Message-ID: <108503107.5563508.1431942532435.JavaMail.zimbra@inria.fr> Hello, I would like to let users choose between providing third party libraries or let CMake download them. To do that, I try to write a simple code like this to manage a third party library FOO of an executable MY_EXEC: ================================================= IF(NOT EXISTS FOO_DIR) MESSAGE(STATUS "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED") # download and install FOO, define FOO_DIR ENDIF() INCLUDE_DIRECTORIES(MY_EXEC ${FOO_DIR}/include) TARGET_LINK_LIBRARIES(MY_EXEC ${FOO_DIR}/include) ================================================= To do that, I think the user should have the possibility to define FOO_DIR with an option. So, I put the line OPTION(FOO_DIR) before the code below. However, it doesn't seem to work because FOO_DIR does not seem to be defined. The message "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED" always appears, - even if I type "cmake -D FOO_DIR=path", where path is a user-defined path to FOO library, - even if I put a default value to FOO_DIR with OPTION(FOO_DIR path), where path is a hard-coded path to FOO. Where does I make a mistake here? What is the correct way to manage FOO_DIR when it can be defined by a user? Note: the next step is to define FOO_DIR in a FindFoo.cmake file and use find_package(Foo), but it's not my goal yet. Thank you very much for your help! C?dric -------------- next part -------------- An HTML attachment was scrubbed... URL: From petr.kmoch at gmail.com Mon May 18 06:04:21 2015 From: petr.kmoch at gmail.com (Petr Kmoch) Date: Mon, 18 May 2015 12:04:21 +0200 Subject: [CMake] What is the correct way to manage a possibly user-defined directory? In-Reply-To: <108503107.5563508.1431942532435.JavaMail.zimbra@inria.fr> References: <1708008871.5539725.1431941550257.JavaMail.zimbra@inria.fr> <108503107.5563508.1431942532435.JavaMail.zimbra@inria.fr> Message-ID: Hi Cedric. if(EXISTS) does not automatically dereference its argument. So your current code is testing for the existence of a directory literally named "FOO_DIR". You want to dereference the variable: if(NOT EXISTS ${FOO_DIR}) Second, option() is intended for on/off options only (a checkbox). If you want to provide a path selector, use set(... CACHE) instead: set(FOO_DIR "" CACHE PATH "Provide path to FOO library here") This will create a path selector widget in CMake UI, with "Provide path to FOO library here" serving as its tooltip/documentation. Petr On Mon, May 18, 2015 at 11:48 AM, Cedric Doucet wrote: > > Hello, > > I would like to let users choose between providing third party libraries > or let CMake download them. > To do that, I try to write a simple code like this to manage a third party > library FOO of an executable MY_EXEC: > ================================================= > IF(NOT EXISTS FOO_DIR) > MESSAGE(STATUS "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED") > # download and install FOO, define FOO_DIR > ENDIF() > INCLUDE_DIRECTORIES(MY_EXEC ${FOO_DIR}/include) > TARGET_LINK_LIBRARIES(MY_EXEC ${FOO_DIR}/include) > ================================================= > To do that, I think the user should have the possibility to define FOO_DIR > with an option. > So, I put the line > OPTION(FOO_DIR) > before the code below. > > However, it doesn't seem to work because FOO_DIR does not seem to be > defined. > The message "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED" always appears, > - even if I type "cmake -D FOO_DIR=path", where path is a user-defined > path to FOO library, > - even if I put a default value to FOO_DIR with OPTION(FOO_DIR path), > where path is a hard-coded path to FOO. > > Where does I make a mistake here? > What is the correct way to manage FOO_DIR when it can be defined by a user? > > Note: the next step is to define FOO_DIR in a FindFoo.cmake file and use > find_package(Foo), but it's not my goal yet. > > Thank you very much for your help! > > C?dric > > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cedric.doucet at inria.fr Mon May 18 06:05:07 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Mon, 18 May 2015 12:05:07 +0200 (CEST) Subject: [CMake] What is the correct way to manage a possibly user-defined directory? In-Reply-To: <108503107.5563508.1431942532435.JavaMail.zimbra@inria.fr> References: <108503107.5563508.1431942532435.JavaMail.zimbra@inria.fr> Message-ID: <352864559.5570718.1431943507839.JavaMail.zimbra@inria.fr> Ok, I found the error: IF(NOT EXISTS FOO_DIR) should be replaced by IF(NOT EXISTS ${FOO_DIR}) However, it seems I don't need to define an option. I just have to type cmake -D FOO_DIR=path .. Should I define an option? When does one need to define an option? C?dric ----- Mail original ----- > De: "Cedric Doucet" > ?: cmake at cmake.org > Envoy?: Lundi 18 Mai 2015 11:48:52 > Objet: [CMake] What is the correct way to manage a possibly user-defined > directory? > Hello, > I would like to let users choose between providing third party libraries or > let CMake download them. > To do that, I try to write a simple code like this to manage a third party > library FOO of an executable MY_EXEC: > ================================================= > IF(NOT EXISTS FOO_DIR) > MESSAGE(STATUS "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED") > # download and install FOO, define FOO_DIR > ENDIF() > INCLUDE_DIRECTORIES(MY_EXEC ${FOO_DIR}/include) > TARGET_LINK_LIBRARIES(MY_EXEC ${FOO_DIR}/include) > ================================================= > To do that, I think the user should have the possibility to define FOO_DIR > with an option. > So, I put the line > OPTION(FOO_DIR) > before the code below. > However, it doesn't seem to work because FOO_DIR does not seem to be defined. > The message "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED" always appears, > - even if I type "cmake -D FOO_DIR=path", where path is a user-defined path > to FOO library, > - even if I put a default value to FOO_DIR with OPTION(FOO_DIR path), where > path is a hard-coded path to FOO. > Where does I make a mistake here? > What is the correct way to manage FOO_DIR when it can be defined by a user? > Note: the next step is to define FOO_DIR in a FindFoo.cmake file and use > find_package(Foo), but it's not my goal yet. > Thank you very much for your help! > C?dric > -- > 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: > http://public.kitware.com/mailman/listinfo/cmake -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruslan_baratov at yahoo.com Mon May 18 06:32:52 2015 From: ruslan_baratov at yahoo.com (Ruslan Baratov) Date: Mon, 18 May 2015 12:32:52 +0200 Subject: [CMake] Where do all the extra clang flags come from in Xcode? In-Reply-To: <1431924624.22116.99.camel@mad-scientist.net> References: <1431640402.3092.169.camel@mad-scientist.net> <55588D0F.5090308@yahoo.com> <1431924624.22116.99.camel@mad-scientist.net> Message-ID: <5559BFD4.5030404@yahoo.com> On 18-May-15 06:50, Paul Smith wrote: > On Sun, 2015-05-17 at 14:43 +0200, Ruslan Baratov via CMake wrote: >> As far as I know extra flags set by Xcode itself. You can use >> XCODE_ATTRIBUTE_* target properties to enable/disable warnings. This >> table can be helpful: >> https://github.com/ruslo/leathers/wiki/List#xcodeclang-table > Thanks for your reply... but I don't quite understand what this table is > telling me. This table tells you what attribute you need to set to disable/enable specific warning. E.g.: | Clang | Xcode | +-----------------+----------------------------+ | enum-conversion | CLANG_WARN_ENUM_CONVERSION | Makefile generator: > cat CMakeLists.txt cmake_minimum_required(VERSION 3.0) project(Foo) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wenum-conversion") add_library(foo foo.cpp) > cmake -H. -B_builds "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON > cmake --build _builds /.../usr/bin/c++ -Wenum-conversion ... Xcode generator (default): > cat CMakeLists.txt cmake_minimum_required(VERSION 3.0) project(Foo) add_library(foo foo.cpp) > cmake -H. -B_builds -GXcode > cmake --build _builds /.../usr/bin/clang ... -Wno-enum-conversion ... Xcode generator (enable): > cat CMakeLists.txt cmake_minimum_required(VERSION 3.0) project(Foo) add_library(foo foo.cpp) set_target_properties( foo PROPERTIES XCODE_ATTRIBUTE_CLANG_WARN_ENUM_CONVERSION YES ) > cmake -H. -B_builds -GXcode > cmake --build _builds /.../usr/bin/clang ... -Wenum-conversion ... Xcode generator (disable): > cat CMakeLists.txt cmake_minimum_required(VERSION 3.0) project(Foo) add_library(foo foo.cpp) set_target_properties( foo PROPERTIES XCODE_ATTRIBUTE_CLANG_WARN_ENUM_CONVERSION NO ) > cmake -H. -B_builds -GXcode > cmake --build _builds /.../usr/bin/clang ... -Wno-enum-conversion ... > > As mentioned, these builds are performed on build servers running OSX, > where basically the code is retrieved via Git, then cmake is run, then > cmake -build is run (which invokes xcodebuild via the command line), all > using SSH commands from a build control server. At no time is Xcode > itself invoked. I don't understand what you mean by "no time is Xcode itself invoked". When you set generator to "Unix Makefiles" then Makefile project generated: > cmake -H. -B_builds "-GUnix Makefiles" > ls _builds/Makefile _builds/Makefile when you set generator to "Xcode" then Xcode project used: > cmake -H. -B_builds -GXcode > ls _builds/Foo.xcodeproj/project.pbxproj _builds/Foo.xcodeproj/project.pbxproj so there is no difference between: * open Xcode project and hit "Build" * cmake --build _builds * (cd _builds && xcodebuild -alltargets) > > So, if the properties you describe are Xcode settings that need to be > tweaked then do you know if there is some command-line way to do it, > that I could encode into my build scripts for example? See example above. Also you can use some helper functions to do it in cross-platform way: sugar_generate_warning_flags( target_compile_options target_properties ENABLE enum-conversion ) set_target_properties( foo PROPERTIES ${target_properties} COMPILE_OPTIONS "${target_compile_options}" ) This will set MSVC flags too. See this wiki: https://github.com/ruslo/sugar/wiki/Cross-platform-warning-suppression Cheers, Ruslo -------------- next part -------------- An HTML attachment was scrubbed... URL: From cedric.doucet at inria.fr Mon May 18 07:35:49 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Mon, 18 May 2015 13:35:49 +0200 (CEST) Subject: [CMake] What is the correct way to manage a possibly user-defined directory? In-Reply-To: References: <1708008871.5539725.1431941550257.JavaMail.zimbra@inria.fr> <108503107.5563508.1431942532435.JavaMail.zimbra@inria.fr> Message-ID: <1726992412.5594300.1431948949573.JavaMail.zimbra@inria.fr> Hi Petr! Thank you very much! Now, I understand when an option should be used! :) I tried set(FOO_DIR "" CACHE PATH "Provide path to FOO library here") and it works fine with the user interface! Cheers, C?dric ----- Mail original ----- > De: "Petr Kmoch" > ?: "Cedric Doucet" > Cc: cmake at cmake.org > Envoy?: Lundi 18 Mai 2015 12:04:21 > Objet: Re: [CMake] What is the correct way to manage a possibly user-defined > directory? > Hi Cedric. > if(EXISTS) does not automatically dereference its argument. So your current > code is testing for the existence of a directory literally named "FOO_DIR". > You want to dereference the variable: > if(NOT EXISTS ${FOO_DIR}) > Second, option() is intended for on/off options only (a checkbox). If you > want to provide a path selector, use set(... CACHE) instead: > set(FOO_DIR "" CACHE PATH "Provide path to FOO library here") > This will create a path selector widget in CMake UI, with "Provide path to > FOO library here" serving as its tooltip/documentation. > Petr > On Mon, May 18, 2015 at 11:48 AM, Cedric Doucet < cedric.doucet at inria.fr > > wrote: > > Hello, > > > I would like to let users choose between providing third party libraries or > > let CMake download them. > > > To do that, I try to write a simple code like this to manage a third party > > library FOO of an executable MY_EXEC: > > > ================================================= > > > IF(NOT EXISTS FOO_DIR) > > > MESSAGE(STATUS "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED") > > > # download and install FOO, define FOO_DIR > > > ENDIF() > > > INCLUDE_DIRECTORIES(MY_EXEC ${FOO_DIR}/include) > > > TARGET_LINK_LIBRARIES(MY_EXEC ${FOO_DIR}/include) > > > ================================================= > > > To do that, I think the user should have the possibility to define FOO_DIR > > with an option. > > > So, I put the line > > > OPTION(FOO_DIR) > > > before the code below. > > > However, it doesn't seem to work because FOO_DIR does not seem to be > > defined. > > > The message "FOO LIBRARY WILL BE DOWNLOADED AND INSTALLED" always appears, > > > - even if I type "cmake -D FOO_DIR=path", where path is a user-defined path > > to FOO library, > > > - even if I put a default value to FOO_DIR with OPTION(FOO_DIR path), where > > path is a hard-coded path to FOO. > > > Where does I make a mistake here? > > > What is the correct way to manage FOO_DIR when it can be defined by a user? > > > Note: the next step is to define FOO_DIR in a FindFoo.cmake file and use > > find_package(Foo), but it's not my goal yet. > > > Thank you very much for your help! > > > C?dric > > > -- > > > 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: > > > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cedric.doucet at inria.fr Mon May 18 08:29:32 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Mon, 18 May 2015 14:29:32 +0200 (CEST) Subject: [CMake] Is it possible to define a custom help message? In-Reply-To: <1327054075.5620879.1431952032885.JavaMail.zimbra@inria.fr> Message-ID: <1532236478.5622125.1431952172290.JavaMail.zimbra@inria.fr> Hello, when one types 'cmake -help', one gets a message containing a summary of all available options to the cmake command. Is it possible to customize this message, so as to print a description of all useful variables and all options defined by the option command? Thank you for your help! C?dric -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.king at kitware.com Mon May 18 08:48:59 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 18 May 2015 08:48:59 -0400 Subject: [CMake] Export environment variables in generated Makefile In-Reply-To: References: Message-ID: <5559DFBB.509@kitware.com> On 05/17/2015 12:35 AM, Taylor Braun-Jones wrote: > CMake already has an ENVIRONMENT property for tests ... > symmetric feature would be to support an ENVIRONMENT property > for targets as well. We can provide it for tests because ctest directly runs the tests. There is no way to implement environment settings consistently across all generators when launching compiler tools. The VS and Xcode IDE project files provide no way to do it in general. Our workflow for command-line builds has always been to have the necessary environment variables defined by the caller and not within the scope of CMake. -Brad From paul at mad-scientist.net Mon May 18 09:20:30 2015 From: paul at mad-scientist.net (Paul Smith) Date: Mon, 18 May 2015 09:20:30 -0400 Subject: [CMake] Where do all the extra clang flags come from in Xcode? In-Reply-To: <5559BFD4.5030404@yahoo.com> References: <1431640402.3092.169.camel@mad-scientist.net> <55588D0F.5090308@yahoo.com> <1431924624.22116.99.camel@mad-scientist.net> <5559BFD4.5030404@yahoo.com> Message-ID: <1431955230.22116.105.camel@mad-scientist.net> On Mon, 2015-05-18 at 12:32 +0200, Ruslan Baratov via CMake wrote: > This table tells you what attribute you need to set to disable/enable > specific warning. I see, so these are CMake attributes? That wasn't clear to me. I thought they were attributes of Xcode. I guess my basic question is, why are all these extra flags to disable and enable various warnings set in the Xcode generator? I expected it would work like the makefile generator, where if you don't set any flags in CMakeLists.txt then you don't get any warnings enabled (or explicitly disabled). It surprises me that when I take the same CMakeLists.txt file and use a Makefile generator and an Xcode generator, I get very different compile lines. And secondarily, is there any way to get the Xcode generator to work like the Makefile generator, where only the warning flags I explicitly defined in my CMakeLists.txt file are added to the compile/link lines and no others? From parag at ionicsecurity.com Mon May 18 10:50:25 2015 From: parag at ionicsecurity.com (Parag Chandra) Date: Mon, 18 May 2015 14:50:25 +0000 Subject: [CMake] Where do all the extra clang flags come from in Xcode? In-Reply-To: <1431955230.22116.105.camel@mad-scientist.net> References: <1431640402.3092.169.camel@mad-scientist.net> <55588D0F.5090308@yahoo.com> <1431924624.22116.99.camel@mad-scientist.net> <5559BFD4.5030404@yahoo.com> <1431955230.22116.105.camel@mad-scientist.net> Message-ID: <8C423994-8885-4B05-92BD-41EBB5A96877@ionicsecurity.com> This is just a guess, but I think the reason you?re seeing all these extra warnings enabled/disabled when you use Xcode is that Xcode is going to, by default, enable many of these warnings when you create a new project, and CMake isn?t doing anything special to alter those in order to match up with the Makefiles it generates. In other words, these flags might very well be the same ones you?d see if you were to manually create an Xcode project via its wizards. So in reference to your last question, I don?t think you?re going to be able to just ?whitelist? the flags you want enabled. You?ll also have to take stock of the default flags Xcode enables and ?blacklist? those. Parag Chandra Senior Software Engineer, Mobile Team Mobile: +1.919.824.1410 Ionic Security Inc. 1170 Peachtree St. NE STE 400, Atlanta, GA 30309 On 5/18/15, 1:20 PM, "Paul Smith" wrote: >On Mon, 2015-05-18 at 12:32 +0200, Ruslan Baratov via CMake wrote: >> This table tells you what attribute you need to set to disable/enable >> specific warning. > >I see, so these are CMake attributes? That wasn't clear to me. I >thought they were attributes of Xcode. > >I guess my basic question is, why are all these extra flags to disable >and enable various warnings set in the Xcode generator? I expected it >would work like the makefile generator, where if you don't set any flags >in CMakeLists.txt then you don't get any warnings enabled (or explicitly >disabled). It surprises me that when I take the same CMakeLists.txt >file and use a Makefile generator and an Xcode generator, I get very >different compile lines. > >And secondarily, is there any way to get the Xcode generator to work >like the Makefile generator, where only the warning flags I explicitly >defined in my CMakeLists.txt file are added to the compile/link lines >and no others? > >-- > >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: >http://public.kitware.com/mailman/listinfo/cmake From apaku at gmx.de Mon May 18 11:09:15 2015 From: apaku at gmx.de (Andreas Pakulat) Date: Mon, 18 May 2015 17:09:15 +0200 Subject: [CMake] Where do all the extra clang flags come from in Xcode? In-Reply-To: <1431955230.22116.105.camel@mad-scientist.net> References: <1431640402.3092.169.camel@mad-scientist.net> <55588D0F.5090308@yahoo.com> <1431924624.22116.99.camel@mad-scientist.net> <5559BFD4.5030404@yahoo.com> <1431955230.22116.105.camel@mad-scientist.net> Message-ID: Hi Paul, On Mon, May 18, 2015 at 3:20 PM, Paul Smith wrote: > On Mon, 2015-05-18 at 12:32 +0200, Ruslan Baratov via CMake wrote: > > This table tells you what attribute you need to set to disable/enable > > specific warning. > > I see, so these are CMake attributes? That wasn't clear to me. I > thought they were attributes of Xcode. > > I guess my basic question is, why are all these extra flags to disable > and enable various warnings set in the Xcode generator? I expected it > would work like the makefile generator, where if you don't set any flags > in CMakeLists.txt then you don't get any warnings enabled (or explicitly > disabled). It surprises me that when I take the same CMakeLists.txt > file and use a Makefile generator and an Xcode generator, I get very > different compile lines. > If you look at the foo.xcodeproj contents of a very simple CMake project (hello-world style) you'll notice just 1 file and there are not a lot of -W words inside that file either. I see 3 warnings being added by CMake when generating this file. That suggests anything else is added by Xcode itself because thats what its default settings are. Xcode (and xcodebuild) has a lot more logics builtin that make. Make is essentially just a dependency-tracking and execution tool and thus cannot make any assumptions about what is being executed when a target is to be 'made'. It cannot add any compile flags that the make-developers deem useful, since the action executed for a target may not be a compile run at all. Xcode on the other hand with its more structured project file has a very clear idea of what is a compile action and what is not and apparently the Apple devs think a certain set of flags are useful for everybody and hence are added to all compiler invocations. You'll also notice this when creating a new project inside xcode and then examine and run it outside, i.e. grep for -W flags in the generated files. There are literally none, but still xcodebuild shows tons of -W flags added to the compiler invocation. > And secondarily, is there any way to get the Xcode generator to work > like the Makefile generator, where only the warning flags I explicitly > defined in my CMakeLists.txt file are added to the compile/link lines > and no others? > > Given the above, your only options are: propose a patch to cmake (or find someone to do this for you) that enhances the xcode generator to disable all flags that are not explicitly enabled so its closer to the makefile generator. This is however quite a lot of effort upfront and in maintenance since each new xcode version (even just bugfix versions) may need changes to the list. The alternative to that is that you blacklist via the mentioned attributes the warnings you don't want to have enabled, each and every one of them individually. Andreas -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruslan_baratov at yahoo.com Mon May 18 11:10:14 2015 From: ruslan_baratov at yahoo.com (Ruslan Baratov) Date: Mon, 18 May 2015 17:10:14 +0200 Subject: [CMake] Where do all the extra clang flags come from in Xcode? In-Reply-To: <1431955230.22116.105.camel@mad-scientist.net> References: <1431640402.3092.169.camel@mad-scientist.net> <55588D0F.5090308@yahoo.com> <1431924624.22116.99.camel@mad-scientist.net> <5559BFD4.5030404@yahoo.com> <1431955230.22116.105.camel@mad-scientist.net> Message-ID: <555A00D6.8060608@yahoo.com> On 18-May-15 15:20, Paul Smith wrote: > On Mon, 2015-05-18 at 12:32 +0200, Ruslan Baratov via CMake wrote: >> This table tells you what attribute you need to set to disable/enable >> specific warning. > I see, so these are CMake attributes? That wasn't clear to me. I > thought they were attributes of Xcode. Please take a look at examples I've sent earlier. I have no idea how I can make it even more clearer. > > I guess my basic question is, why are all these extra flags to disable > and enable various warnings set in the Xcode generator? As far as I know this is Xcode defaults. So I guess you need to ask Apple's Xcode support team. > I expected it > would work like the makefile generator, where if you don't set any flags > in CMakeLists.txt then you don't get any warnings enabled (or explicitly > disabled). It surprises me that when I take the same CMakeLists.txt > file and use a Makefile generator and an Xcode generator, I get very > different compile lines. I guess you can open a bug with feature request. Note that only it's not enough to just set all this attributes to YES, but also you need to read compiler flags (+ build types) and change attributes accordingly. E.g. -Wno-enum-conversion in CMAKE_CXX_FLAGS automatically must add property `XCODE_ATTRIBUTE_CLANG_WANR_ENUM_CONVERSION NO` to all targets. > > And secondarily, is there any way to get the Xcode generator to work > like the Makefile generator, where only the warning flags I explicitly > defined in my CMakeLists.txt file are added to the compile/link lines > and no others? > Again. Take a look at examples I've sent earlier. The helper function works exactly like you want. This is the only way known to me to achieve this nicely. Cheer, Ruslo From ruslan_baratov at yahoo.com Mon May 18 11:29:18 2015 From: ruslan_baratov at yahoo.com (Ruslan Baratov) Date: Mon, 18 May 2015 17:29:18 +0200 Subject: [CMake] Where do all the extra clang flags come from in Xcode? In-Reply-To: <8C423994-8885-4B05-92BD-41EBB5A96877@ionicsecurity.com> References: <1431640402.3092.169.camel@mad-scientist.net> <55588D0F.5090308@yahoo.com> <1431924624.22116.99.camel@mad-scientist.net> <5559BFD4.5030404@yahoo.com> <1431955230.22116.105.camel@mad-scientist.net> <8C423994-8885-4B05-92BD-41EBB5A96877@ionicsecurity.com> Message-ID: <555A054E.9030505@yahoo.com> On 18-May-15 16:50, Parag Chandra wrote: > In other words, these flags might very > well be the same ones you?d see if you were to manually create an Xcode > project via its wizards. > Not exactly. Wizard add some extra attributes: Xcode 6.2 -> New project -> OSX -> Application -> Command Line Tool > grep -i warn project.pbxproj CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; However CMake use others: > cmake -H. -B_builds -GXcode > grep -i warn project.pbxproj WARNING_CFLAGS = ("-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", ); WARNING_CFLAGS = ("-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", ); WARNING_CFLAGS = ("-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", ); WARNING_CFLAGS = ("-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", ); WARNING_CFLAGS = ("-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", ); WARNING_CFLAGS = ("-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", ); WARNING_CFLAGS = ("-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", ); WARNING_CFLAGS = ("-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", ); WARNING_CFLAGS = ("-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", ); WARNING_CFLAGS = ("-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", ); WARNING_CFLAGS = ("-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", ); WARNING_CFLAGS = ("-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", "$(inherited)", ); In CMake case Xcode set missing attributes to default values, some of them set to YES, some of them set to NO From cedric.doucet at inria.fr Mon May 18 12:05:30 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Mon, 18 May 2015 18:05:30 +0200 (CEST) Subject: [CMake] Unknown argument in FOREACH In-Reply-To: <841082611.5731162.1431964904155.JavaMail.zimbra@inria.fr> Message-ID: <1756626825.5733082.1431965130444.JavaMail.zimbra@inria.fr> Hello, I try to write a loop to donwload and install libraries whose name is contained in a list. I wrote these lines from the 45th line of my CMakeLists.txt file: =========================================================== set(LIBRARIES_TO_DOWNLOAD EIGEN) foreach(LIBRARY IN ${LIBRARIES_TO_DOWNLOAD}) string(TOLOWER ${LIBRARY} LIBRARY_NAME) ExternalProject_Add(${LIBRARY_NAME} PREFIX ${LIBRARY_PREFIX} DOWNLOAD_DIR ${${LIBRARY}_DOWNLOAD_DIR} SOURCE_DIR ${${LIBRARY}_SOURCE_DIR} BINARY_DIR ${${LIBRARY}_BINARY_DIR} STAMP_DIR ${${LIBRARY}_STAMP_DIR} INSTALL_DIR ${${LIBRARY}_INSTALL_DIR} URL ${${LIBRARY}_URL} URL_MD5 ${${LIBRARY}_URL_MD5} CMAKE_ARGS ${${LIBRARY}_ARGS} LOG_DOWNLOAD 1 LOG_UPDATE 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_TEST 1 LOG_INSTALL 1 ) endforeach(LIBRARY) =========================================================== However, I get the following error message: ========================================================================================= CMake Error at CMakeLists.txt:45 (foreach): Unknown argument: EIGEN CMake Error at CMakeLists.txt:46 (string): string no output variable specified CMake Error at /usr/local/bibliotheques/cmake/3.2.2/share/cmake-3.2/Modules/ExternalProject.cmake:1850 (message): error: no download info for 'PREFIX' -- please specify existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, GIT_REPOSITORY, HG_REPOSITORY or DOWNLOAD_COMMAND Call Stack (most recent call first): /usr/local/bibliotheques/cmake/3.2.2/share/cmake-3.2/Modules/ExternalProject.cmake:2321 (_ep_add_download_command) CMakeLists.txt:47 (ExternalProject_Add) CMake Error at CMakeLists.txt:64 (endforeach): endforeach An ENDFOREACH command was found outside of a proper FOREACH ENDFOREACH structure. Or its arguments did not match the opening FOREACH command. ========================================================================================= Do you know where the problem come from? Cheers, C?dric -------------- next part -------------- An HTML attachment was scrubbed... URL: From petr.kmoch at gmail.com Mon May 18 12:16:16 2015 From: petr.kmoch at gmail.com (Petr Kmoch) Date: Mon, 18 May 2015 18:16:16 +0200 Subject: [CMake] Unknown argument in FOREACH In-Reply-To: <1756626825.5733082.1431965130444.JavaMail.zimbra@inria.fr> References: <841082611.5731162.1431964904155.JavaMail.zimbra@inria.fr> <1756626825.5733082.1431965130444.JavaMail.zimbra@inria.fr> Message-ID: Hi Cedric. If you check the documentation of foreach() ( http://www.cmake.org/cmake/help/v3.2/command/foreach.html), you will see there is no "IN item item..." syntax. Either LISTS or ITEMS has to follow after IN, or IN must be omitted altogether. So either do this: foreach(LIBRARY IN LISTS LIBRARIES_TO_DOWNLOAD) or this: foreach(LIBRARY ${LIBRARIES_TO_DOWNLOAD}) I always prefer the former, because the latter will fail if the first item in the list happens to be "IN". Petr On Mon, May 18, 2015 at 6:05 PM, Cedric Doucet wrote: > > Hello, > > I try to write a loop to donwload and install libraries whose name is > contained in a list. > I wrote these lines from the 45th line of my CMakeLists.txt file: > > =========================================================== > set(LIBRARIES_TO_DOWNLOAD EIGEN) > > foreach(LIBRARY IN ${LIBRARIES_TO_DOWNLOAD}) > string(TOLOWER ${LIBRARY} LIBRARY_NAME) > ExternalProject_Add(${LIBRARY_NAME} > PREFIX ${LIBRARY_PREFIX} > DOWNLOAD_DIR ${${LIBRARY}_DOWNLOAD_DIR} > SOURCE_DIR ${${LIBRARY}_SOURCE_DIR} > BINARY_DIR ${${LIBRARY}_BINARY_DIR} > STAMP_DIR ${${LIBRARY}_STAMP_DIR} > INSTALL_DIR ${${LIBRARY}_INSTALL_DIR} > URL ${${LIBRARY}_URL} > URL_MD5 ${${LIBRARY}_URL_MD5} > CMAKE_ARGS ${${LIBRARY}_ARGS} > LOG_DOWNLOAD 1 > LOG_UPDATE 1 > LOG_CONFIGURE 1 > LOG_BUILD 1 > LOG_TEST 1 > LOG_INSTALL 1 > ) > endforeach(LIBRARY) > =========================================================== > > However, I get the following error message: > > > ========================================================================================= > CMake Error at CMakeLists.txt:45 (foreach): > Unknown argument: > EIGEN > > CMake Error at CMakeLists.txt:46 (string): > string no output variable specified > > CMake Error at > /usr/local/bibliotheques/cmake/3.2.2/share/cmake-3.2/Modules/ExternalProject.cmake:1850 > (message): > error: no download info for 'PREFIX' -- please specify existing/non-empty > SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, > GIT_REPOSITORY, HG_REPOSITORY or DOWNLOAD_COMMAND > Call Stack (most recent call first): > > /usr/local/bibliotheques/cmake/3.2.2/share/cmake-3.2/Modules/ExternalProject.cmake:2321 > (_ep_add_download_command) > CMakeLists.txt:47 (ExternalProject_Add) > > CMake Error at CMakeLists.txt:64 (endforeach): > endforeach An ENDFOREACH command was found outside of a proper FOREACH > ENDFOREACH structure. Or its arguments did not match the opening FOREACH > command. > > ========================================================================================= > > Do you know where the problem come from? > > Cheers, > > C?dric > > > > > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cedric.doucet at inria.fr Mon May 18 12:25:46 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Mon, 18 May 2015 18:25:46 +0200 (CEST) Subject: [CMake] Unknown argument in FOREACH In-Reply-To: References: <841082611.5731162.1431964904155.JavaMail.zimbra@inria.fr> <1756626825.5733082.1431965130444.JavaMail.zimbra@inria.fr> Message-ID: <1161198957.5737669.1431966346560.JavaMail.zimbra@inria.fr> Hi Petr, thank you very much! I checked the documentation and for examples on the internet. However, I did not noticed the details. I may be blind because I am familiar with range-based loops like in C++ or Python. I will try to look the documentation more carefully the next time. Of course, after some tests, your solution works fine! :) C?dric ----- Mail original ----- > De: "Petr Kmoch" > ?: "Cedric Doucet" > Cc: cmake at cmake.org > Envoy?: Lundi 18 Mai 2015 18:16:16 > Objet: Re: [CMake] Unknown argument in FOREACH > Hi Cedric. > If you check the documentation of foreach() ( > http://www.cmake.org/cmake/help/v3.2/command/foreach.html ), you will see > there is no "IN item item..." syntax. Either LISTS or ITEMS has to follow > after IN, or IN must be omitted altogether. So either do this: > foreach(LIBRARY IN LISTS LIBRARIES_TO_DOWNLOAD) > or this: > foreach(LIBRARY ${LIBRARIES_TO_DOWNLOAD}) > I always prefer the former, because the latter will fail if the first item in > the list happens to be "IN". > Petr > On Mon, May 18, 2015 at 6:05 PM, Cedric Doucet < cedric.doucet at inria.fr > > wrote: > > Hello, > > > I try to write a loop to donwload and install libraries whose name is > > contained in a list. > > > I wrote these lines from the 45th line of my CMakeLists.txt file: > > > =========================================================== > > > set(LIBRARIES_TO_DOWNLOAD EIGEN) > > > foreach(LIBRARY IN ${LIBRARIES_TO_DOWNLOAD}) > > > string(TOLOWER ${LIBRARY} LIBRARY_NAME) > > > ExternalProject_Add(${LIBRARY_NAME} > > > PREFIX ${LIBRARY_PREFIX} > > > DOWNLOAD_DIR ${${LIBRARY}_DOWNLOAD_DIR} > > > SOURCE_DIR ${${LIBRARY}_SOURCE_DIR} > > > BINARY_DIR ${${LIBRARY}_BINARY_DIR} > > > STAMP_DIR ${${LIBRARY}_STAMP_DIR} > > > INSTALL_DIR ${${LIBRARY}_INSTALL_DIR} > > > URL ${${LIBRARY}_URL} > > > URL_MD5 ${${LIBRARY}_URL_MD5} > > > CMAKE_ARGS ${${LIBRARY}_ARGS} > > > LOG_DOWNLOAD 1 > > > LOG_UPDATE 1 > > > LOG_CONFIGURE 1 > > > LOG_BUILD 1 > > > LOG_TEST 1 > > > LOG_INSTALL 1 > > > ) > > > endforeach(LIBRARY) > > > =========================================================== > > > However, I get the following error message: > > > ========================================================================================= > > > CMake Error at CMakeLists.txt:45 (foreach): > > > Unknown argument: > > > EIGEN > > > CMake Error at CMakeLists.txt:46 (string): > > > string no output variable specified > > > CMake Error at > > /usr/local/bibliotheques/cmake/3.2.2/share/cmake-3.2/Modules/ExternalProject.cmake:1850 > > (message): > > > error: no download info for 'PREFIX' -- please specify existing/non-empty > > > SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, > > > GIT_REPOSITORY, HG_REPOSITORY or DOWNLOAD_COMMAND > > > Call Stack (most recent call first): > > > /usr/local/bibliotheques/cmake/3.2.2/share/cmake-3.2/Modules/ExternalProject.cmake:2321 > > (_ep_add_download_command) > > > CMakeLists.txt:47 (ExternalProject_Add) > > > CMake Error at CMakeLists.txt:64 (endforeach): > > > endforeach An ENDFOREACH command was found outside of a proper FOREACH > > > ENDFOREACH structure. Or its arguments did not match the opening FOREACH > > > command. > > > ========================================================================================= > > > Do you know where the problem come from? > > > Cheers, > > > C?dric > > > -- > > > 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: > > > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreev at swemel.ru Mon May 18 12:01:56 2015 From: andreev at swemel.ru (Konstantin Andreev) Date: Mon, 18 May 2015 19:01:56 +0300 Subject: [CMake] Problem Compiling on Solaris 10 x86 In-Reply-To: <4EE272F3.3090501@oanda.com> References: <4EE272F3.3090501@oanda.com> Message-ID: <555A0CF4.3020903@swemel.ru> [posting to the old thread for reference] On 09 Dec 2011, Christopher Hylarides wrote: > I'm trying to build cmake on Solaris 10 x86 and am getting the following error: > ... > [ 96%] Building CXX object Source/CMakeFiles/ccmake.dir/CursesDialog/cmCursesWidget.cxx.o > [ 96%] Building CXX object Source/CMakeFiles/ccmake.dir/CursesDialog/ccmake.cxx.o > Linking CXX executable ../bin/ccmake > Undefined first referenced > symbol in file > wattr_on CMakeFiles/ccmake.dir/CursesDialog/cmCursesLongMessageForm.cxx.o > wattr_off CMakeFiles/ccmake.dir/CursesDialog/cmCursesLongMessageForm.cxx.o > ld: fatal: symbol referencing errors. No output written to ../bin/ccmake > ... This bug is still not fixed in the contemporary cmake-3.2.2. Explanation: SUN/Oracle Solaris typically has two `curses' packages installed : traditional Unix `curses' and GNU `ncurses'. The wise cmake builds itself against headers of GNU `ncurses', but links with Unix `curses' with obvious result above. To workaround, you could uninstall either Unix `curses' or GNU `ncurses' development package. Konstantin Andreev Software Engineer Swemel JSC From bill.hoffman at kitware.com Mon May 18 13:27:45 2015 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Mon, 18 May 2015 13:27:45 -0400 Subject: [CMake] Problem Compiling on Solaris 10 x86 In-Reply-To: <555A0CF4.3020903@swemel.ru> References: <4EE272F3.3090501@oanda.com> <555A0CF4.3020903@swemel.ru> Message-ID: <555A2111.6090009@kitware.com> On 5/18/2015 12:01 PM, Konstantin Andreev wrote: > SUN/Oracle Solaris typically has two `curses' packages installed : traditional Unix `curses' and GNU `ncurses'. > > > The wise cmake builds itself against headers of GNU `ncurses', but links with Unix `curses' with obvious result above. > > > To workaround, you could uninstall either Unix `curses' or GNU `ncurses' development package. > Where is the ncurses library? From your cache it seems that it can not find the ncurses library: CURSES_LIBRARY:FILEPATH=/usr/lib/libcurses.so CURSES_NCURSES_LIBRARY:FILEPATH=CURSES_NCURSES_LIBRARY-NOTFOUND -Bill From taylor at braun-jones.org Mon May 18 16:51:09 2015 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Mon, 18 May 2015 16:51:09 -0400 Subject: [CMake] Export environment variables in generated Makefile In-Reply-To: <5559DFBB.509@kitware.com> References: <5559DFBB.509@kitware.com> Message-ID: On Mon, May 18, 2015 at 8:48 AM, Brad King wrote: > On 05/17/2015 12:35 AM, Taylor Braun-Jones wrote: > > CMake already has an ENVIRONMENT property for tests ... > > symmetric feature would be to support an ENVIRONMENT property > > for targets as well. > > We can provide it for tests because ctest directly runs the tests. > There is no way to implement environment settings consistently > across all generators when launching compiler tools. The VS > and Xcode IDE project files provide no way to do it in general. > Our workflow for command-line builds has always been to have the > necessary environment variables defined by the caller and not > within the scope of CMake. > Okay, I had a hunch this might be the case. Thanks for clarifying. Taylor -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.bostick1 at gmail.com Tue May 19 03:47:10 2015 From: andrew.bostick1 at gmail.com (Andrew Bostick) Date: Tue, 19 May 2015 12:17:10 +0430 Subject: [CMake] -question- Message-ID: Dear CMake users *I installed the newest version of cmake (3.2.2).* *Than I used *Installation guide for GROMACS 5.0.5: (*Quick and dirty *installation ) http://www.gromacs.org/Documentation/Installation_Instructions_5.0?highlight=installation#quick-and-dirty-installation When I used following command: cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON I encountered with: CUDA_TOOLKIT_ROOT_DIR not found or specified -- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "4.0") -- No compatible CUDA toolkit found (v4.0+), disabling native GPU acceleration -- The GROMACS-managed build of FFTW 3 will configure with the following optimizations: --enable-sse2 Downloading: http://gerrit.gromacs.org/download/regressiontests-5.0.5.tar.gz -- [download 100% complete] CMake Error at tests/CMakeLists.txt:57 (message): error: downloading 'http://gerrit.gromacs.org/download/regressiontests-5.0.5.tar.gz' failed status_code: 1 status_string: "Unsupported protocol" log: Hostname was NOT found in DNS cache Trying 130.237.25.133... Connected to gerrit.gromacs.org (130.237.25.133) port 80 (#0) GET /download/regressiontests-5.0.5.tar.gz HTTP/1.1 User-Agent: curl/7.38.0 Host: gerrit.gromacs.org Accept: */* HTTP/1.1 302 Found Date: Mon, 18 May 2015 19:11:21 GMT Server Apache/2.2.22 (Ubuntu) is not blacklisted Server: Apache/2.2.22 (Ubuntu) Location: https://kth.box.com/shared/static/ft4o4qpm318vsrori35sqhcuv5w6qjnu.gz Vary: Accept-Encoding Content-Length: 337 Content-Type: text/html; charset=iso-8859-1 Ignoring the response-body 302 Found

Found

The document has moved here.


Apache/2.2.22 (Ubuntu) Server at gerrit.gromacs.org Port 80
Connection #0 to host gerrit.gromacs.org left intact Issue another request to this URL: 'https://kth.box.com/shared/static/ft4o4qpm318vsrori35sqhcuv5w6qjnu.gz' Protocol "https" not supported or disabled in libcurl Closing connection -1 -- Configuring incomplete, errors occurred! See also "/export/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/CMakeOutput.log". See also "/export/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/CMakeError.log". ------------------------------------------------- the content of CMakeOutput.log file is as follows: The system is: Linux - 2.6.32-431.11.2.el6.x86_64 - x86_64 Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. Compiler: /usr/bin/cc Build flags: Id flags: The output was: 0 Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" The C compiler identification is GNU, found in "/export/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/3.2.2/CompilerIdC/a.out" Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. Compiler: /usr/bin/c++ Build flags: Id flags: The output was: 0 Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" The CXX compiler identification is GNU, found in "/export/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/3.2.2/CompilerIdCXX/a.out" Determining if the C compiler works passed with the following output: Change Dir: /export/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/gmake" "cmTryCompileExec2875484959/fast" /usr/bin/gmake -f CMakeFiles/cmTryCompileExec2875484959.dir/build.make CMakeFiles/cmTryCompileExec2875484959.dir/build @ "CMakeOutput.log" 1317L, 113885C ---------------------------------------------------------- the content of CMakeError.log file is as follows: Performing C SOURCE FILE Test CFLAGS_EXCESS_PREC failed with the following output: Change Dir: /export/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/gmake" "cmTryCompileExec2440156335/fast" /usr/bin/gmake -f CMakeFiles/cmTryCompileExec2440156335.dir/build.make CMakeFiles/cmTryCompileExec2440156335.dir/build gmake[1]: Entering directory `/state/partition1/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/CMakeTmp' /usr/local/bin/cmake -E cmake_progress_report /export/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/CMakeTmp/CMakeFiles 1 Building C object CMakeFiles/cmTryCompileExec2440156335.dir/src.c.o /usr/bin/cc -DCFLAGS_EXCESS_PREC -fexcess-precision=fast -o CMakeFiles/cmTryCompileExec2440156335.dir/src.c.o -c /export/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/CMakeTmp/src.c cc1: error: unrecognized command line option "-fexcess-precision=fast" gmake[1]: *** [CMakeFiles/cmTryCompileExec2440156335.dir/src.c.o] Error 1 gmake[1]: Leaving directory `/state/partition1/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/CMakeTmp' gmake: *** [cmTryCompileExec2440156335/fast] Error 2 Source file was: int main(void) { return 0; } Performing C++ SOURCE FILE Test CXXFLAGS_EXCESS_PREC failed with the following output: Change Dir: /export/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/gmake" "cmTryCompileExec188469838/fast" /usr/bin/gmake -f CMakeFiles/cmTryCompileExec188469838.dir/build.make CMakeFiles/cmTryCompileExec188469838.dir/build gmake[1]: Entering directory `/state/partition1/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/CMakeTmp' /usr/local/bin/cmake -E cmake_progress_report /export/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/CMakeTmp/CMakeFiles 1 Building CXX object CMakeFiles/cmTryCompileExec188469838.dir/src.cxx.o /usr/bin/c++ -DCXXFLAGS_EXCESS_PREC -fexcess-precision=fast -o CMakeFiles/cmTryCompileExec188469838.dir/src.cxx.o -c /export/apps/gromacs/gromacs-5.0.5/build/CMakeFiles/CMakeTmp/src.cxx cc1plus: error: unrecognized command line option "-fexcess-precision=fast" ------------------------------------------------- one of Gromacs developers suggested me the following me: All of the above redirection is correct behaviour for our setup, but the problem is that your CMake is linking to an unsuitable version of libcurl. See http://www.cmake.org/pipermail/cmake-developers/2013-July/019430.html for background. You can maybe change your openssl library, file a bug with Ubuntu, use a Kitware-provided CMake binary, build your own, download the GROMACS tests yourself... ------------------------------------------------- I have not any experience in CMake installation. How to resolve this issue? Please Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreev at swemel.ru Tue May 19 04:58:24 2015 From: andreev at swemel.ru (Konstantin Andreev) Date: Tue, 19 May 2015 11:58:24 +0300 Subject: [CMake] Problem Compiling on Solaris 10 x86 In-Reply-To: <555A2111.6090009@kitware.com> References: <4EE272F3.3090501@oanda.com> <555A0CF4.3020903@swemel.ru> <555A2111.6090009@kitware.com> Message-ID: <555AFB30.4090502@swemel.ru> On 18 May 2015 12:01 PM, Konstantin Andreev wrote: > SUN/Oracle Solaris typically has two `curses' packages installed : traditional Unix `curses' and GNU `ncurses'. Cmake builds itself against headers of GNU `ncurses', but links with Unix `curses' with obvious result above. > > To workaround, you could uninstall either Unix `curses' or GNU `ncurses' development package. On 18 May 2015 20:27, Bill Hoffman wrote: > Where is the ncurses library? From your cache it seems that it can not find the ncurses library: Bill, thank you for attending this. Only what I have posted (the final error message) is from my build : > ... > Linking CXX executable ../bin/ccmake > Undefined first referenced > symbol in file > wattr_on CMakeFiles/ccmake.dir/CursesDialog/cmCursesLongMessageForm.cxx.o > wattr_off CMakeFiles/ccmake.dir/CursesDialog/cmCursesLongMessageForm.cxx.o > ... It's identical to the error message of the topic starter, but I didn't look into the cmake cache. Here is a setup of the `curses': * SysV curses /usr/include/curses.h # header (multiarch) /lib/libcurses.so* # 32-bit libraries /usr/lib/libcurses.so* -> /lib/* # symlinks to above * X/Open curses /usr/xpg4/include/curses.h # header (multiarch) /usr/xpg4/lib/libcurses.so* # 32-bit libraries * GNU ncurses /usr/include/ncurses/* # headers (multiarch) /usr/gnu/lib/libncurses.so* # 32-bit libraries /usr/gnu/bin/ncurses5-config # 32-bit config script Even if it's not easy to guess `ncurses' libs here, it's still looks like a mistake to match ncurses headers to `libcurses.so'. BTW, 1. On Unix systems (which Solaris is) it's preferable to use native `curses', because it's mandatory, but GNU `ncurses' is optional. If other things being equal, why create extra dependency? 2. /usr/sfw is one more place on Solaris where to look into when you search for non-Unix alternates, like `ncurses'. Konstantin Andreev Software Engineer Swemel JSC From wenty_wabhua at 163.com Tue May 19 05:37:06 2015 From: wenty_wabhua at 163.com (=?GBK?B?zfXP/rHz?=) Date: Tue, 19 May 2015 17:37:06 +0800 (CST) Subject: [CMake] I'm using Cygwin on Windows. How can i get dependance target with out ":" in makefile. Message-ID: <7d752005.fe10.14d6b88a45a.Coremail.wenty_wabhua@163.com> hi,all I'm using cmake on windows with Cygwin. After I run "cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=debug ..\code\sip" , build info was witen to some dir. But make command get an error Info : alg_sip/CMakeFiles/alg_sip.dir/build.make:54: *** target pattern contains no '%'. Stop. The makefile is like this: 1: alg_sip/CMakeFiles/alg_sip.dir/W_/src_ios/alg/sip/source/p_sip_acr.c.obj: alg_sip/CMakeFiles/alg_sip.dir/flags.make 2: alg_sip/CMakeFiles/alg_sip.dir/W_/src_ios/alg/sip/source/p_sip_acr.c.obj: alg_sip/CMakeFiles/alg_sip.dir/includes_C.rsp 3: alg_sip/CMakeFiles/alg_sip.dir/W_/src_ios/alg/sip/source/p_sip_acr.c.obj: W:/src_ios/alg/sip/source/p_sip_acr.c 4: $(CMAKE_COMMAND) -E cmake_progress_report W:/scripts/test/build/CMakeFiles $(CMAKE_PROGRESS_1) 5: @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building C object alg_sip/CMakeFiles/alg_sip.dir/W_/src_ios/alg/sip/source/p_sip_acr.c.obj" 6: cd alg_sip && D:/KIDE2.4/host/ide/cygwin/bin/cc.exe $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/alg_sip.dir/W_/src_ios/alg/sip/source/p_sip_acr.c.obj -c W:/src_ios/alg/sip/source/p_sip_acr.c In line 3, " W: " was recognized as a dependent delimeter. So how can I make this to be a valid makefile? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cedric.doucet at inria.fr Tue May 19 06:37:03 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Tue, 19 May 2015 12:37:03 +0200 (CEST) Subject: [CMake] How URL_MD5 is computed in ExternalProject_Add? In-Reply-To: <354157992.5919472.1432031490843.JavaMail.zimbra@inria.fr> Message-ID: <1756909455.5922653.1432031823092.JavaMail.zimbra@inria.fr> Hello, I use the URL_MD5 variable to avoid downloading more than once a library with the ExternalProject_Add command. However, I don't manage to get the same MD5 code as CMake when I try to get one with generators available on the internet. How could I get the same one for an URL written in the form http://www.mywebsite.myext/mypath/myfile? I have already tried the MD5 of the URL and of myfile but I don't get the same MD5 as CMake. Thanks! C?dric -------------- next part -------------- An HTML attachment was scrubbed... URL: From cedric.doucet at inria.fr Tue May 19 07:14:47 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Tue, 19 May 2015 13:14:47 +0200 (CEST) Subject: [CMake] How URL_MD5 is computed in ExternalProject_Add? In-Reply-To: <1756909455.5922653.1432031823092.JavaMail.zimbra@inria.fr> References: <1756909455.5922653.1432031823092.JavaMail.zimbra@inria.fr> Message-ID: <558668504.5934832.1432034087377.JavaMail.zimbra@inria.fr> I managed to obtain the same MD5 code by running the md5sum command on the downloaded file. However, I would like to write an automatic way of downloading third-party libraries. Is it possible to let CMake compute the MD5 of the downloaded file? C?dric ----- Mail original ----- > De: "Cedric Doucet" > ?: cmake at cmake.org > Envoy?: Mardi 19 Mai 2015 12:37:03 > Objet: [CMake] How URL_MD5 is computed in ExternalProject_Add? > Hello, > I use the URL_MD5 variable to avoid downloading more than once a library with > the ExternalProject_Add command. > However, I don't manage to get the same MD5 code as CMake when I try to get > one with generators available on the internet. > How could I get the same one for an URL written in the form > http://www.mywebsite.myext/mypath/myfile? > I have already tried the MD5 of the URL and of myfile but I don't get the > same MD5 as CMake. > Thanks! > C?dric > -- > 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: > http://public.kitware.com/mailman/listinfo/cmake -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.chevrier at sap.com Tue May 19 07:29:07 2015 From: marc.chevrier at sap.com (CHEVRIER, Marc) Date: Tue, 19 May 2015 11:29:07 +0000 Subject: [CMake] How URL_MD5 is computed in ExternalProject_Add? Message-ID: <310D72FD-EC51-4FC9-A7E4-3A1ED304166D@sap.com> You can use FILE (MD5 ) command to compute MD5 value. From: CMake on behalf of Cedric Doucet Date: Tuesday 19 May 2015 13:14 To: "cmake at cmake.org" Subject: Re: [CMake] How URL_MD5 is computed in ExternalProject_Add? I managed to obtain the same MD5 code by running the md5sum command on the downloaded file. However, I would like to write an automatic way of downloading third-party libraries. Is it possible to let CMake compute the MD5 of the downloaded file? C?dric ________________________________ De: "Cedric Doucet" > ?: cmake at cmake.org Envoy?: Mardi 19 Mai 2015 12:37:03 Objet: [CMake] How URL_MD5 is computed in ExternalProject_Add? Hello, I use the URL_MD5 variable to avoid downloading more than once a library with the ExternalProject_Add command. However, I don't manage to get the same MD5 code as CMake when I try to get one with generators available on the internet. How could I get the same one for an URL written in the form http://www.mywebsite.myext/mypath/myfile? I have already tried the MD5 of the URL and of myfile but I don't get the same MD5 as CMake. Thanks! C?dric -- 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: http://public.kitware.com/mailman/listinfo/cmake -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Tue May 19 09:04:58 2015 From: DLRdave at aol.com (David Cole) Date: Tue, 19 May 2015 09:04:58 -0400 Subject: [CMake] How URL_MD5 is computed in ExternalProject_Add? In-Reply-To: <310D72FD-EC51-4FC9-A7E4-3A1ED304166D@sap.com> References: <310D72FD-EC51-4FC9-A7E4-3A1ED304166D@sap.com> Message-ID: The point of specifying URL_MD5 in ExternalProject_Add is so that it can check to see if it downloaded the file properly. If you don't tell it what the md5 sum should be, then what good is computing it after downloading it? The point is to double check that it downloaded correctly and as expected. If you don't tell it what to expect, it's impossible. So... you can't download arbitrary content from the internet unless you can also download it's corresponding md5 sum reliably. But... you can't even do that: because if somebody is trying to spoof it and hacks the file on the internet, they can just as easily hack the md5 you'd get from the internet and fool you into using a hacked file. So: it's up to you to verify that a package retrieved from the internet is use-able and un-hacked, and then computes its md5 sum (or even better, SHA-1 sum), and pass it to ExternalProject_Add so it can *fail* if the sum of the downloaded file does not match the expected sum. Does this make sense? On Tue, May 19, 2015 at 7:29 AM, CHEVRIER, Marc wrote: > > You can use FILE (MD5 ) command to compute MD5 value. > > From: CMake on behalf of Cedric Doucet > Date: Tuesday 19 May 2015 13:14 > To: "cmake at cmake.org" > Subject: Re: [CMake] How URL_MD5 is computed in ExternalProject_Add? > > > I managed to obtain the same MD5 code by running the md5sum command on the > downloaded file. > However, I would like to write an automatic way of downloading third-party > libraries. > Is it possible to let CMake compute the MD5 of the downloaded file? > > C?dric > > > > ________________________________ > > De: "Cedric Doucet" > ?: cmake at cmake.org > Envoy?: Mardi 19 Mai 2015 12:37:03 > Objet: [CMake] How URL_MD5 is computed in ExternalProject_Add? > > Hello, > > I use the URL_MD5 variable to avoid downloading more than once a library > with the ExternalProject_Add command. > However, I don't manage to get the same MD5 code as CMake when I try to get > one with generators available on the internet. > > How could I get the same one for an URL written in the form > http://www.mywebsite.myext/mypath/myfile? > I have already tried the MD5 of the URL and of myfile but I don't get the > same MD5 as CMake. > > Thanks! > > C?dric > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > > > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake From cedric.doucet at inria.fr Tue May 19 09:38:49 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Tue, 19 May 2015 15:38:49 +0200 (CEST) Subject: [CMake] How URL_MD5 is computed in ExternalProject_Add? In-Reply-To: References: <310D72FD-EC51-4FC9-A7E4-3A1ED304166D@sap.com> Message-ID: <1035131362.5995682.1432042729906.JavaMail.zimbra@inria.fr> Hello David, I understand exactly what you mean but the misunderstanding comes from your sentence: >> > The point is to double check that it downloaded correctly and as expected. That's NOT why I use the URL_MD5 variable in ExternalProject_Add. I use it to avoid downloading again libraries after typing 'make clean'. So, my feeling is that I shouldn't use the URL_MD5 variable to perform this checking. Furthermore, I should check other steps (updating, configuration, building, installation). Do you agree with this? What is the correct way to do this with CMake? C?dric ----- Mail original ----- > De: "David Cole" > ?: "Marc CHEVRIER" > Cc: "Cedric Doucet" , cmake at cmake.org > Envoy?: Mardi 19 Mai 2015 15:04:58 > Objet: Re: [CMake] How URL_MD5 is computed in ExternalProject_Add? > > The point of specifying URL_MD5 in ExternalProject_Add is so that it > can check to see if it downloaded the file properly. If you don't tell > it what the md5 sum should be, then what good is computing it after > downloading it? > > The point is to double check that it downloaded correctly and as > expected. If you don't tell it what to expect, it's impossible. So... > you can't download arbitrary content from the internet unless you can > also download it's corresponding md5 sum reliably. > > But... you can't even do that: because if somebody is trying to spoof > it and hacks the file on the internet, they can just as easily hack > the md5 you'd get from the internet and fool you into using a hacked > file. > > So: it's up to you to verify that a package retrieved from the > internet is use-able and un-hacked, and then computes its md5 sum (or > even better, SHA-1 sum), and pass it to ExternalProject_Add so it can > *fail* if the sum of the downloaded file does not match the expected > sum. > > Does this make sense? > > > > On Tue, May 19, 2015 at 7:29 AM, CHEVRIER, Marc > wrote: > > > > You can use FILE (MD5 ) command to compute MD5 value. > > > > From: CMake on behalf of Cedric Doucet > > Date: Tuesday 19 May 2015 13:14 > > To: "cmake at cmake.org" > > Subject: Re: [CMake] How URL_MD5 is computed in ExternalProject_Add? > > > > > > I managed to obtain the same MD5 code by running the md5sum command on the > > downloaded file. > > However, I would like to write an automatic way of downloading third-party > > libraries. > > Is it possible to let CMake compute the MD5 of the downloaded file? > > > > C?dric > > > > > > > > ________________________________ > > > > De: "Cedric Doucet" > > ?: cmake at cmake.org > > Envoy?: Mardi 19 Mai 2015 12:37:03 > > Objet: [CMake] How URL_MD5 is computed in ExternalProject_Add? > > > > Hello, > > > > I use the URL_MD5 variable to avoid downloading more than once a library > > with the ExternalProject_Add command. > > However, I don't manage to get the same MD5 code as CMake when I try to get > > one with generators available on the internet. > > > > How could I get the same one for an URL written in the form > > http://www.mywebsite.myext/mypath/myfile? > > I have already tried the MD5 of the URL and of myfile but I don't get the > > same MD5 as CMake. > > > > Thanks! > > > > C?dric > > > > -- > > > > 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: > > http://public.kitware.com/mailman/listinfo/cmake > > > > > > > > -- > > > > 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: > > http://public.kitware.com/mailman/listinfo/cmake > From cedric.doucet at inria.fr Tue May 19 09:39:32 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Tue, 19 May 2015 15:39:32 +0200 (CEST) Subject: [CMake] How URL_MD5 is computed in ExternalProject_Add? In-Reply-To: <1035131362.5995682.1432042729906.JavaMail.zimbra@inria.fr> References: <310D72FD-EC51-4FC9-A7E4-3A1ED304166D@sap.com> <1035131362.5995682.1432042729906.JavaMail.zimbra@inria.fr> Message-ID: <1812858597.5995797.1432042772120.JavaMail.zimbra@inria.fr> ... And thank you very much for your help Marc! :) ----- Mail original ----- > De: "Cedric Doucet" > ?: "David Cole" > Cc: cmake at cmake.org > Envoy?: Mardi 19 Mai 2015 15:38:49 > Objet: Re: [CMake] How URL_MD5 is computed in ExternalProject_Add? > > > Hello David, > > I understand exactly what you mean but the misunderstanding comes from your > sentence: > > >> > The point is to double check that it downloaded correctly and as > >> > expected. > > That's NOT why I use the URL_MD5 variable in ExternalProject_Add. > I use it to avoid downloading again libraries after typing 'make clean'. > > So, my feeling is that I shouldn't use the URL_MD5 variable to perform this > checking. > Furthermore, I should check other steps (updating, configuration, building, > installation). > > Do you agree with this? > What is the correct way to do this with CMake? > > C?dric > > > ----- Mail original ----- > > De: "David Cole" > > ?: "Marc CHEVRIER" > > Cc: "Cedric Doucet" , cmake at cmake.org > > Envoy?: Mardi 19 Mai 2015 15:04:58 > > Objet: Re: [CMake] How URL_MD5 is computed in ExternalProject_Add? > > > > The point of specifying URL_MD5 in ExternalProject_Add is so that it > > can check to see if it downloaded the file properly. If you don't tell > > it what the md5 sum should be, then what good is computing it after > > downloading it? > > > > The point is to double check that it downloaded correctly and as > > expected. If you don't tell it what to expect, it's impossible. So... > > you can't download arbitrary content from the internet unless you can > > also download it's corresponding md5 sum reliably. > > > > But... you can't even do that: because if somebody is trying to spoof > > it and hacks the file on the internet, they can just as easily hack > > the md5 you'd get from the internet and fool you into using a hacked > > file. > > > > So: it's up to you to verify that a package retrieved from the > > internet is use-able and un-hacked, and then computes its md5 sum (or > > even better, SHA-1 sum), and pass it to ExternalProject_Add so it can > > *fail* if the sum of the downloaded file does not match the expected > > sum. > > > > Does this make sense? > > > > > > > > On Tue, May 19, 2015 at 7:29 AM, CHEVRIER, Marc > > wrote: > > > > > > You can use FILE (MD5 ) command to compute MD5 value. > > > > > > From: CMake on behalf of Cedric Doucet > > > Date: Tuesday 19 May 2015 13:14 > > > To: "cmake at cmake.org" > > > Subject: Re: [CMake] How URL_MD5 is computed in ExternalProject_Add? > > > > > > > > > I managed to obtain the same MD5 code by running the md5sum command on > > > the > > > downloaded file. > > > However, I would like to write an automatic way of downloading > > > third-party > > > libraries. > > > Is it possible to let CMake compute the MD5 of the downloaded file? > > > > > > C?dric > > > > > > > > > > > > ________________________________ > > > > > > De: "Cedric Doucet" > > > ?: cmake at cmake.org > > > Envoy?: Mardi 19 Mai 2015 12:37:03 > > > Objet: [CMake] How URL_MD5 is computed in ExternalProject_Add? > > > > > > Hello, > > > > > > I use the URL_MD5 variable to avoid downloading more than once a library > > > with the ExternalProject_Add command. > > > However, I don't manage to get the same MD5 code as CMake when I try to > > > get > > > one with generators available on the internet. > > > > > > How could I get the same one for an URL written in the form > > > http://www.mywebsite.myext/mypath/myfile? > > > I have already tried the MD5 of the URL and of myfile but I don't get the > > > same MD5 as CMake. > > > > > > Thanks! > > > > > > C?dric > > > > > > -- > > > > > > 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: > > > http://public.kitware.com/mailman/listinfo/cmake > > > > > > > > > > > > -- > > > > > > 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: > > > http://public.kitware.com/mailman/listinfo/cmake > > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > From bm_witness at yahoo.com Tue May 19 10:22:55 2015 From: bm_witness at yahoo.com (BRM) Date: Tue, 19 May 2015 14:22:55 +0000 (UTC) Subject: [CMake] FindModules.cmake quality + Kitware proposition In-Reply-To: <20150514150932.99665A93DE@public.kitware.com> References: <20150514150932.99665A93DE@public.kitware.com> Message-ID: <588247427.2348528.1432045375782.JavaMail.yahoo@mail.yahoo.com> I'll add to it that all the Find Modules should be able to support projects that have their own builds of a library. Some Find Modules (e.g FindBoost) works generally well and supports HINTS and PATHS; but other (FindCURL) do not. For me, this means that I'll have to be adding variations of numerous modules to get it done so everything links and works correctly when I'd rather just use what CMake already provides. $0.02 Ben On Thursday, May 14, 2015 11:16 AM, Nagy-Egri M?t? Ferenc via CMake wrote: This is more of a remark, or something to get the ball rolling, rather than anything else. I recently came across various FindModule.cmake files (FindOpenCL, FindOpenGL, FindGLEW, FindGLM, FindSFML) as a sideeffect of a project I am developing, but have had my share with quite a few others (FindQt, RustCMake, FindOpenAL, FindBoost, ?). My overall impression is that the quality of these modules is highly fluctuating to say the least. While generally the FindModules shipping with CMake as built-in scripts are usable, there is a fair amount of room for improvement. FindGLEW.cmake for eg. is terrible. I have never imagined that such a widely used library has a 7 line FindModule script. On Windows it is practically useless. As for nearly all other FindModule scripts, nearly none of them use target_include_libraries() that would allow for end-users of the scripts to not have to worry about include directories. Some projects strive at being cross-platform, but compiling them on Windows (mostly the GNU projects that aim on being Windows friendly) is massive pain. libJPEG to name just one provides nmake makefiles that are capable of producing Visual Studio 2010 project files at best (huuraay), and have undocumented external dependencies. These projects (and their users)?cry out for CMake support. Here is a proposition to consider: Kitware generally has the philosphy with CMake being: do it yourself or hire us to do it. While on a corporate basis this is a legitimate approach, I as a poor academic fellow do not have 10.000$ to spare for a feature I so wish, neither do I have the time to educate myself in the internal ways of CMake to contribute. So all I do is hack, hack, hack all day. The Chocolatey project (a package manager for Windows)?recently won a massive Kickstarter campaign that aimed solely increasing the overall quality of the project. With this campaign they aimed on growing from an??interesting idea? to begin??mainstream?. With the money they won, they hired full time package moderators, developed automated scripts of facilitating authoring, wrote tutorials, created templates, and even managed to get the ball rolling with OneGet (Powershell 5.0 package manager manager) to adopt Chocolatey as the first supported public repo. I would suggest Kitware start a similar community funded project to increase the overall quality of the software. While I do not have 10 grands to buy a feature, I do have 10 dollars pocket money to contribute (as do MANY others). As several levels of goals, the stock FindModules scripts could be brought to a homogenous quality, identical naming conventions (no more MYLIB_INC_DIR, MYLIB_INCLUDE_DIRS, MyLib_INCLUDE_DIR), high quality templates for new adopters, make the CMake Guide freely available online (epub, pdf, docx, whatever), convert 10 GNU projects to CMake, convert 50 GNU projects to CMake, create Snappy back-end of CPack, or my personal favorite (the feature I do not have 10.000 dollars for) is NMake batch mode support for multicore build, etc. There are so many places CMake itself can be improved, and so many users who really should be adopting, but have not started due to lacking man power. (These are the projects that would benefit the most from a freely available tutorial, because truth be told: writing capable, high-quality CMake scripts is no easy task.) If I were a charmismatic spokesperson I?d say: I RAISE 10 DOLLARS, WHO?S WITH ME?! But because I?m not, I?ll just leave it here as a suggestion. Ideas? -- 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: http://public.kitware.com/mailman/listinfo/cmake -------------- next part -------------- An HTML attachment was scrubbed... URL: From guraaf at gmail.com Tue May 19 10:55:43 2015 From: guraaf at gmail.com (Guraaf) Date: Tue, 19 May 2015 09:55:43 -0500 Subject: [CMake] specifying linker for cross-compilation Message-ID: Hello all, I am a newbie though I have used CMake a bit for a few projects. Now, I am trying to use CMake for cross-compiling on my Linux desktop for an embedded system (ARM DS-5 based). Right now, the needs are simple - I need to specify the compiler and linker with flags for both. However, I can't figure out why the linking step doesn't work. The "armlink" does get specified but Make is invoking it without any parameters, i.e., without any object files to link and produce the output .elf file. I am looking to keep it simple and hopefully this is not too involved. Any advice appreciated. My system has cmake version 2.8.7 and I invoke as: $ cd build $ cmake .. $ make VERBOSE=1 I can't seem to figure out where and how do I tell that the output will be blinky.elf. e.g., If I try on command-line by myself it is: $ armlink --cpu=Cortex-M3 --map --ro-base=0x0 --rw-base=0x0008000 --first='boot.o(RESET)' --datacompressor=off CMakeFiles/blinky.dir/blinky.c.o -o blinky.elf but the makefile is invoking as only: $ armlink My current CMakeLists and output is given below. Look forward to your pointers. cmake_minimum_required(VERSION 2.8) SET(CMAKE_SYSTEM_NAME Generic) project(test_arm) enable_language(C ASM) # cross-compilation for ARM SET(CMAKE_C_COMPILER armcc) SET(CMAKE_AR armar) SET(CMAKE_LINKER armlink) SET(CMAKE_C_FLAGS "--cpu=Cortex-M3") SET(CMAKE_AR_FLAGS "-armcc,-Ospace") SET(CMAKE_EXE_LINKER_FLAGS "--map --ro-base=0x0 --rw-base=0x0008000 --first='boot.o(RESET)' --datacompressor=off") include_directories(../include) add_executable( blinky blinky.c ) set_target_properties( blinky PROPERTIES LINKER_LANGUAGE C) $ make VERBOSE=1[100%] Building C object CMakeFiles/blinky.dir/blinky.c.o/usr/bin/cmake -E cmake_link_script CMakeFiles/blinky.dir/link.txt --verbose=1 armlinkLinking C executable blinkyProduct: DS-5 Professional 5.21.0 [5210017]Component: ARM Compiler 5.05 update 1 (build 106)Tool: armlink [4d0efa]For support see http://www.arm.com/support/Software supplied by: ARM LimitedUsage: armlink option-list input-file-list ---- Guraaf -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.kacvinsky at vectorcast.com Tue May 19 13:28:05 2015 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Tue, 19 May 2015 13:28:05 -0400 Subject: [CMake] macros with arguments Message-ID: HI, Background: trying to build several executables that have the same target link libraries, compile flags, etc..., but different source files. Rather than duplicate all of the necessary bits for each target, I thought I'd write a macro that takes in arguments (the target name and list of files). But I am am unsure (based on the cmake documentation for macro()) as how to pick out the target and list of files so I can do the right thing with add_executable. Any ideas? Thanks, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan at su-root.co.uk Tue May 19 14:01:08 2015 From: dan at su-root.co.uk (Dan Liew) Date: Tue, 19 May 2015 19:01:08 +0100 Subject: [CMake] OBJECT libraries and target visibility properties seem broken Message-ID: Hi, I'm not sure if this is actually a bug but I've been relying on the OBJECT library[1] feature as a convenient way of having source code in multiple directories be put into a shared library. I now have a need to hide the symbols in my libraries but I've found that using OBJECT libraries means that setting the CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN on the final resulting shared library and/or constituent OBJECT libraries does absolutely nothing. Here's an example. I've kept everything in a single directory for simplicity but the real world use case would be that ``fooX`` and ``barX`` OBJECT libraries are defined in a sub directory. ``` project(objlibtest) cmake_minimum_required(VERSION 3.0) add_library(fooX OBJECT foo.cpp) add_library(barX OBJECT bar.cpp) add_library(result SHARED $ $) set_target_properties(result fooX barX PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN 1) ``` If you watch the build (``make VERBOSE=1``) you'll see that neither ``-fvisibility=hidden`` nor ``-fvisibility-inlines-hidden`` get passed to the compiler. If the CMakeLists.txt file is like this ``` project(objlibtest) cmake_minimum_required(VERSION 3.0) add_library(result SHARED foo.cpp bar.cpp) set_target_properties(result PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN 1) ``` then setting ``-fvisibility=hidden`` and ``-fvisibility-inlines-hidden`` get passed. Is this a bug or it intentional? If the only purpose of OBJECT libraries is to provide a convenient way to group source files in other directories then this seems like a bug. [1] http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library Thanks, Dan. From scott at towel42.com Tue May 19 13:42:44 2015 From: scott at towel42.com (Scott Aron Bloom) Date: Tue, 19 May 2015 17:42:44 +0000 Subject: [CMake] Setting install dir based on Debug or Release Message-ID: We use the install system, and love it. However, since our install include copies of 3rd party debug libraries that are named the same as the release counterparts (not our call ;() I would like to just have a the path be install.deb rather than "install" We set the CMAKE_INSTLL_PREFIX variable, but all the configurations get set to the same install... The problem I see, is the code only gets executed once, and at that point the CMAKE_BUILD_TYPE isn't set yet.. Yes I realize this for windows, so it is a multi-config system.. but I cant believe Im the only one with this issue. This is is what Im trying... IF( "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Install) message( STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" ) ELSEIF( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Install.deb) message( STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" ) ELSE() MESSAGE( STATUS "CMAKE_BUILD_TYPE not set yet ${CMAKE_BUILD_TYPE}" ) ENDIF() Any help would be most appreciated Thanks Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.kacvinsky at vectorcast.com Tue May 19 15:30:13 2015 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Tue, 19 May 2015 15:30:13 -0400 Subject: [CMake] macros with arguments In-Reply-To: References: Message-ID: On Tue, May 19, 2015 at 1:28 PM, Tom Kacvinsky wrote: > HI, > > Background: trying to build several executables that have the same target > link libraries, compile flags, etc..., but different source files. Rather > than duplicate all of the necessary bits for each target, I thought I'd > write a macro that takes in arguments (the target name and list of files). > > But I am am unsure (based on the cmake documentation for macro()) as how > to pick out the target and list of files so I can do the right thing with > add_executable. > > Any ideas? > > Thanks, > > Tom > I figured this out. macro(macro_name target_name) add_executable(${target_name} ${ARGN}) target_link_libraries(${target_name} ...) endmacro(macro_name) Sorry for the noise Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From guraaf at gmail.com Tue May 19 16:19:09 2015 From: guraaf at gmail.com (Guraaf) Date: Tue, 19 May 2015 15:19:09 -0500 Subject: [CMake] specifying linker for cross-compilation Message-ID: Further to my earlier question, I spent more time on: http://www.cmake.org/Wiki/CMake_Cross_Compiling but still couldn't get the linker to work. I now have two files: arm.cmake INCLUDE(CMakeForceCompiler) SET(CMAKE_SYSTEM_NAME Generic) CMAKE_FORCE_C_COMPILER(armcc GNU) SET(CMAKE_ASM_COMPILER armasm) SET(CMAKE_AR armar) SET(CMAKE_LINKER armlink) SET(CMAKE_C_FLAGS "--cpu=Cortex-M3") SET(CMAKE_AR_FLAGS "-armcc,-Ospace") SET(CMAKE_C_LINK_FLAGS "--map --ro-base=0x0 --rw-base=0x0008000 --first='boot.o(RESET)' --datacompressor=off") SET(CMAKE_C_LINK_EXECUTABLE=" ${CMAKE_C_LINK_FLAGS} -o ") SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) and my CMakeLists.txt: cmake_minimum_required(VERSION 2.8) project(test_arm) add_executable( blinky blinky.c ) However, the armlink is never invoked. Make still wants to link via "armcc" and never calls armlink. What am I doing wrong for getting a specific linker with specific flags to work? $ mkdir build $ cd build $ cmake -DCMAKE_TOOLCHAIN_FILE=../arm.cmake .. $ make VERBOSE=1 Thanks a lot! ---- Guraaf -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.chevrier at sap.com Wed May 20 03:00:18 2015 From: marc.chevrier at sap.com (CHEVRIER, Marc) Date: Wed, 20 May 2015 07:00:18 +0000 Subject: [CMake] Setting install dir based on Debug or Release Message-ID: Multi-configurations is a bit complex to handle regarding install directories but it is doable. Here is my solution: 1. Handle various possibilities (multi-configs or mono-config). In case of multi-config, you have to rely on variable CMAKE_CFG_INTDIR which be contains information enabling to instantiate the current configuration at runtime. I also force definition of a default config (Debug) if none is specified (in case of mono config) to avoid bad behaviours. if (DEFINED CMAKE_CONFIGURATION_TYPES) # multi-config handling set (CMAKE_BUILD_CONFIG \${BUILD_TYPE}) set (CMAKE_CFG_BUILD_CONFIG ${CMAKE_CFG_INTDIR}) else() # mono config handling if (CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel" FORCE) else() set (CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel" FORCE) endif() set (CMAKE_BUILD_CONFIG ${CMAKE_BUILD_TYPE}) set (CMAKE_CFG_BUILD_CONFIG ${CMAKE_BUILD_TYPE}) endif() 2. Now you can use variables CMAKE_BUILD_CONFIG or CMAKE_CFG_BUILD_CONFIG to define your install prefix. There is two different variables because depending of the context of use, one or the other must be used. Here is an example: add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_BUILD_CONFIG}/output_file" COMMAND "${CMAKE_COMMAND}" -DBUILD_TYPE=$ -P script.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating output_file") OUTPUT parameter does not support generator expressions so pattern $ cannot be used. You have to rely on CMAKE_CFG_INTDIR in case of multi-config but on CMAKE_BUILD_TYPE for mono-config. So use wrapper CMAKE_CFG_BUILD_CONFIG. install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_CONFIG}/output_file DESTINATION ${CMAKE_BUILD_CONFIG}) In case of install command, CMAKE_CFG_INTDIR must not be used in multi-config? So use wrapper CMAKE_BUILD_CONFIG. This is why I have two different variables! Hope this is helpful. Marc From: CMake on behalf of Scott Aron Bloom Date: Tuesday 19 May 2015 19:42 To: "cmake at cmake.org" Subject: [CMake] Setting install dir based on Debug or Release We use the install system, and love it. However, since our install include copies of 3rd party debug libraries that are named the same as the release counterparts (not our call ;() I would like to just have a the path be install.deb rather than ?install? We set the CMAKE_INSTLL_PREFIX variable, but all the configurations get set to the same install? The problem I see, is the code only gets executed once, and at that point the CMAKE_BUILD_TYPE isn?t set yet.. Yes I realize this for windows, so it is a multi-config system.. but I cant believe Im the only one with this issue. This is is what Im trying? IF( "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Install) message( STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" ) ELSEIF( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Install.deb) message( STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" ) ELSE() MESSAGE( STATUS "CMAKE_BUILD_TYPE not set yet ${CMAKE_BUILD_TYPE}" ) ENDIF() Any help would be most appreciated Thanks Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: From cedric.doucet at inria.fr Wed May 20 05:42:08 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Wed, 20 May 2015 11:42:08 +0200 (CEST) Subject: [CMake] File organization and the essence of modules In-Reply-To: <2046046959.6262558.1432114176613.JavaMail.zimbra@inria.fr> Message-ID: <1662349850.6270434.1432114928478.JavaMail.zimbra@inria.fr> Hello, I wonder how I should organize cmake files in my project. For the moment, I have organized my project like this: ========================== project/ CMakeLists.txt cmake/ modules/ FindLibrary.cmake MyFunction.cmake src/ CMakeLists.txt ========================== If I keep on organizing files like this, the "cmake" directory will only contain a subdirectory named "modules" and dedicated to auxiliary files like custom functions and scripts for the find_package function. Actually, it seems to be the case in the installation directory of cmake itself, where a subdirectory named "Modules" contains both functions and scripts for the find_package function. Does it make sense to separate functions from scripts for the find_package function? Is each script a module in CMake, whatever it contains? What are the different kinds of scripts/modules: functions, scripts for the find_package function, configuration files, what else? Thank you for your help! C?dric -------------- next part -------------- An HTML attachment was scrubbed... URL: From scott at towel42.com Wed May 20 10:25:28 2015 From: scott at towel42.com (Scott Aron Bloom) Date: Wed, 20 May 2015 14:25:28 +0000 Subject: [CMake] Setting install dir based on Debug or Release In-Reply-To: References: Message-ID: That makes sense.. Ill play with it and see. It looks like a straight forward solution? Scott From: CHEVRIER, Marc [mailto:marc.chevrier at sap.com] Sent: Wednesday, May 20, 2015 12:00 AM To: Scott Aron Bloom; cmake at cmake.org Subject: Re: [CMake] Setting install dir based on Debug or Release Multi-configurations is a bit complex to handle regarding install directories but it is doable. Here is my solution: 1. Handle various possibilities (multi-configs or mono-config). In case of multi-config, you have to rely on variable CMAKE_CFG_INTDIR which be contains information enabling to instantiate the current configuration at runtime. I also force definition of a default config (Debug) if none is specified (in case of mono config) to avoid bad behaviours. if (DEFINED CMAKE_CONFIGURATION_TYPES) # multi-config handling set (CMAKE_BUILD_CONFIG \${BUILD_TYPE}) set (CMAKE_CFG_BUILD_CONFIG ${CMAKE_CFG_INTDIR}) else() # mono config handling if (CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel" FORCE) else() set (CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel" FORCE) endif() set (CMAKE_BUILD_CONFIG ${CMAKE_BUILD_TYPE}) set (CMAKE_CFG_BUILD_CONFIG ${CMAKE_BUILD_TYPE}) endif() 2. Now you can use variables CMAKE_BUILD_CONFIG or CMAKE_CFG_BUILD_CONFIG to define your install prefix. There is two different variables because depending of the context of use, one or the other must be used. Here is an example: add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_BUILD_CONFIG}/output_file" COMMAND "${CMAKE_COMMAND}" -DBUILD_TYPE=$ -P script.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating output_file") OUTPUT parameter does not support generator expressions so pattern $ cannot be used. You have to rely on CMAKE_CFG_INTDIR in case of multi-config but on CMAKE_BUILD_TYPE for mono-config. So use wrapper CMAKE_CFG_BUILD_CONFIG. install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_CONFIG}/output_file DESTINATION ${CMAKE_BUILD_CONFIG}) In case of install command, CMAKE_CFG_INTDIR must not be used in multi-config? So use wrapper CMAKE_BUILD_CONFIG. This is why I have two different variables! Hope this is helpful. Marc From: CMake on behalf of Scott Aron Bloom Date: Tuesday 19 May 2015 19:42 To: "cmake at cmake.org" Subject: [CMake] Setting install dir based on Debug or Release We use the install system, and love it. However, since our install include copies of 3rd party debug libraries that are named the same as the release counterparts (not our call ;() I would like to just have a the path be install.deb rather than ?install? We set the CMAKE_INSTLL_PREFIX variable, but all the configurations get set to the same install? The problem I see, is the code only gets executed once, and at that point the CMAKE_BUILD_TYPE isn?t set yet.. Yes I realize this for windows, so it is a multi-config system.. but I cant believe Im the only one with this issue. This is is what Im trying? IF( "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Install) message( STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" ) ELSEIF( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Install.deb) message( STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" ) ELSE() MESSAGE( STATUS "CMAKE_BUILD_TYPE not set yet ${CMAKE_BUILD_TYPE}" ) ENDIF() Any help would be most appreciated Thanks Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: From cedric.doucet at inria.fr Wed May 20 14:49:07 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Wed, 20 May 2015 20:49:07 +0200 (CEST) Subject: [CMake] Passing arguments to functions In-Reply-To: <1469082414.6452216.1432147291905.JavaMail.zimbra@inria.fr> Message-ID: <867115729.6453662.1432147747153.JavaMail.zimbra@inria.fr> Hello, I try to wrote a function DownloadThenInstall which calls the ExternalProject_Add function after havind defined useful variables like prefix, download_dir, etc. I would like to call it like this DownloadThenInstall(Eigen) to download and install the Eigen library (for example). But it doesn't work unless I change the call to DownloadThenInstall(${Eigen}) Below is the core of the function. In the first call of DownloadThenInstall, name and url are empty. In the second call of DownloadThenInstall, name and url have the right values. How could I modify my script in order to make the first call, DownloadThenInstall(Eigen), work? Thank you very much! C?dric -------------------- function(DownloadThenInstall LIBRARY_NAME) string(TOLOWER ${LIBRARY_NAME} LIBRARY_LOWERNAME) string(TOUPPER ${LIBRARY_NAME} LIBRARY_UPPERNAME) #=================================== # define useful variables for ExternalProject_Add #=================================== set(${LIBRARY_UPPERNAME}_PREFIX ${EXTERNAL_DIR}/${LIBRARY_LOWERNAME} ) set(${LIBRARY_UPPERNAME}_DOWNLOAD_DIR ${${LIBRARY_UPPERNAME}_PREFIX}/download) set(${LIBRARY_UPPERNAME}_SOURCE_DIR ${${LIBRARY_UPPERNAME}_PREFIX}/src) set(${LIBRARY_UPPERNAME}_BINARY_DIR ${${LIBRARY_UPPERNAME}_PREFIX}/build) set(${LIBRARY_UPPERNAME}_TMP_DIR ${${LIBRARY_UPPERNAME}_PREFIX}/tmp) set(${LIBRARY_UPPERNAME}_STAMP_DIR ${${LIBRARY_UPPERNAME}_PREFIX}/stamp) set(${LIBRARY_UPPERNAME}_INSTALL_DIR ${${LIBRARY_UPPERNAME}_PREFIX}/install) #==================================== # messages for debugging purpose (to be removed) #==================================== message(STATUS "name: ${LIBRARY_NAME}") message(STATUS "url: ${${LIBRARY_NAME}_URL}") #===================== # call to ExternalProject_Add #===================== endfunction(DownloadThenInstall) -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.kacvinsky at vectorcast.com Wed May 20 14:57:23 2015 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Wed, 20 May 2015 14:57:23 -0400 Subject: [CMake] add_executable with generated files Message-ID: I have need to make an executable that depends on a generated file. I've read several tutorials on how to do this, but even after following those instructions, I get this error: CMake Error at CMakeLists.txt:436 (add_executable): Cannot find source file: .chop/maint.adb Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp has anyone done this, and if so, do you have tips on how to proceed? Thanks, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.kacvinsky at vectorcast.com Wed May 20 15:27:23 2015 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Wed, 20 May 2015 15:27:23 -0400 Subject: [CMake] add_executable with generated files In-Reply-To: References: Message-ID: My mistake, the tutorials I looked at were for using generated files in add_library. I do have a working add_library with generated files, but I can't seem to get generated files to work with add_executable. So is there a difference between the two? add_library allows for use of generated files, but add_executable does not? On Wed, May 20, 2015 at 2:57 PM, Tom Kacvinsky wrote: > I have need to make an executable that depends on a generated file. I've > read several tutorials on how to do this, but even after following those > instructions, I get this error: > > CMake Error at CMakeLists.txt:436 (add_executable): > Cannot find source file: > > .chop/maint.adb > > Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp > > has anyone done this, and if so, do you have tips on how to proceed? > > Thanks, > > Tom > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.kacvinsky at vectorcast.com Wed May 20 16:18:59 2015 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Wed, 20 May 2015 16:18:59 -0400 Subject: [CMake] add_executable with generated files In-Reply-To: References: Message-ID: On Wed, May 20, 2015 at 3:27 PM, Tom Kacvinsky wrote: > > On Wed, May 20, 2015 at 2:57 PM, Tom Kacvinsky < > tom.kacvinsky at vectorcast.com> wrote: > >> I have need to make an executable that depends on a generated file. I've >> read several tutorials on how to do this, but even after following those >> instructions, I get this error: >> >> CMake Error at CMakeLists.txt:436 (add_executable): >> Cannot find source file: >> >> .chop/maint.adb >> >> Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp >> >> has anyone done this, and if so, do you have tips on how to proceed? >> >> Thanks, >> >> Tom >> > > My mistake, the tutorials I looked at were for using generated files in > add_library. I do have a working add_library with generated files, but I > can't seem to get generated files to work with add_executable. So is there > a difference between the two? add_library allows for use of generated > files, but add_executable does not? > > OK, figured something out. If the rule to generate the file is at the same level CMakeLists.txt (or higher) than the CMakeLists.txt that contains the add_executable command which uses the gnerated file, then everything is OK. But if the add_executable is at a higher level than the "rule" that gnerates the file, everything falls apart. This is why my add_library example worked but by add_executable example was not. To confuse the issue even further, I have this setup foo/CMakeLists.txt -> contains macro that uses add_executable foo/vcast/CMakeLists.txt -> contains rule to generate file foo/vcast/progs/CMakeLists.txt -> invokes macro defined at level 1, using the file generated at level 2 Apparently this is enough to thow things off. I though the add_executable would have "occurred" at level 3 as that is where the macro is expanded, but I am guessing cmake expansion of macros doesn't work that way. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cedric.doucet at inria.fr Thu May 21 07:10:04 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Thu, 21 May 2015 13:10:04 +0200 (CEST) Subject: [CMake] How to skip steps and use default values in ExternalProject_Add command? In-Reply-To: <178712264.6660598.1432205573561.JavaMail.zimbra@inria.fr> Message-ID: <440951913.6665578.1432206604087.JavaMail.zimbra@inria.fr> Hello, I would like to loop on a list of libraries to download and install, by calling the ExternalProject_Add command for each of these libraries. To do that, I need to define some commands for each library, like CONFIGURE_COMMAND, BUILD_COMMAND and INSTALL_COMMAND. These commands may differ from one library to another; for example, some of them may be based on make, or autoconfig, or cmake, etc. Furthermore, some of these libraries may not need to be built. What is the good way to skip some steps? Is it possible to use default values for some commands? The problem in my situation is that I have to fill in each command since I want to design way of downloading and installing third party libraries. To be clear, I wrote a loop which looks like this: ========================================================================== foreach(LIBRARY IN LISTS NOT_FOUND_LIBRARIES) ExternalProject_Add(${${LIBRARY}_LOWERNAME} PREFIX ${${LIBRARY}_PREFIX} URL ${${LIBRARY}_URL} CONFIGURE_COMMAND ${${LIBRARY}_CONFIGURE_COMMAND} BUILD_COMMAND ${${LIBRARY}_BUILD_COMMAND} INSTALL_COMMAND ${${LIBRARY}_INSTALL_COMMAND} ) endforeach(LIBRARY) ========================================================================== However, if a library is based on cmake, I do not need to specify commands for configuration and building. Is it possible to say that the default value of CONFIGURE_COMMAND will be used for example? The only way I know to do that is to suppress the line defining CONFIGURE_COMMAND but I can't do that since other libraries may need to define it. To skip steps, I replace the corresponding command by 'ls' but it's not very clean. That is to say, the value of ${LIBRARY}_CONFIGURE_COMMAND is 'ls' when I want to skip the configuration step. Thank you very much for your help. C?dric -------------- next part -------------- An HTML attachment was scrubbed... URL: From petr.kmoch at gmail.com Thu May 21 07:33:27 2015 From: petr.kmoch at gmail.com (Petr Kmoch) Date: Thu, 21 May 2015 13:33:27 +0200 Subject: [CMake] How to skip steps and use default values in ExternalProject_Add command? In-Reply-To: <440951913.6665578.1432206604087.JavaMail.zimbra@inria.fr> References: <178712264.6660598.1432205573561.JavaMail.zimbra@inria.fr> <440951913.6665578.1432206604087.JavaMail.zimbra@inria.fr> Message-ID: Hi Cedric. When doing things like that, remember that CMake's "named arguments" are arguments just like any other. So you can easily obtain them from variable expansion; something like this: if(${LIBRARY}_CONFIGURE_COMMAND) set(the_configure_command CONFIGURE_COMMAND ${${LIBRARY}_CONFIGURE_COMMAND}) else() set(the_configure_command "") endif() ExternalProject_Add(${${LIBRARY}_LOWERNAME} PREFIX ${${LIBRARY}_PREFIX} URL ${${LIBRARY}_URL} ${the_configure_command} BUILD_COMMAND ${${LIBRARY}_BUILD_COMMAND} INSTALL_COMMAND ${${LIBRARY}_INSTALL_COMMAND} ) The same trick can be applied to any other command you need to conditionally exclude, of course. Petr On Thu, May 21, 2015 at 1:10 PM, Cedric Doucet wrote: > Hello, > > I would like to loop on a list of libraries to download and install, by > calling the ExternalProject_Add command for each of these libraries. > To do that, I need to define some commands for each library, like > CONFIGURE_COMMAND, BUILD_COMMAND and INSTALL_COMMAND. > These commands may differ from one library to another; for example, some > of them may be based on make, or autoconfig, or cmake, etc. > Furthermore, some of these libraries may not need to be built. > > What is the good way to skip some steps? > Is it possible to use default values for some commands? > > The problem in my situation is that I have to fill in each command since I > want to design way of downloading and installing third party libraries. > To be clear, I wrote a loop which looks like this: > > ========================================================================== > foreach(LIBRARY IN LISTS NOT_FOUND_LIBRARIES) > ExternalProject_Add(${${LIBRARY}_LOWERNAME} > PREFIX ${${LIBRARY}_PREFIX} > URL ${${LIBRARY}_URL} > CONFIGURE_COMMAND > ${${LIBRARY}_CONFIGURE_COMMAND} > BUILD_COMMAND > ${${LIBRARY}_BUILD_COMMAND} > INSTALL_COMMAND > ${${LIBRARY}_INSTALL_COMMAND} > ) > endforeach(LIBRARY) > ========================================================================== > > However, if a library is based on cmake, I do not need to specify commands > for configuration and building. > Is it possible to say that the default value of CONFIGURE_COMMAND will be > used for example? > The only way I know to do that is to suppress the line > defining CONFIGURE_COMMAND but I can't do that since other libraries may > need to define it. > > To skip steps, I replace the corresponding command by 'ls' but it's not > very clean. > That is to say, the value of ${LIBRARY}_CONFIGURE_COMMAND is 'ls' when I > want to skip the configuration step. > > Thank you very much for your help. > > C?dric > > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cedric.doucet at inria.fr Thu May 21 07:43:42 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Thu, 21 May 2015 13:43:42 +0200 (CEST) Subject: [CMake] How to skip steps and use default values in ExternalProject_Add command? In-Reply-To: References: <178712264.6660598.1432205573561.JavaMail.zimbra@inria.fr> <440951913.6665578.1432206604087.JavaMail.zimbra@inria.fr> Message-ID: <584536943.6674284.1432208622420.JavaMail.zimbra@inria.fr> Hi Petr! Thank you for the trick: it's very powerful! Does this mean that these two calls are equivalent if I write: set(the_configure_command CONFIGURE_COMMAND) ? ExternalProject_Add(${${LIBRARY}_LOWERNAME} PREFIX ${${LIBRARY}_PREFIX} URL ${${LIBRARY}_URL} ${the_configure_command} ) ExternalProject_Add(${${LIBRARY}_LOWERNAME} PREFIX ${${LIBRARY}_PREFIX} URL ${${LIBRARY}_URL} ) I guess the default value of CONFIGURE_COMMAND will be used, right? C?dric ----- Mail original ----- > De: "Petr Kmoch" > ?: "Cedric Doucet" > Cc: cmake at cmake.org > Envoy?: Jeudi 21 Mai 2015 13:33:27 > Objet: Re: [CMake] How to skip steps and use default values in > ExternalProject_Add command? > Hi Cedric. > When doing things like that, remember that CMake's "named arguments" are > arguments just like any other. So you can easily obtain them from variable > expansion; something like this: > if(${LIBRARY}_CONFIGURE_COMMAND) > set(the_configure_command CONFIGURE_COMMAND ${${LIBRARY}_CONFIGURE_COMMAND}) > else() > set(the_configure_command "") > endif() > ExternalProject_Add(${${LIBRARY}_LOWERNAME} > PREFIX ${${LIBRARY}_PREFIX} > URL ${${LIBRARY}_URL} > ${the_configure_command} > BUILD_COMMAND ${${LIBRARY}_BUILD_COMMAND} > INSTALL_COMMAND ${${LIBRARY}_INSTALL_COMMAND} > ) > The same trick can be applied to any other command you need to conditionally > exclude, of course. > Petr > On Thu, May 21, 2015 at 1:10 PM, Cedric Doucet < cedric.doucet at inria.fr > > wrote: > > Hello, > > > I would like to loop on a list of libraries to download and install, by > > calling the ExternalProject_Add command for each of these libraries. > > > To do that, I need to define some commands for each library, like > > CONFIGURE_COMMAND, BUILD_COMMAND and INSTALL_COMMAND. > > > These commands may differ from one library to another; for example, some of > > them may be based on make, or autoconfig, or cmake, etc. > > > Furthermore, some of these libraries may not need to be built. > > > What is the good way to skip some steps? > > > Is it possible to use default values for some commands? > > > The problem in my situation is that I have to fill in each command since I > > want to design way of downloading and installing third party libraries. > > > To be clear, I wrote a loop which looks like this: > > > ========================================================================== > > > foreach(LIBRARY IN LISTS NOT_FOUND_LIBRARIES) > > > ExternalProject_Add(${${LIBRARY}_LOWERNAME} > > > PREFIX ${${LIBRARY}_PREFIX} > > > URL ${${LIBRARY}_URL} > > > CONFIGURE_COMMAND ${${LIBRARY}_CONFIGURE_COMMAND} > > > BUILD_COMMAND ${${LIBRARY}_BUILD_COMMAND} > > > INSTALL_COMMAND ${${LIBRARY}_INSTALL_COMMAND} > > > ) > > > endforeach(LIBRARY) > > > ========================================================================== > > > However, if a library is based on cmake, I do not need to specify commands > > for configuration and building. > > > Is it possible to say that the default value of CONFIGURE_COMMAND will be > > used for example? > > > The only way I know to do that is to suppress the line defining > > CONFIGURE_COMMAND but I can't do that since other libraries may need to > > define it. > > > To skip steps, I replace the corresponding command by 'ls' but it's not > > very > > clean. > > > That is to say, the value of ${LIBRARY}_CONFIGURE_COMMAND is 'ls' when I > > want > > to skip the configuration step. > > > Thank you very much for your help. > > > C?dric > > > -- > > > 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: > > > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From petr.kmoch at gmail.com Thu May 21 08:21:48 2015 From: petr.kmoch at gmail.com (Petr Kmoch) Date: Thu, 21 May 2015 14:21:48 +0200 Subject: [CMake] How to skip steps and use default values in ExternalProject_Add command? In-Reply-To: <584536943.6674284.1432208622420.JavaMail.zimbra@inria.fr> References: <178712264.6660598.1432205573561.JavaMail.zimbra@inria.fr> <440951913.6665578.1432206604087.JavaMail.zimbra@inria.fr> <584536943.6674284.1432208622420.JavaMail.zimbra@inria.fr> Message-ID: No idea on this one. The trick I showed is "vanilla CMake," a direct consequence of the CMake parsing & string processing algorithm. What you're asking is about the internals of ExternalProject_Add, of which I know nothing. Petr On Thu, May 21, 2015 at 1:43 PM, Cedric Doucet wrote: > > Hi Petr! > > Thank you for the trick: it's very powerful! > > Does this mean that these two calls are equivalent if I write: set(the_configure_command > CONFIGURE_COMMAND)? > > ExternalProject_Add(${${LIBRARY}_LOWERNAME} > PREFIX ${${LIBRARY}_PREFIX} > URL ${${LIBRARY}_URL} > ${the_configure_command} > ) > > ExternalProject_Add(${${LIBRARY}_LOWERNAME} > PREFIX ${${LIBRARY}_PREFIX} > URL ${${LIBRARY}_URL} > ) > > I guess the default value of CONFIGURE_COMMAND will be used, right? > > C?dric > > > ------------------------------ > > *De: *"Petr Kmoch" > *?: *"Cedric Doucet" > *Cc: *cmake at cmake.org > *Envoy?: *Jeudi 21 Mai 2015 13:33:27 > *Objet: *Re: [CMake] How to skip steps and use default values in > ExternalProject_Add command? > > > Hi Cedric. > > When doing things like that, remember that CMake's "named arguments" are > arguments just like any other. So you can easily obtain them from variable > expansion; something like this: > > if(${LIBRARY}_CONFIGURE_COMMAND) > set(the_configure_command CONFIGURE_COMMAND > ${${LIBRARY}_CONFIGURE_COMMAND}) > else() > set(the_configure_command "") > endif() > > ExternalProject_Add(${${LIBRARY}_LOWERNAME} > PREFIX ${${LIBRARY}_PREFIX} > URL ${${LIBRARY}_URL} > ${the_configure_command} > BUILD_COMMAND ${${LIBRARY}_BUILD_COMMAND} > INSTALL_COMMAND ${${LIBRARY}_INSTALL_COMMAND} > ) > > The same trick can be applied to any other command you need to > conditionally exclude, of course. > > Petr > > On Thu, May 21, 2015 at 1:10 PM, Cedric Doucet > wrote: > >> Hello, >> >> I would like to loop on a list of libraries to download and install, by >> calling the ExternalProject_Add command for each of these libraries. >> To do that, I need to define some commands for each library, like >> CONFIGURE_COMMAND, BUILD_COMMAND and INSTALL_COMMAND. >> These commands may differ from one library to another; for example, some >> of them may be based on make, or autoconfig, or cmake, etc. >> Furthermore, some of these libraries may not need to be built. >> >> What is the good way to skip some steps? >> Is it possible to use default values for some commands? >> >> The problem in my situation is that I have to fill in each command since >> I want to design way of downloading and installing third party libraries. >> To be clear, I wrote a loop which looks like this: >> >> ========================================================================== >> foreach(LIBRARY IN LISTS NOT_FOUND_LIBRARIES) >> ExternalProject_Add(${${LIBRARY}_LOWERNAME} >> PREFIX ${${LIBRARY}_PREFIX} >> URL ${${LIBRARY}_URL} >> CONFIGURE_COMMAND >> ${${LIBRARY}_CONFIGURE_COMMAND} >> BUILD_COMMAND >> ${${LIBRARY}_BUILD_COMMAND} >> INSTALL_COMMAND >> ${${LIBRARY}_INSTALL_COMMAND} >> ) >> endforeach(LIBRARY) >> ========================================================================== >> >> However, if a library is based on cmake, I do not need to specify >> commands for configuration and building. >> Is it possible to say that the default value of CONFIGURE_COMMAND will be >> used for example? >> The only way I know to do that is to suppress the line >> defining CONFIGURE_COMMAND but I can't do that since other libraries may >> need to define it. >> >> To skip steps, I replace the corresponding command by 'ls' but it's not >> very clean. >> That is to say, the value of ${LIBRARY}_CONFIGURE_COMMAND is 'ls' when I >> want to skip the configuration step. >> >> Thank you very much for your help. >> >> C?dric >> >> >> -- >> >> 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: >> http://public.kitware.com/mailman/listinfo/cmake >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cedric.doucet at inria.fr Thu May 21 08:31:32 2015 From: cedric.doucet at inria.fr (Cedric Doucet) Date: Thu, 21 May 2015 14:31:32 +0200 (CEST) Subject: [CMake] How to skip steps and use default values in ExternalProject_Add command? In-Reply-To: References: <178712264.6660598.1432205573561.JavaMail.zimbra@inria.fr> <440951913.6665578.1432206604087.JavaMail.zimbra@inria.fr> <584536943.6674284.1432208622420.JavaMail.zimbra@inria.fr> Message-ID: <958611155.6690932.1432211492892.JavaMail.zimbra@inria.fr> Thank you very much for your help, Petr! I will try it! Cheers, C?dric ----- Mail original ----- > De: "Petr Kmoch" > ?: "Cedric Doucet" > Cc: cmake at cmake.org > Envoy?: Jeudi 21 Mai 2015 14:21:48 > Objet: Re: [CMake] How to skip steps and use default values in > ExternalProject_Add command? > No idea on this one. The trick I showed is "vanilla CMake," a direct > consequence of the CMake parsing & string processing algorithm. What you're > asking is about the internals of ExternalProject_Add, of which I know > nothing. > Petr > On Thu, May 21, 2015 at 1:43 PM, Cedric Doucet < cedric.doucet at inria.fr > > wrote: > > Hi Petr! > > > Thank you for the trick: it's very powerful! > > > Does this mean that these two calls are equivalent if I write: > > set(the_configure_command CONFIGURE_COMMAND) ? > > > ExternalProject_Add(${${LIBRARY}_LOWERNAME} > > > PREFIX ${${LIBRARY}_PREFIX} > > > URL ${${LIBRARY}_URL} > > > ${the_configure_command} > > > ) > > > ExternalProject_Add(${${LIBRARY}_LOWERNAME} > > > PREFIX ${${LIBRARY}_PREFIX} > > > URL ${${LIBRARY}_URL} > > > ) > > > I guess the default value of CONFIGURE_COMMAND will be used, right? > > > C?dric > > > > De: "Petr Kmoch" < petr.kmoch at gmail.com > > > > > > > ?: "Cedric Doucet" < cedric.doucet at inria.fr > > > > > > > Cc: cmake at cmake.org > > > > > > Envoy?: Jeudi 21 Mai 2015 13:33:27 > > > > > > Objet: Re: [CMake] How to skip steps and use default values in > > > ExternalProject_Add command? > > > > > > Hi Cedric. > > > > > > When doing things like that, remember that CMake's "named arguments" are > > > arguments just like any other. So you can easily obtain them from > > > variable > > > expansion; something like this: > > > > > > if(${LIBRARY}_CONFIGURE_COMMAND) > > > > > > set(the_configure_command CONFIGURE_COMMAND > > > ${${LIBRARY}_CONFIGURE_COMMAND}) > > > > > > else() > > > > > > set(the_configure_command "") > > > > > > endif() > > > > > > ExternalProject_Add(${${LIBRARY}_LOWERNAME} > > > > > > PREFIX ${${LIBRARY}_PREFIX} > > > > > > URL ${${LIBRARY}_URL} > > > > > > ${the_configure_command} > > > > > > BUILD_COMMAND ${${LIBRARY}_BUILD_COMMAND} > > > > > > INSTALL_COMMAND ${${LIBRARY}_INSTALL_COMMAND} > > > > > > ) > > > > > > The same trick can be applied to any other command you need to > > > conditionally > > > exclude, of course. > > > > > > Petr > > > > > > On Thu, May 21, 2015 at 1:10 PM, Cedric Doucet < cedric.doucet at inria.fr > > > > wrote: > > > > > > > Hello, > > > > > > > > > > I would like to loop on a list of libraries to download and install, by > > > > calling the ExternalProject_Add command for each of these libraries. > > > > > > > > > > To do that, I need to define some commands for each library, like > > > > CONFIGURE_COMMAND, BUILD_COMMAND and INSTALL_COMMAND. > > > > > > > > > > These commands may differ from one library to another; for example, > > > > some > > > > of > > > > them may be based on make, or autoconfig, or cmake, etc. > > > > > > > > > > Furthermore, some of these libraries may not need to be built. > > > > > > > > > > What is the good way to skip some steps? > > > > > > > > > > Is it possible to use default values for some commands? > > > > > > > > > > The problem in my situation is that I have to fill in each command > > > > since > > > > I > > > > want to design way of downloading and installing third party libraries. > > > > > > > > > > To be clear, I wrote a loop which looks like this: > > > > > > > > > > ========================================================================== > > > > > > > > > > foreach(LIBRARY IN LISTS NOT_FOUND_LIBRARIES) > > > > > > > > > > ExternalProject_Add(${${LIBRARY}_LOWERNAME} > > > > > > > > > > PREFIX ${${LIBRARY}_PREFIX} > > > > > > > > > > URL ${${LIBRARY}_URL} > > > > > > > > > > CONFIGURE_COMMAND ${${LIBRARY}_CONFIGURE_COMMAND} > > > > > > > > > > BUILD_COMMAND ${${LIBRARY}_BUILD_COMMAND} > > > > > > > > > > INSTALL_COMMAND ${${LIBRARY}_INSTALL_COMMAND} > > > > > > > > > > ) > > > > > > > > > > endforeach(LIBRARY) > > > > > > > > > > ========================================================================== > > > > > > > > > > However, if a library is based on cmake, I do not need to specify > > > > commands > > > > for configuration and building. > > > > > > > > > > Is it possible to say that the default value of CONFIGURE_COMMAND will > > > > be > > > > used for example? > > > > > > > > > > The only way I know to do that is to suppress the line defining > > > > CONFIGURE_COMMAND but I can't do that since other libraries may need to > > > > define it. > > > > > > > > > > To skip steps, I replace the corresponding command by 'ls' but it's not > > > > very > > > > clean. > > > > > > > > > > That is to say, the value of ${LIBRARY}_CONFIGURE_COMMAND is 'ls' when > > > > I > > > > want > > > > to skip the configuration step. > > > > > > > > > > Thank you very much for your help. > > > > > > > > > > C?dric > > > > > > > > > > -- > > > > > > > > > > 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: > > > > > > > > > > http://public.kitware.com/mailman/listinfo/cmake > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From taylor at braun-jones.org Thu May 21 11:10:57 2015 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Thu, 21 May 2015 11:10:57 -0400 Subject: [CMake] Ninja generator: skip checking of dependencies when building a target Message-ID: Does the CMake Ninja generator support a way to skip dependencies when building a target? Something like the target_name/fast feature for the Makefile generator? [1] Thanks, Taylor [1] http://www.cmake.org/Wiki/CMake_FAQ#Is_there_a_way_to_skip_checking_of_dependent_libraries_when_compiling.3F -------------- next part -------------- An HTML attachment was scrubbed... URL: From gabriele.greco at darts.it Thu May 21 12:02:43 2015 From: gabriele.greco at darts.it (Gabriele Greco) Date: Thu, 21 May 2015 18:02:43 +0200 Subject: [CMake] Always build a source file Message-ID: Hi guys, I'm a long time lurker but I've never wrote here also if I'm using cmake since a few years. What is the clean way to enforce the compilation of a selected source file every time I build it (also if not changed)? I do it this way: add_custom_command(TARGET mytarget POST_BUILD COMMAND touch ${CMAKE_CURRENT_SOURCE_DIR}/ver.cpp) ... that works, but it seems not very clean, I thought it could be possible modifying source file properties with: set_source_file_properties(ver.cpp ...) But I've not found a "FORCE" property or anything remotely similar (at least in the 2.8.12 manual, that is the cmake version I'm using for platform 'purity' issues...) -- Ing. Gabriele Greco, DARTS Engineering -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lucas.Pettey at engilitycorp.com Thu May 21 18:00:12 2015 From: Lucas.Pettey at engilitycorp.com (Lucas.Pettey at engilitycorp.com) Date: Thu, 21 May 2015 22:00:12 +0000 Subject: [CMake] (no subject) Message-ID: <45BF0169B950CD4A97DC5223BB2B44B33A53F695@VACH-MX1.EGL.ENGILITYCORP.COM> Hello, I am trying to compile a code written in C, but using an external library that contains C++ functions. I am on a Cray system and everything works if I manually link with the cray CC wrapper. When I change the linker language with this command: set_property(TARGET adh PROPERTY LINKER_LANGUAGE CXX) CMake is using the CC wrapper, but adding -lstdc++ to the link line. This causes an error. Can anyone tell me how to not get this added library? Thanks, Lucas Pettey, PhD HPCMP PETTT EQM CTA Lead ERDC-DSRC OnSite Vicksburg, MS 512-297-9833 Mobile (preferred) 601-634-2980 Office lucas.pettey at engilitycorp.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From steveire at gmail.com Thu May 21 18:08:43 2015 From: steveire at gmail.com (Stephen Kelly) Date: Fri, 22 May 2015 00:08:43 +0200 Subject: [CMake] Ninja generator: skip checking of dependencies when building a target References: Message-ID: Taylor Braun-Jones wrote: > Does the CMake Ninja generator support a way to skip dependencies when > building a target? Something like the target_name/fast feature for the > Makefile generator? [1] I believe the last time that was raised was http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/3471/focus=3483 If you have new information, feel free to file a bug and link to that. Thanks, Steve. From dan at su-root.co.uk Fri May 22 08:19:10 2015 From: dan at su-root.co.uk (Dan Liew) Date: Fri, 22 May 2015 13:19:10 +0100 Subject: [CMake] (no subject) In-Reply-To: <45BF0169B950CD4A97DC5223BB2B44B33A53F695@VACH-MX1.EGL.ENGILITYCORP.COM> References: <45BF0169B950CD4A97DC5223BB2B44B33A53F695@VACH-MX1.EGL.ENGILITYCORP.COM> Message-ID: Hi, On 21 May 2015 at 23:00, wrote: > Hello, > > I am trying to compile a code written in C, but using an external library > that contains C++ functions. I am on a Cray system and everything works if I > manually link with the cray CC wrapper. When I change the linker language > with this command: > > set_property(TARGET adh PROPERTY LINKER_LANGUAGE CXX) > > CMake is using the CC wrapper, but adding -lstdc++ to the link line. This > causes an error. Can anyone tell me how to not get this added library? Why are you telling CMake that the linker language is C++ in the target you are building is C code? The C code you are compiling be must calling into extern "C" functions in the external library you mention which means the linker (at compile time) should not need to know about C++ at all. At runtime the linker needs to know that your external library depends on C++ but you don't need to be concerned with this because when your external library was built those dependencies end up in the shared library. E.g. ``` $ readelf -d /usr/lib/libboost_program_options.so ... Tag Type Name/Value ... 0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6] ... ``` Does your target build if you just leave LINKER_LANGUAGE alone (i.e. set C)? I would expect that it would. Thanks, Dan. From Lucas.Pettey at engilitycorp.com Fri May 22 11:11:41 2015 From: Lucas.Pettey at engilitycorp.com (Lucas.Pettey at engilitycorp.com) Date: Fri, 22 May 2015 15:11:41 +0000 Subject: [CMake] (no subject) In-Reply-To: References: <45BF0169B950CD4A97DC5223BB2B44B33A53F695@VACH-MX1.EGL.ENGILITYCORP.COM>, Message-ID: <45BF0169B950CD4A97DC5223BB2B44B33A540711@VACH-MX1.EGL.ENGILITYCORP.COM> The Cray system requires static libraries, so all symbols are defined during the linking process. Leaving out the LINKER_LANGUAGE CXX statement, CMake sees all the source files as C files, uses the C linker and I get undefined symbol errors. Manually linking with the C++ linker but excluding the -lstdc++ flag generates an executable. I really just need CMake to use the C++ linker without adding that flag. Thanks, Lucas Pettey, PhD HPCMP PETTT EQM CTA Lead ERDC-DSRC OnSite Vicksburg, MS 512-297-9833 Mobile (preferred) 601-634-2980 Office lucas.pettey at engilitycorp.com ________________________________________ From: Dan Liew [dan at su-root.co.uk] Sent: Friday, May 22, 2015 7:19 AM To: Pettey, Lucas @ EngilityCorp Cc: cmake at cmake.org Subject: Re: [CMake] (no subject) Hi, On 21 May 2015 at 23:00, wrote: > Hello, > > I am trying to compile a code written in C, but using an external library > that contains C++ functions. I am on a Cray system and everything works if I > manually link with the cray CC wrapper. When I change the linker language > with this command: > > set_property(TARGET adh PROPERTY LINKER_LANGUAGE CXX) > > CMake is using the CC wrapper, but adding -lstdc++ to the link line. This > causes an error. Can anyone tell me how to not get this added library? Why are you telling CMake that the linker language is C++ in the target you are building is C code? The C code you are compiling be must calling into extern "C" functions in the external library you mention which means the linker (at compile time) should not need to know about C++ at all. At runtime the linker needs to know that your external library depends on C++ but you don't need to be concerned with this because when your external library was built those dependencies end up in the shared library. E.g. ``` $ readelf -d /usr/lib/libboost_program_options.so ... Tag Type Name/Value ... 0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6] ... ``` Does your target build if you just leave LINKER_LANGUAGE alone (i.e. set C)? I would expect that it would. Thanks, Dan. From bronger at physik.rwth-aachen.de Sat May 23 06:24:11 2015 From: bronger at physik.rwth-aachen.de (Torsten Bronger) Date: Sat, 23 May 2015 12:24:11 +0200 Subject: [CMake] How to install Python3 package? Message-ID: <874mn3h9ro.fsf@physik.rwth-aachen.de> Hall?chen! I have a very simple Python 3 package that I want to install in the Python path with CMake. For example on Ubuntu, I'd like to install it in /usr/lib/python3/dist-packages. Anyway, assuming the Python module is in mypackage/mymodule.py, the lines from mypackage import mymodule must work fine after the installation. I could execute python3 -c "import site; print(site.getsitepackages()[0])" and store the result in a CMake variable, but is this the way to go? I have also found http://bloerg.net/2012/11/10/cmake-and-distutils.html but it is awkward IMO. Tsch?, Torsten. -- Torsten Bronger Jabber ID: torsten.bronger at jabber.rwth-aachen.de From stanlyzam at gmail.com Sun May 24 14:41:12 2015 From: stanlyzam at gmail.com (stanlyzam at gmail.com) Date: Sun, 24 May 2015 13:41:12 -0500 Subject: [CMake] stanlyzam@gmail.com has indicated you're a friend. Accept? Message-ID: <0.0.1C.F6B.1D09650521507C4.2D44@mail6.flipmailer.com> Hi, stanlyzam at gmail.com wants to follow you. ****** Is stanlyzam at gmail.com you friend? ****** If Yes please follow the link below: http://invites.flipmailer.com/signup_e.html?fullname=&email=cmake at cmake.org&invitername=stanly&inviterid=4351604&userid=0&token=0&emailmasterid=626ad2e3-baaa-428e-b5d2-8dc44d902982&from=stanlyzam at gmail.com&template=invite_reg_a&test=AA&src=txt_yes If No please follow the link below: http://invites.flipmailer.com/signup_e.html?fullname=&email=cmake at cmake.org&invitername=stanly&inviterid=4351604&userid=0&token=0&emailmasterid=626ad2e3-baaa-428e-b5d2-8dc44d902982&from=stanlyzam at gmail.com&template=invite_reg_a&test=AA&src=txt_no Follow the link below to remove yourself from all such emails http://invites.flipmailer.com/uns_inviter.jsp?email=cmake at cmake.org&iid=626ad2e3-baaa-428e-b5d2-8dc44d902982&from=stanlyzam at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From steveire at gmail.com Mon May 25 06:08:29 2015 From: steveire at gmail.com (Stephen Kelly) Date: Mon, 25 May 2015 12:08:29 +0200 Subject: [CMake] Setting install dir based on Debug or Release References: Message-ID: Scott Aron Bloom wrote: > The problem I see, is the code only gets executed once, and at that point > the CMAKE_BUILD_TYPE isn't set yet.. Yes I realize this for windows, so > it is a multi-config system.. but I cant believe Im the only one with this > issue. See http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/52088/focus=52095 Thanks, Steve. From davidh at netacquire.com Mon May 25 16:04:35 2015 From: davidh at netacquire.com (David Hauck) Date: Mon, 25 May 2015 20:04:35 +0000 Subject: [CMake] Per Target CMAKE_C??_FLAGS Reset/Redefinition Message-ID: Hi, I've been searching for a definitive discussion of this but haven't been successful finding it. I have a (Unix Makefile) CMakeLists.txt project sub-directory that defines several (3) targets (for executable and shared targets). I'm trying to reset/redefine the CMAKE_C??_FLAGS (specifically CMAKE_C_FLAGS) property on one of the targets via the following statement in the CMakeLists.txt file: set_property(TARGET PROPERTY CMAKE_C_FLAGS "-Wall -shared") set_property(TARGET PROPERTY CMAKE_C_FLAGS_DEBUG "-g") set_property(TARGET PROPERTY CMAKE_C_FLAGS_RELEASE "-O3") However, this isn't working and the resulting target compilation is using the directory's value for these properties. Other redefinitions of per-target properties (e.g., INCLUDE_DIRECTORIES) do seem to take so I'm wondering if certain properties are per-directory only and aren't meaningful with the "set_property(TARGET ...)" construct? If I move the target to its own sub-directory and use the following CMakeLists.txt commands instead the compile flags are properly (re)set: SET (CMAKE_C_FLAGS "-Wall -shared") SET (CMAKE_C_FLAGS_DEBUG "-g") SET (CMAKE_C_FLAGS_RELEASE "-O3") Oddly the aforementioned "set_property(TARGET..." constructs in place of the above "SET(CMAKE..." constructs also fail to reset the flags in this new directory so this doesn't seem related to the sub-directory CMakeLists.txt file when multiple targets are defined. I must have missed something obvious related to this in the documentation and/or the mailing list/Google. Any ideas? Thanks, -David From mpaluru at gmail.com Tue May 26 14:07:03 2015 From: mpaluru at gmail.com (Murali Paluru) Date: Tue, 26 May 2015 11:07:03 -0700 Subject: [CMake] Per Target CMAKE_C??_FLAGS Reset/Redefinition In-Reply-To: References: Message-ID: Hi David, The project that I am working on has similar needs of having different flags for each target. I have placed the different targets in different sub-folders and set the CMAKE_*_FLAGS. This approach seems to work fine as you mentioned. >From my understanding, a new add_subdirectory creates a new scope of variables. I feel that having different targets in different directories is a good logical separation. So if that's working for you, why not use it? I am not sure if there is a better way, but I hope someone will comment. Regards, Murali. On Mon, May 25, 2015 at 1:04 PM, David Hauck wrote: > Hi, > > I've been searching for a definitive discussion of this but haven't been > successful finding it. I have a (Unix Makefile) CMakeLists.txt project > sub-directory that defines several (3) targets (for executable and shared > targets). I'm trying to reset/redefine the CMAKE_C??_FLAGS (specifically > CMAKE_C_FLAGS) property on one of the targets via the following statement > in the CMakeLists.txt file: > > set_property(TARGET PROPERTY CMAKE_C_FLAGS "-Wall -shared") > set_property(TARGET PROPERTY CMAKE_C_FLAGS_DEBUG "-g") > set_property(TARGET PROPERTY CMAKE_C_FLAGS_RELEASE "-O3") > > However, this isn't working and the resulting target compilation is using > the directory's value for these properties. Other redefinitions of > per-target properties (e.g., INCLUDE_DIRECTORIES) do seem to take so I'm > wondering if certain properties are per-directory only and aren't > meaningful with the "set_property(TARGET ...)" construct? > > If I move the target to its own sub-directory and use the following > CMakeLists.txt commands instead the compile flags are properly (re)set: > > SET (CMAKE_C_FLAGS "-Wall -shared") > SET (CMAKE_C_FLAGS_DEBUG "-g") > SET (CMAKE_C_FLAGS_RELEASE "-O3") > > Oddly the aforementioned "set_property(TARGET..." constructs in place of > the above "SET(CMAKE..." constructs also fail to reset the flags in this > new directory so this doesn't seem related to the sub-directory > CMakeLists.txt file when multiple targets are defined. > > I must have missed something obvious related to this in the documentation > and/or the mailing list/Google. Any ideas? > > Thanks, > -David > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From d3ck0r at gmail.com Tue May 26 14:21:45 2015 From: d3ck0r at gmail.com (J Decker) Date: Tue, 26 May 2015 11:21:45 -0700 Subject: [CMake] Per Target CMAKE_C??_FLAGS Reset/Redefinition In-Reply-To: References: Message-ID: SET_TARGET_PROPERTIES( PROPERTIES COMPILE_FLAGS "${ExtraFlags}" COMPILE_DEFINITIONS "SIMPLE_FLAG;DEFINED_SYMBOL=xxxx;DEFINED_STRING=\"string value\"" ) On Tue, May 26, 2015 at 11:07 AM, Murali Paluru wrote: > Hi David, > > The project that I am working on has similar needs of having different > flags for each target. I have placed the different targets in different > sub-folders and set the CMAKE_*_FLAGS. This approach seems to work fine as > you mentioned. > > From my understanding, a new add_subdirectory creates a new scope of > variables. > > I feel that having different targets in different directories is a good > logical separation. So if that's working for you, why not use it? I am not > sure if there is a better way, but I hope someone will comment. > > Regards, > Murali. > > On Mon, May 25, 2015 at 1:04 PM, David Hauck > wrote: > >> Hi, >> >> I've been searching for a definitive discussion of this but haven't been >> successful finding it. I have a (Unix Makefile) CMakeLists.txt project >> sub-directory that defines several (3) targets (for executable and shared >> targets). I'm trying to reset/redefine the CMAKE_C??_FLAGS (specifically >> CMAKE_C_FLAGS) property on one of the targets via the following statement >> in the CMakeLists.txt file: >> >> set_property(TARGET PROPERTY CMAKE_C_FLAGS "-Wall -shared") >> set_property(TARGET PROPERTY CMAKE_C_FLAGS_DEBUG "-g") >> set_property(TARGET PROPERTY CMAKE_C_FLAGS_RELEASE "-O3") >> >> However, this isn't working and the resulting target compilation is using >> the directory's value for these properties. Other redefinitions of >> per-target properties (e.g., INCLUDE_DIRECTORIES) do seem to take so I'm >> wondering if certain properties are per-directory only and aren't >> meaningful with the "set_property(TARGET ...)" construct? >> >> If I move the target to its own sub-directory and use the following >> CMakeLists.txt commands instead the compile flags are properly (re)set: >> >> SET (CMAKE_C_FLAGS "-Wall -shared") >> SET (CMAKE_C_FLAGS_DEBUG "-g") >> SET (CMAKE_C_FLAGS_RELEASE "-O3") >> >> Oddly the aforementioned "set_property(TARGET..." constructs in place of >> the above "SET(CMAKE..." constructs also fail to reset the flags in this >> new directory so this doesn't seem related to the sub-directory >> CMakeLists.txt file when multiple targets are defined. >> >> I must have missed something obvious related to this in the documentation >> and/or the mailing list/Google. Any ideas? >> >> Thanks, >> -David >> >> -- >> >> 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: >> http://public.kitware.com/mailman/listinfo/cmake >> > > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mlakata at pacificbiosciences.com Tue May 26 14:23:59 2015 From: mlakata at pacificbiosciences.com (Mark Lakata) Date: Tue, 26 May 2015 18:23:59 +0000 Subject: [CMake] fatal error with Cmake 3.2.2 running on NFS system, resolved if --debug-trycompile is given Message-ID: <1902C87AEA59044B93A0F007C128D23BD2A469@DC-EXCHMBX02.Nanofluidics.com> If I run cmake 3.2.2 normally, I get errors like this: CMake Error: Remove failed on file: /home/UNIXHOME/mlakata/p4/acq/Sequel/basewriter/build/x86_64/Debug/CMakeFiles/CMakeTmp/.nfs000000000786c4ec0000398c: System Error: No such file or directory If it was just a warning, I would ignore it, but it is a fatal error that causes cmake to not finish generating the Makefiles. If I run 'cmake --debug-trycompile ...' , the errors go away. Or, if I rerun 'cmake .' the problem does not occur again (I assume due to cached results). It appears that the try_compile stage is trying to delete temporary files but failing at it due to a timing issue. I'm running on CentOS7. I haven't seen this problem before when I was running cmake 2.8.11. I used the 'cmake-3.2.2-Linux-x86_64.tar.gz' download and copied it to /opt as my test installation. -Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From mpaluru at gmail.com Tue May 26 14:31:49 2015 From: mpaluru at gmail.com (Murali Paluru) Date: Tue, 26 May 2015 11:31:49 -0700 Subject: [CMake] Question about loading Toolchain files Message-ID: Hi, The current way of specifying a toolchain file is during the configure step via the command line. mkdir /tmp/build && cd /tmp/build cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchain.cmake /path/to/source In the project that I am working on I need to load different toolchain files depending on the application/target I need to build. For that reason, I set the CMAKE_*_COMPILER before I call the project(). But if I want to figure out the host system and load the toolchain based on that it's not possible. CMAKE_SYSTEM_NAME is available only after project() call is finished. Is there anyway I can figure out the host information before the call to project()? What I would like to do: include(toolchain-${CMAKE_SYSTEM_NAME}-${MYPRODUCT_ARCH}.cmake) project(myproject) add_subdirectory(src) Regards, Murali. -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidh at netacquire.com Tue May 26 14:43:04 2015 From: davidh at netacquire.com (David Hauck) Date: Tue, 26 May 2015 18:43:04 +0000 Subject: [CMake] Per Target CMAKE_C??_FLAGS Reset/Redefinition In-Reply-To: References: Message-ID: Hi Murali, On Tuesday, May 26, 2015 11:07 AM, muralisrsai at gmail.com wrote: > Hi David, > > The project that I am working on has similar needs of having different > flags for each target. I have placed the different targets in > different sub-folders and set the CMAKE_*_FLAGS. This approach seems > to work fine as you mentioned. > > From my understanding, a new add_subdirectory creates a new scope of > variables. > > I feel that having different targets in different directories is a > good logical separation. So if that's working for you, why not use it? I'm fine using this alternate method. However: 1) it wasn't my first choice, and 2) there didn't seem to be anything obvious that documented why/whether this wouldn't be supported. As such, wrt #2, I spent a chunk of time trying to figure out why it wasn't working. Perhaps others have fought this as well? If so, my suggestion would be to either: a) support it (assuming this isn't obviously not possible), or b) document that it's not supported (apologies if this already exists somewhere and I've missed it!). Thanks, -David > I am not sure if there is a better way, but I hope someone will comment. > > Regards, > Murali. > > On Mon, May 25, 2015 at 1:04 PM, David Hauck > wrote: > > > Hi, > > I've been searching for a definitive discussion of this but haven't > been successful finding it. I have a (Unix Makefile) CMakeLists.txt > project sub-directory that defines several (3) targets (for executable > and shared targets). I'm trying to reset/redefine the CMAKE_C??_FLAGS > (specifically CMAKE_C_FLAGS) property on one of the targets via the > following statement in the CMakeLists.txt file: > > set_property(TARGET PROPERTY CMAKE_C_FLAGS "-Wall > -shared") set_property(TARGET PROPERTY > CMAKE_C_FLAGS_DEBUG "-g") set_property(TARGET PROPERTY > CMAKE_C_FLAGS_RELEASE "-O3") > > However, this isn't working and the resulting target compilation is > using the directory's value for these properties. Other redefinitions > of per- target properties (e.g., INCLUDE_DIRECTORIES) do seem to take > so I'm wondering if certain properties are per-directory only and > aren't meaningful with the "set_property(TARGET ...)" construct? > > If I move the target to its own sub-directory and use the following > CMakeLists.txt commands instead the compile flags are properly (re)set: > > SET (CMAKE_C_FLAGS "-Wall -shared") > SET (CMAKE_C_FLAGS_DEBUG "-g") > SET (CMAKE_C_FLAGS_RELEASE "-O3") > > Oddly the aforementioned "set_property(TARGET..." constructs in place > of the above "SET(CMAKE..." constructs also fail to reset the flags in > this new directory so this doesn't seem related to the sub-directory > CMakeLists.txt file when multiple targets are defined. > > I must have missed something obvious related to this in the > documentation and/or the mailing list/Google. Any ideas? > > Thanks, > -David > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > > From davidh at netacquire.com Tue May 26 14:44:52 2015 From: davidh at netacquire.com (David Hauck) Date: Tue, 26 May 2015 18:44:52 +0000 Subject: [CMake] Per Target CMAKE_C??_FLAGS Reset/Redefinition In-Reply-To: References: Message-ID: Hi Decker, On Tuesday, May 26, 2015 11:22 AM, CMake wrote: > SET_TARGET_PROPERTIES( PROPERTIES > COMPILE_FLAGS "${ExtraFlags}" > COMPILE_DEFINITIONS > "SIMPLE_FLAG;DEFINED_SYMBOL=xxxx;DEFINED_STRING=\"string value\"" > ) I'm not sure if this was meant as a solution, but I doubt the above works; these simply *add* to the compile flags, they don't allow for completely replacing/resetting them... Thanks, -David > On Tue, May 26, 2015 at 11:07 AM, Murali Paluru > wrote: > > > Hi David, > > The project that I am working on has similar needs of having > different flags for each target. I have placed the different targets > in different sub- folders and set the CMAKE_*_FLAGS. This approach > seems to work fine as you mentioned. > > From my understanding, a new add_subdirectory creates a new scope of > variables. > > I feel that having different targets in different directories is a > good logical separation. So if that's working for you, why not use it? > I am not sure if there is a better way, but I hope someone will comment. > > Regards, > Murali. > > On Mon, May 25, 2015 at 1:04 PM, David Hauck > wrote: > > > Hi, > > I've been searching for a definitive discussion of this but haven't > been successful finding it. I have a (Unix Makefile) CMakeLists.txt > project sub-directory that defines several (3) targets (for executable > and shared targets). I'm trying to reset/redefine the CMAKE_C??_FLAGS > (specifically CMAKE_C_FLAGS) property on one of the targets via the > following statement in the CMakeLists.txt file: > > set_property(TARGET PROPERTY CMAKE_C_FLAGS "-Wall > -shared") set_property(TARGET PROPERTY > CMAKE_C_FLAGS_DEBUG "-g") set_property(TARGET PROPERTY > CMAKE_C_FLAGS_RELEASE "-O3") > > However, this isn't working and the resulting target compilation is > using the directory's value for these properties. Other redefinitions > of per-target properties (e.g., INCLUDE_DIRECTORIES) do seem to take > so I'm wondering if certain properties are per-directory only and > aren't meaningful with the "set_property(TARGET ...)" > construct? > > If I move the target to its own sub-directory and use the following > CMakeLists.txt commands instead the compile flags are properly (re)set: > > SET (CMAKE_C_FLAGS "-Wall -shared") > SET (CMAKE_C_FLAGS_DEBUG "-g") > SET (CMAKE_C_FLAGS_RELEASE "-O3") > > Oddly the aforementioned "set_property(TARGET..." > constructs in place of the above "SET(CMAKE..." constructs also fail > to reset the flags in this new directory so this doesn't seem related > to the sub- directory CMakeLists.txt file when multiple targets are defined. > > I must have missed something obvious related to this in the > documentation and/or the mailing list/Google. Any ideas? > > Thanks, > -David > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > > > > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake > > From tom.kacvinsky at vectorcast.com Tue May 26 17:31:59 2015 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Tue, 26 May 2015 17:31:59 -0400 Subject: [CMake] -Wno-dev not working? Message-ID: Using cmake 2.8.11.2 built from source on Linux. I am using -Wno-dev at generation time: CC=gcc cmake -Wno-dev .. but I see messages like this: Warning: Source file "license_mailer_pkg.ads" is listed multiple times for target "license_gen" I thought -Wno-dev would turn this off. This is an expected warning given the setup I have and I want to suppress it so as not to confuse other developers. What am I missing? Thanks, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.king at kitware.com Wed May 27 13:24:58 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 27 May 2015 13:24:58 -0400 Subject: [CMake] fatal error with Cmake 3.2.2 running on NFS system, resolved if --debug-trycompile is given In-Reply-To: <1902C87AEA59044B93A0F007C128D23BD2A469@DC-EXCHMBX02.Nanofluidics.com> References: <1902C87AEA59044B93A0F007C128D23BD2A469@DC-EXCHMBX02.Nanofluidics.com> Message-ID: <5565FDEA.8050102@kitware.com> On 05/26/2015 02:23 PM, Mark Lakata wrote: > CMake Error: Remove failed on file: /.../CMakeTmp/.nfs000000000786c4ec0000398c: > System Error: No such file or directory I'll work on changes to teach CMake to tolerate ENOENT here in case it loses a race like this. Thanks, -Brad From brad.king at kitware.com Wed May 27 13:36:42 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 27 May 2015 13:36:42 -0400 Subject: [CMake] Linking C program to external C++ library In-Reply-To: <45BF0169B950CD4A97DC5223BB2B44B33A53F695@VACH-MX1.EGL.ENGILITYCORP.COM> References: <45BF0169B950CD4A97DC5223BB2B44B33A53F695@VACH-MX1.EGL.ENGILITYCORP.COM> Message-ID: <556600AA.3030505@kitware.com> On 05/21/2015 06:00 PM, Lucas.Pettey at engilitycorp.com wrote: > I am trying to compile a code written in C, but using an external > library that contains C++ functions. I am on a Cray system and > everything works if I manually link with the cray CC wrapper. > When I change the linker language with this command: > > set_property(TARGET adh PROPERTY LINKER_LANGUAGE CXX) > > CMake is using the CC wrapper, but adding -lstdc++ to the link line. > This causes an error. Can anyone tell me how to not get this added library? CMake detects the libraries implicitly added by the compiler front-end for each language. When mixing languages it chooses to link using the compiler front-end for one of the languages and adds the implicit libraries needed for other languages and not added by the chosen one. This case looks strange because you are telling it to link with the C++ compiler but CMake is still adding the implicit library for C++. Look at CMakeFiles/${CMAKE_VERSION}/CMake*Compiler.cmake for details of the compiler detected for each language. Look for these variables: CMAKE_C_COMPILER CMAKE_C_IMPLICIT_LINK_LIBRARIES CMAKE_CXX_COMPILER CMAKE_CXX_IMPLICIT_LINK_LIBRARIES To what are they set? Thanks, -Brad From khouli at gmail.com Wed May 27 13:48:54 2015 From: khouli at gmail.com (Kevin Houlihan) Date: Wed, 27 May 2015 13:48:54 -0400 Subject: [CMake] Migrating from another build system that maintains its own source file lists Message-ID: Hello, I want to migrate from a build system that has its own lists of source files that must be maintained for the time being. I have scripts to translate those list files into CMakeLists.txt files but I don't know of a good way to integrate those into a CMake generated build system and keep the generated CMakeLists.txt files up to date with the files they were generated from. My current solution is to use a Makefile to check to see if the CMakeLists.txt files need to be updated as part of the build. This is a bit clumsy. The issue seems similar to the problem of using file globbing in CMakeLIsts.txt files and as far as I know, the answer there is "don't do that". Still I thought I'd try my luck. Any suggestions? -------------- next part -------------- An HTML attachment was scrubbed... URL: From irwin at beluga.phys.uvic.ca Wed May 27 14:17:24 2015 From: irwin at beluga.phys.uvic.ca (Alan W. Irwin) Date: Wed, 27 May 2015 11:17:24 -0700 (PDT) Subject: [CMake] Migrating from another build system that maintains its own source file lists In-Reply-To: References: Message-ID: On 2015-05-27 13:48-0400 Kevin Houlihan wrote: > Hello, > > I want to migrate from a build system that has its own lists of source > files that must be maintained for the time being. I have scripts to > translate those list files into CMakeLists.txt files but I don't know of a > good way to integrate those into a CMake generated build system and keep > the generated CMakeLists.txt files up to date with the files they were > generated from. > > My current solution is to use a Makefile to check to see if the > CMakeLists.txt files need to be updated as part of the build. This is a bit > clumsy. > > The issue seems similar to the problem of using file globbing in > CMakeLIsts.txt files and as far as I know, the answer there is "don't do > that". Still I thought I'd try my luck. > > Any suggestions? Use a CMake list of files, and maintain that, e.g., set(lib_SRC_FILE_LIST a.c b.c c.c [...] ) add_library(lib ${lib_SRC_FILE_LIST}) or if there are thousands of files in the list and you don't want to disrupt the logic of your principal CMakeLists.txt files with lists scattered all over within the file, then look at the include(...) command which will include CMake source code from a file (say completely devoted to the above list creation command). Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ -------------- next part -------------- -- 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: http://public.kitware.com/mailman/listinfo/cmake From karasevpa at gmail.com Wed May 27 23:37:33 2015 From: karasevpa at gmail.com (Peter Karasev) Date: Wed, 27 May 2015 20:37:33 -0700 Subject: [CMake] cmake 3.x + vs2013, "unknown compiler", re: bug 15057 Message-ID: I encountered a situation like described here: https://public.kitware.com/Bug/view.php?id=15057 The bug seems to be closed as "not reproducible"; here is one way to cause it: 1. Have %PATH% environment variable contain C:/cygdrive/bin , which also contains a copy of cmake 2.x (for me it was 2.8.12) 2. Invoke cmake-gui.exe from cmake version 3.x 3. try to generate VS2013 solution, it fails saying unknown compiler. The workaround is to purge your PATH environment variable so that no copies of cmake.exe are there. ? ? It still feels like a bug ? that could be fixed? ; why should cmake 3.x allow old versions to interfere with it at runtime? ?At a minimum, some kind of warning would make the issue more obvious and save people some time. ? _______________ Peter Karasev karasevpa at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From falk.tristram at cognex.com Thu May 28 02:15:09 2015 From: falk.tristram at cognex.com (Tristram, Falk) Date: Thu, 28 May 2015 08:15:09 +0200 Subject: [CMake] TI-C CMAKE_C_LINK_EXECUTABLE order Message-ID: <3960370AB9E94C4F99461A0A6C2C3BA00290B23450@blitzpost2.europe.pc.cognex.com> Hi all, before creating a bug report about this problem, I first want to get feedback here. I have created a CMake build system for a whole bunch of embedded targets all working fine. Now I ran into a strange problem related to the tms470_5.0.1. Some of the symbols are just dropped by linker (optimized out). I pinned down the problem to the "TI-C.cmake". set(CMAKE_C_LINK_EXECUTABLE " --run_linker --output_file= --map_file=.map ") is the last entry. In my case OBJECTS just consists out of one file "main.c.obj". Changing the order just works fine, as follows: set(CMAKE_C_LINK_EXECUTABLE " --run_linker --output_file= --map_file=.map ") Now here is my question: Is there any specific reason why comes as last parameter? Could you change the order for future versions? Note: I am still checking/testing the impact of the changed order to our other TI-C build systems. Best regards, Falk -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.king at kitware.com Thu May 28 08:53:22 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 28 May 2015 08:53:22 -0400 Subject: [CMake] fatal error with Cmake 3.2.2 running on NFS system, resolved if --debug-trycompile is given In-Reply-To: <5565FDEA.8050102@kitware.com> References: <1902C87AEA59044B93A0F007C128D23BD2A469@DC-EXCHMBX02.Nanofluidics.com> <5565FDEA.8050102@kitware.com> Message-ID: <55670FC2.6060100@kitware.com> On 05/27/2015 01:24 PM, Brad King wrote: > On 05/26/2015 02:23 PM, Mark Lakata wrote: >> CMake Error: Remove failed on file: /.../CMakeTmp/.nfs000000000786c4ec0000398c: >> System Error: No such file or directory > > I'll work on changes to teach CMake to tolerate ENOENT here in > case it loses a race like this. The relevant code was in the external KWSys project. I've fixed that here: http://review.source.kitware.com/19830/ Then I updated KWSys within CMake: KWSys 2015-05-27 (61e0419f) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ee71b751 and merged it here: Merge branch 'upstream-kwsys' into update-kwsys http://www.cmake.org/gitweb?p=cmake.git;a=commit;h=bf365792 Please build with commit bf365792 to see if it resolves this problem for you. Thanks, -Brad From bill.hoffman at kitware.com Thu May 28 10:30:30 2015 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Thu, 28 May 2015 10:30:30 -0400 Subject: [CMake] cmake 3.x + vs2013, "unknown compiler", re: bug 15057 In-Reply-To: References: Message-ID: <55672686.3060905@kitware.com> On 5/27/2015 11:37 PM, Peter Karasev wrote: > The workaround is to purge your PATH environment variable so that no > copies of cmake.exe are there. > ? ? > It still feels like a bug > ? that could be fixed? > ; why should cmake 3.x allow old versions to interfere with it at runtime? > ?At a minimum, some kind of warning would make the issue more obvious > and save people some time. ? > I suspect this does not have anything to do with cmake being in the PATH but rather cygwin being in the PATH. If you could send me the CMakeError.log file that might show what is wrong. Also, the output from the run. -Bill From ramey at rrsd.com Thu May 28 11:44:09 2015 From: ramey at rrsd.com (Robert Ramey) Date: Thu, 28 May 2015 08:44:09 -0700 Subject: [CMake] CDash problem posting results Message-ID: I have a CDash dashbord set up my.cdash.org which I can access at: http://my.cdash.org/index.php?project=Safe+Numerics&filtercount=1&showfilters=1&field1=buildstarttime/date&compare1=83&value1=1%20year%20ago so far so good. But I have a few problems. a) The site doesn't show up when I look at www.cdash.org . Note a huge deal, but I expected it should. b) A bigger issue is that I get occasional emails from admin at cdash.org: from:admin at cdash.org subject:[Safe Numerics] - Administration Object: Cannot create handler based on XML content An XML submission from 68.180.229.57 to the project Safe Numerics cannot be parsed. The content of the file is as follow: -CDash on my.cdash.org This suggests to me that others are trying to run my CMake/CTest/CDash script but not having success. What can I do to make this work? Robert Ramey From hocheung20 at gmail.com Thu May 28 12:17:15 2015 From: hocheung20 at gmail.com (Ho Cheung) Date: Thu, 28 May 2015 11:17:15 -0500 Subject: [CMake] Empty log in build.xml Message-ID: <3F0C006A-D409-4A5D-A86C-B2A5513C9D42@gmail.com> Hello all, I?m having trouble writing a script for submission to a locally-run CDash server. My versions are CDash 2.2.2 and CMake 3.2.1. Here is my script: http://pastebin.com/index/9YwEyb5x I run with ctest -VV -S /path/to/script and I can watch the build progress but when looking at the build.xml, the Log portion appears empty. All the other parts (Configure, Tests) report normally. Does anyone have any clue as to why this might be? Thanks, Ho Cheung -------------- next part -------------- An HTML attachment was scrubbed... URL: From hocheung20 at gmail.com Thu May 28 12:49:13 2015 From: hocheung20 at gmail.com (Ho Cheung) Date: Thu, 28 May 2015 11:49:13 -0500 Subject: [CMake] Empty log in build.xml In-Reply-To: <3F0C006A-D409-4A5D-A86C-B2A5513C9D42@gmail.com> References: <3F0C006A-D409-4A5D-A86C-B2A5513C9D42@gmail.com> Message-ID: I appear to have discovered my error. The project?s CMakeLists needs include(CTest) at the top. There were no warnings or errors telling me that I needed this. Thanks for anyone who might have looked at this, Ho > On May 28, 2015, at 11:17 AM, Ho Cheung wrote: > > Hello all, > > I?m having trouble writing a script for submission to a locally-run CDash server. > > My versions are CDash 2.2.2 and CMake 3.2.1. > > Here is my script: > > http://pastebin.com/index/9YwEyb5x > > I run with ctest -VV -S /path/to/script and I can watch the build progress but when looking at the build.xml, the Log portion appears empty. All the other parts (Configure, Tests) report normally. Does anyone have any clue as to why this might be? > > Thanks, > Ho Cheung > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From scott at towel42.com Thu May 28 13:01:53 2015 From: scott at towel42.com (Scott Aron Bloom) Date: Thu, 28 May 2015 17:01:53 +0000 Subject: [CMake] Multiple install targets Message-ID: Is it possible to have multiple install targets? Essentially, our install system, installs a bunch of "mostly static" files, that rarely change, but are needed for a complete installation. However, running the install, takes time to verify each file hasn't changed. What Im thinking, is creating a "FULL_INSTALL" and a "MINIMAL_INSTALL" target, but would like to know if there is a "formal" way to do it. Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: From irwin at beluga.phys.uvic.ca Thu May 28 13:11:39 2015 From: irwin at beluga.phys.uvic.ca (Alan W. Irwin) Date: Thu, 28 May 2015 10:11:39 -0700 (PDT) Subject: [CMake] Migrating from another build system that maintains its own source file lists In-Reply-To: References: Message-ID: Hi Kevin: I believe this discussion continues to belong on the cmake list so I have CC'd there. > On Wed, May 27, 2015 at 2:17 PM, Alan W. Irwin > wrote: > >> On 2015-05-27 13:48-0400 Kevin Houlihan wrote: >> >> Hello, >>> >>> I want to migrate from a build system that has its own lists of source >>> files that must be maintained for the time being. I have scripts to >>> translate those list files into CMakeLists.txt files but I don't know of a >>> good way to integrate those into a CMake generated build system and keep >>> the generated CMakeLists.txt files up to date with the files they were >>> generated from. >>> >>> My current solution is to use a Makefile to check to see if the >>> CMakeLists.txt files need to be updated as part of the build. This is a >>> bit >>> clumsy. >>> >>> The issue seems similar to the problem of using file globbing in >>> CMakeLIsts.txt files and as far as I know, the answer there is "don't do >>> that". Still I thought I'd try my luck. >>> >>> Any suggestions? >>> >> >> Use a CMake list of files, and maintain that, e.g., >> >> set(lib_SRC_FILE_LIST >> a.c >> b.c >> c.c >> [...] >> ) >> >> add_library(lib ${lib_SRC_FILE_LIST}) >> >> or if there are thousands of files in the list and you don't want >> to disrupt the logic of your principal CMakeLists.txt files with >> lists scattered all over within the file, then look at >> the include(...) command which will include CMake source code >> from a file (say completely devoted to the above list creation command). >> On 2015-05-28 08:31-0400 Kevin Houlihan wrote: > Sorry, I wasn't clear. The list of source files from the existing non-CMake > build system is the authoritative list and whenever it changes (potentially > by people who aren't me) I want the CMakeLists.txt files to automatically > update. Generating the CMakeLists.txt files isn't the issue, it's > automating that process. Just for reference the actual quote you were referring to is likely from which says: "Note We do not recommend using GLOB to collect a list of source files from your source tree. If no CMakeLists.txt file changes when a source is added or removed then the generated build system cannot know when to ask CMake to regenerate." Does this mean that a summary of your need is that you want an automated method such that if a source file was added or deleted for an already configured build of a library, then the next attempt to build that library would regenerate the list of source files for that library? If so, that is an intriguing problem. I have never tried anything like that, but to replace your current Makefile approach it seems to me the following approach would work: 1. Implement a custom command that file depended on the authorative list of source files for a particular library and whose OUTPUT was the generated CMakeLists.txt file that built that library. 2. Implement a custom target which file depended on that OUTPUT file. 3. Use add_dependencies to make the library target depend on the custom target (so the custom target will always be built first). Of course, 1. through 3. could all be implemented as part of the generated CMakeLists.txt file. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ From Lucas.Pettey at engilitycorp.com Thu May 28 13:32:42 2015 From: Lucas.Pettey at engilitycorp.com (Lucas.Pettey at engilitycorp.com) Date: Thu, 28 May 2015 17:32:42 +0000 Subject: [CMake] Linking C program to external C++ library In-Reply-To: <556600AA.3030505@kitware.com> References: <45BF0169B950CD4A97DC5223BB2B44B33A53F695@VACH-MX1.EGL.ENGILITYCORP.COM>, <556600AA.3030505@kitware.com> Message-ID: <45BF0169B950CD4A97DC5223BB2B44B34246B177@VACH-MX1.EGL.ENGILITYCORP.COM> The CMAKE_*_COMPILER variables are set correctly. The CMAKE_*_IMPLICIT_LINK_LIBRARIES have a whole bunch of libraries probably generated from the Cray wrapper. It is interesting to note that the stdc++ library is in CMAKE_C_IMPLICIT_LINK_LIBRARIES and CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES but not in CMAKE_CXX_IMPLICIT_LINK_LIBRARIES. Also, when the LINKER_LANGUAGE variable is not set, CMake links with the C compiler but does not add the stdc++ library. On the Cray systems, the wrappers correctly invoke all necessary libraries, thus CMake is working harder than it needs to. Is there any way to tell CMake not to add these other IMPLICIT_LINK_LIBRARIES when doing a mixed language build? Thanks, Lucas Pettey, PhD HPCMP PETTT EQM CTA Lead ERDC-DSRC OnSite Vicksburg, MS 512-297-9833 Mobile (preferred) 601-634-2980 Office lucas.pettey at engilitycorp.com ________________________________________ From: Brad King [brad.king at kitware.com] Sent: Wednesday, May 27, 2015 12:36 PM To: Pettey, Lucas @ EngilityCorp Cc: cmake at cmake.org; Dan Liew Subject: Re: [CMake] Linking C program to external C++ library On 05/21/2015 06:00 PM, Lucas.Pettey at engilitycorp.com wrote: > I am trying to compile a code written in C, but using an external > library that contains C++ functions. I am on a Cray system and > everything works if I manually link with the cray CC wrapper. > When I change the linker language with this command: > > set_property(TARGET adh PROPERTY LINKER_LANGUAGE CXX) > > CMake is using the CC wrapper, but adding -lstdc++ to the link line. > This causes an error. Can anyone tell me how to not get this added library? CMake detects the libraries implicitly added by the compiler front-end for each language. When mixing languages it chooses to link using the compiler front-end for one of the languages and adds the implicit libraries needed for other languages and not added by the chosen one. This case looks strange because you are telling it to link with the C++ compiler but CMake is still adding the implicit library for C++. Look at CMakeFiles/${CMAKE_VERSION}/CMake*Compiler.cmake for details of the compiler detected for each language. Look for these variables: CMAKE_C_COMPILER CMAKE_C_IMPLICIT_LINK_LIBRARIES CMAKE_CXX_COMPILER CMAKE_CXX_IMPLICIT_LINK_LIBRARIES To what are they set? Thanks, -Brad From brad.king at kitware.com Thu May 28 13:49:01 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 28 May 2015 13:49:01 -0400 Subject: [CMake] Linking C program to external C++ library In-Reply-To: <45BF0169B950CD4A97DC5223BB2B44B34246B177@VACH-MX1.EGL.ENGILITYCORP.COM> References: <45BF0169B950CD4A97DC5223BB2B44B33A53F695@VACH-MX1.EGL.ENGILITYCORP.COM>, <556600AA.3030505@kitware.com> <45BF0169B950CD4A97DC5223BB2B44B34246B177@VACH-MX1.EGL.ENGILITYCORP.COM> Message-ID: <5567550D.2080504@kitware.com> On 05/28/2015 01:32 PM, Lucas.Pettey at engilitycorp.com wrote: > It is interesting to note that the stdc++ library is in > CMAKE_C_IMPLICIT_LINK_LIBRARIES and CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES > but not in CMAKE_CXX_IMPLICIT_LINK_LIBRARIES. A similar case was discussed here: http://www.cmake.org/Bug/view.php?id=14207#c33256 and deemed to be local misconfiguration of the compilers. There is no reason a C or Fortran compiler should link to the C++ runtime library. > when the LINKER_LANGUAGE variable is not set, CMake > links with the C compiler but does not add the stdc++ library. That's because it sees stdc++ in the "C" implicit library list so it knows the compiler front-end will add it. > Is there any way to tell CMake not to add these other > IMPLICIT_LINK_LIBRARIES when doing a mixed language build? Once could add set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "") to the project after the respective languages are enabled (by the project() or enable_language() commands). -Brad From Lucas.Pettey at engilitycorp.com Thu May 28 13:59:22 2015 From: Lucas.Pettey at engilitycorp.com (Lucas.Pettey at engilitycorp.com) Date: Thu, 28 May 2015 17:59:22 +0000 Subject: [CMake] Linking C program to external C++ library In-Reply-To: <5567550D.2080504@kitware.com> References: <45BF0169B950CD4A97DC5223BB2B44B33A53F695@VACH-MX1.EGL.ENGILITYCORP.COM>, <556600AA.3030505@kitware.com> <45BF0169B950CD4A97DC5223BB2B44B34246B177@VACH-MX1.EGL.ENGILITYCORP.COM>, <5567550D.2080504@kitware.com> Message-ID: <45BF0169B950CD4A97DC5223BB2B44B34246D192@VACH-MX1.EGL.ENGILITYCORP.COM> Thanks for the very complete answer, Brad. I will implement your final suggestion since we have no control over the compiler scripts and already have some platform dependent variables set. Lucas Pettey, PhD HPCMP PETTT EQM CTA Lead ERDC-DSRC OnSite Vicksburg, MS 512-297-9833 Mobile (preferred) 601-634-2980 Office lucas.pettey at engilitycorp.com ________________________________________ From: Brad King [brad.king at kitware.com] Sent: Thursday, May 28, 2015 12:49 PM To: Pettey, Lucas @ EngilityCorp Cc: cmake at cmake.org; Dan Liew Subject: Re: [CMake] Linking C program to external C++ library On 05/28/2015 01:32 PM, Lucas.Pettey at engilitycorp.com wrote: > It is interesting to note that the stdc++ library is in > CMAKE_C_IMPLICIT_LINK_LIBRARIES and CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES > but not in CMAKE_CXX_IMPLICIT_LINK_LIBRARIES. A similar case was discussed here: http://www.cmake.org/Bug/view.php?id=14207#c33256 and deemed to be local misconfiguration of the compilers. There is no reason a C or Fortran compiler should link to the C++ runtime library. > when the LINKER_LANGUAGE variable is not set, CMake > links with the C compiler but does not add the stdc++ library. That's because it sees stdc++ in the "C" implicit library list so it knows the compiler front-end will add it. > Is there any way to tell CMake not to add these other > IMPLICIT_LINK_LIBRARIES when doing a mixed language build? Once could add set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "") to the project after the respective languages are enabled (by the project() or enable_language() commands). -Brad From Anthony.R.Ette at controlsdata.com Thu May 28 15:24:13 2015 From: Anthony.R.Ette at controlsdata.com (Ette, Anthony (CDS)) Date: Thu, 28 May 2015 19:24:13 +0000 Subject: [CMake] Eclipse .cproject file (support for multiple build configurations) Message-ID: <2A375B5C08C24643A8A3F8CC2B98C1084BAC0C78@USINDPR-MBX003.Rolls-Royce.Local> To Whom It May Concern: I'm using Cmake 3.2.2, specifically the "Eclipse CDT4 - NMake Makefiles" generator. My application is multi-platform but common source. We were using managed Makefiles for UNIX and Visual Studio solutions/projects for Windows but we'd like to ditch all of this in favor of the more flexible Cmake. That said, we were using two different build configurations in our Eclipse projects and we would switch between active build configuration depending on which platform we were developing for at the time. Using Cmake with the -G option I describe above seems to always result in a single build configuration (named "Configuration") in the Eclipse .cproject file. Does Cmake Eclipse CDT 4 generator support multiple build configurations? If so, how do I set it up? On a related note: it seems as though cmake was designed assuming separate source for each platform but we have common source. Ideally, we'd like all the targets to be defined within a single file (e.g. Makefile) so when we switch platforms, we don't have to rerun Cmake to regenerate Makefiles for that platform. Can cmake handle this kind of setup or is the advise to just split the source and clone & own for each platform to avoid rerunning cmake when you switch? Thank you for your time and support, Anthony Ette Systems Engineer Simulation and Modeling Controls and Data Services Inc. Part of the Rolls-Royce Group 7661 N Perimeter Rd Indianapolis, IN 46241 tel: +1 (317) 230-6943 mob: +1 (317) 864-7975 email: Anthony.R.Ette at controlsdata.com www.controlsdata.com This e-mail (including attachments) contains contents owned by Rolls-Royce plc and its subsidiaries, affiliated companies or customers and covered by the laws of England and Wales, Brazil, US, or Canada (federal, state or provincial). The information contained in this email is intended to be confidential, may be legally privileged and subject to export controls which may restrict the access to and transfer of the information. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, interception or copying of this communication is strictly prohibited and may subject you to further legal action. Reply to the sender if you received this email by accident, and then delete the email and any attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Anthony.R.Ette at controlsdata.com Thu May 28 15:26:43 2015 From: Anthony.R.Ette at controlsdata.com (Ette, Anthony (CDS)) Date: Thu, 28 May 2015 19:26:43 +0000 Subject: [CMake] Support for Multiple Build Configurations in Eclipse Message-ID: <2A375B5C08C24643A8A3F8CC2B98C1084BAC0C8F@USINDPR-MBX003.Rolls-Royce.Local> To Whom It May Concern: I'm using Cmake 3.2.2, specifically the "Eclipse CDT4 - NMake Makefiles" generator. My application is multi-platform but common source. We were using managed Makefiles for UNIX and Visual Studio solutions/projects for Windows but we'd like to ditch all of this in favor of the more flexible Cmake. That said, we were using two different build configurations in our Eclipse projects and we would switch between active build configuration depending on which platform we were developing for at the time. Using Cmake with the -G option I describe above seems to always result in a single build configuration (named "Configuration") in the Eclipse .cproject file. Does Cmake Eclipse CDT 4 generator support multiple build configurations? If so, how do I set it up? On a related note: it seems as though cmake was designed assuming separate source for each platform but we have common source. Ideally, we'd like all the targets to be defined within a single file (e.g. Makefile) so when we switch platforms, we don't have to rerun Cmake to regenerate Makefiles for that platform. Can cmake handle this kind of setup or is the advise to just split the source and clone & own for each platform to avoid rerunning cmake when you switch? Thank you for your time and support, Anthony Ette Systems Engineer Simulation and Modeling Controls and Data Services Inc. Part of the Rolls-Royce Group 7661 N Perimeter Rd Indianapolis, IN 46241 tel: +1 (317) 230-6943 mob: +1 (317) 864-7975 email: Anthony.R.Ette at controlsdata.com www.controlsdata.com This e-mail (including attachments) contains contents owned by Rolls-Royce plc and its subsidiaries, affiliated companies or customers and covered by the laws of England and Wales, Brazil, US, or Canada (federal, state or provincial). The information contained in this email is intended to be confidential, may be legally privileged and subject to export controls which may restrict the access to and transfer of the information. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, interception or copying of this communication is strictly prohibited and may subject you to further legal action. Reply to the sender if you received this email by accident, and then delete the email and any attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Anthony.R.Ette at controlsdata.com Thu May 28 15:17:08 2015 From: Anthony.R.Ette at controlsdata.com (Ette, Anthony (CDS)) Date: Thu, 28 May 2015 19:17:08 +0000 Subject: [CMake] Eclipse .cproject Preprocessor Macro Definitions Message-ID: <2A375B5C08C24643A8A3F8CC2B98C1084BAC0C53@USINDPR-MBX003.Rolls-Royce.Local> To Whom It May Concern: I'm using Cmake 3.2.2, specifically the "Eclipse CDT4 - NMake Makefiles" generator. I am able to successfully run cmake and build from within Eclipse but there seem to be things missing from the .cproject file. For example, I've got a source routine with #ifdef _WIN32 and this chunk of code is greyed out (i.e. not perceived active) in the Eclipse editor and source outline views (see picture below). I find this surprising since the build succeeds (it's ultimately able to find the necessary windows headers) and /DWIN32 is defined in CMAKE_CXX_FLAGS. [cid:image001.png at 01D09958.9F78F2E0] Can you explain why the Eclipse project is unaware of the toolchain preprocessor macros and elaborate on how I can control this behavior using cmake (i.e. what knobs do I have at my disposal to tweak the .cproject file that gets generated by the Cmake generator, if any)? Thank you for your time and support, Anthony Ette Systems Engineer Simulation and Modeling Controls and Data Services Inc. Part of the Rolls-Royce Group 7661 N Perimeter Rd Indianapolis, IN 46241 tel: +1 (317) 230-6943 mob: +1 (317) 864-7975 email: Anthony.R.Ette at controlsdata.com www.controlsdata.com This e-mail (including attachments) contains contents owned by Rolls-Royce plc and its subsidiaries, affiliated companies or customers and covered by the laws of England and Wales, Brazil, US, or Canada (federal, state or provincial). The information contained in this email is intended to be confidential, may be legally privileged and subject to export controls which may restrict the access to and transfer of the information. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, interception or copying of this communication is strictly prohibited and may subject you to further legal action. Reply to the sender if you received this email by accident, and then delete the email and any attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 12675 bytes Desc: image001.png URL: From Torsten at Robitzki.de Fri May 29 05:14:06 2015 From: Torsten at Robitzki.de (Torsten at Robitzki.de) Date: Fri, 29 May 2015 11:14:06 +0200 Subject: [CMake] cross compiling with sdcc Message-ID: <0C30A697-C3DB-4400-8269-A69EA79DC6E5@Robitzki.de> Hello, I was looking for some resources on how to configure cmake to use the small device c compiler (sdcc). I tried a little bit and found that cmake assumed that the object file extension would be .obj. But sdcc uses .rel for object files. I?ve searched a lot in the web and the cmake sources, tried to figure out, how the compiler detection mechanism works. I saw that there is a file Platform/Generic-SDCC-C.cmake, while searching for a way to force cmake to use this file, I found a makro CMAKE_FORCE_C_COMPILER that let me override the compiler detection. So now I have a working solution and wonder if that solution is one ?correct? solution. ?correct? in terms of supported and intended by the developers. cmake_minimum_required(VERSION 3.2) include (CMakeForceCompiler) set(CMAKE_SYSTEM_NAME Generic) CMAKE_FORCE_C_COMPILER(sdcc SDCC) project(test C) Does this looks reasonable? Thank you very much for your time! Kind regards, Torsten From fifteenknots505 at gmail.com Sat May 30 07:28:10 2015 From: fifteenknots505 at gmail.com (Martin Weber) Date: Sat, 30 May 2015 13:28:10 +0200 Subject: [CMake] Eclipse .cproject Preprocessor Macro Definitions In-Reply-To: <2A375B5C08C24643A8A3F8CC2B98C1084BAC0C53@USINDPR-MBX003.Rolls-Royce.Local> References: <2A375B5C08C24643A8A3F8CC2B98C1084BAC0C53@USINDPR-MBX003.Rolls-Royce.Local> Message-ID: <2144330.nbX5cvHVkn@linux> Am Donnerstag, 28. Mai 2015, 19:17:08 schrieb Ette, Anthony: > To Whom It May Concern: > > I'm using Cmake 3.2.2, specifically the "Eclipse CDT4 - NMake Makefiles" > generator. I am able to successfully run cmake and build from within > Eclipse but there seem to be things missing from the .cproject file. For > example, I've got a source routine with #ifdef _WIN32 and this chunk of > code is greyed out (i.e. not perceived active) in the Eclipse editor and > source outline views (see picture below). I find this surprising since the > build succeeds (it's ultimately able to find the necessary windows headers) > and /DWIN32 is defined in CMAKE_CXX_FLAGS. This may be more related to CDt than to cmake, since cmake just generates the makefiles and the Eclipse project files. Your code is displayed as greyed out, since CDT does not know about the _WIN32 macro (but the build does know). You may manually add it in the project settings, or enable the GCC build output parser plus the gcc builtin specs detector to tell CDT about the macro. The build output parser will find macros and include paths in the gcc command lines and add them automatically. Of course, this will not work, if the cmake generated build script passes the compiler options in a file:( Advertising: Give the cmake4eclips plugin a try (which I am the author of) Martin -- Cd wrttn wtht vwls s mch trsr. From cubicool at gmail.com Sat May 30 08:50:05 2015 From: cubicool at gmail.com (Jeremy Moles) Date: Sat, 30 May 2015 08:50:05 -0400 Subject: [CMake] amccmake Message-ID: <5569B1FD.6010403@gmail.com> https://github.com/cubicool/amccmake Hello everyone! I wanted to take a quick second and make Linux-centric developers aware of a small, handy script I've written that will automatically create and setup CMake in your projects (in a clean way) for GCC, Clang, and Mingw automatically. I call it amccmake (which is fun to say out loud, try it! "Eh-Em-See-See-Make"), which stands for: Automated Multiple Compiler CMake ...and it's just a simple Bash script that uses a local config to generate a build hierarchy for your project. It'll be fairly self-explanatory to anyone who does lots of Linux development using CMake. It also provides an interesting (but Bash-abusive) way of putting your cmake -D calls into a big bash array in a config file, which might be as handy for others as it is me. Thanks! And enjoy! From guillaume.du.roy at gmail.com Sun May 31 08:19:16 2015 From: guillaume.du.roy at gmail.com (Guillaume du Roy) Date: Sun, 31 May 2015 14:19:16 +0200 Subject: [CMake] Building VTK for IOS Architectures Message-ID: <007306BA-7D40-4D8E-894C-F3D9FCE6B71A@gmail.com> Following your IOS instructions i get this error for the vtk Compile tools: -- Build files have been written to: /Users/Guillaume/Downloads/VTK-6.2.0 [ 25%] Performing build step for 'vtk-compile-tools' make[3]: *** No rule to make target `vtkCompileTools'. Stop. make[2]: *** [CMakeExternals/Prefix/vtk-compile-tools/src/vtk-compile-tools-stamp/vtk-compile-tools-build] Error 2 make[1]: *** [CMakeFiles/vtk-compile-tools.dir/all] Error 2 make: *** [all] Error 2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian.reinhard at googlemail.com Sun May 31 09:40:08 2015 From: florian.reinhard at googlemail.com (Florian Reinhard) Date: Sun, 31 May 2015 15:40:08 +0200 Subject: [CMake] TI-C CMAKE_C_LINK_EXECUTABLE order In-Reply-To: <3960370AB9E94C4F99461A0A6C2C3BA00290B23450@blitzpost2.europe.pc.cognex.com> References: <3960370AB9E94C4F99461A0A6C2C3BA00290B23450@blitzpost2.europe.pc.cognex.com> Message-ID: <1644270.s5LzNiYBmu@botein> Hi Falk! I've read through the cl6x linker docs once again [1] SPRU187V Chapter 5, page 137 and following. >From my experience and the docs i'd say, yes you're right. To prove the solution to your problem, see page 138: "When you specify a library as linker input, the linker includes and links only those library members that resolve undefined references." Current cmake behaviour: Library functions are favored over user functions. Desired behaviour: User functions are favored library functions. Before proposing a change in cmake, i'd like to check how our cmake/ti project (>200k lines) behaves and if it still links. Unfortunately i'll not be able to do this before 15.6.2015. Regards, Florian [1] http://www.ti.com/lit/ug/spru187v/spru187v.pdf On Thursday 28 May 2015 08:15:09 Tristram, Falk wrote: > Hi all, > > before creating a bug report about this problem, I first want to get > feedback here. I have created a CMake build system for a whole bunch of > embedded targets all working fine. > > Now I ran into a strange problem related to the tms470_5.0.1. > Some of the symbols are just dropped by linker (optimized out). > I pinned down the problem to the "TI-C.cmake". > > set(CMAKE_C_LINK_EXECUTABLE " --run_linker > --output_file= --map_file=.map > ") > > is the last entry. > In my case OBJECTS just consists out of one file "main.c.obj". > > Changing the order just works fine, as follows: > set(CMAKE_C_LINK_EXECUTABLE " --run_linker > --output_file= --map_file=.map > ") > > Now here is my question: > Is there any specific reason why comes as last parameter? > Could you change the order for future versions? > > Note: I am still checking/testing the impact of the changed order to our > other TI-C build systems. > > Best regards, > Falk From david_bjornbak at keysight.com Sun May 31 12:04:11 2015 From: david_bjornbak at keysight.com (david_bjornbak at keysight.com) Date: Sun, 31 May 2015 16:04:11 +0000 Subject: [CMake] Visual Studio 2013, increamental builds, intermediate directories and long target names Message-ID: Unfortunately, we're hitting an issue migrating from VS 2012 to VS 2103 with Cmake working with long target names. Apparently the only know workarounds to the issues listed below is to shorten target names but, we're working with fairly long set of projects and it's not practical to rename the target names involved. Imaging going through something twice the size of VTK and changing target names and keeping the meaning of the names. I didn't look into the cmake source code around this yet but, I wanted to see if this issue is viewed as a Microsoft limitation that's not practical to code around or not. http://stackoverflow.com/questions/28959488/how-to-enable-incremental-builds-for-vs-2013-with-cmake-and-long-target-names http://stackoverflow.com/questions/29726394/warning-msb8028-the-intermediate-directory-debug-contains-files-shared-from ++David->Bjornbak; -------------- next part -------------- An HTML attachment was scrubbed... URL: From dank at kegel.com Sun May 31 12:43:09 2015 From: dank at kegel.com (Dan Kegel) Date: Sun, 31 May 2015 09:43:09 -0700 Subject: [CMake] Visual Studio 2013, increamental builds, intermediate directories and long target names In-Reply-To: References: Message-ID: Did you try the workaround suggested in the first link you gave, i.e. set( RatherLongLibraryName_GUID_CMAKE CACHE INTERNAL "remove this and Visual Studio will mess up incremental builds") On Sun, May 31, 2015 at 9:04 AM, wrote: > Unfortunately, we're hitting an issue migrating from VS 2012 to VS 2103 with > Cmake working with long target names. > > > > Apparently the only know workarounds to the issues listed below is to > shorten target names but, we're working with fairly long set of projects > and it's not practical to rename the target names involved. Imaging going > through something twice the size of VTK and changing target names and > keeping the meaning of the names. > > > > I didn't look into the cmake source code around this yet but, I wanted to > see if this issue is viewed as a Microsoft limitation that's not practical > to code around or not. > > > > http://stackoverflow.com/questions/28959488/how-to-enable-incremental-builds-for-vs-2013-with-cmake-and-long-target-names > > http://stackoverflow.com/questions/29726394/warning-msb8028-the-intermediate-directory-debug-contains-files-shared-from > > > > > > > > ++David->Bjornbak; > > > > > -- > > 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: > http://public.kitware.com/mailman/listinfo/cmake From f.scott.carver at gmail.com Sun May 31 17:53:37 2015 From: f.scott.carver at gmail.com (Scott Carver) Date: Sun, 31 May 2015 21:53:37 +0000 Subject: [CMake] symlinks during install Message-ID: I have a cmake setup that uses symlinks to place resource files/directories/libraries relative to several different subcomponents during the build process. This avoids excessive copying, and makes it easier to build / test individual components. Something like this (*'s as symlinks): /build/componentA/ /componentA.app /HelpFiles* /build/componentB/ /HelpFiles* /componentB.app /Contents/Resources/componentA.app* During the install stage, I'm assembling all of the subcomponents into an .app package (on mac, at least), and obviously need the symlinks to be turned into copies. This is proving to be tricky.... The symlinks are copied over to the install folder as I install each component, so later steps to install hard-copies of those files fails, as they collide with existing symlinks. Explicitly deleting those symlinks in the install folder doesn't seem like an option - the locations/names come from generator expressions, which can't easily be expanded in a post-install "install(CODE ...)" command, for example. It's not difficult to simple provide a fixed list of symlinks to replace with copies, glob-and-replace ALL symlinks with copies, or just do the symlink swap with a shell script - but none of those feel like good solutions. I don't want to resolve symlinks that shouldn't be resolved, and I don't want to maintain a global list of symlinks to resolve (that has to be updated if a component is added or moved). Any advice on how to do this in a proper CMAKE way? Or - any strategies I can use to avoid some of the excess copying? Thanks much Scott C -------------- next part -------------- An HTML attachment was scrubbed... URL: