From zbeekman at gmail.com Thu Dec 1 00:31:21 2016 From: zbeekman at gmail.com (Zaak Beekman) Date: Thu, 01 Dec 2016 05:31:21 +0000 Subject: [CMake] FindMPI In-Reply-To: References: Message-ID: OK, upon more careful reading of the documentation for FindMPI, and realizing that I am using CMake 3.6 not 3.7 I have adjusted my approach to be consistent with the documentation and your suggestions. I don't know if the documentation actually needs expanding upon... I think I just failed to fully comprehend it. As far as enhancements to FindMPI go, It might be worthwhile to check if FC, CC,CXX match any obvious MPI wrappers, and then set MPI__compiler and select the MPI version from there: If the user set the compiler explicitly to an MPI wrapper, that's likely the MPI they intend to use.... If I find some time maybe I'll work up a pull request for this. On Mon, Nov 28, 2016 at 10:22 AM Chuck Atkins wrote: > Hi Zaak, > > Sorry for the first mail being so abrupt, I didn't mean to hit "send" so > soon. > > > > I took a look at the FindMPI CMake module, and it seems as though you can > set MPI_HOME to a list of directories to search. > > > That's also another way of doing it, which would probably be easier than > what I iniitially suggested; the former has just become my own habbit since > MPI_HOME isn't always set. MPI_HOME is used as a hint to search for > mpiexec. If mpiexec is found, it then uses it's location as a basis for > locating the compiler wrappers. > > That being said, if using MPI through an environment module (as is the > typical use case) then FindMPI should "just work" as the wrappers generally > end up in the path when the appropriate MPI module is loaded. If you need > to point to an entirely external MPI not part of your environment at all > though, then using the MPI_HOME env var or MPI__COMPILER CMake vars > is the way to do it. > > > > Would KitWare accept a pull request or a patch that expands the > documentation of FindMPI > > > Of course :-). Expanding the "Usage" section in FindMPI to include using > the MPI_HOME environment variable would be a good place for that. > > > > and/or adds some clearer additional features to the call signature (like > HINTS and PATHS)? > > > Could you clarify what you mean by this? To which call signature? > > > - Chuck > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wy39666161 at 163.com Thu Dec 1 01:02:13 2016 From: wy39666161 at 163.com (wy39666161 at 163.com) Date: Thu, 1 Dec 2016 14:02:13 +0800 Subject: [CMake] A trouble in using cmake for xcode Message-ID: <201612011402122454567@163.com> hi dear: I have a trouble in using cmake.I try to find a way to resolve that for a long time, but finally get no results. I attempt to create an ios application imessage extension by cmake but i can't find a suitable command. So i contact you for some suggestion. Look forward for your favourable reply. Thanks very much! wy39666161 at 163.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From annulen at yandex.ru Thu Dec 1 09:17:50 2016 From: annulen at yandex.ru (Konstantin Tokarev) Date: Thu, 01 Dec 2016 17:17:50 +0300 Subject: [CMake] Get path without Windows drive letter Message-ID: <4854501480601870@web19m.yandex.ru> Hello, On Windows, is there any better way to strip out drive letter from path besides using REGEX REPLACE? I looked at get_filename_component but didn't find anything appropriate. What I'm doing at higher level is transposition of CMAKE_INSTALL_PREFIX with DESTDIR variable, like what install(FILES) is doing. I cannot use built-in DESTDIR support because I need to pass modified path to external program. Is there any better way to achieve that? Thanks! -- Regards, Konstantin From p.jansen at computer.org Thu Dec 1 11:25:21 2016 From: p.jansen at computer.org (Peter Jansen) Date: Thu, 1 Dec 2016 09:25:21 -0700 (MST) Subject: [CMake] [EXTERNAL]: Errors with cmake for VS2105 (update 3) + clang + nmake In-Reply-To: References: <1479749631787-7594637.post@n2.nabble.com> <1479993655162-7594651.post@n2.nabble.com> Message-ID: <1480609521012-7594691.post@n2.nabble.com> Toolset "v140_clang_c2" allows me to generate (& build) Clang/C2 projects with Generator "Visual Studio 15 Win64", and Toolset "v140" regular MS "cl" compiler projects. Generator "NMake Makefiles" does not support any -T toolset specification; all I can successfully generate (& build) are Makefile targets for regular MS "cl" compiler projects. I am unable to use "Clang/C2" projects. By the way, I use "SET PreferredToolArchitecture=x64" in order to be able to use the native 64-bit versions of these compilers, producing 64-bit code. By the way (#2), as I also installed MS VS 2017 RC, using toolset "v141_clang_c2" for Clang/C2 projects (or "v141" for "cl" projects), correctly produces VS 2017 projects. But here too, no joy with the combination "NMake Makefiles" for Clang/C2 compiler projects, only MS "cl". In short: my problem of trying to use cmake to generate Clang/C2 NMake Makefile targets has NOT been solved. I now assume this is a problem with cmake, or an unsupported combination. Nevertheless, I thank you Parag for all your efforts. Cheers, Peter Jansen -- View this message in context: http://cmake.3232098.n2.nabble.com/Errors-with-cmake-for-VS2105-update-3-clang-nmake-tp7594637p7594691.html Sent from the CMake mailing list archive at Nabble.com. From chuck.atkins at kitware.com Thu Dec 1 14:01:45 2016 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Thu, 1 Dec 2016 14:01:45 -0500 Subject: [CMake] FindMPI In-Reply-To: References: Message-ID: > > As far as enhancements to FindMPI go, It might be worthwhile to check if > FC, CC,CXX match any obvious MPI wrappers, and then set MPI__compiler > and select the MPI version from there: If the user set the compiler > explicitly to an MPI wrapper, that's likely the MPI they intend to use.... > If I find some time maybe I'll work up a pull request for this. > It's actualy already there since this is the default and preferred behavior in Cray systems. As a fallback if MPI can't be found, then it tests the regular compilers. If successful, it will not interrogate them and MPI_FOUND wll be true but the MPI__{LIBRARIES,INCLUDE_DIRS} variables will be empty. Instead it will explicitly set MPI__COMPILER_NO_INTERROGATE=/path/to/mpi{cc,c++,f90}. Look around line 600 (try_reguilar_compiler and interrogate_mpi_compiler) I think the logic is a bit backwards on this and if you were to make a change, I'd suggest it be there and re-order a few things such that if MPI things haven't been already explicitly set then the *first* thing to do (rather than last) is test the regular compilers, then if those don't work, search for and interrogate the MPI wrappers. - Chuck -------------- next part -------------- An HTML attachment was scrubbed... URL: From zbeekman at gmail.com Thu Dec 1 14:10:48 2016 From: zbeekman at gmail.com (Zaak Beekman) Date: Thu, 01 Dec 2016 19:10:48 +0000 Subject: [CMake] FindMPI In-Reply-To: References: Message-ID: On Thu, Dec 1, 2016 at 2:02 PM Chuck Atkins wrote: > > I think the logic is a bit backwards on this and if you were to make a > change, I'd suggest it be there and re-order a few things such that if MPI > things haven't been already explicitly set then the *first* thing to do > (rather than last) is test the regular compilers, then if those don't work, > search for and interrogate the MPI wrappers. > > - Chuck > I agree, and further more, why does it not interrogate the MPI wrapper if set as FC or CC? Would there be any harm in attempting to pull out the {LIBRARIES,INCLUD_DIRS} etc.? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuck.atkins at kitware.com Thu Dec 1 14:47:20 2016 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Thu, 1 Dec 2016 14:47:20 -0500 Subject: [CMake] FindMPI In-Reply-To: References: Message-ID: > why does it not interrogate the MPI wrapper if set as FC or CC? > CC, CXX, and FC env vars are just used to initialize the CMAKE_{C,CXX,Fortran}_COMPILER variables wihch CMake will then use as the "regular" compilers for a given language. If those regular compilers already work with MPI then there's no need to retrieve the underlying settings that it uses. > Would there be any harm in attempting to pull out the > {LIBRARIES,INCLUD_DIRS} etc.? > They should be empty. People often think of the variables as "this is where MPI things are" which is not really what they mean. What they are saying is "these are the extra things to add when useing MPI". So if your primary compiler is an MPI wrapper then there's no extra includes or libraries to add. - Chuck -------------- next part -------------- An HTML attachment was scrubbed... URL: From gjasny at googlemail.com Sat Dec 3 05:17:21 2016 From: gjasny at googlemail.com (Gregor Jasny) Date: Sat, 3 Dec 2016 11:17:21 +0100 Subject: [CMake] A trouble in using cmake for xcode In-Reply-To: <201612011402122454567@163.com> References: <201612011402122454567@163.com> Message-ID: <06ac7f45-c4dd-a4cb-fc00-e6c62df92dee@googlemail.com> Hello, On 01/12/2016 07:02, wy39666161 at 163.com wrote: > I have a trouble in using cmake.I try to find a way to resolve that for a long time, but finally get no results. I attempt to create an ios application imessage extension by cmake but i can't find a suitable command. So i contact you for some suggestion. Look forward for your favourable reply. Thanks very much! Do you mean something like the "iMessage Application" in the Xcode project generation wizard? Thanks, Gregor From dan at su-root.co.uk Sat Dec 3 06:52:00 2016 From: dan at su-root.co.uk (Dan Liew) Date: Sat, 3 Dec 2016 11:52:00 +0000 Subject: [CMake] Adding dependencies to the `clean` target in 2016? Message-ID: Hi, As part of a project I work on we use CMake's `ExternalProject()` to build a set of runtime libraries that the project needs via a second build system (Makefile based) that knows how to build the runtime libraries. The code (which is full of hacks... sorry) is at [1]. What I want to do is when the `clean` target is invoked in the CMake generated build system is have the command `make clean` invoked on the project being built by `ExternalProject()`. There was a post about this 10 years ago [1], has anything changed since then? Using `ADDITIONAL_MAKE_CLEAN_FILES` is not really an option because CMake doesn't know what files are generated by the other build system. Even if CMake did know what those files were I don't think it should be removing them itself. It should be using the other build system because that knows best how to do a clean. I realise the `clean` target won't be available for all generators but for those that do, it would be really nice to able to do something like this. ``` if (TARGET clean) add_custom_target(CleanKLEERuntimes COMMAND make -f mycustom_makefile clean USES_TERMINAL ) add_dependencies(clean CleanKLEERuntimes) endif() ``` Right now this doesn't work though. * `if (TARGET clean)` is always false * `add_dependencies()` does not work on the `clean` target. [1] https://github.com/klee/klee/blob/28a3d47fa03b9ed98f1bbb4f1b38ecbd44ab1a00/runtime/CMakeLists.txt#L104 [2] https://cmake.org/pipermail/cmake/2006-October/011477.html Thanks, Dan. From gjasny at googlemail.com Sat Dec 3 13:46:55 2016 From: gjasny at googlemail.com (Gregor Jasny) Date: Sat, 3 Dec 2016 19:46:55 +0100 Subject: [CMake] A trouble in using cmake for xcode In-Reply-To: <0B6B1B78-9885-42CC-85C9-4DD37962DE5F@163.com> References: <201612011402122454567@163.com> <06ac7f45-c4dd-a4cb-fc00-e6c62df92dee@googlemail.com> <0B6B1B78-9885-42CC-85C9-4DD37962DE5F@163.com> Message-ID: <261bf29f-359b-78c0-b36e-b6040ca5e650@googlemail.com> On 03/12/2016 15:07, wy39666161 at 163.com wrote: >>> I have a trouble in using cmake.I try to find a way to resolve that for a long time, but finally get no results. I attempt to create an ios application imessage extension by cmake but i can't find a suitable command. So i contact you for some suggestion. Look forward for your favourable reply. Thanks very much! >> Do you mean something like the "iMessage Application" in the Xcode >> project generation wizard? > Yes, It is. Can you give me some suggestion. Thanks for your reply. I need to extend CMake to be able to set an arbitrary product type for the bundle. In your case: productType = "com.apple.product-type.application.messages"; productType = "com.apple.product-type.app-extension.messages"; Please give me some days to implement the behavior. Can you point me to an already existing extension (maybe on GitHub) and tell me how to test them in simulator? Thanks, Gregor From gjasny at googlemail.com Sat Dec 3 18:18:38 2016 From: gjasny at googlemail.com (Gregor Jasny) Date: Sun, 4 Dec 2016 00:18:38 +0100 Subject: [CMake] A trouble in using cmake for xcode In-Reply-To: <261bf29f-359b-78c0-b36e-b6040ca5e650@googlemail.com> References: <201612011402122454567@163.com> <06ac7f45-c4dd-a4cb-fc00-e6c62df92dee@googlemail.com> <0B6B1B78-9885-42CC-85C9-4DD37962DE5F@163.com> <261bf29f-359b-78c0-b36e-b6040ca5e650@googlemail.com> Message-ID: <3259bf55-954a-119a-0498-24e906a864ef@googlemail.com> On 03/12/2016 19:46, Gregor Jasny wrote: > On 03/12/2016 15:07, wy39666161 at 163.com wrote: >>>> I have a trouble in using cmake.I try to find a way to resolve that for a long time, but finally get no results. I attempt to create an ios application imessage extension by cmake but i can't find a suitable command. So i contact you for some suggestion. Look forward for your favourable reply. Thanks very much! > >>> Do you mean something like the "iMessage Application" in the Xcode >>> project generation wizard? > >> Yes, It is. Can you give me some suggestion. Thanks for your reply. > > I need to extend CMake to be able to set an arbitrary product type for > the bundle. In your case: > > productType = "com.apple.product-type.application.messages"; > productType = "com.apple.product-type.app-extension.messages"; I filed a preliminary merge request: https://gitlab.kitware.com/cmake/cmake/merge_requests/310 From rainer.poisel at gmail.com Sun Dec 4 15:01:09 2016 From: rainer.poisel at gmail.com (Rainer Poisel) Date: Sun, 4 Dec 2016 20:01:09 +0000 Subject: [CMake] Duplicating a shared library and replacing target link libraries Message-ID: Hello, I am currently developing a test-framework that offers two versions of a base-library: * the "originalLibrary" and * a library "originalLibraryForward" that has the same interface as the "originalLibrary". Calls to "originalLibraryForward"-functions can be forwarded to the "originalLibrary", however it is also possible to install pre- and post-call hooks, implement different behavior, reference counting, etc. Other libraries linking against "originalLibrary" can be tested by linking against "originalLibraryForward". In my build environment I want to have both versions of a library: one linking against "originalLibrary" and one linking against "originalLibraryForward". In order to minimize the effort to create the library linking against "originalLibraryForward", I wrote a function that "recreates" the library, however the linker is instructed to link against "originalLibraryForward" instead of "originalLibrary": 8<====================== function(AddMockedLibrary libraryName) get_target_property(sourceFiles ${libraryName} SOURCES) get_target_property(linkLibs ${libraryName} LINK_LIBRARIES) get_target_property(includeDirs ${libraryName} INCLUDE_DIRECTORIES) get_target_property(compileDefinitions ${libraryName} COMPILE_DEFINITIONS) get_target_property(compileOptions ${libraryName} COMPILE_OPTIONS) add_library(${libraryName}_MOCK SHARED ${sourceFiles} ) target_include_directories(${libraryName}_MOCK PRIVATE ${includeDirs} ) list(REMOVE_ITEM linkLibs originalLibrary ) target_link_libraries(${libraryName}_MOCK PRIVATE ${linkLibs} originalLibraryForward ) if (compileOptions) target_compile_options(${libraryName}_MOCK PRIVATE ${compileOptions} ) endif() if (compileDefinitions) target_compile_definitions(${libraryName}_MOCK PRIVATE ${compileDefinitions} ) endif() endfunction() 8<====================== Now to my problems: this approach works fairly well with two exceptions: The library linking against "originalLibraryForward" has to be compiled from the original sources too. Actually performing the linking step should be sufficient. Is there a way to accomplish that? The function does not work when the library passed to AddMockedLibrary() uses target_link_libraries() with IMPORTED targets from, e. g. calls to find_package(). In order to make creating the _MOCK-Library work I have to duplicate the original call to find_package() before calling AddMockedLibrary(). Is there a way to automate this as well? Thanks for your help, Rainer From spease at suitabletech.com Sun Dec 4 21:40:51 2016 From: spease at suitabletech.com (Steven Pease) Date: Sun, 4 Dec 2016 18:40:51 -0800 Subject: [CMake] Java example? Message-ID: Does anyone know where to find a Java .jar example for cmake that works with the latest signing requirements for an embedded applet? Thanks. -- - Steven -------------- next part -------------- An HTML attachment was scrubbed... URL: From timothy.rae at sbibits.com Sun Dec 4 21:47:20 2016 From: timothy.rae at sbibits.com (Timothy Rae) Date: Mon, 5 Dec 2016 11:47:20 +0900 Subject: [CMake] Prevent ExternalProject from updating git submodules In-Reply-To: References: <9cb3ed5e-f9c1-6d4e-27df-d6849c70a061@sbibits.com> <56263faa-9492-be51-d5b0-eaa238a7ecff@sbibits.com> Message-ID: <0ef85390-ec82-3b83-763e-0d202b5d13d6@sbibits.com> I finally got a chance to try David's suggestion out, but unfortunately that doesn't work. I think the ExternalProject script is downloading the submodules in a separate step rather than via the "git clone --recursive" command. I simply mentioned the recursive clone as a way to reproduce the issue. You could also just set a local filesystem path as the GIT_REPOSITORY and disable the internet to reproduce: 1) git clone https://github.com/ericniebler/range-v3.git LOCAL_CLONE_DIR 2) Add ExternalProject_Add(range-v3 GIT_REPOSITORY LOCAL_CLONE_DIR) to a project 3) Disable the internet 4) Attempt to build ** Watch it hang, and you have to ctrl+c to exit ** On 25/10/16 22:12, David Cole wrote: > Sounds like you should consider customizing the git clone with > DOWNLOAD_COMMAND. You can do anything you want as a customization... > > HTH, > David > > > On Oct 24, 2016, at 11:35 PM, Timothy Rae > wrote: > >> Thanks for the tip, but I'd rather it didn't fetch the documentation >> submodule at all, as this unnecessarily slows down the build. >> >> On Tue, Oct 25, 2016 at 12:29 PM, Hendrik Sattler >> > wrote: >> >> Hi, >> >> you can tell git where your copy of tree remote url is. This is >> site-specific and does not change the repository: >> git config remote."$origirl".url "$newurl" >> >> HS >> >> >> Am 25. Oktober 2016 03:52:12 MESZ, schrieb Tim Rae >> >: >> >Hi all, >> > >> >I'm using ExternalProject_Add to add the popular C++ library range-v3 >> >to >> >one of our projects. However, since the build server only has local >> >intranet access, and therefore can't access the main github >> repository, >> > >> >we have put a clone of that repo on our local gitlab: >> > >> >ExternalProject_Add(range-v3 >> > PREFIX ${PREFIX_DIR} >> > GIT_REPOSITORY ${LOCAL_GITLAB_URI} >> >) >> > >> >The problem is that range-v3 has a documentation submodule that >> points >> >to github, so `git clone ${LOCAL_GITLAB_URI} --recursive` would fail >> >when github is inaccessible, whereas git clone works fine without the >> >recursive flag. >> > >> >I found a previous message from Tim Gallagher on the mailing list >> >reporting the same problem, but it looks like the issue was never >> >addressed upstream. >> > >> >https://cmake.org/pipermail/cmake/2015-March/060100.html >> >> > >> >Unfortunately, specifying GIT_SUBMODULES "" will add all >> submodules, so >> > >> >it doesn't appear that variable will help to solve the issue. I would >> >suggest either having a special value like "__NONE__", or having >> a new >> >boolean variable like INIT_GIT_SUBMODULES; either of which can be >> used >> >to disable the automatic initialization of submodules entirely. >> > >> >You could also change the default to NOT pull in submodules. This >> would >> > >> >be much better IMHO, as the current behavior is unintuitive. Most >> >developers (e.g. myself until yesterday) don't even know what a >> >submodule is, and are only familiar with using git clone, as >> opposed to >> > >> >git clone --recursive. Obviously this would be a breaking change >> >though, >> >so I understand that you probably don't want to go with this option. >> > >> >For now I have "solved" the problem by adding a new commit to our >> >range-v3 fork removing all git submodules, however this makes it more >> >difficult to get the upstream changes in, so I highly recommend >> adding >> >an option to disable the automatic initialization of git submodules. >> > >> >Best regards, >> >Tim >> > >> >-- >> >*This correspondence (including any attachments) is for the intended >> >recipient(s) only. It may contain confidential or privileged >> >information or >> >both. No confidentiality or privilege is waived or lost by any >> >mis-transmission. If you receive this correspondence by mistake, >> please >> > >> >contact the sender immediately, delete this correspondence (and all >> >attachments) and destroy any hard copies. You must not use, disclose, >> >copy, >> >distribute or rely on any part of this correspondence (including any >> >attachments) if you are not the intended recipient(s). ? >> >???????????????????? ?? ????????? >> ????????????????????????? ? >> >?????????????? >> >? ??????????????????? ? ?????????? >> ????????????????????????? ? >> >??????????? >> >????????????????????? ?? ??????? >> ?????????????? ??????????????? ? >> >???????? >> >????????????????????? ????? ????? >> ???????????????? ??* >> >-- >> > >> >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 >> >> >> -- >> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail >> gesendet. >> >> >> >> /This correspondence (including any attachments) is for the intended >> recipient(s) only. It may contain confidential or privileged >> information or both. No confidentiality or privilege is waived or lost >> by any mis-transmission. If you receive this correspondence by >> mistake, please contact the sender immediately, delete this >> correspondence (and all attachments) and destroy any hard copies. You >> must not use, disclose, copy, distribute or rely on any part of this >> correspondence (including any attachments) if you are not the intended >> recipient(s).? ???????????????????? ?? ???? >> ?????????????????????????????? ? ??? >> ??????????? ? ??????????????????? ? >> ??????????????????????????????????? >> ? ??????????? ????????????????????? >> ?? ????????????????????? ??????????? >> ???? ? ???????? ???????????????????? >> ? ????? ????????????????????? ??/ >> -- >> >> 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 -- *This correspondence (including any attachments) is for the intended recipient(s) only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis-transmission. If you receive this correspondence by mistake, please contact the sender immediately, delete this correspondence (and all attachments) and destroy any hard copies. You must not use, disclose, copy, distribute or rely on any part of this correspondence (including any attachments) if you are not the intended recipient(s).?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????* From fabricio.ceolin at miningmath.com Mon Dec 5 06:31:46 2016 From: fabricio.ceolin at miningmath.com (=?UTF-8?Q?Fabr=C3=ADcio_Ceolin?=) Date: Mon, 5 Dec 2016 09:31:46 -0200 Subject: [CMake] CMAKE_EXPORT_COMPILE_COMMANDS don't work in CMakeLists.txt Message-ID: Hi, I am trying to put set(CMAKE_EXPORT_COMPILE_COMMANDS ,1) inside a toolchain file but the command has no effect there. I've tried to put it in CMakeLists.txt too using the previosly set and add_definitions(-DCMAKE_EXPORT_COMPILE_COMMANDS=1) without success. The command only works in command line, when I put -DCMAKE_EXPORT_COMPILE_COMMANDS=1 in cmake args. I am using ubuntu 16.04 with cmake 3.5.1 from ubuntu (3.5.1-1ubuntu1). Is it possible to use CMAKE_EXPORT_COMPILE_COMMANDS inside external toolchain file (using args -DCMAKE_TOOLCHAIN_FILE=.cmake) or in CMakeLists.txt? Thanks, Fabr?cio Ceolin +55 (31) 98675-1359 MiningMath Associates www.miningmath.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.king at kitware.com Mon Dec 5 09:05:41 2016 From: brad.king at kitware.com (Brad King) Date: Mon, 5 Dec 2016 09:05:41 -0500 Subject: [CMake] Adding dependencies to the `clean` target in 2016? In-Reply-To: References: Message-ID: On 12/03/2016 06:52 AM, Dan Liew wrote: > There was a post about this 10 years ago [1], has anything changed since then? No. From my response back then: >> The "clean" target is not a first class target available to >> CMakeLists.txt code....We do plan to make targets like install >> and clean first class eventually but it is not yet implemented. This never happened. These generator-provided targets have very different semantics (e.g. per-directory behavior in the Makefile generator) and that makes it hard to define them in a way that is visible to client code during configuration. It may be possible but will require deep design thought. > I realise the `clean` target won't be available for all generators but > for those that do, it would be really nice to able to do something > like this. > > add_dependencies(clean CleanKLEERuntimes) Just as `ADDITIONAL_MAKE_CLEAN_FILES` is a make-specific solution I think something like `ADDITIONAL_MAKE_CLEAN_COMMAND` or perhaps `ADDITIONAL_MAKE_CLEAN_TARGET` could be offered. Such configuration could be interpreted by the makefile generator while generating the "make clean" target. -Brad From mike.jackson at bluequartz.net Mon Dec 5 09:29:55 2016 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Mon, 05 Dec 2016 09:29:55 -0500 Subject: [CMake] BundleUtilities with Command line program on macOS Message-ID: <584579E3.9040301@bluequartz.net> I am using the BundleUtilites on macOS to create a redistributable package that consists of a large number of command line programs, libraries and other assorted support files. The issue that I am having is that each time BundleUtilities runs on a given executable, it will also attempt to "fix up" all the other executables in the installation directory. The result is that the packaging takes long and longer as it goes along, i.e., the first BundleUtility goes fast, but the second goes a bit slower because it attempts to fixup and verify the first AND the second. The third one does the first, second and third and so on and so on. Short of some sort of workaround that looks for a lock file or completion file or something to stop BundleUtilities from running a bunch of times is there a "better way"? Thanks -- Michael A. Jackson BlueQuartz Software, LLC [e]: mike.jackson at bluequartz.net From chuck.atkins at kitware.com Mon Dec 5 11:21:24 2016 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Mon, 5 Dec 2016 11:21:24 -0500 Subject: [CMake] Duplicating a shared library and replacing target link libraries In-Reply-To: References: Message-ID: > > The library linking against "originalLibraryForward" has to be > compiled from the original sources too. Actually performing the linking step should be sufficient. Is there a way to accomplish that? > Object libraries are what you need here. See https://cmake.org/cmake/help/v3.7/manual/cmake-buildsystem.7.html#object-libraries . Essentially you'll do something like this: add_library(fooObj OBJECT ${foo_Common_Sources}) add_library(foo $ ${foo_RealOnly_Sources}) add_library(fooMock $ ${foo_MockOnly_Sources}) The function does not work when the library passed to > AddMockedLibrary() uses target_link_libraries() with IMPORTED targets > from, e. g. calls to find_package(). In order to make creating the > _MOCK-Library work I have to duplicate the original call to > find_package() before calling AddMockedLibrary(). Is there a way to > automate this as well? > You might be able to go down the route of creating an INTERFACE library with all of the common properties necessary for both the actual and mock libraries. You could then add the interface lib as a public dependency with target_link_libraries(foo PUBLIC fooInterface) and target_link_libraries(fooMock PUBLIC fooInterface). It's a bit convoluted but I think it could work well here for you. - Chuck -------------- next part -------------- An HTML attachment was scrubbed... URL: From zmertens at asu.edu Mon Dec 5 13:42:18 2016 From: zmertens at asu.edu (Zach Mertens-McConnell) Date: Mon, 5 Dec 2016 11:42:18 -0700 Subject: [CMake] RPATH issue using ExternalProject_Add Message-ID: I'm having an issue building a child project through my master project where the child project is an "External Project" which is automatically built using CMake's "ExternalProject_Add" feature if it is not found (using "FindChildProject.cmake"). The error message happens during installing of the child project after running my cmake and make command. *cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..* *make -j8* *[ 1%] Performing update step for 'ext_dawg'* *[ 2%] Performing configure step for 'ext_dawg'* *-- Compiling with build type 'Release'.* *-- version: 1.1.2-429-g56f23c7.* *-- Boost version: 1.58.0* *-- Found the following Boost libraries:* *-- program_options* *-- unit_test_framework* *[ 89%] Built target phylogenyLib* *-- Configuring done* *-- Generating done* *-- Build files have been written to: /home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build* *[ 89%] Performing build step for 'ext_dawg'* *[ 87%] Built target libdawg2-static* *[ 87%] Built target libdawg2* *[ 87%] Built target version* *[100%] Built target dawg* *[ 89%] Performing install step for 'ext_dawg'* *[ 87%] Built target libdawg2* *[ 87%] Built target libdawg2-static* *[ 87%] Built target version* *[100%] Built target dawg* *Install the project...* *-- Install configuration: "Release"* *-- Up-to-date: /home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build/doc/dawg-2/copying.txt* *-- Up-to-date: /home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build/doc/dawg-2/readme.txt* *-- Up-to-date: /home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build/doc/dawg-2/changelog.txt* *-- Up-to-date: /home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build/share/dawg-2/lambda.pl * *-- Up-to-date: /home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build/share/dawg-2/outsplit.pl * *-- Up-to-date: /home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build/share/dawg-2/nexus2fasta.pl * *-- Up-to-date: /home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build/share/dawg-2/varrep.pl * *-- Installing: /home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build/bin/dawg* *CMake Error at src/cmake_install.cmake:45 (file):* * file RPATH_CHANGE could not write new RPATH:* * /home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build/lib* * to the file:* * /home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build/bin/dawg* * No valid ELF RPATH or RUNPATH entry exists in the file;* *Call Stack (most recent call first):* * cmake_install.cmake:64 (include)* *Makefile:116: recipe for target 'install' failed* *make[3]: *** [install] Error 1* *CMakeFiles/ext_dawg.dir/build.make:74: recipe for target 'ext_deps/ext_dawg-stamp/ext_dawg-install' failed* *make[2]: *** [ext_deps/ext_dawg-stamp/ext_dawg-install] Error 2* *CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/ext_dawg.dir/all' failed* *make[1]: *** [CMakeFiles/ext_dawg.dir/all] Error 2* *Makefile:127: recipe for target 'all' failed* *make: *** [all] Error 2* ---------------------------------------------------------------------------------------------------------------------------- This child project can be built alone with no issues (it will install as well), but it can't seem to be built as an external project due to the RPATH error message above. Do I need to modify the RPATH settings from the master project or how can I specify the order of installation such that the libs are installed before the bin? The static library, libdawg2.a, which is trying to be linked to the executable in the error message above, is built in "/home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build/src/lib", but is installed to "/home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build/lib" where the executable in "/home/hendrix/repo/spartaabc-personal/build/ext_deps/ext_dawg-build/bin" needs to set it's RPATH. And like I said I can build this child project alone, it's RPATH is set to "/lib" in it's respective CMakeLists.txt file. -- Zach Mertens zmertens at asu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike.jackson at bluequartz.net Mon Dec 5 21:38:13 2016 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Mon, 05 Dec 2016 21:38:13 -0500 Subject: [CMake] Full absolute path as RPATH in build tree Message-ID: <58462495.2000600@bluequartz.net> what combinations of RPATH variables do I need to set to get a full, absolute path to a build library in my build tree? THis is on macOS 10.10.5 and cmake 3.5 and above. I have tried all sorts of combinations and I either get just the library name or @rpath/library.dylib neither of which is going to work for my needs. Thanks -- Michael A. Jackson BlueQuartz Software, LLC [e]: mike.jackson at bluequartz.net From clinton at elemtech.com Mon Dec 5 22:20:15 2016 From: clinton at elemtech.com (clinton at elemtech.com) Date: Mon, 5 Dec 2016 20:20:15 -0700 (MST) Subject: [CMake] Full absolute path as RPATH in build tree In-Reply-To: <58462495.2000600@bluequartz.net> References: <58462495.2000600@bluequartz.net> Message-ID: <318977683.103762914.1480994415316.JavaMail.zimbra@elemtech.com> Do you want the library identification to be a full path? set_target_properties(foo PROPERTIES MACOSX_RPATH OFF) Clint ----- On Dec 5, 2016, at 7:38 PM, Michael Jackson mike.jackson at bluequartz.net wrote: > what combinations of RPATH variables do I need to set to get a full, > absolute path to a build library in my build tree? THis is on macOS > 10.10.5 and cmake 3.5 and above. I have tried all sorts of combinations > and I either get just the library name or @rpath/library.dylib neither > of which is going to work for my needs. > > Thanks > > -- > Michael A. Jackson > BlueQuartz Software, LLC > [e]: mike.jackson at bluequartz.net > -- > > 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 mike.jackson at bluequartz.net Mon Dec 5 22:22:22 2016 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Mon, 05 Dec 2016 22:22:22 -0500 Subject: [CMake] Full absolute path as RPATH in build tree In-Reply-To: <318977683.103762914.1480994415316.JavaMail.zimbra@elemtech.com> References: <58462495.2000600@bluequartz.net> <318977683.103762914.1480994415316.JavaMail.zimbra@elemtech.com> Message-ID: <58462EEE.7000106@bluequartz.net> I have this: if(APPLE AND BUILD_SHARED_LIBS) set_target_properties(EMsoftLib PROPERTIES MACOSX_RPATH FALSE) set_target_properties(EMsoftLib PROPERTIES INSTALL_NAME_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") endif() -- Michael A. Jackson 400 S. Pioneer Blvd Owner, President Springboro, Ohio 45066 BlueQuartz Software, LLC EMail: mike.jackson at bluequartz.net Voice: 937-790-1601 Web: http://www.bluequartz.net Fax: 937-746-0783 clinton at elemtech.com wrote: > Do you want the library identification to be a full path? > set_target_properties(foo PROPERTIES MACOSX_RPATH OFF) > > Clint > > ----- On Dec 5, 2016, at 7:38 PM, Michael Jackson mike.jackson at bluequartz.net wrote: > >> what combinations of RPATH variables do I need to set to get a full, >> absolute path to a build library in my build tree? THis is on macOS >> 10.10.5 and cmake 3.5 and above. I have tried all sorts of combinations >> and I either get just the library name or @rpath/library.dylib neither >> of which is going to work for my needs. >> >> Thanks >> >> -- >> Michael A. Jackson >> BlueQuartz Software, LLC >> [e]: mike.jackson at bluequartz.net >> -- >> >> 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 clinton at elemtech.com Mon Dec 5 22:32:47 2016 From: clinton at elemtech.com (clinton at elemtech.com) Date: Mon, 5 Dec 2016 20:32:47 -0700 (MST) Subject: [CMake] Full absolute path as RPATH in build tree In-Reply-To: <58462EEE.7000106@bluequartz.net> References: <58462495.2000600@bluequartz.net> <318977683.103762914.1480994415316.JavaMail.zimbra@elemtech.com> <58462EEE.7000106@bluequartz.net> Message-ID: <2092107081.103767616.1480995167434.JavaMail.zimbra@elemtech.com> If you want the INSTALL_NAME_DIR to have effect in the build tree, you also need set_target_properties(EMsoftLib PROPERTIES BUILD_WITH_INSTALL_RPATH ON) Clint ----- On Dec 5, 2016, at 8:22 PM, Michael Jackson mike.jackson at bluequartz.net wrote: > I have this: > > if(APPLE AND BUILD_SHARED_LIBS) > set_target_properties(EMsoftLib PROPERTIES MACOSX_RPATH FALSE) > set_target_properties(EMsoftLib PROPERTIES INSTALL_NAME_DIR > "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") > endif() > > -- > Michael A. Jackson 400 S. Pioneer Blvd > Owner, President Springboro, Ohio 45066 > BlueQuartz Software, LLC EMail: mike.jackson at bluequartz.net > Voice: 937-790-1601 Web: http://www.bluequartz.net > Fax: 937-746-0783 > > > clinton at elemtech.com wrote: >> Do you want the library identification to be a full path? >> set_target_properties(foo PROPERTIES MACOSX_RPATH OFF) >> >> Clint >> >> ----- On Dec 5, 2016, at 7:38 PM, Michael Jackson mike.jackson at bluequartz.net >> wrote: >> >>> what combinations of RPATH variables do I need to set to get a full, >>> absolute path to a build library in my build tree? THis is on macOS >>> 10.10.5 and cmake 3.5 and above. I have tried all sorts of combinations >>> and I either get just the library name or @rpath/library.dylib neither >>> of which is going to work for my needs. >>> >>> Thanks >>> >>> -- >>> Michael A. Jackson >>> BlueQuartz Software, LLC >>> [e]: mike.jackson at bluequartz.net >>> -- >>> >>> 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 Dec 6 09:47:18 2016 From: DLRdave at aol.com (David Cole) Date: Tue, 6 Dec 2016 09:47:18 -0500 Subject: [CMake] Prevent ExternalProject from updating git submodules In-Reply-To: <0ef85390-ec82-3b83-763e-0d202b5d13d6@sbibits.com> References: <9cb3ed5e-f9c1-6d4e-27df-d6849c70a061@sbibits.com> <56263faa-9492-be51-d5b0-eaa238a7ecff@sbibits.com> <0ef85390-ec82-3b83-763e-0d202b5d13d6@sbibits.com> Message-ID: If you customize DOWNLOAD_COMMAND, you should also probably customize UPDATE_COMMAND. If you are just using a fixed snapshot from some repo, consider simply using a *.tar.gz snapped to that commit rather than connecting to the repo at all. The GitHub "/archive/" URLs are perfect for this. However, if you are still going to use some sort of git command for DOWNLOAD_COMMAND, just use: UPDATE_COMMAND "" to prevent any git commands from running after the download step. By the way, it's unclear to me: are you just trying to get something to work for your project, or are you saying there's a bug in CMake that needs to be dealt with regardless of what you do for your project. The repo-based ExternalProject stuff assumes online status is readily available... If that's not true, you shouldn't use the repo-based ExternalProject stuff and instead use a "download everything once to a local spot" and then thereafter use the local stuff. HTH, David C. On Sun, Dec 4, 2016 at 9:47 PM, Timothy Rae wrote: > I finally got a chance to try David's suggestion out, but unfortunately that > doesn't work. I think the ExternalProject script is downloading the > submodules in a separate step rather than via the "git clone --recursive" > command. > > I simply mentioned the recursive clone as a way to reproduce the issue. You > could also just set a local filesystem path as the GIT_REPOSITORY and > disable the internet to reproduce: > > 1) git clone https://github.com/ericniebler/range-v3.git LOCAL_CLONE_DIR > 2) Add ExternalProject_Add(range-v3 GIT_REPOSITORY LOCAL_CLONE_DIR) to a > project > 3) Disable the internet > 4) Attempt to build > > ** Watch it hang, and you have to ctrl+c to exit ** > > > On 25/10/16 22:12, David Cole wrote: >> >> Sounds like you should consider customizing the git clone with >> DOWNLOAD_COMMAND. You can do anything you want as a customization... >> >> HTH, >> David >> >> >> On Oct 24, 2016, at 11:35 PM, Timothy Rae > > wrote: >> >>> Thanks for the tip, but I'd rather it didn't fetch the documentation >>> submodule at all, as this unnecessarily slows down the build. >>> >>> On Tue, Oct 25, 2016 at 12:29 PM, Hendrik Sattler >>> > wrote: >>> >>> Hi, >>> >>> you can tell git where your copy of tree remote url is. This is >>> site-specific and does not change the repository: >>> git config remote."$origirl".url "$newurl" >>> >>> HS >>> >>> >>> Am 25. Oktober 2016 03:52:12 MESZ, schrieb Tim Rae >>> >: >>> >>> >Hi all, >>> > >>> >I'm using ExternalProject_Add to add the popular C++ library >>> range-v3 >>> >to >>> >one of our projects. However, since the build server only has local >>> >intranet access, and therefore can't access the main github >>> repository, >>> > >>> >we have put a clone of that repo on our local gitlab: >>> > >>> >ExternalProject_Add(range-v3 >>> > PREFIX ${PREFIX_DIR} >>> > GIT_REPOSITORY ${LOCAL_GITLAB_URI} >>> >) >>> > >>> >The problem is that range-v3 has a documentation submodule that >>> points >>> >to github, so `git clone ${LOCAL_GITLAB_URI} --recursive` would fail >>> >when github is inaccessible, whereas git clone works fine without >>> the >>> >recursive flag. >>> > >>> >I found a previous message from Tim Gallagher on the mailing list >>> >reporting the same problem, but it looks like the issue was never >>> >addressed upstream. >>> > >>> >https://cmake.org/pipermail/cmake/2015-March/060100.html >>> >>> > >>> >Unfortunately, specifying GIT_SUBMODULES "" will add all >>> submodules, so >>> > >>> >it doesn't appear that variable will help to solve the issue. I >>> would >>> >suggest either having a special value like "__NONE__", or having >>> a new >>> >boolean variable like INIT_GIT_SUBMODULES; either of which can be >>> used >>> >to disable the automatic initialization of submodules entirely. >>> > >>> >You could also change the default to NOT pull in submodules. This >>> would >>> > >>> >be much better IMHO, as the current behavior is unintuitive. Most >>> >developers (e.g. myself until yesterday) don't even know what a >>> >submodule is, and are only familiar with using git clone, as >>> opposed to >>> > >>> >git clone --recursive. Obviously this would be a breaking change >>> >though, >>> >so I understand that you probably don't want to go with this option. >>> > >>> >For now I have "solved" the problem by adding a new commit to our >>> >range-v3 fork removing all git submodules, however this makes it >>> more >>> >difficult to get the upstream changes in, so I highly recommend >>> adding >>> >an option to disable the automatic initialization of git submodules. >>> > >>> >Best regards, >>> >Tim >>> > >>> >-- >>> >*This correspondence (including any attachments) is for the intended >>> >recipient(s) only. It may contain confidential or privileged >>> >information or >>> >both. No confidentiality or privilege is waived or lost by any >>> >mis-transmission. If you receive this correspondence by mistake, >>> please >>> > >>> >contact the sender immediately, delete this correspondence (and all >>> >attachments) and destroy any hard copies. You must not use, >>> disclose, >>> >copy, >>> >distribute or rely on any part of this correspondence (including any >>> >attachments) if you are not the intended recipient(s). ? >>> >???????????????????? ?? ????????? >>> ????????????????????????? ? >>> >?????????????? >>> >? ??????????????????? ? ?????????? >>> ????????????????????????? ? >>> >??????????? >>> >????????????????????? ?? ??????? >>> ?????????????? ??????????????? ? >>> >???????? >>> >????????????????????? ????? ????? >>> ???????????????? ??* >>> >-- >>> > >>> >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 >>> >>> >>> -- >>> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail >>> gesendet. >>> >>> >>> >>> /This correspondence (including any attachments) is for the intended >>> recipient(s) only. It may contain confidential or privileged >>> information or both. No confidentiality or privilege is waived or lost >>> by any mis-transmission. If you receive this correspondence by >>> mistake, please contact the sender immediately, delete this >>> correspondence (and all attachments) and destroy any hard copies. You >>> must not use, disclose, copy, distribute or rely on any part of this >>> correspondence (including any attachments) if you are not the intended >>> recipient(s).? ???????????????????? ?? ???? >>> ?????????????????????????????? ? ??? >>> ??????????? ? ??????????????????? ? >>> ??????????????????????????????????? >>> ? ??????????? ????????????????????? >>> ?? ????????????????????? ??????????? >>> ???? ? ???????? ???????????????????? >>> ? ????? ????????????????????? ??/ >>> -- >>> >>> 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 > > > > -- > *This correspondence (including any attachments) is for the intended > recipient(s) only. It may contain confidential or privileged information or > both. No confidentiality or privilege is waived or lost by any > mis-transmission. If you receive this correspondence by mistake, please > contact the sender immediately, delete this correspondence (and all > attachments) and destroy any hard copies. You must not use, disclose, copy, > distribute or rely on any part of this correspondence (including any > attachments) if you are not the intended > recipient(s).?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????* From bram.dejong at gmail.com Tue Dec 6 16:30:18 2016 From: bram.dejong at gmail.com (Bram de Jong) Date: Tue, 6 Dec 2016 22:30:18 +0100 Subject: [CMake] back-slashes for generator expression on windows Message-ID: hi cmake-peoples! CMake v3.7.0: I'm using $ and $ on Windows and they generate paths with forward slashes... Is there an easy way to convert these to back-slashes? The testing tool (i.e. via add_test( ) ) I am using expects back-slashes... - Bram -- http://www.freesound.org http://www.smartelectronix.com http://www.musicdsp.org Mobile: +49 (0) 176 68279940 -------------- next part -------------- An HTML attachment was scrubbed... URL: From craig.scott at crascit.com Tue Dec 6 16:33:30 2016 From: craig.scott at crascit.com (Craig Scott) Date: Wed, 7 Dec 2016 08:33:30 +1100 Subject: [CMake] back-slashes for generator expression on windows In-Reply-To: References: Message-ID: Check out the $ generator expression. See docs at the bottom of the following page: https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html Something like $> should work I think. On Wed, Dec 7, 2016 at 8:30 AM, Bram de Jong wrote: > hi cmake-peoples! > > CMake v3.7.0: I'm using $ and $ on > Windows and they generate paths with forward slashes... Is there an easy > way to convert these to back-slashes? > > The testing tool (i.e. via add_test( ) ) I am using expects back-slashes... > > - Bram > > -- > http://www.freesound.org > http://www.smartelectronix.com > http://www.musicdsp.org > > Mobile: +49 (0) 176 68279940 > > -- > > 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 > -- Craig Scott Melbourne, Australia https://crascit.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From public at jayeshbadwaik.in Tue Dec 6 23:48:04 2016 From: public at jayeshbadwaik.in (Jayesh Badwaik) Date: Wed, 07 Dec 2016 05:48:04 +0100 Subject: [CMake] Replacing Compile Options for a Target Message-ID: <2469592.hB6mriArqC@wadner> Hi, My global compile flags are specified with "std=c++14" in them. However, there is a third party header file which I want to compile in my code wherein I need to use a completely different set of compile flags starting with "-std=c++98". I have seen target_compile_options() but that seems to just add options to the already available global options. What command should I use to assign a completely new set of flags from the scratch. -- Cheers Jayesh Badwaik https://www.jayeshbadwaik.in -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part. URL: From Dvir.Yitzchaki at ceva-dsp.com Wed Dec 7 00:31:02 2016 From: Dvir.Yitzchaki at ceva-dsp.com (Dvir Yitzchaki) Date: Wed, 7 Dec 2016 05:31:02 +0000 Subject: [CMake] Replacing Compile Options for a Target In-Reply-To: <2469592.hB6mriArqC@wadner> References: <2469592.hB6mriArqC@wadner> Message-ID: There's no problem as the compiler will just use the last flag value. See an example at http://coliru.stacked-crooked.com/a/738fff0fcc2eb3c4. Regards, Dvir Yitzchaki Debugger Software Engineer, SDT -----Original Message----- From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Jayesh Badwaik Sent: Wednesday, December 07, 2016 6:48 AM To: CMake Subject: [CMake] Replacing Compile Options for a Target Hi, My global compile flags are specified with "std=c++14" in them. However, there is a third party header file which I want to compile in my code wherein I need to use a completely different set of compile flags starting with "-std=c++98". I have seen target_compile_options() but that seems to just add options to the already available global options. What command should I use to assign a completely new set of flags from the scratch. -- Cheers Jayesh Badwaik https://www.jayeshbadwaik.in From bram.dejong at gmail.com Wed Dec 7 03:51:14 2016 From: bram.dejong at gmail.com (Bram de Jong) Date: Wed, 7 Dec 2016 09:51:14 +0100 Subject: [CMake] back-slashes for generator expression on windows In-Reply-To: References: Message-ID: Thanks, that works wonderfully! - bram On Tue, Dec 6, 2016 at 10:33 PM, Craig Scott wrote: > Check out the $ generator expression. See docs at the > bottom of the following page: > > https://cmake.org/cmake/help/latest/manual/cmake-generator- > expressions.7.html > > Something like $> should work I think. > > > On Wed, Dec 7, 2016 at 8:30 AM, Bram de Jong > wrote: > >> hi cmake-peoples! >> >> CMake v3.7.0: I'm using $ and $ on >> Windows and they generate paths with forward slashes... Is there an easy >> way to convert these to back-slashes? >> >> The testing tool (i.e. via add_test( ) ) I am using expects >> back-slashes... >> >> - Bram >> >> -- >> http://www.freesound.org >> http://www.smartelectronix.com >> http://www.musicdsp.org >> >> Mobile: +49 (0) 176 68279940 >> >> -- >> >> 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 >> > > > > -- > Craig Scott > Melbourne, Australia > https://crascit.com > -- http://www.freesound.org http://www.smartelectronix.com http://www.musicdsp.org Mobile: +49 (0) 176 68279940 -------------- next part -------------- An HTML attachment was scrubbed... URL: From post at hendrik-sattler.de Wed Dec 7 04:50:09 2016 From: post at hendrik-sattler.de (Hendrik Sattler) Date: Wed, 07 Dec 2016 10:50:09 +0100 Subject: [CMake] Replacing Compile Options for a Target In-Reply-To: References: <2469592.hB6mriArqC@wadner> Message-ID: Hi, actually not all compilers do that. There are really strange ones out there. HS Am 7. Dezember 2016 06:31:02 MEZ, schrieb Dvir Yitzchaki : >There's no problem as the compiler will just use the last flag value. >See an example at http://coliru.stacked-crooked.com/a/738fff0fcc2eb3c4. > >Regards, > >Dvir Yitzchaki >Debugger Software Engineer, SDT > > >-----Original Message----- >From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Jayesh >Badwaik >Sent: Wednesday, December 07, 2016 6:48 AM >To: CMake >Subject: [CMake] Replacing Compile Options for a Target > >Hi, > >My global compile flags are specified with "std=c++14" in them. >However, there is a third party header file which I want to compile in >my code wherein I need to use a completely different set of compile >flags starting with "-std=c++98". > >I have seen target_compile_options() but that seems to just add options >to the already available global options. What command should I use to >assign a completely new set of flags from the scratch. > >-- >Cheers >Jayesh Badwaik >https://www.jayeshbadwaik.in -- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet. From david.wagner at intel.com Wed Dec 7 05:07:43 2016 From: david.wagner at intel.com (Wagner, David) Date: Wed, 7 Dec 2016 11:07:43 +0100 Subject: [CMake] Replacing Compile Options for a Target In-Reply-To: References: <2469592.hB6mriArqC@wadner> Message-ID: <5847DF6F.9020707@intel.com> Instead of using the global flags target_compile_options(), you could use the global CMAKE_CXX_STANDARD variable and the set_target_properties( PROPERTIES CXX_STANDARD 14) command. W On 07/12/2016 10:50, Hendrik Sattler wrote: > Hi, > > actually not all compilers do that. There are really strange ones out there. > > HS > > > Am 7. Dezember 2016 06:31:02 MEZ, schrieb Dvir Yitzchaki : >> There's no problem as the compiler will just use the last flag value. >> See an example at http://coliru.stacked-crooked.com/a/738fff0fcc2eb3c4. >> >> Regards, >> >> Dvir Yitzchaki >> Debugger Software Engineer, SDT >> >> >> -----Original Message----- >> From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Jayesh >> Badwaik >> Sent: Wednesday, December 07, 2016 6:48 AM >> To: CMake >> Subject: [CMake] Replacing Compile Options for a Target >> >> Hi, >> >> My global compile flags are specified with "std=c++14" in them. >> However, there is a third party header file which I want to compile in >> my code wherein I need to use a completely different set of compile >> flags starting with "-std=c++98". >> >> I have seen target_compile_options() but that seems to just add options >> to the already available global options. What command should I use to >> assign a completely new set of flags from the scratch. >> >> -- >> Cheers >> Jayesh Badwaik >> https://www.jayeshbadwaik.in > -- David Wagner complex != complicated --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. From david.wagner at intel.com Wed Dec 7 05:13:50 2016 From: david.wagner at intel.com (Wagner, David) Date: Wed, 7 Dec 2016 11:13:50 +0100 Subject: [CMake] CMAKE_EXPORT_COMPILE_COMMANDS don't work in CMakeLists.txt In-Reply-To: References: Message-ID: <5847E0DE.5090906@intel.com> On 05/12/2016 12:31, Fabr?cio Ceolin wrote: > Hi, > > I am trying to put > set(CMAKE_EXPORT_COMPILE_COMMANDS ,1) inside a toolchain file but the command > has no effect there. I've tried to put it in CMakeLists.txt too using the > previosly set and add_definitions(-DCMAKE_EXPORT_COMPILE_COMMANDS=1) without > success. "set(CMAKE_EXPORT_COMPILE_COMMANDS 1)" inside the CMakeLists.txt works for me but note that you have an extra comma before the "1" value. CMake only uses commas for lists. It probably also works in the toolchain file. I don't see how using add_definitions() would work because it is only used in the compiler's command line. W -- David Wagner complex != complicated --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. From fabricio.ceolin at miningmath.com Wed Dec 7 05:35:07 2016 From: fabricio.ceolin at miningmath.com (=?UTF-8?Q?Fabr=C3=ADcio_Ceolin?=) Date: Wed, 7 Dec 2016 08:35:07 -0200 Subject: [CMake] CMAKE_EXPORT_COMPILE_COMMANDS don't work in CMakeLists.txt In-Reply-To: <5847E0DE.5090906@intel.com> References: <5847E0DE.5090906@intel.com> Message-ID: Hi, Thank you David. Which version of cmake and operational system are you using? In my CMakeLists.txt file, I tried to set set(CMAKE_EXPORT_COMPILE_COMMANDS 1) and set(CMAKE_EXPORT_COMPILE_COMMANDS ON) without success, unfortunately. Em qua, 7 de dez de 2016 ?s 08:13, Wagner, David escreveu: > > > On 05/12/2016 12:31, Fabr?cio Ceolin wrote: > > Hi, > > > > I am trying to put > > set(CMAKE_EXPORT_COMPILE_COMMANDS ,1) inside a toolchain file but the > command > > has no effect there. I've tried to put it in CMakeLists.txt too using the > > previosly set and add_definitions(-DCMAKE_EXPORT_COMPILE_COMMANDS=1) > without > > success. > > "set(CMAKE_EXPORT_COMPILE_COMMANDS 1)" inside the CMakeLists.txt works > for me > but note that you have an extra comma before the "1" value. CMake only uses > commas for lists. It probably also works in the toolchain file. I don't > see how > using add_definitions() would work because it is only used in the > compiler's > command line. > > W > > -- > David Wagner > > complex != complicated > --------------------------------------------------------------------- > Intel Corporation SAS (French simplified joint stock company) > Registered headquarters: "Les Montalets"- 2, rue de Paris, > 92196 Meudon Cedex, France > Registration Number: 302 456 199 R.C.S. NANTERRE > Capital: 4,572,000 Euros > > This e-mail and any attachments may contain confidential material for > the sole use of the intended recipient(s). Any review or distribution > by others is strictly prohibited. If you are not the intended > recipient, please contact the sender and delete all copies. > > -- > > 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 public at jayeshbadwaik.in Wed Dec 7 05:38:18 2016 From: public at jayeshbadwaik.in (Jayesh Badwaik) Date: Wed, 07 Dec 2016 11:38:18 +0100 Subject: [CMake] Replacing Compile Options for a Target In-Reply-To: References: <2469592.hB6mriArqC@wadner> Message-ID: <185140364.9NgI0FP0S5@wadner> On Wednesday, 7 December 2016 05:31:02 CET you wrote: > There's no problem as the compiler will just use the last flag value. > See an example at http://coliru.stacked-crooked.com/a/738fff0fcc2eb3c4. Still, seems very ugly solution. Also doesn't work with multiple different flags. Better solution I have found is to create a static library from the header in a subdirectory and set CMAKE_CXX_FLAGS for that subdirectory only. This seems to be working and looks robust for all test cases I have encountered. -- Cheers Jayesh Badwaik https://www.jayeshbadwaik.in -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part. URL: From david.wagner at intel.com Wed Dec 7 05:48:18 2016 From: david.wagner at intel.com (Wagner, David) Date: Wed, 7 Dec 2016 11:48:18 +0100 Subject: [CMake] CMAKE_EXPORT_COMPILE_COMMANDS don't work in CMakeLists.txt In-Reply-To: References: <5847E0DE.5090906@intel.com> Message-ID: <5847E8F2.8060100@intel.com> I've tested this on Ubuntu 15.10 using CMake 3.2.2 Where, in the CMakeLists did you put it? As far as I can tell, it needs to be done before defining the targets for which you want compile commands to be exported. W On 07/12/2016 11:35, Fabr?cio Ceolin wrote: > Hi, > > Thank you David. Which version of cmake and operational system are you using? > In my CMakeLists.txt file, I tried to set > > set(CMAKE_EXPORT_COMPILE_COMMANDS 1) > > and > > set(CMAKE_EXPORT_COMPILE_COMMANDS ON) > > without success, unfortunately. > > Em qua, 7 de dez de 2016 ?s 08:13, Wagner, David > escreveu: > > > > On 05/12/2016 12:31, Fabr?cio Ceolin wrote: > > Hi, > > > > I am trying to put > > set(CMAKE_EXPORT_COMPILE_COMMANDS ,1) inside a toolchain file but the command > > has no effect there. I've tried to put it in CMakeLists.txt too using the > > previosly set and add_definitions(-DCMAKE_EXPORT_COMPILE_COMMANDS=1) without > > success. > > "set(CMAKE_EXPORT_COMPILE_COMMANDS 1)" inside the CMakeLists.txt works for me > but note that you have an extra comma before the "1" value. CMake only uses > commas for lists. It probably also works in the toolchain file. I don't see how > using add_definitions() would work because it is only used in the compiler's > command line. > > W > > -- > David Wagner > > complex != complicated > --------------------------------------------------------------------- > Intel Corporation SAS (French simplified joint stock company) > Registered headquarters: "Les Montalets"- 2, rue de Paris, > 92196 Meudon Cedex, France > Registration Number: 302 456 199 R.C.S. NANTERRE > Capital: 4,572,000 Euros > > This e-mail and any attachments may contain confidential material for > the sole use of the intended recipient(s). Any review or distribution > by others is strictly prohibited. If you are not the intended > recipient, please contact the sender and delete all copies. > > -- > > 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 > > -- David Wagner complex != complicated --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. From fabricio.ceolin at miningmath.com Wed Dec 7 11:16:44 2016 From: fabricio.ceolin at miningmath.com (=?UTF-8?Q?Fabr=C3=ADcio_Ceolin?=) Date: Wed, 7 Dec 2016 14:16:44 -0200 Subject: [CMake] CMAKE_EXPORT_COMPILE_COMMANDS don't work in CMakeLists.txt In-Reply-To: <5847E8F2.8060100@intel.com> References: <5847E0DE.5090906@intel.com> <5847E8F2.8060100@intel.com> Message-ID: Putting set(CMAKE_EXPORT_COMPILE_COMMANDS 1) right above defining target solve the problem. Fabr?cio Ceolin +55 (31) 98675-1359 MiningMath Associates www.miningmath.com 2016-12-07 8:48 GMT-02:00 Wagner, David : > I've tested this on Ubuntu 15.10 using CMake 3.2.2 > > Where, in the CMakeLists did you put it? As far as I can tell, it needs to > be done before defining the targets for which you want compile commands to > be exported. > > W > > On 07/12/2016 11:35, Fabr?cio Ceolin wrote: > >> Hi, >> >> Thank you David. Which version of cmake and operational system are you >> using? >> In my CMakeLists.txt file, I tried to set >> >> set(CMAKE_EXPORT_COMPILE_COMMANDS 1) >> >> and >> >> set(CMAKE_EXPORT_COMPILE_COMMANDS ON) >> >> without success, unfortunately. >> >> Em qua, 7 de dez de 2016 ?s 08:13, Wagner, David > > escreveu: >> >> >> >> >> On 05/12/2016 12:31, Fabr?cio Ceolin wrote: >> > Hi, >> > >> > I am trying to put >> > set(CMAKE_EXPORT_COMPILE_COMMANDS ,1) inside a toolchain file but >> the command >> > has no effect there. I've tried to put it in CMakeLists.txt too >> using the >> > previosly set and add_definitions(-DCMAKE_EXPORT_COMPILE_COMMANDS=1) >> without >> > success. >> >> "set(CMAKE_EXPORT_COMPILE_COMMANDS 1)" inside the CMakeLists.txt >> works for me >> but note that you have an extra comma before the "1" value. CMake >> only uses >> commas for lists. It probably also works in the toolchain file. I >> don't see how >> using add_definitions() would work because it is only used in the >> compiler's >> command line. >> >> W >> >> -- >> David Wagner >> >> complex != complicated >> --------------------------------------------------------------------- >> Intel Corporation SAS (French simplified joint stock company) >> Registered headquarters: "Les Montalets"- 2, rue de Paris, >> 92196 Meudon Cedex, France >> Registration Number: 302 456 199 R.C.S. NANTERRE >> Capital: 4,572,000 Euros >> >> This e-mail and any attachments may contain confidential material for >> the sole use of the intended recipient(s). Any review or distribution >> by others is strictly prohibited. If you are not the intended >> recipient, please contact the sender and delete all copies. >> >> -- >> >> Powered by www.kitware.com >> >> Please keep messages on-topic and check the CMake FAQ at: >> http://www.cmake.org/Wiki/CMake_FAQ > ke_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 >> >> >> > -- > David Wagner > > complex != complicated > --------------------------------------------------------------------- > Intel Corporation SAS (French simplified joint stock company) > Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon > Cedex, France > Registration Number: 302 456 199 R.C.S. NANTERRE > Capital: 4,572,000 Euros > > This e-mail and any attachments may contain confidential material for > the sole use of the intended recipient(s). Any review or distribution > by others is strictly prohibited. If you are not the intended > recipient, please contact the sender and delete all copies. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From henning.meyer at dedrone.com Wed Dec 7 12:51:58 2016 From: henning.meyer at dedrone.com (Henning Meyer) Date: Wed, 7 Dec 2016 18:51:58 +0100 Subject: [CMake] bug in cpack deb generator if "file" not available Message-ID: <8eecde5a-4f77-3903-c076-d9e1aebba4d3@dedrone.com> Hi, the CPack DEB generator executes the file tool to determine whether a file is executable this is a snippet from CPackDeb.cmake from cmake gitlab master: # get file info so that we can determine if file is executable or not unset(CPACK_DEB_INSTALL_FILES) foreach(FILE_ IN LISTS FILE_PATHS_) execute_process(COMMAND file "./${FILE_}" WORKING_DIRECTORY "${WDIR}" OUTPUT_VARIABLE INSTALL_FILE_) list(APPEND CPACK_DEB_INSTALL_FILES "${INSTALL_FILE_}") endforeach() # Only dynamically linked ELF files are included # Extract only file name infront of ":" foreach(_FILE IN LISTS CPACK_DEB_INSTALL_FILES) if(_FILE MATCHES "ELF.*dynamically linked") string(REGEX MATCH "(^.*):" _FILE_NAME "${_FILE}") list(APPEND CPACK_DEB_BINARY_FILES "${CMAKE_MATCH_1}") set(CONTAINS_EXECUTABLE_FILES_ TRUE) endif() if(_FILE MATCHES "ELF.*shared object") string(REGEX MATCH "(^.*):" _FILE_NAME "${_FILE}") list(APPEND CPACK_DEB_SHARED_OBJECT_FILES "${CMAKE_MATCH_1}") endif() endforeach() The problem is that execute_process(COMMAND file) may fail, and if it does, we do not add the dependencies of that executable to the generated deb file. This issue happened to us because our continuous integration system tried building inside a minimal docker image, where /usr/bin/file was simply not available, but it might fail for other reasons too: for example strange things in the user's path, open file limit exceeded or out of memory conditions. I would therefore much prefer if the above code: 1) uses a variable ${FILE_EXECUTABLE} for the file tool defaulting to /usr/bin/file similar to the way it uses the variable ${READELF_EXECUTABLE} for the readelf tool 2) checks the return code on every iteration of the foreach() loop, and calls message(FATAL_ERROR) if it is non-zero. I would be willing to implement this in a branch. Regards, Henning PS: I reported this as a packing issue (file is a missing dependency of cmake) to ubuntu at https://bugs.launchpad.net/ubuntu/+source/cmake/+bug/1647868 From rcdailey.lists at gmail.com Thu Dec 8 10:01:53 2016 From: rcdailey.lists at gmail.com (Robert Dailey) Date: Thu, 8 Dec 2016 09:01:53 -0600 Subject: [CMake] Does target order matter for dependencies? Message-ID: When I define my targets (custom, library, executable), does the order of their declaration matter when it comes to using those targets in dependencies? It's difficult to explain, so I'll show an example: add_executable(foo main1.cpp) target_link_libraries(foo abc) add_library(abc main2.cpp) In the example above, the add_library() happens after target_link_libraries() for the executable. I've seen this work, but I was using static libraries. Would this work for shared libraries too? Does CMake do a multi-pass parse so that all targets are known prior to them being referenced? The target_link_libraries() [1] documentation states: "The named target must be created by add_library() within the project or as an IMPORTED library. If it is created within the project an ordering dependency will automatically be added in the build system to make sure the named library target is up-to-date before the links." I'm not sure what "up-to-date" here means, or if this specific documentation is talking about compile-time dependencies or cmake dependencies. [1]: https://cmake.org/cmake/help/latest/command/target_link_libraries.html From nilsgladitz at gmail.com Thu Dec 8 10:16:41 2016 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Thu, 8 Dec 2016 16:16:41 +0100 Subject: [CMake] Does target order matter for dependencies? In-Reply-To: References: Message-ID: <66d40b91-af0d-9b6a-2f35-631758af5e8a@gmail.com> On 12/08/2016 04:01 PM, Robert Dailey wrote: > When I define my targets (custom, library, executable), does the order > of their declaration matter when it comes to using those targets in > dependencies? It's difficult to explain, so I'll show an example: > > > add_executable(foo main1.cpp) > target_link_libraries(foo abc) > > add_library(abc main2.cpp) > > In the example above, the add_library() happens after > target_link_libraries() for the executable. I've seen this work, but I > was using static libraries. Would this work for shared libraries too? Yes, that is fine. > Does CMake do a multi-pass parse so that all targets are known prior > to them being referenced? The link-dependencies are evaluated at generation time after your cmake code has been fully parsed. At that time all targets are known. > > The target_link_libraries() [1] documentation states: > > "The named target must be created by add_library() within the project > or as an IMPORTED library. If it is created within the project an > ordering dependency will automatically be added in the build system to > make sure the named library target is up-to-date before the > links." > > I'm not sure what "up-to-date" here means, or if this specific > documentation is talking about compile-time dependencies or cmake > dependencies. It means CMake makes sure the generated build system fully builds "abc" before it starts building "foo" (which isn't always strictly required but how it is currently implemented). e.g. if "abc" has custom commands that generate header files that "foo" also depends on this will make sure they are created/updated before "foo" makes use of them. And more obviously "abc"'s library output is created/updated before "foo" tries to link to it. Nils From gio at cloudnc.co.uk Thu Dec 8 11:43:25 2016 From: gio at cloudnc.co.uk (Giovanni Funchal) Date: Thu, 8 Dec 2016 16:43:25 +0000 Subject: [CMake] OBJECT libraries and INTERFACE_SOURCES Message-ID: Hi, The help page [1] mentions that: > Although object libraries may not be named directly in calls to the > target_link_libraries() command, they can be ?linked? indirectly by > using an Interface Library whose INTERFACE_SOURCES target property > is set to name $. However, I was unable to get this to work. Doing this: add_library(lib-obj OBJECT test.cpp) add_library(lib INTERFACE) add_dependencies(lib lib-obj) set_target_properties(lib PROPERTIES INTERFACE_SOURCES $) And then trying to specify lib in link_libraries of an executable yields an error message "Cannot find source file: ... Tried extensions:... ". Am I doing something wrong? Thanks, -- Giovanni [1] https://cmake.org/cmake/help/v3.6/manual/cmake-buildsystem.7.html#object-libraries -------------- next part -------------- An HTML attachment was scrubbed... URL: From steveire at gmail.com Thu Dec 8 16:56:12 2016 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 08 Dec 2016 21:56:12 +0000 Subject: [CMake] OBJECT libraries and INTERFACE_SOURCES References: Message-ID: Giovanni Funchal wrote: > Hi, > > The help page [1] mentions that: > >> Although object libraries may not be named directly in calls to the >> target_link_libraries() command, they can be ?linked? indirectly by >> using an Interface Library whose INTERFACE_SOURCES target property >> is set to name $. > > However, I was unable to get this to work. Doing this: > > add_library(lib-obj OBJECT test.cpp) > add_library(lib INTERFACE) > add_dependencies(lib lib-obj) > set_target_properties(lib PROPERTIES INTERFACE_SOURCES > $) > > And then trying to specify lib in link_libraries of an executable yields > an error message "Cannot find source file: ... Tried extensions:... ". > > Am I doing something wrong? This works for me: cmake_minimum_required(VERSION 3.3) project(testit CXX) add_library(lib-obj OBJECT foo.cpp) add_library(lib-iface INTERFACE) set_target_properties(lib-iface PROPERTIES INTERFACE_SOURCES $ ) add_executable(main foo-user.cpp) target_link_libraries(main lib-iface) Thanks, Steve. From gio at cloudnc.co.uk Fri Dec 9 05:26:21 2016 From: gio at cloudnc.co.uk (Giovanni Funchal) Date: Fri, 9 Dec 2016 10:26:21 +0000 Subject: [CMake] OBJECT libraries and INTERFACE_SOURCES In-Reply-To: References: Message-ID: Hi, Apologies, the problem wasn't properly minimised because I had some trouble wrapping my head around it. Here's two complete examples which I hope can explain the problem better this time. 1) This works: [CMakeLists.txt] cmake_minimum_required(VERSION 3.6) project(Test) add_library(lib1-obj OBJECT lib1.cpp) add_library(lib1 INTERFACE) set_target_properties(lib1 PROPERTIES INTERFACE_SOURCES $) add_library(lib2 lib2.cpp) target_link_libraries(lib2 lib1) add_executable(main main.cpp) target_link_libraries(main lib2) 2) But this does not: [CMakeLists.txt] cmake_minimum_required(VERSION 3.6) project(Test) add_library(lib1-obj OBJECT lib1.cpp) add_library(lib1 INTERFACE) set_target_properties(lib1 PROPERTIES INTERFACE_SOURCES $) add_library(lib2 lib2.cpp) target_link_libraries(lib2 lib1) add_subdirectory(main) [main/CMakeLists.txt] add_executable(main main.cpp) target_link_libraries(main lib2) With the second example, I get an error "cannot find source file lib1.cpp.o tried extensions...". Thanks, -- Giovanni On Thu, Dec 8, 2016 at 9:56 PM, Stephen Kelly wrote: > Giovanni Funchal wrote: > > > Hi, > > > > The help page [1] mentions that: > > > >> Although object libraries may not be named directly in calls to the > >> target_link_libraries() command, they can be ?linked? indirectly by > >> using an Interface Library whose INTERFACE_SOURCES target property > >> is set to name $. > > > > However, I was unable to get this to work. Doing this: > > > > add_library(lib-obj OBJECT test.cpp) > > add_library(lib INTERFACE) > > add_dependencies(lib lib-obj) > > set_target_properties(lib PROPERTIES INTERFACE_SOURCES > > $) > > > > And then trying to specify lib in link_libraries of an executable yields > > an error message "Cannot find source file: ... Tried extensions:... ". > > > > Am I doing something wrong? > > This works for me: > > cmake_minimum_required(VERSION 3.3) > > project(testit CXX) > > add_library(lib-obj OBJECT foo.cpp) > add_library(lib-iface INTERFACE) > set_target_properties(lib-iface PROPERTIES > INTERFACE_SOURCES $ > ) > add_executable(main foo-user.cpp) > target_link_libraries(main lib-iface) > > > 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 dan at su-root.co.uk Fri Dec 9 08:18:11 2016 From: dan at su-root.co.uk (Dan Liew) Date: Fri, 9 Dec 2016 13:18:11 +0000 Subject: [CMake] Adding dependencies to the `clean` target in 2016? In-Reply-To: References: Message-ID: On 5 December 2016 at 14:05, Brad King wrote: > On 12/03/2016 06:52 AM, Dan Liew wrote: >> There was a post about this 10 years ago [1], has anything changed since then? > > No. From my response back then: > >>> The "clean" target is not a first class target available to >>> CMakeLists.txt code....We do plan to make targets like install >>> and clean first class eventually but it is not yet implemented. > > This never happened. These generator-provided targets have very > different semantics (e.g. per-directory behavior in the Makefile > generator) and that makes it hard to define them in a way that is > visible to client code during configuration. It may be possible but > will require deep design thought. Thanks for the info. Giving developers control of the `clean` target is something I'd like to see even if it does require quite a bit of thought. CMake has special commands for doing `install` so I'd expect something analogous for managing how `clean is performed`. These would be declared on a per directory basis and if the generator worked a per directory basis then we would have per directory clean targets otherwise there would just be a global clean target. >> I realise the `clean` target won't be available for all generators but >> for those that do, it would be really nice to able to do something >> like this. >> >> add_dependencies(clean CleanKLEERuntimes) > > Just as `ADDITIONAL_MAKE_CLEAN_FILES` is a make-specific solution I > think something like `ADDITIONAL_MAKE_CLEAN_COMMAND` or perhaps > `ADDITIONAL_MAKE_CLEAN_TARGET` could be offered. Such configuration > could be interpreted by the makefile generator while generating the > "make clean" target. I suppose that would do the job. I do use Ninja as a generator a lot too. Would Ninja support it too? Dan. From brad.king at kitware.com Fri Dec 9 08:28:18 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 9 Dec 2016 08:28:18 -0500 Subject: [CMake] Adding dependencies to the `clean` target in 2016? In-Reply-To: References: Message-ID: On 12/09/2016 08:18 AM, Dan Liew wrote: > CMake has special commands for doing `install` so I'd expect something > analogous for managing how `clean is performed`. CMake has full control over the generation of the install rules. For "clean" this is only true for the Makefile generator. >> think something like `ADDITIONAL_MAKE_CLEAN_COMMAND` or perhaps >> `ADDITIONAL_MAKE_CLEAN_TARGET` > I suppose that would do the job. I do use Ninja as a generator a lot > too. Would Ninja support it too? No, because ninja has its own model for a "clean" operation. Getting custom "clean" behavior in general would require adding a custom target that looks like a normal target to build systems but inside is full of commands to clean. For this I don't think any special support is needed from CMake: add_custom_target(myclean COMMAND ${whatever_command_user_wants} COMMAND ${CMAKE_COMMAND} --build . --target clean --config $ ) -Brad From chuck.atkins at kitware.com Fri Dec 9 11:17:02 2016 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Fri, 9 Dec 2016 11:17:02 -0500 Subject: [CMake] OBJECT libraries and INTERFACE_SOURCES In-Reply-To: References: Message-ID: Hi Giovanni, Does it work if you add lib1 as a private dependency of lib2? i.e.: target_link_libraries(lib2 PRIVATE lib1) Also, it shouldn't matter but what about in your original example if you use the full path to the source file instead while still keeping the public link dependency? i.e.: add_library(lib1-obj OBJECT $(CMAKE_CURRENT_SOURCE_DIR}/lib1.cpp). ---------- Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. On Fri, Dec 9, 2016 at 5:26 AM, Giovanni Funchal wrote: > Hi, > > Apologies, the problem wasn't properly minimised because I had some > trouble wrapping my head around it. Here's two complete examples which I > hope can explain the problem better this time. > > 1) This works: > > [CMakeLists.txt] > cmake_minimum_required(VERSION 3.6) > project(Test) > add_library(lib1-obj OBJECT lib1.cpp) > add_library(lib1 INTERFACE) > set_target_properties(lib1 PROPERTIES INTERFACE_SOURCES > $) > add_library(lib2 lib2.cpp) > target_link_libraries(lib2 lib1) > add_executable(main main.cpp) > target_link_libraries(main lib2) > > 2) But this does not: > > [CMakeLists.txt] > cmake_minimum_required(VERSION 3.6) > project(Test) > add_library(lib1-obj OBJECT lib1.cpp) > add_library(lib1 INTERFACE) > set_target_properties(lib1 PROPERTIES INTERFACE_SOURCES > $) > add_library(lib2 lib2.cpp) > target_link_libraries(lib2 lib1) > add_subdirectory(main) > > [main/CMakeLists.txt] > add_executable(main main.cpp) > target_link_libraries(main lib2) > > With the second example, I get an error "cannot find source file > lib1.cpp.o tried extensions...". > > Thanks, > -- Giovanni > > > On Thu, Dec 8, 2016 at 9:56 PM, Stephen Kelly wrote: > >> Giovanni Funchal wrote: >> >> > Hi, >> > >> > The help page [1] mentions that: >> > >> >> Although object libraries may not be named directly in calls to the >> >> target_link_libraries() command, they can be ?linked? indirectly by >> >> using an Interface Library whose INTERFACE_SOURCES target property >> >> is set to name $. >> > >> > However, I was unable to get this to work. Doing this: >> > >> > add_library(lib-obj OBJECT test.cpp) >> > add_library(lib INTERFACE) >> > add_dependencies(lib lib-obj) >> > set_target_properties(lib PROPERTIES INTERFACE_SOURCES >> > $) >> > >> > And then trying to specify lib in link_libraries of an executable yields >> > an error message "Cannot find source file: ... Tried extensions:... ". >> > >> > Am I doing something wrong? >> >> This works for me: >> >> cmake_minimum_required(VERSION 3.3) >> >> project(testit CXX) >> >> add_library(lib-obj OBJECT foo.cpp) >> add_library(lib-iface INTERFACE) >> set_target_properties(lib-iface PROPERTIES >> INTERFACE_SOURCES $ >> ) >> add_executable(main foo-user.cpp) >> target_link_libraries(main lib-iface) >> >> >> 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 > > > > -- > > 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/opensou > rce/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gio at cloudnc.co.uk Fri Dec 9 11:25:31 2016 From: gio at cloudnc.co.uk (Giovanni Funchal) Date: Fri, 9 Dec 2016 16:25:31 +0000 Subject: [CMake] OBJECT libraries and INTERFACE_SOURCES In-Reply-To: References: Message-ID: Hello, PRIVATE works, but I don't understand why (the only difference between the two examples is using a subdirectory). Using ${CMAKE_CURRENT_SOURCE_DIR} does not work. Thanks, -- Giovanni On Fri, Dec 9, 2016 at 4:17 PM, Chuck Atkins wrote: > Hi Giovanni, > Does it work if you add lib1 as a private dependency of lib2? i.e.: > target_link_libraries(lib2 PRIVATE lib1) > > Also, it shouldn't matter but what about in your original example if you > use the full path to the source file instead while still keeping the public > link dependency? i.e.: > add_library(lib1-obj OBJECT $(CMAKE_CURRENT_SOURCE_DIR}/lib1.cpp). > > ---------- > Chuck Atkins > Staff R&D Engineer, Scientific Computing > Kitware, Inc. > > > On Fri, Dec 9, 2016 at 5:26 AM, Giovanni Funchal > wrote: > >> Hi, >> >> Apologies, the problem wasn't properly minimised because I had some >> trouble wrapping my head around it. Here's two complete examples which I >> hope can explain the problem better this time. >> >> 1) This works: >> >> [CMakeLists.txt] >> cmake_minimum_required(VERSION 3.6) >> project(Test) >> add_library(lib1-obj OBJECT lib1.cpp) >> add_library(lib1 INTERFACE) >> set_target_properties(lib1 PROPERTIES INTERFACE_SOURCES >> $) >> add_library(lib2 lib2.cpp) >> target_link_libraries(lib2 lib1) >> add_executable(main main.cpp) >> target_link_libraries(main lib2) >> >> 2) But this does not: >> >> [CMakeLists.txt] >> cmake_minimum_required(VERSION 3.6) >> project(Test) >> add_library(lib1-obj OBJECT lib1.cpp) >> add_library(lib1 INTERFACE) >> set_target_properties(lib1 PROPERTIES INTERFACE_SOURCES >> $) >> add_library(lib2 lib2.cpp) >> target_link_libraries(lib2 lib1) >> add_subdirectory(main) >> >> [main/CMakeLists.txt] >> add_executable(main main.cpp) >> target_link_libraries(main lib2) >> >> With the second example, I get an error "cannot find source file >> lib1.cpp.o tried extensions...". >> >> Thanks, >> -- Giovanni >> >> >> On Thu, Dec 8, 2016 at 9:56 PM, Stephen Kelly wrote: >> >>> Giovanni Funchal wrote: >>> >>> > Hi, >>> > >>> > The help page [1] mentions that: >>> > >>> >> Although object libraries may not be named directly in calls to the >>> >> target_link_libraries() command, they can be ?linked? indirectly by >>> >> using an Interface Library whose INTERFACE_SOURCES target property >>> >> is set to name $. >>> > >>> > However, I was unable to get this to work. Doing this: >>> > >>> > add_library(lib-obj OBJECT test.cpp) >>> > add_library(lib INTERFACE) >>> > add_dependencies(lib lib-obj) >>> > set_target_properties(lib PROPERTIES INTERFACE_SOURCES >>> > $) >>> > >>> > And then trying to specify lib in link_libraries of an executable >>> yields >>> > an error message "Cannot find source file: ... Tried extensions:... ". >>> > >>> > Am I doing something wrong? >>> >>> This works for me: >>> >>> cmake_minimum_required(VERSION 3.3) >>> >>> project(testit CXX) >>> >>> add_library(lib-obj OBJECT foo.cpp) >>> add_library(lib-iface INTERFACE) >>> set_target_properties(lib-iface PROPERTIES >>> INTERFACE_SOURCES $ >>> ) >>> add_executable(main foo-user.cpp) >>> target_link_libraries(main lib-iface) >>> >>> >>> 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 >> >> >> >> -- >> >> 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 PuetzKevinA at JohnDeere.com Fri Dec 9 19:36:49 2016 From: PuetzKevinA at JohnDeere.com (Kevin Puetz) Date: Fri, 9 Dec 2016 17:36:49 -0700 (MST) Subject: [CMake] VS2017 + CMake integration In-Reply-To: References: Message-ID: <1481330209316-7594734.post@n2.nabble.com> > Once we have it ready, it will be updated in-place in VS in one of the future releases. We can't commit yet that CMake 3.7 will be in VS 2017 RTW but it will definitely be in one of the VS Updates. VS ships every 1-2 months a preview update and every 3-4 months a major update. FWIW, I'm eagerly awaiting this functionality, but can't use it until you get CMake 3.7, because CMake 3.6.2 hits a bug in Windows-MSVC-CXX.cmake (https://gitlab.kitware.com/cmake/cmake/issues/16330) that makes our project(s) fail to configure. -- View this message in context: http://cmake.3232098.n2.nabble.com/VS2017-CMake-integration-tp7594639p7594734.html Sent from the CMake mailing list archive at Nabble.com. From gio at cloudnc.co.uk Mon Dec 12 04:44:04 2016 From: gio at cloudnc.co.uk (Giovanni Funchal) Date: Mon, 12 Dec 2016 09:44:04 +0000 Subject: [CMake] OBJECT libraries and INTERFACE_SOURCES In-Reply-To: References: Message-ID: Hello, Can someone confirm please if this is a bug and whether I should file a bug report? Also, the "PRIVATE" workaround doesn't suit me (because it breaks transitivity of includes). Is there any other workaround I can use? I assume reverting to static libraries is the best thing to do in the meanwhile? Thanks, -- Giovanni On Fri, Dec 9, 2016 at 4:25 PM, Giovanni Funchal wrote: > Hello, > > PRIVATE works, but I don't understand why (the only difference between the > two examples is using a subdirectory). > > Using ${CMAKE_CURRENT_SOURCE_DIR} does not work. > > Thanks, > -- Giovanni > > > On Fri, Dec 9, 2016 at 4:17 PM, Chuck Atkins > wrote: > >> Hi Giovanni, >> Does it work if you add lib1 as a private dependency of lib2? i.e.: >> target_link_libraries(lib2 PRIVATE lib1) >> >> Also, it shouldn't matter but what about in your original example if you >> use the full path to the source file instead while still keeping the public >> link dependency? i.e.: >> add_library(lib1-obj OBJECT $(CMAKE_CURRENT_SOURCE_DIR}/lib1.cpp). >> >> ---------- >> Chuck Atkins >> Staff R&D Engineer, Scientific Computing >> Kitware, Inc. >> >> >> On Fri, Dec 9, 2016 at 5:26 AM, Giovanni Funchal >> wrote: >> >>> Hi, >>> >>> Apologies, the problem wasn't properly minimised because I had some >>> trouble wrapping my head around it. Here's two complete examples which I >>> hope can explain the problem better this time. >>> >>> 1) This works: >>> >>> [CMakeLists.txt] >>> cmake_minimum_required(VERSION 3.6) >>> project(Test) >>> add_library(lib1-obj OBJECT lib1.cpp) >>> add_library(lib1 INTERFACE) >>> set_target_properties(lib1 PROPERTIES INTERFACE_SOURCES >>> $) >>> add_library(lib2 lib2.cpp) >>> target_link_libraries(lib2 lib1) >>> add_executable(main main.cpp) >>> target_link_libraries(main lib2) >>> >>> 2) But this does not: >>> >>> [CMakeLists.txt] >>> cmake_minimum_required(VERSION 3.6) >>> project(Test) >>> add_library(lib1-obj OBJECT lib1.cpp) >>> add_library(lib1 INTERFACE) >>> set_target_properties(lib1 PROPERTIES INTERFACE_SOURCES >>> $) >>> add_library(lib2 lib2.cpp) >>> target_link_libraries(lib2 lib1) >>> add_subdirectory(main) >>> >>> [main/CMakeLists.txt] >>> add_executable(main main.cpp) >>> target_link_libraries(main lib2) >>> >>> With the second example, I get an error "cannot find source file >>> lib1.cpp.o tried extensions...". >>> >>> Thanks, >>> -- Giovanni >>> >>> >>> On Thu, Dec 8, 2016 at 9:56 PM, Stephen Kelly >>> wrote: >>> >>>> Giovanni Funchal wrote: >>>> >>>> > Hi, >>>> > >>>> > The help page [1] mentions that: >>>> > >>>> >> Although object libraries may not be named directly in calls to the >>>> >> target_link_libraries() command, they can be ?linked? indirectly by >>>> >> using an Interface Library whose INTERFACE_SOURCES target property >>>> >> is set to name $. >>>> > >>>> > However, I was unable to get this to work. Doing this: >>>> > >>>> > add_library(lib-obj OBJECT test.cpp) >>>> > add_library(lib INTERFACE) >>>> > add_dependencies(lib lib-obj) >>>> > set_target_properties(lib PROPERTIES INTERFACE_SOURCES >>>> > $) >>>> > >>>> > And then trying to specify lib in link_libraries of an executable >>>> yields >>>> > an error message "Cannot find source file: ... Tried extensions:... ". >>>> > >>>> > Am I doing something wrong? >>>> >>>> This works for me: >>>> >>>> cmake_minimum_required(VERSION 3.3) >>>> >>>> project(testit CXX) >>>> >>>> add_library(lib-obj OBJECT foo.cpp) >>>> add_library(lib-iface INTERFACE) >>>> set_target_properties(lib-iface PROPERTIES >>>> INTERFACE_SOURCES $ >>>> ) >>>> add_executable(main foo-user.cpp) >>>> target_link_libraries(main lib-iface) >>>> >>>> >>>> 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 >>> >>> >>> >>> -- >>> >>> 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 patrick.boettcher at posteo.de Mon Dec 12 07:10:21 2016 From: patrick.boettcher at posteo.de (Patrick Boettcher) Date: Mon, 12 Dec 2016 13:10:21 +0100 Subject: [CMake] Policy to forbid linking with non-cmake-targets Message-ID: <20161212131021.4c9e7be0@yaise-pc1> Hi list, is there a policy which can be enabled to forbid calling target_link_libraries(foo bar) where bar is _not_ a known cmake target? Right now, if 'bar' is not a cmake-target cmake tries to link with -lbar (on linux). Can I inhibit this behavior in any way? I'd prefer cmake telling me that this target is unknown rather than receiving a link error at the end of the build-process. Thanks, -- Patrick. From parag at ionicsecurity.com Mon Dec 12 09:25:35 2016 From: parag at ionicsecurity.com (Parag Chandra) Date: Mon, 12 Dec 2016 14:25:35 +0000 Subject: [CMake] [EXTERNAL]: Policy to forbid linking with non-cmake-targets In-Reply-To: <20161212131021.4c9e7be0@yaise-pc1> References: <20161212131021.4c9e7be0@yaise-pc1> Message-ID: <76966BA2-7491-4EC5-8CE6-52F6C5DF9077@ionic.com> Not sure if there is a policy for what you want, but I?ve accomplished something similar via a macro that I use to link my libraries. It looks something like this: macro (LinkOnlyIfLibraryIsTarget linkTarget) foreach (nextLibrary ${ARGN}) if (TARGET ${nextLibrary}) target_link_libraries (${linkTarget} ${nextLibrary}) else message (FATAL_ERROR "${nextLibrary} was not defined as a CMake target") endif () endforeach () endmacro() So instead of calling target_link_libraries() directly, I invoke this macro with similar syntax: LinkOnlyIfLibraryIsTarget(executableName library1 library2 library3) Hope this helps. Parag Chandra Technical Lead, Mobile Team Mobile: +1.919.824.1410 Ionic Security Inc. 1170 Peachtree St. NE STE 400, Atlanta, GA 30309 On 12/12/16, 7:10 AM, "CMake on behalf of Patrick Boettcher" wrote: Hi list, is there a policy which can be enabled to forbid calling target_link_libraries(foo bar) where bar is _not_ a known cmake target? Right now, if 'bar' is not a cmake-target cmake tries to link with -lbar (on linux). Can I inhibit this behavior in any way? I'd prefer cmake telling me that this target is unknown rather than receiving a link error at the end of the build-process. Thanks, -- Patrick. -- 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 irwin at beluga.phys.uvic.ca Mon Dec 12 18:50:10 2016 From: irwin at beluga.phys.uvic.ca (Alan W. Irwin) Date: Mon, 12 Dec 2016 15:50:10 -0800 (PST) Subject: [CMake] Policy to forbid linking with non-cmake-targets In-Reply-To: <20161212131021.4c9e7be0@yaise-pc1> References: <20161212131021.4c9e7be0@yaise-pc1> Message-ID: On 2016-12-12 13:10+0100 Patrick Boettcher wrote: > Hi list, > > is there a policy which can be enabled to forbid calling > > target_link_libraries(foo bar) > > where bar is _not_ a known cmake target? > > Right now, if 'bar' is not a cmake-target cmake tries to link with > -lbar (on linux). Can I inhibit this behavior in any way? > > I'd prefer cmake telling me that this target is unknown rather than > receiving a link error at the end of the build-process. Hi Patrick: Try if(NOT TARGET bar) to check for this issue. And if it is an issue that occurs for many different targets that you build, instead of deploying such checks again and again, you could implement and use instead a function that checks for the above condition before calling target_link_libraries. 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 mark.wang at gmail.com Tue Dec 13 01:49:04 2016 From: mark.wang at gmail.com (Mark Wang) Date: Mon, 12 Dec 2016 22:49:04 -0800 Subject: [CMake] Buck generator? Message-ID: Hi all -- We're thinking about extending CMake with a generator that outputs files for the Buck build system we use here at Facebook (https://buckbuild.com) Before we get started, was wondering if anyone's been working on such a thing yet. Thanks, Mark -- "There are 10 types of people in this world: those who understand binary and those who don't." -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.schwarzstein at gmail.com Tue Dec 13 08:29:08 2016 From: bo.schwarzstein at gmail.com (Bo Zhou) Date: Tue, 13 Dec 2016 22:29:08 +0900 Subject: [CMake] Best Practise for Multiple Platforms of External Project Message-ID: Hi In my project I have to compile the same external projects by the different generators, is that possible to handle this cases by ExternalProject_Add ? I tried this way, firstly, just download the repository ExternalProject_Add(OPENEXR_DOWNLOAD PREFIX ${OPENEXR_PREFIX} GIT_REPOSITORY https://github.com/openexr/openexr.git GIT_TAG v2.2.0 CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "") ExternalProject_Get_Property(OPENEXR_DOWNLOAD SOURCE_DIR) SET(OPENEXR_SOURCE_DIR ${SOURCE_DIR}) Then I tried to create a specific new target to use specific generator ExternalProject_Add(OPENEXR_VC11 DEPENDS OPENEXR_DOWNLOAD SOURCE_DIR ${OPENEXR_SOURCE_DIR}/IlmBase) Seems can't work, it requires an non-empty SOURCE_DIR, but before downloading, it's empty :( So is there any better way to do this ? Thanks very much ! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Dvir.Yitzchaki at ceva-dsp.com Tue Dec 13 09:28:46 2016 From: Dvir.Yitzchaki at ceva-dsp.com (Dvir Yitzchaki) Date: Tue, 13 Dec 2016 14:28:46 +0000 Subject: [CMake] checking for cmake predefined targets Message-ID: <51e0bc893089466e8b77d42516ee7a74@ceva-dsp.com> Hi list. With Visual Studio generator, is there a way, at configuration time, to check for the existence of INSTALL, PACKAGE and RUN_TESTS targets? Seems they only present when the configuration files have an install(), enable_testing() or include(CPack) commands somewhere. I need this information to make TFS not trying to add these projects to source control. Thanks, Dvir -------------- next part -------------- An HTML attachment was scrubbed... URL: From craig.scott at crascit.com Tue Dec 13 14:51:51 2016 From: craig.scott at crascit.com (Craig Scott) Date: Wed, 14 Dec 2016 06:51:51 +1100 Subject: [CMake] Best Practise for Multiple Platforms of External Project In-Reply-To: References: Message-ID: You could try using file(MAKE_DIRECTORY ...) between the two ExternalProject_Add() calls to actually ensure the directory exists, but I'm not 100% sure whether this would not interfere with the download step when it goes to do that at build time. I'm pretty sure it works, but you should confirm it. Another choice is to do the download at configure time rather than build time. This would mean the source would already be there by the time you reached the second ExternalProject_Add() call in your example. There are pros and cons to this, with the main objection being that ideally the configure step should be quick and making the download part of configure can increase the time that stage takes. For a general implementation supporting this functionality, have a look here: https://github.com/Crascit/DownloadProject On Wed, Dec 14, 2016 at 12:29 AM, Bo Zhou wrote: > Hi > > In my project I have to compile the same external projects by the > different generators, is that possible to handle this cases > by ExternalProject_Add ? > > I tried this way, firstly, just download the repository > > ExternalProject_Add(OPENEXR_DOWNLOAD > PREFIX ${OPENEXR_PREFIX} > GIT_REPOSITORY https://github.com/openexr/openexr.git > GIT_TAG v2.2.0 > CONFIGURE_COMMAND "" > BUILD_COMMAND "" > INSTALL_COMMAND "") > > > ExternalProject_Get_Property(OPENEXR_DOWNLOAD SOURCE_DIR) > SET(OPENEXR_SOURCE_DIR ${SOURCE_DIR}) > > Then I tried to create a specific new target to use specific generator > > ExternalProject_Add(OPENEXR_VC11 > DEPENDS OPENEXR_DOWNLOAD > SOURCE_DIR ${OPENEXR_SOURCE_DIR}/IlmBase) > > > Seems can't work, it requires an non-empty SOURCE_DIR, but before > downloading, it's empty :( > > So is there any better way to do this ? Thanks very much ! > > > -- > > 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 > -- Craig Scott Melbourne, Australia https://crascit.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcarrera at gmail.com Tue Dec 13 21:26:54 2016 From: dcarrera at gmail.com (Daniel Carrera) Date: Wed, 14 Dec 2016 03:26:54 +0100 Subject: [CMake] Bug in Kitware's release of Ninja when compiling with PGI Fortran Message-ID: Hello, First of all, I want to say that I think it's amazing that Kitware has gone through the trouble of maintaining a separate build of Ninja with bugfixes so that us Fortran users can use Ninja with CMake: https://github.com/Kitware/ninja/releases Since no good deed goes unpunished... I want to report that this release of Ninja doesn't seem to like the PGI compiler. Let me show you. I have a toy project with just two files: - CMakeLists.txt - src/foo.f90 Where foo.f90 is a toy program that adds two integers, and CMakeLists.tx contains the bare minimum: -------------------------- $ cat CMakeLists.txt cmake_minimum_required(VERSION 3.7) project(hello) enable_language(Fortran) add_executable(prog src/foo.f90) -------------------------- At this point I should say that I am running CMake 3.7.1 freshly downloaded from cmake.org and my OS is Ubuntu Linux 16.04 LTS. So anyway, if we produce Makefiles everything is fine: -------------------------- $ mkdir build $ cd build build $ echo $FC # <---- PGI compiler. pgfortran build $ cmake .. -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- The Fortran compiler identification is PGI 16.10.0 -- Check for working Fortran compiler: /usr/local/bin/pgfortran -- Check for working Fortran compiler: /usr/local/bin/pgfortran -- works -- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - done -- Checking whether /usr/local/bin/pgfortran supports Fortran 90 -- Checking whether /usr/local/bin/pgfortran supports Fortran 90 -- yes -- Configuring done -- Generating done -- Build files have been written to: /build -------------------------- But when I ask CMake to make Ninja files, I have a problem: -------------------------- build $ rm -rf [a-zA-Z]* build $ cmake -GNinja .. -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- The Fortran compiler identification is PGI 16.10.0 -- Check for working Fortran compiler: /usr/local/bin/pgfortran CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKE_Fortran_PREPROCESS_SOURCE CMake Error: Internal CMake error, TryCompile generation of cmake failed -- Check for working Fortran compiler: /usr/local/bin/pgfortran -- broken CMake Error at /opt/cmake-3.7.1-Linux-x86_64/share/cmake-3.7/Modules/CMakeTestFortranCompiler.cmake:44 (message): The Fortran compiler "/usr/local/bin/pgfortran" is not able to compile a simple test program. It fails with the following output: CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:4 (enable_language) -- Configuring incomplete, errors occurred! See also "/build/CMakeFiles/CMakeOutput.log". See also "/build/CMakeFiles/CMakeError.log". -------------------------- I have attached CMakeError.log and CMakeOutput.log inside the Zip file "CMakeFiles.zip". I looked at the log files and I didn't see anything informative. This problem only occurs with the PGI compiler. CMake+Ninja seem to work just fine for the GNU and Intel compilers. I have verified that I can compile Fortran programs with the PGI compiler. The PGI compiler is also a very recent download from their website. I'm using the free "Community Edition" compiler. I hope this helps someone find a fix so that CMake+Ninja works even better. Once again, thank you for going through the trouble of patching somebody else's source tree just to give me another feature. Cheers, Daniel. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CMakeFiles.zip Type: application/zip Size: 4876 bytes Desc: not available URL: From seberline at telltalegames.com Wed Dec 14 19:44:55 2016 From: seberline at telltalegames.com (Scott Eberline) Date: Wed, 14 Dec 2016 16:44:55 -0800 Subject: [CMake] CMake, VS, Nsight Tegra, NDK, mixed C/C++ - applies C++ options to C source Message-ID: We have a large project library of mostly C++, mixed with a handful of C. The C++ compilation commands look correct and work fine. But C files are passed to clang++.exe -x c, rather than clang.exe. Which should work, except that CMAKE_CXX_FLAGS is applied while CMAKE_C_FLAGS is ignored. CMAKE_CXX_FLAGS includes options not supported for C, so the build fails with messages like, TRACKEDTOOLTASKWRAPPER`1 : error : invalid argument '-std=c++11' not allowed with 'C/ObjC' I've tried overriding the C++ options with C-compatible options, for example set_source_files_properties(${C_SOURCES} PROPERTIES COMPILE_FLAGS "-std=c99"). But I've found that per-file COMPILE_FLAGS precede CMAKE_CXX_FLAGS on the resulting compiler command line, so the C++ flags still get priority. I've searched CMake list archives, Stack Overflow, Nvidia's development tool forums etc. but not found any solution. (Caveat - I'm trying to use NDK r13b which is not yet supported by Nsight Tegra. So far, this just involves falsifying the NDK's revision in its source.properties file, and creating a couple of directory symbolic links so LLVM libc++ headers can be found where they lived in NDK r12b. If falsifying the NDK version eventually causes problems, I'll reconsider it, but for now it seems promising.) CMake 3.7.1 Visual Studio 2015 Update 3 Nsight Tegra Visual Studio Edition 3.4 NDK r13b cmake.exe ^ -DANDROID_PLATFORM=android-24 ^ -DANDROID_STL=c++_static ^ -DCMAKE_C_FLAGS="-std=c99" ^ -DCMAKE_C_STANDARD=99 ^ -DCMAKE_C_STANDARD_REQUIRED=ON ^ -DCMAKE_CXX_STANDARD=14 ^ -DCMAKE_CXX_STANDARD_REQUIRED=ON ^ -DCMAKE_TOOLCHAIN_FILE=C:\Android\NDK-r13b\build\cmake\android.toolchain.cmake ^ -G"Visual Studio 14 2015" ^ -T"DefaultClang" ^ The generated CMakeCCompiler.cmake looks mostly correct, in particular CMAKE_C_COMPILER and CMAKE_C_SOURCE_FILE_EXTENSIONS, although CMAKE__IMPLICIT_LINK_LIBRARIES and CMAKE__IMPLICIT_LINK_DIRECTORIES are set for android-9 and GNU libstdc++ rather than the values specified in ANDROID_PLATFORM and ANDROID_STL. As an aside, it seems ANDROID_PLATFORM, ANDROID_STL, CMAKE_C_STANDARD and CMAKE_CXX_STANDARD are completely ignored in the generated VS project. I assume that's a topic for a different thread. Thanks for taking the time to read; any advice is appreciated. From florent.castelli at gmail.com Wed Dec 14 22:57:29 2016 From: florent.castelli at gmail.com (Florent Castelli) Date: Thu, 15 Dec 2016 04:57:29 +0100 Subject: [CMake] CMake, VS, Nsight Tegra, NDK, mixed C/C++ - applies C++ options to C source In-Reply-To: References: Message-ID: <47e992bf-c77a-91af-8f71-b6c4a2a84e00@gmail.com> I'm pretty sure that the toolchain bundled with the NDK, made by Google, hasn't been tested with other generators than Ninja or possibly Make. Also, there are some known bugs with it, including the one related to CMAKE_CXX_STANDARD (see https://code.google.com/p/android/issues/detail?id=227915 and https://github.com/android-ndk/ndk/issues/222 ). I'd recommend using other generators if you want to use this toolchain or maybe try the Android support released with CMake 3.7.1 instead, though I have no idea if it's supposed to work with the Visual Studio generators either! /Florent On 15/12/2016 01:44, Scott Eberline wrote: > We have a large project library of mostly C++, mixed with a handful of > C. The C++ compilation commands look correct and work fine. But C > files are passed to clang++.exe -x c, rather than clang.exe. Which > should work, except that CMAKE_CXX_FLAGS is applied while > CMAKE_C_FLAGS is ignored. CMAKE_CXX_FLAGS includes options not > supported for C, so the build fails with messages like, > > TRACKEDTOOLTASKWRAPPER`1 : error : invalid argument '-std=c++11' not > allowed with 'C/ObjC' > > I've tried overriding the C++ options with C-compatible options, for > example set_source_files_properties(${C_SOURCES} PROPERTIES > COMPILE_FLAGS "-std=c99"). But I've found that per-file COMPILE_FLAGS > precede CMAKE_CXX_FLAGS on the resulting compiler command line, so the > C++ flags still get priority. > > I've searched CMake list archives, Stack Overflow, Nvidia's > development tool forums etc. but not found any solution. > > (Caveat - I'm trying to use NDK r13b which is not yet supported by > Nsight Tegra. So far, this just involves falsifying the NDK's revision > in its source.properties file, and creating a couple of directory > symbolic links so LLVM libc++ headers can be found where they lived in > NDK r12b. If falsifying the NDK version eventually causes problems, > I'll reconsider it, but for now it seems promising.) > > CMake 3.7.1 > Visual Studio 2015 Update 3 > Nsight Tegra Visual Studio Edition 3.4 > NDK r13b > > cmake.exe ^ > -DANDROID_PLATFORM=android-24 ^ > -DANDROID_STL=c++_static ^ > -DCMAKE_C_FLAGS="-std=c99" ^ > -DCMAKE_C_STANDARD=99 ^ > -DCMAKE_C_STANDARD_REQUIRED=ON ^ > -DCMAKE_CXX_STANDARD=14 ^ > -DCMAKE_CXX_STANDARD_REQUIRED=ON ^ > -DCMAKE_TOOLCHAIN_FILE=C:\Android\NDK-r13b\build\cmake\android.toolchain.cmake > ^ > -G"Visual Studio 14 2015" ^ > -T"DefaultClang" ^ > > The generated CMakeCCompiler.cmake looks mostly correct, in particular > CMAKE_C_COMPILER and CMAKE_C_SOURCE_FILE_EXTENSIONS, although > CMAKE__IMPLICIT_LINK_LIBRARIES and > CMAKE__IMPLICIT_LINK_DIRECTORIES are set for android-9 and GNU > libstdc++ rather than the values specified in ANDROID_PLATFORM and > ANDROID_STL. As an aside, it seems ANDROID_PLATFORM, ANDROID_STL, > CMAKE_C_STANDARD and CMAKE_CXX_STANDARD are completely ignored in the > generated VS project. I assume that's a topic for a different thread. > > Thanks for taking the time to read; any advice is appreciated. From brad.king at kitware.com Thu Dec 15 11:35:31 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Dec 2016 11:35:31 -0500 Subject: [CMake] Ninja+Fortran support for PGI compiler (was: Bug in Kitware's release of Ninja when compiling with PGI Fortran) In-Reply-To: References: Message-ID: <2133ff01-8503-8c91-c324-12001ab94bc8@kitware.com> On 12/13/2016 09:26 PM, Daniel Carrera wrote: > First of all, I want to say that I think it's amazing that Kitware has > gone through the trouble of maintaining a separate build of Ninja with > bugfixes so that us Fortran users can use Ninja with CMake: Thanks for trying it out! > -- The Fortran compiler identification is PGI 16.10.0 > -- Check for working Fortran compiler: /usr/local/bin/pgfortran > CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. > Missing variable is: > CMAKE_Fortran_PREPROCESS_SOURCE This is not a problem with Ninja or our branch of it, but rather with CMake's information about the PGI Fortran compiler not being updated to support the Ninja generator. One can see the value for a few other compilers (from commit 39ebfc79e614dc395d5ace2ad5818b3ba75ca478): ``` $ git grep -A 1 Fortran_PREPROCESS_SOURCE Modules/Compiler/GNU-Fortran.cmake:set(CMAKE_Fortran_PREPROCESS_SOURCE Modules/Compiler/GNU-Fortran.cmake- " -cpp -E -o ") -- Modules/Compiler/Intel-Fortran.cmake:set(CMAKE_Fortran_PREPROCESS_SOURCE Modules/Compiler/Intel-Fortran.cmake- " -fpp -E > ") -- Modules/Compiler/SunPro-Fortran.cmake:set(CMAKE_Fortran_PREPROCESS_SOURCE Modules/Compiler/SunPro-Fortran.cmake- " -F -o ") ``` The `Modules/Compiler/PGI-Fortran.cmake` module needs to be updated too. I don't have that compiler handy, so if you can figure out the appropriate line to add to that file, please try it out. If you get it working please post it and Cc me so it can be integrated. Thanks, -Brad From david at mongodb.com Thu Dec 15 14:37:42 2016 From: david at mongodb.com (David Golden) Date: Thu, 15 Dec 2016 14:37:42 -0500 Subject: [CMake] FindPkgConfig and OS X frameworks Message-ID: Hello. In packaging the MongoDB C++ driver with CMake, we hit a snag when a dependency included OS X frameworks in the pkg-config information: $ PKG_CONFIG_PATH=/usr/local/custom/mongodb/lib/pkgconfig \ pkg-config --cflags --libs libmongoc-1.0 -I/usr/local/custom/mongodb/include/libmongoc-1.0 -I/usr/local/custom/mongodb/include/libbson-1.0 -L/usr/local/custom/mongodb/lib -lmongoc-1.0 -framework Security -framework CoreFoundation -lbson-1.0 We have a custom .cmake module that uses FindPkgConfig with a line like this: pkg_check_modules(LIBMONGOC REQUIRED libmongoc-1.0>=${LibMongoC_FIND_VERSION} ) However the resulting LIBMONGOC_LIBRARIES omits the frameworks, pushing them into LIBMONGOC_LDFLAGS_OTHER: LIBMONGOC_LDFLAGS_OTHER:INTERNAL=-framework;Security;- framework;CoreFoundation We were able to recover these back into LIBMONGOC_LIBRARIES through this round-about hack: if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND LIBMONGOC_LDFLAGS_OTHER) # "-framework;Security;-framework;CoreFoundation" to # "-framework Security;-framework CoreFoundation" string(REPLACE "-framework;" "-framework " LIBMONGOC_FRAMEWORKS "${LIBMONGOC_LDFLAGS_OTHER}") list(APPEND LIBMONGOC_LIBRARIES ${LIBMONGOC_FRAMEWORKS}) set(LIBMONGOC_LIBRARIES ${LIBMONGOC_LIBRARIES} CACHE INTERNAL "") endif() This eventually results in adding '-framework Security' etc. to target_link_libraries(), which seems to solve the problem we had experienced. (Though one SO post said this could produce parse errors, we didn't experience any) Extensive online searching didn't turn up a standard, well-accepted idiomatic way to handle OS X frameworks from pkg-config. Have we missed something? Is this a bug in FindPkgConfig not recognizing OS X framework entries? What do people suggest? For reference, my testing used CMake 3.6.2. Thank you very much, David Golden -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.schwarzstein at gmail.com Thu Dec 15 20:15:06 2016 From: bo.schwarzstein at gmail.com (Bo Zhou) Date: Fri, 16 Dec 2016 10:15:06 +0900 Subject: [CMake] Best Practise for Multiple Platforms of External Project In-Reply-To: References: Message-ID: Hi Craig I got a workaround for that, using FILE command to create an empty file inside that folder, then it works. I also tried your script, because of too many dependencies, so it takes such a long time in Configuration phase, I will use that later in small project. Thank you for your help. On Wed, Dec 14, 2016 at 4:51 AM, Craig Scott wrote: > You could try using file(MAKE_DIRECTORY ...) between the two > ExternalProject_Add() calls to actually ensure the directory exists, but > I'm not 100% sure whether this would not interfere with the download step > when it goes to do that at build time. I'm pretty sure it works, but you > should confirm it. > > Another choice is to do the download at configure time rather than build > time. This would mean the source would already be there by the time you > reached the second ExternalProject_Add() call in your example. There are > pros and cons to this, with the main objection being that ideally the > configure step should be quick and making the download part of configure > can increase the time that stage takes. For a general implementation > supporting this functionality, have a look here: > > https://github.com/Crascit/DownloadProject > > > > On Wed, Dec 14, 2016 at 12:29 AM, Bo Zhou > wrote: > >> Hi >> >> In my project I have to compile the same external projects by the >> different generators, is that possible to handle this cases >> by ExternalProject_Add ? >> >> I tried this way, firstly, just download the repository >> >> ExternalProject_Add(OPENEXR_DOWNLOAD >> PREFIX ${OPENEXR_PREFIX} >> GIT_REPOSITORY https://github.com/openexr/openexr.git >> GIT_TAG v2.2.0 >> CONFIGURE_COMMAND "" >> BUILD_COMMAND "" >> INSTALL_COMMAND "") >> >> >> ExternalProject_Get_Property(OPENEXR_DOWNLOAD SOURCE_DIR) >> SET(OPENEXR_SOURCE_DIR ${SOURCE_DIR}) >> >> Then I tried to create a specific new target to use specific generator >> >> ExternalProject_Add(OPENEXR_VC11 >> DEPENDS OPENEXR_DOWNLOAD >> SOURCE_DIR ${OPENEXR_SOURCE_DIR}/IlmBase) >> >> >> Seems can't work, it requires an non-empty SOURCE_DIR, but before >> downloading, it's empty :( >> >> So is there any better way to do this ? Thanks very much ! >> >> >> -- >> >> 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 >> > > > > -- > Craig Scott > Melbourne, Australia > https://crascit.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seberline at telltalegames.com Thu Dec 15 20:36:52 2016 From: seberline at telltalegames.com (Scott Eberline) Date: Thu, 15 Dec 2016 17:36:52 -0800 Subject: [CMake] CMake, VS, Nsight Tegra, NDK, mixed C/C++ - applies C++ options to C source In-Reply-To: <47e992bf-c77a-91af-8f71-b6c4a2a84e00@gmail.com> References: <47e992bf-c77a-91af-8f71-b6c4a2a84e00@gmail.com> Message-ID: I suspect that if the first source in a target is C++, every source in that targets gets CMAKE_CXX_FLAGS, otherwise CMAKE_C_FLAGS. So for now, mixing C and C++ sources in the same target is broken. I worked around this issue by putting C sources in their own static library, and linking that into the main shared library. Florent, thanks for the response and especially the links. We use the VS generator for some platforms, Ninja for Android and a couple others. I'm tasked with improving our edit-build-debug workflow by specifically migrating to Visual Studio for Android. We have a modified taka-no-me toolchain file, but current employees don't know its exact provenance so getting/merging updates is problematic. I thought the stock toolchain file provided by the latest NDK would give us the best results, at least until Kitware/CMake, Microsoft/CMake/VCMDDAndroid, Nsight Tegra VS Edition and the NDK work out their differences. On Wed, Dec 14, 2016 at 7:57 PM, Florent Castelli wrote: > I'm pretty sure that the toolchain bundled with the NDK, made by Google, > hasn't been tested with other generators than Ninja or possibly Make. > Also, there are some known bugs with it, including the one related to > CMAKE_CXX_STANDARD (see > https://code.google.com/p/android/issues/detail?id=227915 and > https://github.com/android-ndk/ndk/issues/222 ). > > I'd recommend using other generators if you want to use this toolchain or > maybe try the Android support released with CMake 3.7.1 instead, though I > have no idea if it's supposed to work with the Visual Studio generators > either! > > /Florent From dcarrera at gmail.com Thu Dec 15 21:10:21 2016 From: dcarrera at gmail.com (Daniel Carrera) Date: Fri, 16 Dec 2016 03:10:21 +0100 Subject: [CMake] Ninja+Fortran support for PGI compiler (was: Bug in Kitware's release of Ninja when compiling with PGI Fortran) In-Reply-To: <2133ff01-8503-8c91-c324-12001ab94bc8@kitware.com> References: <2133ff01-8503-8c91-c324-12001ab94bc8@kitware.com> Message-ID: On 15 December 2016 at 17:35, Brad King wrote: > > This is not a problem with Ninja or our branch of it, but rather with > CMake's information about the PGI Fortran compiler not being updated > to support the Ninja generator. One can see the value for a few other > compilers (from commit 39ebfc79e614dc395d5ace2ad5818b3ba75ca478): > > ``` > $ git grep -A 1 Fortran_PREPROCESS_SOURCE > Modules/Compiler/GNU-Fortran.cmake:set(CMAKE_Fortran_PREPROCESS_SOURCE > Modules/Compiler/GNU-Fortran.cmake- " -cpp > -E -o ") > -- > Modules/Compiler/Intel-Fortran.cmake:set(CMAKE_Fortran_PREPROCESS_SOURCE > Modules/Compiler/Intel-Fortran.cmake- " -fpp > -E > ") > -- > Modules/Compiler/SunPro-Fortran.cmake:set(CMAKE_Fortran_PREPROCESS_SOURCE > Modules/Compiler/SunPro-Fortran.cmake- " > -F -o ") > ``` > > The `Modules/Compiler/PGI-Fortran.cmake` module needs to be updated too. > I don't have that compiler handy, so if you can figure out the appropriate > line to add to that file, please try it out. If you get it working please > post it and Cc me so it can be integrated. > Ok... keeping in mind that I don't know much about CMake or PGI, this seems to be the correct line: set(CMAKE_Fortran_PREPROCESS_SOURCE " -Mpreprocess -E > ") The PGI documentation says that -Mpreprocess "instructs the compiler to perform cpp-like preprocessing on assembly and Fortran input source files". The -E flag causes the compiler to spit the result to stdout instead of saving it to a file. Since the -E flag behaves as in the Intel compiler, I used copied the stdout redirect ">" from the Intel-Fortran.cmake example. I added that line to PGI-Fortran.cmake and it seems to work. CMake can now make Ninja files for PGI. Cheers, Daniel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From demelier.david at gmail.com Fri Dec 16 05:44:05 2016 From: demelier.david at gmail.com (David Demelier) Date: Fri, 16 Dec 2016 11:44:05 +0100 Subject: [CMake] find_library returns the .dll on MinGW Message-ID: Hello, I have the following files: D:/env/mingw64/lib/libzip.dll.a D:/env/mingw64/bin/libzip.dll The following environment: PATH=D:/env/mingw64/bin CMAKE_PREFIX_PATH=D:/env/mingw64 Using this: find_library( ZIP_LIBRARY NAMES zip libzip ) I got this in the CMakeCache.txt: //Path to a library. ZIP_LIBRARY:FILEPATH=D:/env/mingw64/bin/libzip.dll Is there any reason why find_library searches for the .dll instead of the .a in that case? Is there a quick fix or I do something wrong? Regards, -- Demelier David From james.turner at kdab.com Fri Dec 16 06:55:26 2016 From: james.turner at kdab.com (James Turner) Date: Fri, 16 Dec 2016 11:55:26 +0000 Subject: [CMake] 'No known features for CXX compiler' warning with custom Clang Message-ID: <5D3226CB-988B-476E-B3E5-18D38AB52194@kdab.com> Hi, I?m seeing this error from Cmake (3.7.0) when using a custom Clang (from homebrew) on Mac. Googling turns up hits from Cmake 3.0/3.1 when compiler features was being added. What can I do to trace down or debug this error when it occurs with a recent build of Clang? I am guessing there is some compiler-id detection which needs to be extended / over-ridden for my different build of Clang. Kind regards, James -- James Turner - Senior Software Developer KDAB - The Qt, C++ and OpenGL Experts -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3868 bytes Desc: not available URL: From brad.king at kitware.com Fri Dec 16 08:38:13 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Dec 2016 08:38:13 -0500 Subject: [CMake] Ninja+Fortran support for PGI compiler In-Reply-To: References: <2133ff01-8503-8c91-c324-12001ab94bc8@kitware.com> Message-ID: <88e7b687-a6fa-ffa9-bccb-5ea518a1b905@kitware.com> On 12/15/2016 09:10 PM, Daniel Carrera wrote: > set(CMAKE_Fortran_PREPROCESS_SOURCE > " -Mpreprocess -E > ") > > I added that line to PGI-Fortran.cmake and it seems to work. Great! I'll integrate that for CMake 3.8. Thanks, -Brad From dustyn at blasig.us Fri Dec 16 10:19:20 2016 From: dustyn at blasig.us (Dustyn Blasig) Date: Fri, 16 Dec 2016 15:19:20 +0000 Subject: [CMake] Help Utilizing Binary Caches Message-ID: Hello Everyone, I'm fairly new to CMake, but have been learning as I try to migrate our components from Make to CMake. We utilize Git and Submodules for many of our components, along with the Atlassian tools like Bitbucket and Bamboo. While I'm migrating the components to CMake, I was asked to find a way to take advantage of our Bamboo generated artifacts and pull those down and install them if they are available when someone builds. If an artifact is not available for that commit, or if the user has local changes to component, then just build and install locally. I'm having a hard time finding information on best practices to do this. I did run across Artifactory (https://github.com/raumfeld/Artifactory.cmake), is that the way to go at this point. They mentioned utilizing binary caches, but not Bamboo specifically. If that framework is somewhat stable, I think we could make it work. Thanks! Dustyn -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.maynard at kitware.com Fri Dec 16 10:30:38 2016 From: robert.maynard at kitware.com (Robert Maynard) Date: Fri, 16 Dec 2016 10:30:38 -0500 Subject: [CMake] 'No known features for CXX compiler' warning with custom Clang In-Reply-To: <5D3226CB-988B-476E-B3E5-18D38AB52194@kdab.com> References: <5D3226CB-988B-476E-B3E5-18D38AB52194@kdab.com> Message-ID: I would start by looking at the how CMake identified the compiler. You can find this information inside: /CMakeFiles/3.7.0/CMakeCXXCompiler.cmake The important information being what CMAKE_CXX_COMPILER_ID and CMAKE_CXX_COMPILER_VERSION are set too. On Fri, Dec 16, 2016 at 6:55 AM, James Turner wrote: > Hi, > > I?m seeing this error from Cmake (3.7.0) when using a custom Clang (from homebrew) on Mac. Googling turns up hits from Cmake 3.0/3.1 when compiler features was being added. What can I do to trace down or debug this error when it occurs with a recent build of Clang? > > I am guessing there is some compiler-id detection which needs to be extended / over-ridden for my different build of Clang. > > Kind regards, > James > > -- > James Turner - Senior Software Developer > KDAB - The Qt, C++ and OpenGL Experts > > > > > > -- > > 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 bill.hoffman at kitware.com Fri Dec 16 11:18:07 2016 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Fri, 16 Dec 2016 11:18:07 -0500 Subject: [CMake] Ninja+Fortran support for PGI compiler In-Reply-To: <88e7b687-a6fa-ffa9-bccb-5ea518a1b905@kitware.com> References: <2133ff01-8503-8c91-c324-12001ab94bc8@kitware.com> <88e7b687-a6fa-ffa9-bccb-5ea518a1b905@kitware.com> Message-ID: <94203779-ce14-1278-8411-ea852e204e72@kitware.com> On 12/16/2016 8:38 AM, Brad King wrote: > Great! I'll integrate that for CMake 3.8. Daniel, do you think you could setup a dashboard so this stays working? https://cmake.org/testing/ -Bill From james.turner at kdab.com Fri Dec 16 17:41:33 2016 From: james.turner at kdab.com (James Turner) Date: Fri, 16 Dec 2016 22:41:33 +0000 Subject: [CMake] 'No known features for CXX compiler' warning with custom Clang In-Reply-To: References: <5D3226CB-988B-476E-B3E5-18D38AB52194@kdab.com> Message-ID: <06697F9E-E1AC-4FF6-A06C-CE4FF2302A95@kdab.com> > On 16 Dec 2016, at 15:30, Robert Maynard wrote: > > /CMakeFiles/3.7.0/CMakeCXXCompiler.cmake > > The important information being what CMAKE_CXX_COMPILER_ID and > CMAKE_CXX_COMPILER_VERSION are set too. Here?s what I have. I note the _FEATURES variables are all empty. set(CMAKE_CXX_COMPILER "/usr/local/bin/clang-omp++") set(CMAKE_CXX_COMPILER_ARG1 "") set(CMAKE_CXX_COMPILER_ID "Clang") set(CMAKE_CXX_COMPILER_VERSION "3.5.0") set(CMAKE_CXX_COMPILER_WRAPPER "") set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98") set(CMAKE_CXX_COMPILE_FEATURES "") set(CMAKE_CXX98_COMPILE_FEATURES "") set(CMAKE_CXX11_COMPILE_FEATURES "") set(CMAKE_CXX14_COMPILE_FEATURES "") set(CMAKE_CXX_PLATFORM_ID "Darwin") set(CMAKE_CXX_SIMULATE_ID "") set(CMAKE_CXX_SIMULATE_VERSION ?") Kind regards, James -- James Turner - Senior Software Developer KDAB - The Qt, C++ and OpenGL Experts -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3868 bytes Desc: not available URL: From robert.maynard at kitware.com Fri Dec 16 17:59:09 2016 From: robert.maynard at kitware.com (Robert Maynard) Date: Fri, 16 Dec 2016 17:59:09 -0500 Subject: [CMake] 'No known features for CXX compiler' warning with custom Clang In-Reply-To: <06697F9E-E1AC-4FF6-A06C-CE4FF2302A95@kdab.com> References: <5D3226CB-988B-476E-B3E5-18D38AB52194@kdab.com> <06697F9E-E1AC-4FF6-A06C-CE4FF2302A95@kdab.com> Message-ID: That is odd. Inside your build/CMakeFiles should be a file called feature_tests.cxx, and that file is how we determine what features the clang compiler supports. I would use that to determine why feature detection is failing, since currently it believes that none of the features listed in it are valid. Now if the file is empty, that means we are looking at a CMake logic bug somewhere before this. On Fri, Dec 16, 2016 at 5:41 PM, James Turner wrote: > >> On 16 Dec 2016, at 15:30, Robert Maynard wrote: >> >> /CMakeFiles/3.7.0/CMakeCXXCompiler.cmake >> >> The important information being what CMAKE_CXX_COMPILER_ID and >> CMAKE_CXX_COMPILER_VERSION are set too. > > Here?s what I have. I note the _FEATURES variables are all empty. > > set(CMAKE_CXX_COMPILER "/usr/local/bin/clang-omp++") > set(CMAKE_CXX_COMPILER_ARG1 "") > set(CMAKE_CXX_COMPILER_ID "Clang") > set(CMAKE_CXX_COMPILER_VERSION "3.5.0") > set(CMAKE_CXX_COMPILER_WRAPPER "") > set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98") > set(CMAKE_CXX_COMPILE_FEATURES "") > set(CMAKE_CXX98_COMPILE_FEATURES "") > set(CMAKE_CXX11_COMPILE_FEATURES "") > set(CMAKE_CXX14_COMPILE_FEATURES "") > > set(CMAKE_CXX_PLATFORM_ID "Darwin") > set(CMAKE_CXX_SIMULATE_ID "") > set(CMAKE_CXX_SIMULATE_VERSION ?") > > > > Kind regards, > James > > -- > James Turner - Senior Software Developer > KDAB - The Qt, C++ and OpenGL Experts > > > > From dcarrera at gmail.com Sat Dec 17 02:54:11 2016 From: dcarrera at gmail.com (Daniel Carrera) Date: Sat, 17 Dec 2016 08:54:11 +0100 Subject: [CMake] Ninja+Fortran support for PGI compiler In-Reply-To: <94203779-ce14-1278-8411-ea852e204e72@kitware.com> References: <2133ff01-8503-8c91-c324-12001ab94bc8@kitware.com> <88e7b687-a6fa-ffa9-bccb-5ea518a1b905@kitware.com> <94203779-ce14-1278-8411-ea852e204e72@kitware.com> Message-ID: On 16 December 2016 at 17:18, Bill Hoffman wrote: > On 12/16/2016 8:38 AM, Brad King wrote: > >> Great! I'll integrate that for CMake 3.8. >> > Daniel, do you think you could setup a dashboard so this stays working? > https://cmake.org/testing/ > > -Bill > Ok. I'll try. I need some help with the script: # Client maintainer: me at mydomain.net set(CTEST_SITE "machine.site") set(CTEST_BUILD_NAME "pgfortran") set(CTEST_BUILD_CONFIGURATION Debug) set(CTEST_CMAKE_GENERATOR "Ninja") include(${CTEST_SCRIPT_DIRECTORY}/cmake_common.cmake) What should I write for "machine.site"? FYI, I will change computer in two months and I will forget to set this up again. You might want to add PGI to your own nightly tests. The PGI "community edition" is free. That's the one I have. https://www.pgroup.com/products/community.htm Cheers, Daniel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcarrera at gmail.com Sat Dec 17 06:25:50 2016 From: dcarrera at gmail.com (Daniel Carrera) Date: Sat, 17 Dec 2016 12:25:50 +0100 Subject: [CMake] Ninja+Fortran support for PGI compiler In-Reply-To: <88e7b687-a6fa-ffa9-bccb-5ea518a1b905@kitware.com> References: <2133ff01-8503-8c91-c324-12001ab94bc8@kitware.com> <88e7b687-a6fa-ffa9-bccb-5ea518a1b905@kitware.com> Message-ID: On 16 December 2016 at 14:38, Brad King wrote: > On 12/15/2016 09:10 PM, Daniel Carrera wrote: > > set(CMAKE_Fortran_PREPROCESS_SOURCE > > " -Mpreprocess -E > > ") > > > > I added that line to PGI-Fortran.cmake and it seems to work. > > Great! I'll integrate that for CMake 3.8. > > Awesome! Look... I just tested the Oracle compiler. I don't actually use it myself but I have it installed and it also has problems with CMake + Ninja. It looks like the same problem. So again I went to Modules/Compiler but this time I did not see an obvious .cmake file for Oracle. If you want to try to add Oracle to the list of compilers that CMake knows about, this might help: 1) Free download: http://www.oracle.com/technetwork/server-storage/developerstudio/downloads/index.html 2) To identify the compiler, the -V flag should help: $ f90 -V f90: Studio 12.5 Fortran 95 8.8 Linux_i386 2016/05/31 3) This is how you pre-process sources: $ f90 -fpp -F foo.f90 -o output_file Cheers, Daniel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcarrera at gmail.com Sat Dec 17 21:24:35 2016 From: dcarrera at gmail.com (Daniel Carrera) Date: Sun, 18 Dec 2016 03:24:35 +0100 Subject: [CMake] What are the missing features in Ninja that CMake needs? Message-ID: Hello, Kitware maintains a separate release of Ninja in order to support Fortran: https://github.com/Kitware/ninja I kind of want to ask what Kitware changed, but I probably won't understand the details. Instead, I was hoping someone could give me a toy example of a Fortran program that cannot be compiled without Kitware's changes to Ninja? Today I tried to compare CMake+Ninja with Meson+Ninja and both were able to handle the toy programs that I threw at them. So I haven't found the corner of the parameter space that is fixed by Kitware's patches. Cheers, Daniel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Sun Dec 18 08:57:40 2016 From: DLRdave at aol.com (David Cole) Date: Sun, 18 Dec 2016 08:57:40 -0500 Subject: [CMake] What are the missing features in Ninja that CMake needs? In-Reply-To: References: Message-ID: This "compare" view on GitHub shows the difference between the regular/upstream ninja and the Kitware patched ninja: https://github.com/ninja-build/ninja/compare/master...Kitware:features-for-fortran The ReadMe explains the high-level view, and says it is gradually being worked into upstream ninja. Looks to me like it deals with "implicit dynamically discovered dependencies" in the Fortran sources. (i.e., you don't have to say in the build system input what order Fortran files get compiled in, but the order is important, and CMake analyzes them to figure it out.) This change probably helps CMake communicate that info to ninja so things rebuild properly as files get edited. I can't tell from a quick glance through exactly what the problem scenarios are, but I bet Brad King can reply with more info -- probably not till January, though. I saw a message from him Friday signing off until then. Cheers, David C. On Sat, Dec 17, 2016 at 9:24 PM, Daniel Carrera wrote: > Hello, > > Kitware maintains a separate release of Ninja in order to support Fortran: > > https://github.com/Kitware/ninja > > > I kind of want to ask what Kitware changed, but I probably won't understand > the details. Instead, I was hoping someone could give me a toy example of a > Fortran program that cannot be compiled without Kitware's changes to Ninja? > > Today I tried to compare CMake+Ninja with Meson+Ninja and both were able to > handle the toy programs that I threw at them. So I haven't found the corner > of the parameter space that is fixed by Kitware's patches. > > Cheers, > Daniel. > > -- > > 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 hrshl90 at gmail.com Sun Dec 18 11:41:35 2016 From: hrshl90 at gmail.com (Harshal Singhal) Date: Sun, 18 Dec 2016 17:41:35 +0100 Subject: [CMake] (no subject) Message-ID: Hello, I have a VS2013 project with (many sub-projects)many targets (say a b c d....) in different locations, which all are generated using CMake. I am using one top-level CMakeLists with commadadd_subdirectoriesand a CMakeLists file in each of those sub directories. So, Each sub-directory has a single target. Now, Problem is - I want to change "Platform Toolset" only in one (sub-directory) targets (say b) from v120 to v90. I have tried the following commands in my CMakeLists.txt for that particular target (say b) but none of them seem to work: Please help set(CMAKE_VS_PLATFORM_TOOLSET "v90") set(CMAKE_GENERATOR_TOOLSET "v90") or add_definitions (-DCMAKE_VS_PLATFORM_TOOLSET = "v90") add_definitions (-DMAKE_GENERATOR_TOOLSET = "v90") or set_target_properties (b PROPERTIES PLATFORM_TOOLSET "v90") After trying these command - VS2013 shows the "platform toolset " as "v120" for "b target". Maybe it is possible with command line with -T option but I want to change the toolset for only one target not for the whole project. Any ideas how to solve this problem? or please let me know if it is not clear..but please help -- Regards Harshal Singhal -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.schwarzstein at gmail.com Mon Dec 19 04:48:22 2016 From: bo.schwarzstein at gmail.com (Bo Zhou) Date: Mon, 19 Dec 2016 18:48:22 +0900 Subject: [CMake] (no subject) In-Reply-To: References: Message-ID: Hi, I'm using ExternalProject_Add to handle this situation with multiple platforms/targets. https://cmake.org/cmake/help/v3.7/module/ExternalProject.html Hope this works for you. On Mon, Dec 19, 2016 at 1:41 AM, Harshal Singhal wrote: > Hello, > > I have a VS2013 project with (many sub-projects)many targets (say a b c > d....) in different locations, which all are generated using CMake. I am > using one top-level CMakeLists with commadadd_subdirectoriesand a > CMakeLists file in each of those sub directories. So, Each sub-directory > has a single target. > > Now, Problem is - I want to change "Platform Toolset" only in one > (sub-directory) targets (say b) from v120 to v90. > > I have tried the following commands in my CMakeLists.txt for that > particular target (say b) but none of them seem to work: Please help > > set(CMAKE_VS_PLATFORM_TOOLSET "v90") > set(CMAKE_GENERATOR_TOOLSET "v90") > > or > > add_definitions (-DCMAKE_VS_PLATFORM_TOOLSET = "v90") > add_definitions (-DMAKE_GENERATOR_TOOLSET = "v90") > > or > > set_target_properties (b PROPERTIES PLATFORM_TOOLSET "v90") > > After trying these command - VS2013 shows the "platform toolset " as > "v120" for "b target". Maybe it is possible with command line with -T > option but I want to change the toolset for only one target not for the > whole project. Any ideas how to solve this problem? or please let me know > if it is not clear..but please help > > -- > Regards > Harshal Singhal > > -- > > 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 james.turner at kdab.com Mon Dec 19 04:51:48 2016 From: james.turner at kdab.com (James Turner) Date: Mon, 19 Dec 2016 09:51:48 +0000 Subject: [CMake] 'No known features for CXX compiler' warning with custom Clang In-Reply-To: References: <5D3226CB-988B-476E-B3E5-18D38AB52194@kdab.com> <06697F9E-E1AC-4FF6-A06C-CE4FF2302A95@kdab.com> Message-ID: <0C48488E-C721-49AB-BFFF-062397578A1F@kdab.com> > On 16 Dec 2016, at 22:59, Robert Maynard wrote: > > That is odd. Inside your build/CMakeFiles should be a file called > feature_tests.cxx, and that file is how we determine what features the > clang compiler supports. > > I would use that to determine why feature detection is failing, since > currently it believes that none of the features listed in it are > valid. > > Now if the file is empty, that means we are looking at a CMake logic > bug somewhere before this. In my case there is no feature_tests.cxx generated at all. Kind regards, James -- James Turner - Senior Software Developer KDAB - The Qt, C++ and OpenGL Experts -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3868 bytes Desc: not available URL: From drescherjm at gmail.com Mon Dec 19 14:19:33 2016 From: drescherjm at gmail.com (John Drescher) Date: Mon, 19 Dec 2016 14:19:33 -0500 Subject: [CMake] CMake 3.7.0-r2 Open Project sometimes picks wrong version of Visual Studio In-Reply-To: <310578769.71417255.1478618885144.JavaMail.zimbra@elemtech.com> References: <63180e1a-32e1-8299-d4a9-c2e1578a53cb@kitware.com> <310578769.71417255.1478618885144.JavaMail.zimbra@elemtech.com> Message-ID: On Tue, Nov 8, 2016 at 10:28 AM, wrote: > > > ----- On Nov 8, 2016, at 8:13 AM, Taylor Braun-Jones taylor at braun-jones.org wrote: > >> On Fri, Nov 4, 2016 at 2:55 PM, Brad King wrote: >>> >>> On 11/03/2016 06:04 PM, John Drescher wrote: >>> > I opened a project in cmake-gui using the open project button from a >>> > vc 2010 build of a project. The open project opened the project in >>> > Visual Studio 2010. Later I opened the same project but a different >>> > build tree for Visual Studio 2013 CMake-gui had all of the correct >>> > information for the Visual Studio 2013 build but open project tried to >>> > open the Visual Studio 2013 solution in Visual Studio 2010 instead of >>> > the expected Visual Studio 2013. > > I'm unable to reproduce this problem. I have multiple Visual Studio installations of different versions. > I'm not sure whether it could be specific to a project, or specific to installations of visual studio. > >> >> I'm guessing you established MSVS2010 as the default application for >> opening .sln files the first time you used the open project button. >> What happens if you double click on that MSVS2013 .sln file? Sorry for the delay. I went on vacation a few days after emailing about this issue then forgot to check back when I returned.. If I click on a .sln it picks the wrong version of Visual Studio as well so this is not a CMake issue. Thanks, John From robert.maynard at kitware.com Mon Dec 19 14:50:30 2016 From: robert.maynard at kitware.com (Robert Maynard) Date: Mon, 19 Dec 2016 14:50:30 -0500 Subject: [CMake] 'No known features for CXX compiler' warning with custom Clang In-Reply-To: <0C48488E-C721-49AB-BFFF-062397578A1F@kdab.com> References: <5D3226CB-988B-476E-B3E5-18D38AB52194@kdab.com> <06697F9E-E1AC-4FF6-A06C-CE4FF2302A95@kdab.com> <0C48488E-C721-49AB-BFFF-062397578A1F@kdab.com> Message-ID: Are you able to send me the CMakeError.log and CMakeOutput.log from your build/CMakeFiles/ directory. On Mon, Dec 19, 2016 at 4:51 AM, James Turner wrote: > >> On 16 Dec 2016, at 22:59, Robert Maynard wrote: >> >> That is odd. Inside your build/CMakeFiles should be a file called >> feature_tests.cxx, and that file is how we determine what features the >> clang compiler supports. >> >> I would use that to determine why feature detection is failing, since >> currently it believes that none of the features listed in it are >> valid. >> >> Now if the file is empty, that means we are looking at a CMake logic >> bug somewhere before this. > > In my case there is no feature_tests.cxx generated at all. > > Kind regards, > James > > -- > James Turner - Senior Software Developer > KDAB - The Qt, C++ and OpenGL Experts > > > > From bill.hoffman at kitware.com Mon Dec 19 16:16:31 2016 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Mon, 19 Dec 2016 16:16:31 -0500 Subject: [CMake] What are the missing features in Ninja that CMake needs? In-Reply-To: References: Message-ID: <76ccf6ad-ceb1-5b9d-0ea6-199b8daddcb6@kitware.com> On 12/18/2016 8:57 AM, David Cole via CMake wrote: > This "compare" view on GitHub shows the difference between the > regular/upstream ninja and the Kitware patched ninja: > > https://github.com/ninja-build/ninja/compare/master...Kitware:features-for-fortran > > The ReadMe explains the high-level view, and says it is gradually > being worked into upstream ninja. > It has to do with Fortran modules. These are sort of "include" files that are automatically generated by the Fortran compiler. So, there is a specific order in which Fortran source files must be compiled so that files that include exist before they try to include them. For some examples see this cmake test case: https://gitlab.kitware.com/cmake/cmake/tree/master/Tests/FortranModules It will not pass with upstream ninja. -Bill From james.turner at kdab.com Tue Dec 20 11:55:32 2016 From: james.turner at kdab.com (James Turner) Date: Tue, 20 Dec 2016 16:55:32 +0000 Subject: [CMake] 'No known features for CXX compiler' warning with custom Clang In-Reply-To: <0C48488E-C721-49AB-BFFF-062397578A1F@kdab.com> References: <5D3226CB-988B-476E-B3E5-18D38AB52194@kdab.com> <06697F9E-E1AC-4FF6-A06C-CE4FF2302A95@kdab.com> <0C48488E-C721-49AB-BFFF-062397578A1F@kdab.com> Message-ID: > On 19 Dec 2016, at 09:51, James Turner wrote: > > In my case there is no feature_tests.cxx generated at all. For the benefit of posterity, Robert very kindly figured this out: the problem is I did not have CMP0025 set, and the minimum CMake version was set < 3.3 This breaks compiler feature detection with a custom Clang. Setting the policy to NEW makes everything work as expected. Kind regards, James -- James Turner - Senior Software Developer KDAB - The Qt, C++ and OpenGL Experts -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3868 bytes Desc: not available URL: From londinop at gmail.com Tue Dec 20 15:53:58 2016 From: londinop at gmail.com (Paul Londino) Date: Tue, 20 Dec 2016 15:53:58 -0500 Subject: [CMake] Documentation in RPM Package Message-ID: Hello, I am trying to create an RPM package using CPack. I am having trouble packaging the documentation. There is a custom target that generates HTML using DoxyGen (in a folder called html), and this gets installed to /usr/doc/share during the packaging process. However, this generates 12,000+ files which are all added individually to the .spec file. What I would like to do is just add the whole doc directory to the RPM package using the %doc attribute so the RPM correctly installs this in the package-named subfolder of /usr/share/doc and marks it as documentation. I experimented with the CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST variable but this doesn't seem to work on a wildcard basis and excluding all 12,000 generated files by hand does not seem practical. Also, I was able to generate the %doc attribute using CPACK_RPM_USER_FILELIST, but I believe in order to have the auto-generated doc dir, it needs to be a relative path instead of absolute, which I had problems setting using the CMAKE variable (this could be more an RPM issue than a CMAKE one). Any ideas in the best way to achieve what I'm trying to do? I could try using a custom .spec file but there is a lot of value in the automatically generated one from the CMake, so I would prefer to use that if possible. Thanks in advance for any assistance. -Paul From domen.vrankar at gmail.com Tue Dec 20 18:52:38 2016 From: domen.vrankar at gmail.com (Domen Vrankar) Date: Wed, 21 Dec 2016 00:52:38 +0100 Subject: [CMake] Documentation in RPM Package In-Reply-To: References: Message-ID: 2016-12-20 21:53 GMT+01:00 Paul Londino : > Hello, > > I am trying to create an RPM package using CPack. I am having trouble > packaging the documentation. There is a custom target that generates > HTML using DoxyGen (in a folder called html), and this gets installed > to /usr/doc/share during the packaging process. However, this > generates 12,000+ files which are all added individually to the .spec > file. > > What I would like to do is just add the whole doc directory to the RPM > package using the %doc attribute so the RPM correctly installs this in > the package-named subfolder of /usr/share/doc and marks it as > documentation. I experimented with the > CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST variable but this doesn't seem to > work on a wildcard basis and excluding all 12,000 generated files by > hand does not seem practical. Also, I was able to generate the %doc > attribute using CPACK_RPM_USER_FILELIST, but I believe in order to > have the auto-generated doc dir, it needs to be a relative path > instead of absolute, which I had problems setting using the CMAKE > variable (this could be more an RPM issue than a CMAKE one). > > Any ideas in the best way to achieve what I'm trying to do? I could > try using a custom .spec file but there is a lot of value in the > automatically generated one from the CMake, so I would prefer to use > that if possible. > I don't believe that CPack/RPM can currently do what you want. CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST is not intended to be used for removing an entire list of files so it doesn't support wildcards - it is meant to be used to exclude directory paths from being tracked by rpm and deleted during rpm package uninstall. Why exactly do you want to remove all those files? Spec file size or something else? If you write something like this: install(FILES CMakeLists.txt DESTINATION x/maabc COMPONENT test RENAME manx.txt) install(FILES CMakeLists.txt DESTINATION x/maabc COMPONENT test RENAME many.txt) set(CPACK_RPM_USER_FILELIST "%doc /usr/x" ) Where /usr is packaging install prefix (this part could be replaced with a variable so that it depends on for e.g. CPACK_PACKAGING_INSTALL_PREFIX or some other path). And then expect the generated package with (listing only files marked with %doc): rpm -qpld You'll get both files in that subdirectory flagged with %doc and I believe that that's what you'd like to achieve. If for some reason you'd really like to remove those files from spec file you'll either have to patch your CPackRPM.cmake or write your own spec file. If that's the case then please explain the reasons a bit further and if it would be useful for others it could be added to a later CPackRPM release. Regards, Domen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Dvir.Yitzchaki at ceva-dsp.com Wed Dec 21 03:14:49 2016 From: Dvir.Yitzchaki at ceva-dsp.com (Dvir Yitzchaki) Date: Wed, 21 Dec 2016 08:14:49 +0000 Subject: [CMake] cpack multiple packages Message-ID: <47b07b498c81452798ec3f9661e75a06@ceva-dsp.com> Hi. I have a big project which produces several zip packages. Some files are common to all packages while others are unique per package. Is there a way to create these packages using cpack? I tried to use components but it seems that either it puts all components in one package or makes one package per component. Thanks, Dvir -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.noulard at gmail.com Wed Dec 21 03:41:49 2016 From: eric.noulard at gmail.com (Eric Noulard) Date: Wed, 21 Dec 2016 09:41:49 +0100 Subject: [CMake] cpack multiple packages In-Reply-To: <47b07b498c81452798ec3f9661e75a06@ceva-dsp.com> References: <47b07b498c81452798ec3f9661e75a06@ceva-dsp.com> Message-ID: When playing with component you have 3 major way to package which are governed by the value of CPACK_COMPONENTS_GROUPING: 1 package per component -> set(CPACK_COMPONENTS_GROUPING IGNORE) 1 package for all -> set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE) 1 package per component group the default behavior. In order to get 1 package per group you have to specify group when specifying component, more information here: https://cmake.org/cmake/help/v3.7/module/CPackComponent.html https://cmake.org/Wiki/CMake:Component_Install_With_CPack#Principles_of_CPack_Component_Packaging 2016-12-21 9:14 GMT+01:00 Dvir Yitzchaki : > Hi. > > > > I have a big project which produces several zip packages. > > Some files are common to all packages while others are unique per package. > > > > Is there a way to create these packages using cpack? > > > > I tried to use components but it seems that either it puts all components > in one package or makes one package per component. > > > > Thanks, > > > > Dvir > > -- > > 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 Dvir.Yitzchaki at ceva-dsp.com Wed Dec 21 06:29:40 2016 From: Dvir.Yitzchaki at ceva-dsp.com (Dvir Yitzchaki) Date: Wed, 21 Dec 2016 11:29:40 +0000 Subject: [CMake] cpack multiple packages In-Reply-To: References: <47b07b498c81452798ec3f9661e75a06@ceva-dsp.com> Message-ID: Thanks, but as I understand a component can only belong to one group. How can I get the same component/target on multiple packages? From: Eric Noulard [mailto:eric.noulard at gmail.com] Sent: Wednesday, December 21, 2016 10:42 AM To: Dvir Yitzchaki Cc: cmake at cmake.org Subject: Re: [CMake] cpack multiple packages When playing with component you have 3 major way to package which are governed by the value of CPACK_COMPONENTS_GROUPING: 1 package per component -> set(CPACK_COMPONENTS_GROUPING IGNORE) 1 package for all -> set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE) 1 package per component group the default behavior. In order to get 1 package per group you have to specify group when specifying component, more information here: https://cmake.org/cmake/help/v3.7/module/CPackComponent.html https://cmake.org/Wiki/CMake:Component_Install_With_CPack#Principles_of_CPack_Component_Packaging 2016-12-21 9:14 GMT+01:00 Dvir Yitzchaki >: Hi. I have a big project which produces several zip packages. Some files are common to all packages while others are unique per package. Is there a way to create these packages using cpack? I tried to use components but it seems that either it puts all components in one package or makes one package per component. Thanks, Dvir -- 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 aishwaryaselvaraj1708 at gmail.com Wed Dec 21 06:51:31 2016 From: aishwaryaselvaraj1708 at gmail.com (aishwarya selvaraj) Date: Wed, 21 Dec 2016 17:21:31 +0530 Subject: [CMake] Cmake Message-ID: Hi Everyone, Myself Aishwarya .I wanted to make use of Cmake , but I'm really new to this and doesn't have a clear idea about it. 1) *My Goal :* I'm using Praat a speech Processing Software to create plug - in for my Algorithm on Pitch and Time scaling .(I have the .cpp file) In order to do that I need to use the binary file obtained by compiling .cpp file ?in my Praat Script . I intent to share this plug - in with others ,Hence I want it to be machine independent .The binary file I obtained is using gcc in Linux (16.0.2), which clearly wont work in Mac or Windows or even in lower Linux Version. To solve this Problem I understand that I need to make use of Cmake files . 2) My .cpp file called TSM_CODE_V3.cpp is compiled as g++ TSM_CODE_V3.cpp -larmadillo -lsndfile -o TSM where armadillo and sndfile are two depended libraries. 3)* What I have done :* ?I have gone through a loot of tutorials for cmake .I have wage idea , but I'm not able to solve my problem mentioned above . ?My folder TSM consists of build - the folder which consists the final executable binary file and the related cmake files required to create binary file src - consists of my TSM_CODE_V3.cpp code CMakeLists.txt - The top level Cmake file : cmake_minimum_required(VERSION 2.8.9) project(directory_TSM) include_directories(include) file(GLOB SOURCES "src/*.cpp") add_executable(tsm ${SOURCES}) I need to include the library armadillo and lidsndfile . I dont know how to include it into my cmakefile . I have come across find_package ,find_library but I am sure about it . To create my Praat Plug - in I need to compile the source code no matter in which system it is ,which may or may not have these two libraries already installed. So how how do I add libraries using cmake ? I hope you got my point . Could help me ? Hoping for your reply . -- Regards, Aishwarya Selvaraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.stuermer at schaeffler.com Wed Dec 21 07:04:13 2016 From: michael.stuermer at schaeffler.com (Stuermer, Michael SP/HZA-ZSEP) Date: Wed, 21 Dec 2016 12:04:13 +0000 Subject: [CMake] Cmake In-Reply-To: References: Message-ID: <7cb25ae90e3047b8b2acb6255aabb7ed@DE013666.schaeffler.com> Hello, To add your mentioned libraries to the executable you have to link against them. For this the cmake command target_link_libraries() is used: https://cmake.org/cmake/help/v3.7/command/target_link_libraries.html In your case the cmake code should look similar to this: target_link_libraries(tsm armadillo lidsndfile) best regards, Michael From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of aishwarya selvaraj Sent: Wednesday, December 21, 2016 12:52 PM To: cmake at cmake.org Subject: [CMake] Cmake Hi Everyone, Myself Aishwarya .I wanted to make use of Cmake , but I'm really new to this and doesn't have a clear idea about it. 1) My Goal : I'm using Praat a speech Processing Software to create plug - in for my Algorithm on Pitch and Time scaling .(I have the .cpp file) In order to do that I need to use the binary file obtained by compiling .cpp file ?in my Praat Script . I intent to share this plug - in with others ,Hence I want it to be machine independent .The binary file I obtained is using gcc in Linux (16.0.2), which clearly wont work in Mac or Windows or even in lower Linux Version. To solve this Problem I understand that I need to make use of Cmake files . 2) My .cpp file called TSM_CODE_V3.cpp is compiled as g++ TSM_CODE_V3.cpp -larmadillo -lsndfile -o TSM where armadillo and sndfile are two depended libraries. 3) What I have done : ?I have gone through a loot of tutorials for cmake .I have wage idea , but I'm not able to solve my problem mentioned above . ?My folder TSM consists of build - the folder which consists the final executable binary file and the related cmake files required to create binary file src - consists of my TSM_CODE_V3.cpp code CMakeLists.txt - The top level Cmake file : cmake_minimum_required(VERSION 2.8.9) project(directory_TSM) include_directories(include) file(GLOB SOURCES "src/*.cpp") add_executable(tsm ${SOURCES}) I need to include the library armadillo and lidsndfile . I dont know how to include it into my cmakefile . I have come across find_package ,find_library but I am sure about it . To create my Praat Plug - in I need to compile the source code no matter in which system it is ,which may or may not have these two libraries already installed. So how how do I add libraries using cmake ? I hope you got my point . Could help me ? Hoping for your reply . -- Regards, Aishwarya Selvaraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan at su-root.co.uk Wed Dec 21 08:03:19 2016 From: dan at su-root.co.uk (Dan Liew) Date: Wed, 21 Dec 2016 13:03:19 +0000 Subject: [CMake] Cmake In-Reply-To: References: Message-ID: Hi Aishwarya, On 21 December 2016 at 11:51, aishwarya selvaraj wrote: > Hi Everyone, > Myself Aishwarya .I wanted to make use of Cmake , but I'm really new to this > and doesn't have a clear idea about it. > > 1) My Goal : > I'm using Praat a speech Processing Software to create plug - in for my > Algorithm on Pitch and Time scaling .(I have the .cpp file) > In order to do that I need to use the binary file obtained by compiling .cpp > file > in my Praat Script . > I intent to share this plug - in with others ,Hence I want it to be machine > independent .The binary file I obtained is using gcc in Linux (16.0.2), > which clearly wont work in Mac or Windows or even in lower Linux Version. > To solve this Problem I understand that I need to make use of Cmake files . CMake is not going make your binaries machine independent. It can give a way to build your application that will successfully compile on different platforms but you will have to compile the binary on each platform that you are targeting. > 2) My .cpp file called TSM_CODE_V3.cpp is compiled as > g++ TSM_CODE_V3.cpp -larmadillo -lsndfile -o TSM > > where armadillo and sndfile are two depended libraries. > > 3) What I have done : > I have gone through a loot of tutorials for cmake .I have wage idea , but > I'm not able to solve my problem mentioned above . > My folder TSM consists of > build - the folder which consists the final executable binary file and the > related cmake files required to create binary file > src - consists of my TSM_CODE_V3.cpp code > CMakeLists.txt - The top level Cmake file : > > cmake_minimum_required(VERSION 2.8.9) > project(directory_TSM) > include_directories(include) > file(GLOB SOURCES "src/*.cpp") > add_executable(tsm ${SOURCES}) Do not use `file(GLOB ...)` to find source files. It is very bad practice because it prevents CMake from re-generating itself automatically. You should list the source files explicitly. That way when you add/remove a source file the fact you updated the `CMakeLists.txt` file will trigger a re-configure of the build system. > > I need to include the library armadillo and lidsndfile . > I dont know how to include it into my cmakefile . > I have come across find_package ,find_library but I am sure about it . > To create my Praat Plug - in I need to compile the source code no matter in > which system it is ,which may or may not have these two libraries already > installed. > So how how do I add libraries using cmake ? Use `target_link_libraries()` to link libraries into your target. If you're not sure how to use it I highly recommend you read the documentation for it [1]. In terms of finding the library if there is no package for those libraries you can use the `find_library()` command. Again if you're not sure how to use it check out the documentation [2]. Seeing as you are very new to CMake I would also recommend reading [3] which explains some important high level concepts in CMake. [1] https://cmake.org/cmake/help/v3.6/command/target_link_libraries.html [2] https://cmake.org/cmake/help/v3.6/command/find_library.html [3] https://cmake.org/cmake/help/v3.6/manual/cmake-buildsystem.7.html From dustyn at blasig.us Thu Dec 22 12:39:00 2016 From: dustyn at blasig.us (Dustyn Blasig) Date: Thu, 22 Dec 2016 17:39:00 +0000 Subject: [CMake] Help Utilizing Binary Caches In-Reply-To: References: Message-ID: If there is some additional information needed, let me know. I'm mostly looking for advice, so if this has never been done successfully, that would be good to know as well. Thx! On Fri, Dec 16, 2016 at 9:19 AM Dustyn Blasig wrote: > Hello Everyone, > > I'm fairly new to CMake, but have been learning as I try to migrate our > components from Make to CMake. We utilize Git and Submodules for many of > our components, along with the Atlassian tools like Bitbucket and Bamboo. > > While I'm migrating the components to CMake, I was asked to find a way to > take advantage of our Bamboo generated artifacts and pull those down and > install them if they are available when someone builds. If an artifact is > not available for that commit, or if the user has local changes to > component, then just build and install locally. > > I'm having a hard time finding information on best practices to do this. I > did run across Artifactory (https://github.com/raumfeld/Artifactory.cmake), > is that the way to go at this point. They mentioned utilizing binary > caches, but not Bamboo specifically. If that framework is somewhat stable, > I think we could make it work. > > Thanks! > Dustyn > -------------- next part -------------- An HTML attachment was scrubbed... URL: From domen.vrankar at gmail.com Thu Dec 22 13:43:17 2016 From: domen.vrankar at gmail.com (Domen Vrankar) Date: Thu, 22 Dec 2016 19:43:17 +0100 Subject: [CMake] cpack multiple packages In-Reply-To: References: <47b07b498c81452798ec3f9661e75a06@ceva-dsp.com> Message-ID: 2016-12-21 12:29 GMT+01:00 Dvir Yitzchaki : > Thanks, but as I understand a component can only belong to one group. > > How can I get the same component/target on multiple packages? > Usually you wouldn't want to package same file on same location with same filename since during unpackaging they would override each other so this is not supported out of the box. Usually in such cases I would split packages even further so that one package would be base package of others (but automatic dependency tracking between them would require something more sophisticated than zip - RPM, Deb or some other CPack supported packager perhaps). However if you really need to do something like that you could write a function that you would call instead of install(...) command which would just forward to it and the first parameter would have a list of components to which the file should belong. For e.g. some pseudo code: function(my_install my_list other_params_that_get_forwarded...) foreach(component_name_ IN LISTS my_list) install(other_params_that_get_forwarded... COMPONENT ${component_name_}) endforeach() endfunction() my_install("first;second;and_anotherone" "TARGETS target_name" "DESTINATION some_dir") Hope this helps. Regards, Domen -------------- next part -------------- An HTML attachment was scrubbed... URL: From londinop at gmail.com Thu Dec 22 21:14:02 2016 From: londinop at gmail.com (Paul Londino) Date: Thu, 22 Dec 2016 21:14:02 -0500 Subject: [CMake] Documentation in RPM Package In-Reply-To: References: Message-ID: Hi Domen, Thanks for the quick reply. I've spent a bit more time digging into this. What I am specifically trying to do is use the built-in %doc mechanism of RPM to automatically package the documentation. Using rpmbuild, if you specify a relative path (no leading /) with the %doc attribute, it will automatically package the documentation in a subfolder of /usr/share/doc with the name and version of the package. This path is relative to the BUILD directory (after extraction from the SOURCE directory). So for example a file "readme.txt" for a package "foo" version "2.5.1" residing in the BUILD/foo/directory and specified as "%doc readme.txt" will get automatically copied to a /usr/share/foo-2.5.1/readme.txt via the following instructions: cd /home/plondino/code/cpp/foo/cmake_build/_CPack_Packages/Linux/RPM/BUILD + DOCDIR=/home/plondino/code/cpp/foo/cmake_build/_CPack_Packages/Linux/RPM/foo-2.20.5.16916-1.el7.x86_64/libraries/usr/share/doc/foo-devel.rpm-2.20.5.16916 + export DOCDIR + /usr/bin/mkdir -p /home/plondino/code/cpp/foo/cmake_build/_CPack_Packages/Linux/RPM/foo-2.20.5.16916-1.el7.x86_64/libraries/usr/share/doc/foo-devel.rpm-2.20.5.16916 + cp -pr readme.txt /home/plondino/code/cpp/foo/cmake_build/_CPack_Packages/Linux/RPM/foo-2.20.5.16916-1.el7.x86_64/libraries/usr/share/doc/foo-devel.rpm-2.20.5.16916 I am not sure if this behavior is hard-coded or configurable somewhere in the RPM build process. So actually my current CMake build which installs these files to the BUILDROOT directory will not work as is. If given an absolute path such as /usr/share/doc/readme.txt, the RPM build process will look for it under BUILDROOT and not BUILD, and it will not automatically create the package subdirectory; instead it will just use the exact path and mark it as documentation. It believe it would be useful to perform this same kind of documentation installation in CPack, since it seems like a standard place for documentation in an RPM-based distribution. Is there an easy way to do this using the existing CMake infrastructure? A custom installation for documentation that mimics the above structure springs to mind, but it would need to be specific to the RPM packaging only, other package generators would probably not want a similar structure. Any ideas about how to achieve this would be helpful. Please let me know if there is any other data or testing I can provide that would help. Thanks, Paul On Tue, Dec 20, 2016 at 6:52 PM, Domen Vrankar wrote: > 2016-12-20 21:53 GMT+01:00 Paul Londino : >> >> Hello, >> >> I am trying to create an RPM package using CPack. I am having trouble >> packaging the documentation. There is a custom target that generates >> HTML using DoxyGen (in a folder called html), and this gets installed >> to /usr/doc/share during the packaging process. However, this >> generates 12,000+ files which are all added individually to the .spec >> file. >> >> What I would like to do is just add the whole doc directory to the RPM >> package using the %doc attribute so the RPM correctly installs this in >> the package-named subfolder of /usr/share/doc and marks it as >> documentation. I experimented with the >> CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST variable but this doesn't seem to >> work on a wildcard basis and excluding all 12,000 generated files by >> hand does not seem practical. Also, I was able to generate the %doc >> attribute using CPACK_RPM_USER_FILELIST, but I believe in order to >> have the auto-generated doc dir, it needs to be a relative path >> instead of absolute, which I had problems setting using the CMAKE >> variable (this could be more an RPM issue than a CMAKE one). >> >> Any ideas in the best way to achieve what I'm trying to do? I could >> try using a custom .spec file but there is a lot of value in the >> automatically generated one from the CMake, so I would prefer to use >> that if possible. > > > I don't believe that CPack/RPM can currently do what you want. > > CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST is not intended to be used for removing > an entire list of files so it doesn't support wildcards - it is meant to be > used to exclude directory paths from being tracked by rpm and deleted during > rpm package uninstall. > > Why exactly do you want to remove all those files? Spec file size or > something else? > If you write something like this: > > install(FILES CMakeLists.txt DESTINATION x/maabc COMPONENT test RENAME > manx.txt) > install(FILES CMakeLists.txt DESTINATION x/maabc COMPONENT test RENAME > many.txt) > > set(CPACK_RPM_USER_FILELIST > "%doc /usr/x" > ) > > Where /usr is packaging install prefix (this part could be replaced with a > variable so that it depends on for e.g. CPACK_PACKAGING_INSTALL_PREFIX or > some other path). > > And then expect the generated package with (listing only files marked with > %doc): > > rpm -qpld > > You'll get both files in that subdirectory flagged with %doc and I believe > that that's what you'd like to achieve. > > If for some reason you'd really like to remove those files from spec file > you'll either have to patch your CPackRPM.cmake or write your own spec file. > If that's the case then please explain the reasons a bit further and if it > would be useful for others it could be added to a later CPackRPM release. > > Regards, > Domen From leventelist at gmail.com Fri Dec 23 14:57:49 2016 From: leventelist at gmail.com (Lev) Date: Fri, 23 Dec 2016 20:57:49 +0100 Subject: [CMake] cmake vs. Python 3.4 Message-ID: <20161223205749.20c5c5ec@jive> Hi list, I have this: FIND_PACKAGE(PythonInterp) and cmake finds this: -- Found PythonInterp: /usr/bin/python (found version "2.7.9") However, 3.4 is also installed. How can I specify to find 3.4? If I say: set(Python_ADDITIONAL_VERSIONS 3.4) FIND_PACKAGE(PythonInterp 3 REQUIRED) still no luck. This is on a Debian stable, so $ cmake --version cmake version 3.0.2 Thanks, Levente -- 73 de HA5OGL Op.: Levente From irwin at beluga.phys.uvic.ca Fri Dec 23 15:53:30 2016 From: irwin at beluga.phys.uvic.ca (Alan W. Irwin) Date: Fri, 23 Dec 2016 12:53:30 -0800 (PST) Subject: [CMake] cmake vs. Python 3.4 In-Reply-To: <20161223205749.20c5c5ec@jive> References: <20161223205749.20c5c5ec@jive> Message-ID: On 2016-12-23 20:57+0100 Lev wrote: > Hi list, > > > I have this: > > FIND_PACKAGE(PythonInterp) > > and cmake finds this: > > -- Found PythonInterp: /usr/bin/python (found version "2.7.9") > > However, 3.4 is also installed. How can I specify to find 3.4? > > If I say: > > set(Python_ADDITIONAL_VERSIONS 3.4) > FIND_PACKAGE(PythonInterp 3 REQUIRED) > > still no luck. > > This is on a Debian stable, so > > $ cmake --version > cmake version 3.0.2 Try using the update-alternatives command so that "python" becomes symbolically linked to python-3.4 rather than python-2.7.9 Or uninstall python 2.7.9. 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 rleigh at codelibre.net Fri Dec 23 16:11:48 2016 From: rleigh at codelibre.net (Roger Leigh) Date: Fri, 23 Dec 2016 21:11:48 +0000 Subject: [CMake] cmake vs. Python 3.4 In-Reply-To: References: <20161223205749.20c5c5ec@jive> Message-ID: On 23/12/16 20:53, Alan W. Irwin wrote: > On 2016-12-23 20:57+0100 Lev wrote: > >> Hi list, >> >> >> I have this: >> >> FIND_PACKAGE(PythonInterp) >> >> and cmake finds this: >> >> -- Found PythonInterp: /usr/bin/python (found version "2.7.9") >> >> However, 3.4 is also installed. How can I specify to find 3.4? >> >> If I say: >> >> set(Python_ADDITIONAL_VERSIONS 3.4) >> FIND_PACKAGE(PythonInterp 3 REQUIRED) >> >> still no luck. >> >> This is on a Debian stable, so >> >> $ cmake --version >> cmake version 3.0.2 > > Try using the update-alternatives command so that "python" becomes > symbolically linked to python-3.4 rather than python-2.7.9 > > Or uninstall python 2.7.9. This seems a little drastic; I wouldn't expect to have to alter the system for cmake to do what I want. Does FindPython not have logic to check the versioned pythonx.y alternatives when doing these checks? Why isn't it checking the python3 and python3.x commands in this circumstance? Or, give the incompatibility here, do we need a separate FindPython3Interp and equivalents so that we can find Python 2 and 3 version of the executable and libs independently. This is something which has been bugging me for a while since the current behaviour seems somewhat unsatisfactory. Regards, Roger From sklist at kitterman.com Fri Dec 23 16:06:48 2016 From: sklist at kitterman.com (Scott Kitterman) Date: Fri, 23 Dec 2016 16:06:48 -0500 Subject: [CMake] cmake vs. Python 3.4 In-Reply-To: References: <20161223205749.20c5c5ec@jive> Message-ID: <6650942.WWe862O9ob@kitterma-e6430> On Friday, December 23, 2016 12:53:30 PM Alan W. Irwin wrote: > On 2016-12-23 20:57+0100 Lev wrote: > > Hi list, > > > > > > I have this: > > > > FIND_PACKAGE(PythonInterp) > > > > and cmake finds this: > > > > -- Found PythonInterp: /usr/bin/python (found version "2.7.9") > > > > However, 3.4 is also installed. How can I specify to find 3.4? > > > > If I say: > > > > set(Python_ADDITIONAL_VERSIONS 3.4) > > FIND_PACKAGE(PythonInterp 3 REQUIRED) > > > > still no luck. > > > > This is on a Debian stable, so > > > > $ cmake --version > > cmake version 3.0.2 > > Try using the update-alternatives command so that "python" becomes > symbolically linked to python-3.4 rather than python-2.7.9 > > Or uninstall python 2.7.9. No. Don't do that. Debian (and its derivatives don't work that way). The way I've done this before (when building for multiple python and python3 versions is to set: PYTHON_EXECUTABLE=/usr/bin/python$v Where $v would, in your case, be 3.4. Scott K From leventelist at gmail.com Fri Dec 23 16:10:18 2016 From: leventelist at gmail.com (Lev) Date: Fri, 23 Dec 2016 22:10:18 +0100 Subject: [CMake] cmake vs. Python 3.4 In-Reply-To: References: <20161223205749.20c5c5ec@jive> Message-ID: <20161223221018.59dcc657@jive> On Fri, 23 Dec 2016 12:53:30 -0800 (PST) "Alan W. Irwin" wrote: > Try using the update-alternatives command so that "python" becomes > symbolically linked to python-3.4 rather than python-2.7.9 > > Or uninstall python 2.7.9. Ok. Thanks both of you. Merry XMAS, Levente -- 73 de HA5OGL Op.: Levente From elizabeth.fischer at columbia.edu Fri Dec 23 16:44:53 2016 From: elizabeth.fischer at columbia.edu (Elizabeth A. Fischer) Date: Fri, 23 Dec 2016 16:44:53 -0500 Subject: [CMake] cmake vs. Python 3.4 In-Reply-To: References: <20161223205749.20c5c5ec@jive> Message-ID: > > Try using the update-alternatives command so that "python" becomes > symbolically linked to python-3.4 rather than python-2.7.9 > > Or uninstall python 2.7.9. > The standard Python distribution for versions 3 or greater installs a binary called `python3`, not `python`. That is the standard. If you are running Python3 from a binary called `python`, that is not standard. I know that distros do this (or can do it with tweaking); but that doesn't make it standard. If you want to be sure you're getting Python3, you should look for a binary called `python3`. Does FindPython not have logic to check the versioned pythonx.y > alternatives when doing these checks? Why isn't it checking the python3 > and python3.x commands in this circumstance? Have you tried the FindPython I referenced above? It would solve the problems you brought to this thread (and maybe even some you didn't yet know you have). -------------- next part -------------- An HTML attachment was scrubbed... URL: From elizabeth.fischer at columbia.edu Fri Dec 23 16:45:42 2016 From: elizabeth.fischer at columbia.edu (Elizabeth A. Fischer) Date: Fri, 23 Dec 2016 16:45:42 -0500 Subject: [CMake] Fwd: cmake vs. Python 3.4 In-Reply-To: References: <20161223205749.20c5c5ec@jive> Message-ID: Ooops, this message was supposed to be "Reply All" ---------- Forwarded message ---------- From: Elizabeth A. Fischer Date: Fri, Dec 23, 2016 at 3:28 PM Subject: Re: [CMake] cmake vs. Python 3.4 To: Lev Look for a binary called `python3`, not `python`. See here: https://github.com/citibeth/icebin/blob/develop/cmake/FindPython.cmake The `FindPython.cmake` I shared above also queries the Python system for the correct place to install things. See here for how it's used: https://github.com/citibeth/icebin/blob/develop/pylib/CMakeLists.txt On Fri, Dec 23, 2016 at 2:57 PM, Lev wrote: > Hi list, > > > I have this: > > FIND_PACKAGE(PythonInterp) > > and cmake finds this: > > -- Found PythonInterp: /usr/bin/python (found version "2.7.9") > > However, 3.4 is also installed. How can I specify to find 3.4? > > If I say: > > set(Python_ADDITIONAL_VERSIONS 3.4) > FIND_PACKAGE(PythonInterp 3 REQUIRED) > > still no luck. > > This is on a Debian stable, so > > $ cmake --version > cmake version 3.0.2 > > > Thanks, > Levente > > -- > 73 de HA5OGL > Op.: Levente > -- > > 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/opensou > rce/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan at su-root.co.uk Fri Dec 23 17:52:56 2016 From: dan at su-root.co.uk (Dan Liew) Date: Fri, 23 Dec 2016 22:52:56 +0000 Subject: [CMake] cmake vs. Python 3.4 In-Reply-To: <20161223205749.20c5c5ec@jive> References: <20161223205749.20c5c5ec@jive> Message-ID: On 23 Dec 2016 7:58 pm, "Lev" wrote: Hi list, I have this: FIND_PACKAGE(PythonInterp) and cmake finds this: -- Found PythonInterp: /usr/bin/python (found version "2.7.9") However, 3.4 is also installed. How can I specify to find 3.4? If I say: set(Python_ADDITIONAL_VERSIONS 3.4) FIND_PACKAGE(PythonInterp 3 REQUIRED) still no luck. When you did that did you wipe the CMake cache (e.g. delete any existing binary build directory)? In many cases where CMake is asked to find a binary it will create a cache variable if it was found so that on subsequent runs of CMake it doesn't have to search for it again. You may be hitting this. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eike at sf-mail.de Sat Dec 24 06:06:10 2016 From: eike at sf-mail.de (Rolf Eike Beer) Date: Sat, 24 Dec 2016 12:06:10 +0100 Subject: [CMake] cmake vs. Python 3.4 In-Reply-To: <20161223205749.20c5c5ec@jive> References: <20161223205749.20c5c5ec@jive> Message-ID: <1602705.disJLs1nXu@daneel.sf-tec.de> Am Freitag, 23. Dezember 2016, 20:57:49 schrieb Lev: > Hi list, > > > I have this: > > FIND_PACKAGE(PythonInterp) > > and cmake finds this: > > -- Found PythonInterp: /usr/bin/python (found version "2.7.9") > > However, 3.4 is also installed. How can I specify to find 3.4? > > If I say: > > set(Python_ADDITIONAL_VERSIONS 3.4) > FIND_PACKAGE(PythonInterp 3 REQUIRED) The problem here is the "REQUIRED". Older CMake versions did not let "3.4" satisfy "3" as required version, what newer versions do. However they let it pass as a minimum version. And you don't need to add 3.4 to the list of supported versions, if I read the log correct then 3.4 is already in the list for CMake 3.0. Eike, having done most of this version detection stuff -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 181 bytes Desc: This is a digitally signed message part. URL: From eike at sf-mail.de Sat Dec 24 06:19:05 2016 From: eike at sf-mail.de (Rolf Eike Beer) Date: Sat, 24 Dec 2016 12:19:05 +0100 Subject: [CMake] cmake vs. Python 3.4 In-Reply-To: <1602705.disJLs1nXu@daneel.sf-tec.de> References: <20161223205749.20c5c5ec@jive> <1602705.disJLs1nXu@daneel.sf-tec.de> Message-ID: <4282808.bV6FXtDsfX@daneel.sf-tec.de> Am Samstag, 24. Dezember 2016, 12:06:10 schrieb Rolf Eike Beer: > Am Freitag, 23. Dezember 2016, 20:57:49 schrieb Lev: > > Hi list, > > > > > > I have this: > > > > FIND_PACKAGE(PythonInterp) > > > > and cmake finds this: > > > > -- Found PythonInterp: /usr/bin/python (found version "2.7.9") > > > > However, 3.4 is also installed. How can I specify to find 3.4? > > > > If I say: > > > > set(Python_ADDITIONAL_VERSIONS 3.4) > > FIND_PACKAGE(PythonInterp 3 REQUIRED) > > The problem here is the "REQUIRED". Older CMake versions did not let "3.4" > satisfy "3" as required version, what newer versions do. However they let it > pass as a minimum version. And you don't need to add 3.4 to the list of > supported versions, if I read the log correct then 3.4 is already in the > list for CMake 3.0. Ehm, the "3" would not satisfy EXACT, but it of course satisfies REQUIRED. And it works for me, btw. Eike -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 181 bytes Desc: This is a digitally signed message part. URL: From leventelist at gmail.com Sat Dec 24 08:42:57 2016 From: leventelist at gmail.com (Levente) Date: Sat, 24 Dec 2016 14:42:57 +0100 Subject: [CMake] cmake vs. Python 3.4 In-Reply-To: References: <20161223205749.20c5c5ec@jive> Message-ID: Yes. That did the trick. Sorry for the noise. On 23 Dec 2016 23:52, "Dan Liew" wrote: > > > On 23 Dec 2016 7:58 pm, "Lev" wrote: > > Hi list, > > > I have this: > > FIND_PACKAGE(PythonInterp) > > and cmake finds this: > > -- Found PythonInterp: /usr/bin/python (found version "2.7.9") > > However, 3.4 is also installed. How can I specify to find 3.4? > > If I say: > > set(Python_ADDITIONAL_VERSIONS 3.4) > FIND_PACKAGE(PythonInterp 3 REQUIRED) > > still no luck. > > When you did that did you wipe the CMake cache (e.g. delete any existing > binary build directory)? In many cases where CMake is asked to find a > binary it will create a cache variable if it was found so that on > subsequent runs of CMake it doesn't have to search for it again. You may be > hitting this. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kris.f.thielemans at gmail.com Tue Dec 27 11:12:20 2016 From: kris.f.thielemans at gmail.com (Kris Thielemans) Date: Tue, 27 Dec 2016 17:12:20 +0100 Subject: [CMake] installing source (or object) files Message-ID: <000d01d2605c$009506b0$01bf1410$@gmail.com> Hi all I have a non-standard set-up where I have a library that needs to be linked together with some extra source files that contain "registries"). So in my CMakeLists.txt I use Add_executable(wonderful_program wonderful_program.cxx registry.cxx) target_link_libraries(wonderful_program mylib) registry.cxx needs to be compiled with some of my include files. For that, I added include_directories("${PROJECT_SOURCE_DIR}/src/include") I guess I could just as well have added SET_PROPERTY(SOURCE registry.cxx PROPERTY COMPILE_FLAG "-I${STIR_INCLUDE_DIR}") This works fine, but now I want to export my library (relocatable). I have created a config file etc, added mylib as an install target, installed the include files etc. All of that works great for the library. However, I have no idea how to install registry.cxx. I could just INSTALL(FILES registry.cxx .) However, that doesn't copy the properties of the source files anywhere. In particular, it means that a "client" doesn't know what compilation flags to use. Any ideas? Best wishes for 2017! Kris PS: The reason that I need registry.cxx is that it contains some variables that have a funky constructor that initialises some registries somewhere. PS: Full source code is at https://github.com/UCL/STIR -------------- next part -------------- An HTML attachment was scrubbed... URL: From cxjohnson at gmail.com Tue Dec 27 17:26:38 2016 From: cxjohnson at gmail.com (Chris Johnson) Date: Tue, 27 Dec 2016 16:26:38 -0600 Subject: [CMake] Install destination problem Message-ID: In all of my CMakeLists.txt files, I include a settings file, like so: include(global_settings.cmake) Inside global_settings.cmake, I have a line like this: set( CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install ) When I run "make install" on my development system, the files are correctly installed where I expect to find them, in a subdirectory of my build directory named "install". But when I tried to do the same on our production server just now, it tried to install the binaries into /usr/local/bin. It's as if $CMAKE_INSTALL_PREFIX did not get set. What am I doing wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: From kris.f.thielemans at gmail.com Wed Dec 28 10:46:13 2016 From: kris.f.thielemans at gmail.com (Kris Thielemans) Date: Wed, 28 Dec 2016 16:46:13 +0100 Subject: [CMake] Install destination problem In-Reply-To: References: Message-ID: <008c01d26121$85903040$90b090c0$@gmail.com> Hi My guess is that you have a local variable CMAKE_INSTALL_PREFIX being shadowed by the global variable. Best to add the CACHE keyword etc in your set statement, then there?ll be only 1 variable. Kris From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Chris Johnson Sent: 27 December 2016 23:27 To: cmake at cmake.org Subject: [CMake] Install destination problem In all of my CMakeLists.txt files, I include a settings file, like so: include(global_settings.cmake) Inside global_settings.cmake, I have a line like this: set( CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install ) When I run "make install" on my development system, the files are correctly installed where I expect to find them, in a subdirectory of my build directory named "install". But when I tried to do the same on our production server just now, it tried to install the binaries into /usr/local/bin. It's as if $CMAKE_INSTALL_PREFIX did not get set. What am I doing wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cxjohnson at gmail.com Wed Dec 28 11:52:18 2016 From: cxjohnson at gmail.com (Chris Johnson) Date: Wed, 28 Dec 2016 10:52:18 -0600 Subject: [CMake] Install destination problem In-Reply-To: <008c01d26121$85903040$90b090c0$@gmail.com> References: <008c01d26121$85903040$90b090c0$@gmail.com> Message-ID: I've found experimentally that if the install directory exists, it works correctly. If it does not exist, the prefix somehow gets changed to /usr/local. I've not found where that's getting set yet. Thanks for the recommendation on CACHE. On Wed, Dec 28, 2016 at 9:46 AM, Kris Thielemans < kris.f.thielemans at gmail.com> wrote: > Hi > > > > My guess is that you have a local variable CMAKE_INSTALL_PREFIX being > shadowed by the global variable. Best to add the CACHE keyword etc in your > set statement, then there?ll be only 1 variable. > > > > Kris > > > > *From:* CMake [mailto:cmake-bounces at cmake.org] *On Behalf Of *Chris > Johnson > *Sent:* 27 December 2016 23:27 > *To:* cmake at cmake.org > *Subject:* [CMake] Install destination problem > > > > In all of my CMakeLists.txt files, I include a settings file, like so: > > > > include(global_settings.cmake) > > > > Inside global_settings.cmake, I have a line like this: > > > > set( CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install ) > > > > When I run "make install" on my development system, the files are > correctly installed where I expect to find them, in a subdirectory of my > build directory named "install". > > > > But when I tried to do the same on our production server just now, it > tried to install the binaries into /usr/local/bin. > > > > It's as if $CMAKE_INSTALL_PREFIX did not get set. > > > > What am I doing wrong? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mellery451 at gmail.com Wed Dec 28 12:13:40 2016 From: mellery451 at gmail.com (Michael Ellery) Date: Wed, 28 Dec 2016 09:13:40 -0800 Subject: [CMake] Install destination problem In-Reply-To: References: <008c01d26121$85903040$90b090c0$@gmail.com> Message-ID: <4994B31D-3C09-49E9-8951-C860C6C1B12B@gmail.com> This might be helpful: http://stackoverflow.com/questions/39481958/setting-cmake-install-prefix-from-cmakelists-txt-file/39485990#39485990 Also, FWIW, the generated makefile (if you are using the makefile generator) supports DESTDIR which will get prepended to the CMAKE_INSTALL_PREFIX path (which sounds like it is not useful in your case). -Mike > On Dec 28, 2016, at 8:52 AM, Chris Johnson wrote: > > I've found experimentally that if the install directory exists, it works correctly. If it does not exist, the prefix somehow gets changed to /usr/local. I've not found where that's getting set yet. > > Thanks for the recommendation on CACHE. > > On Wed, Dec 28, 2016 at 9:46 AM, Kris Thielemans wrote: > Hi > > > > My guess is that you have a local variable CMAKE_INSTALL_PREFIX being shadowed by the global variable. Best to add the CACHE keyword etc in your set statement, then there?ll be only 1 variable. > > > > Kris > > > > From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Chris Johnson > Sent: 27 December 2016 23:27 > To: cmake at cmake.org > Subject: [CMake] Install destination problem > > > > In all of my CMakeLists.txt files, I include a settings file, like so: > > > > include(global_settings.cmake) > > > > Inside global_settings.cmake, I have a line like this: > > > > set( CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install ) > > > > When I run "make install" on my development system, the files are correctly installed where I expect to find them, in a subdirectory of my build directory named "install". > > > > But when I tried to do the same on our production server just now, it tried to install the binaries into /usr/local/bin. > > > > It's as if $CMAKE_INSTALL_PREFIX did not get set. > > > > What am I doing wrong? > > > -- > > 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 davidklind at gmail.com Fri Dec 30 16:57:54 2016 From: davidklind at gmail.com (DKLind) Date: Fri, 30 Dec 2016 14:57:54 -0700 (MST) Subject: [CMake] Create custom "make help" Message-ID: <1483135074665-7594797.post@n2.nabble.com> Is there a way to create a custom help that is displayed with "make help"? I have tried to implement this using the instructions in this thread: add_custom_target(HelpMe COMMAND ${CMAKE_COMMAND} -DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR} --help-module HelpMe COMMENT "Display User defined help") When I run "make HelpMe" I get the following error: Argument "HelpMe" to --help-module is not a CMake module. -- View this message in context: http://cmake.3232098.n2.nabble.com/Create-custom-make-help-tp7594797.html Sent from the CMake mailing list archive at Nabble.com.