Re: [CMake] Regression in INCLUDE_DIRECTORIES command between cmake 2.8.7 and 2.8.8?
Hi David, I filed a bug (14094) and attached a patch that solves it. Cheers, Marcel. On 16/04/13 15:32, David Cole wrote: I guess you could file a bug/request to de-duplicate in the FindCUDA cmake code. Anybody who reads the property via get_property (or get_target_property or get_directory_property) and then sets it back with some appended info is directly manipulating the property itself. Moreover, include_directories itself simply appends to these properties now as it goes, and the de-duplication happens later, at generate time. So if the cuda stuff is using get_property (and friends) to retrieve the value of the include directories, then it will now need to de-duplicate that list itself if it wants to. On the other hand, the additional -I arguments should still work, unless you're running up against a command line too long problem. Is there an actual build issue you're having, or is this just an aesthetic "I don't like seeing -I duplicate arguments" thing...? D -Original Message- From: Marcel Loose To: David Cole Cc: cmake Sent: Tue, Apr 16, 2013 4:16 am Subject: Re: [CMake] Regression in INCLUDE_DIRECTORIES command between cmake 2.8.7 and 2.8.8? Hi David, Appears you are right. However nvcc is clearly not playing by the new rules. When using cuda_add_executable() I do get multiple -I entries on the command line. Should I file a bug report for FindCUDA then? Regards, Marcel. On 16/04/13 01:03, David Cole wrote: It removes duplicates during generation, though. You shouldn't see duplicates in the generated make files or project files... On Apr 15, 2013, at 5:34 PM, Marcel Loose wrote: Hi all, I noticed that, starting from cmake 2.8.8, INCLUDE_DIRECTORIES no longer remove duplicates. I this a regression? $ cat ../CMakeLists.txt cmake_minimum_required(VERSION 2.6) project(TestIncludeDirectories) get_directory_property(_inc_dirs INCLUDE_DIRECTORIES) message(STATUS "INCLUDE_DIRECTORIES=${_inc_dirs}") include_directories(/usr/include) get_directory_property(_inc_dirs INCLUDE_DIRECTORIES) message(STATUS "INCLUDE_DIRECTORIES=${_inc_dirs}") include_directories(/usr/include) get_directory_property(_inc_dirs INCLUDE_DIRECTORIES) message(STATUS "INCLUDE_DIRECTORIES=${_inc_dirs}") $ ~/x86_64/usr/local/cmake-2.8.7/bin/cmake .. -- INCLUDE_DIRECTORIES= -- INCLUDE_DIRECTORIES=/usr/include -- INCLUDE_DIRECTORIES=/usr/include -- Configuring done -- Generating done -- Build files have been written to: /home/marcel/temp/cmake/include_directories/build $ ~/x86_64/usr/local/cmake-2.8.8/bin/cmake .. -- INCLUDE_DIRECTORIES= -- INCLUDE_DIRECTORIES=/usr/include -- INCLUDE_DIRECTORIES=/usr/include;/usr/include -- Configuring done -- Generating done -- Build files have been written to: /home/marcel/temp/cmake/include_directories/build Best regards, Marcel Loose. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake <>-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Cpack generated RPM and changed binary file size in 2.8.10
Hi, I have a wired situation, I have a binary file (ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped) in bin directory, I then I run "cpack -G RPM" to generate an RPM package. After install the RPM package in another machine, the size of the binary file (82576 KB) is different from original binary file (106228 KB). Some functions in that packaged binary file did not run correctly. Could anyone help to explain me why the size of binary file changes? And how to fix it? Thank you. Kind regards. j -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Cpack generated RPM and changed binary file size in 2.8.10
2013/4/17 jupiter : > Hi, > > I have a wired situation, I have a binary file (ELF 64-bit LSB > executable, x86-64, version 1 (SYSV), dynamically linked (uses shared > libs), for GNU/Linux 2.6.18, stripped) in bin directory, I then I run > "cpack -G RPM" to generate an RPM package. After install the RPM > package in another machine, the size of the binary file (82576 KB) is > different from original binary file (106228 KB). Could you check the size of the executable which gets into the RPM it should be located in: /_CPack_Packages//RPM// When CPackRPM runs you get a message like: CPackRPM: Will use GENERATED spec file: /blah/blah/.../RPM/SPECS/yourpackage.spec then the directory to look into should be: /blah/blah/.../RPM// You can also extract the content of the generated RPM using rpm2cpio (or alien) rpm2cpio .rpm | cpio -idmv alien -t .rpm tar zxvf .tgz then verify the size of the concerned file. > Some functions in > that packaged binary file did not run correctly. Could anyone help to > explain me why the size of binary file changes? I bet you compare with a file produced by "make install/strip"? a) The executable your are looking at may not be the same as the one put into the RPM. b) rpmbuild (which get called by CPackRPM) can post-process the library/executable depending on the distribution you are running on. So first do the comparison with the package executable. Then more questions: 1) On which kind of hosts do you create the RPM? (Fedora Y, OpenSuSE W, Debian Z, etc...) What is the version of RPM on this one: rpm --version 2) On which king of target do you intsall it? What is the version of RPM on the target: rpm --version In each case could check the dependency found in the RPM: rpm -qp --requires yourPackage.rpm > And how to fix it? Depending on the discrepancy between the host and the target this may not be fixable. > > Thank you. > > Kind regards. > > j > -- > > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.cmake.org/mailman/listinfo/cmake -- Erk Le gouvernement représentatif n'est pas la démocratie -- http://www.le-message.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Cpack generated RPM and changed binary file size in 2.8.10
Eric Noulard wrote > 2013/4/17 jupiter < > jupiter.hce@ > >: > > Could you check the size of the executable which gets into the RPM > it should be located in: > > /_CPack_Packages/ > > /RPM/ > > / > > When CPackRPM runs you get a message like: > > CPackRPM: Will use GENERATED spec file: > /blah/blah/.../RPM/SPECS/yourpackage.spec I've just updated my description, the size of the binary package in builddir>/_CPack_Packages//RPM/ was already changed to 82576 KB. Eric Noulard wrote > then the directory to look into should be: > /blah/blah/.../RPM/ > > / > > You can also extract the content of the generated RPM using rpm2cpio (or > alien) > > rpm2cpio > > .rpm | cpio -idmv > > alien -t > > .rpm > tar zxvf > > .tgz > > then verify the size of the concerned file. > >> Some functions in >> that packaged binary file did not run correctly. Could anyone help to >> explain me why the size of binary file changes? > > I bet you compare with a file produced by "make install/strip"? > > a) The executable your are looking at may not be the same as the one > put into the RPM. > > b) rpmbuild (which get called by CPackRPM) can post-process the > library/executable > depending on the distribution you are running on. No, I did not run make install/trip. I used CMake ExternalProject to copy the whole bin directory in configure command, and run "echo" in make and make install command. Eric Noulard wrote > So first do the comparison with the package executable. > Then more questions: > > 1) On which kind of hosts do you create the RPM? > (Fedora Y, OpenSuSE W, Debian Z, etc...) > What is the version of RPM on this one: >rpm --version CentOS 6.2, RPM version 4.8.0. Eric Noulard wrote > 2) On which king of target do you intsall it? > What is the version of RPM on the target: > rpm --version > > In each case could check the dependency found in the RPM: > rpm -qp --requires yourPackage.rpm CentOS 6.2, RPM version 4.8.0. Eric Noulard wrote >> And how to fix it? > > Depending on the discrepancy between the host and the target this may > not be fixable. The binary file size had already changed in build _CPack_Packages directory. Thanks Eric. j -- View this message in context: http://cmake.3232098.n2.nabble.com/Cpack-generated-RPM-and-changed-binary-file-size-in-2-8-10-tp7584084p7584086.html Sent from the CMake mailing list archive at Nabble.com. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] copy_if_different on build
> believe what you want is: > > add_custom_command( > OUTPUT "${output}" > DEPENDS "${input}" > COMMAND ${CMAKE_COMMAND} -E copy > "${input}" "${output}" > > ...which is roughly equivalent to a Makefile rule like: > > output: input > cp input output > > IOW, the file "${output}" depends on the file "${input}" (so the target will > only run when "${input}" is newer than "${output}"), and will be created by > copying "${input}" to "${output}" (using 'cmake -E' for portability). > > Don't forget to have an actual target depend on "${output}" :-). (Probably > you are using it as a source file for a library or executable, so there is > no problem.) > > You may also want to use 'copy_if_different' instead of just 'copy', which > won't change the time stamp of "${output}" if the contents are the same as > "${input}". On the plus side, this means that large targets depending on > "${output}" won't be needlessly rebuilt/relinked. On the down side, the > copy_if_different will remain out of date, and as a result still think it > needs to run after a successful build. Thought I understood this - but alas my implementation is wrong. Here's my test case with a top-level cmake file and 3 subdirectories: 'src', 'bin' and 'outdir'. Top level CMakeLists.txt cmake_minimum_required (VERSION 2.8) project (copyFile) set (TARGETNAME fooCopy) set (TARGETDEST ${PROJECT_SOURCE_DIR}/bin) add_subdirectory (src) src/CMakeLists.txt add_executable (${TARGETNAME}main.cpp) set (input ${CMAKE_CURRENT_SOURCE_DIR}/bin/config.cfg) set (output ${CMAKE_CURRENT_SOURCE_DIR}/outdir/config.cfg) add_dependencies(${TARGETNAME} ${output}) add_custom_command( OUTPUT "${output}" DEPENDS "${input}" COMMAND ${CMAKE_COMMAND} -E copy_if_different "${input}" "${output}" ) install (TARGETS ${TARGETNAME} DESTINATION ${TARGETDEST}) The config file (config.cfg) is just some text and cpp file is just a "hello world" example. Since the config file is not source included as a dependency in the add_executable command, I assume my problem is making the target properly depend on it? Specifically ${TARGETNAME} should depend on "${output}"? -Skippy -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Superbuild subprojects and find_package()
Hello all, Some Googling has led me to questions that have been asked that are similar to this one but I haven't seen a definitive answer. I'm trying to set up a CMake "superbuild" where there are dependencies between the subprojects, and some of the subprojects use find_package() to import targets from their dependencies (other subprojects, from the superbuild's point of view). For a stripped down example, suppose I have proj1 and proj2. proj1 can be built and installed on its own, and it writes out a Proj1Config.cmake file (with targets and such). proj2 uses find_package(Proj1 REQUIRED) to import those targets. So independent of a CMake superbuild, things work just fine if I configure, build, and install proj1, *then* configure, build, and install proj2. Is there a way to do this using a CMake superbuild? Some ideas (mostly gleaned from the aforementioned googling): 1. Use add_subdirectory() from the superproject. I think the REQUIRED on find_package() would fail though? In my case I can modify the subprojects, but I would like for them to continue to build correctly standalone (not inside the superbuild), as they really are separate projects. Is there a way to make add_subdirectory() work without exploding on find_package? 2. Don't use CMake for the "superbuild" - a shell script or plain Makefile could accomplish this pretty easily, but that seems a little hokey. 3. (This one is unclear.) Somehow build proj1 before configuring proj2, and point proj2 at proj1's build directory so it can find Proj1Config.cmake. This seems fragile at best (prefix, RPATH, etc issues). Appreciate any advice! John -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Superbuild subprojects and find_package()
Hi John, the primary tool for superbuilds in CMake's arsenal is ExternalProject_Add from module ExternalProject. I don't have much experience with it, but you can read its docs to see if it could help you. Petr On Thu, Apr 18, 2013 at 5:38 AM, John Gallagher < johnkgallagher+cm...@gmail.com> wrote: > Hello all, > > Some Googling has led me to questions that have been asked that are > similar to this one but I haven't seen a definitive answer. I'm trying to > set up a CMake "superbuild" where there are dependencies between the > subprojects, and some of the subprojects use find_package() to import > targets from their dependencies (other subprojects, from the superbuild's > point of view). For a stripped down example, suppose I have proj1 and > proj2. proj1 can be built and installed on its own, and it writes out a > Proj1Config.cmake file (with targets and such). proj2 uses > > find_package(Proj1 REQUIRED) > > to import those targets. So independent of a CMake superbuild, things work > just fine if I configure, build, and install proj1, *then* configure, > build, and install proj2. Is there a way to do this using a CMake > superbuild? Some ideas (mostly gleaned from the aforementioned googling): > > 1. Use add_subdirectory() from the superproject. I think the REQUIRED on > find_package() would fail though? In my case I can modify the subprojects, > but I would like for them to continue to build correctly standalone (not > inside the superbuild), as they really are separate projects. Is there a > way to make add_subdirectory() work without exploding on find_package? > > 2. Don't use CMake for the "superbuild" - a shell script or plain Makefile > could accomplish this pretty easily, but that seems a little hokey. > > 3. (This one is unclear.) Somehow build proj1 before configuring proj2, > and point proj2 at proj1's build directory so it can find > Proj1Config.cmake. This seems fragile at best (prefix, RPATH, etc issues). > > Appreciate any advice! > > John > > -- > > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.cmake.org/mailman/listinfo/cmake > -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Superbuild subprojects and find_package()
Hi, On Thu, Apr 18, 2013 at 5:38 AM, John Gallagher < johnkgallagher+cm...@gmail.com> wrote: > Hello all, > > Some Googling has led me to questions that have been asked that are > similar to this one but I haven't seen a definitive answer. I'm trying to > set up a CMake "superbuild" where there are dependencies between the > subprojects, and some of the subprojects use find_package() to import > targets from their dependencies (other subprojects, from the superbuild's > point of view). For a stripped down example, suppose I have proj1 and > proj2. proj1 can be built and installed on its own, and it writes out a > Proj1Config.cmake file (with targets and such). proj2 uses > > find_package(Proj1 REQUIRED) > > to import those targets. So independent of a CMake superbuild, things work > just fine if I configure, build, and install proj1, *then* configure, > build, and install proj2. Is there a way to do this using a CMake > superbuild? Some ideas (mostly gleaned from the aforementioned googling): > I haven't used it yet, but this sounds like you should look into the ExternalProject module of CMake. See http://cmake.org/cmake/help/v2.8.10/cmake.html#module:ExternalProject Andreas -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake