[cmake-developers] Finding versioned libraries
Hi, as I found out today this construct doesn't work: find_library(MYLIB libfoo.so.2) This is because find_library will only try to access the whole path if the given name matches PREFIX.*SUFFIX, which is obviously not the case here. My simple approach on fixing this would be to also allow PREFIX.*SUFFIX\..*: diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 2fa2cca..da7650a 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -358,9 +358,17 @@ bool cmFindLibraryHelper::HasValidSuffix(std::string const name) for(std::vectorstd::string::const_iterator si = this-Suffixes.begin(); si != this-Suffixes.end(); ++si) { -std::string const suffix = *si; -if(name.length() suffix.length() - name.substr(name.size()-suffix.length()) == suffix) +std::string suffix = *si; +if(name.length() = suffix.length()) + { + continue; + } +if(name.substr(name.size()-suffix.length()) == suffix) + { + return true; + } +suffix += .; +if(name.find(suffix) != name.npos) { return true; } Any objections? signature.asc Description: This is a digitally signed message part. -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Finding versioned libraries
2012/2/15 Rolf Eike Beer e...@sf-mail.de: Hi, as I found out today this construct doesn't work: find_library(MYLIB libfoo.so.2) This is because find_library will only try to access the whole path if the given name matches PREFIX.*SUFFIX, which is obviously not the case here. My simple approach on fixing this would be to also allow PREFIX.*SUFFIX\..*: [...] @@ -358,9 +358,17 @@ bool cmFindLibraryHelper::HasValidSuffix(std::string const name) [...] Any objections? If the user does not trust find_library for checking proper extension then: 1) He could modify/append CMAKE_FIND_LIBRARY_SUFFIXES in this case: list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .so.2) should work. 2) He could use find_file Now if we consider this is a bug, then with your modification HasValidSuffix is ill-named since it is more like ContainsValidSuffix or MatchesValidSuffix. With this modification one could now find a not-properly-installed library (missing links) without noticing it. What is your purpose here, do you want to ensure that you find a particular version of a lib? -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Finding versioned libraries
2012/2/15 Rolf Eike Beer e...@sf-mail.de: Hi, as I found out today this construct doesn't work: find_library(MYLIB libfoo.so.2) This is because find_library will only try to access the whole path if the given name matches PREFIX.*SUFFIX, which is obviously not the case here. My simple approach on fixing this would be to also allow PREFIX.*SUFFIX\..*: [...] @@ -358,9 +358,17 @@ bool cmFindLibraryHelper::HasValidSuffix(std::string const name) [...] Any objections? If the user does not trust find_library for checking proper extension then: 1) He could modify/append CMAKE_FIND_LIBRARY_SUFFIXES in this case: list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .so.2) should work. 2) He could use find_file Now if we consider this is a bug, then with your modification HasValidSuffix is ill-named since it is more like ContainsValidSuffix or MatchesValidSuffix. With this modification one could now find a not-properly-installed library (missing links) without noticing it. Yes, but only if he explicitely specifies the correct name. It's not that find_library will now find libfoo.so.2 now when you do find_library(VAR foo). What is your purpose here, do you want to ensure that you find a particular version of a lib? FindPerlLibs.cmake queries perl for the perl library name, which is e.g. libperl.so.5.12.4 on my machine. And find_library is not able to find a library given that name, even if it is perfectly valid. With this modification is is able to get that. Eike -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Finding versioned libraries
On 2/15/2012 9:18 AM, Eric Noulard wrote: If the user does not trust find_library for checking proper extension then: 1) He could modify/append CMAKE_FIND_LIBRARY_SUFFIXES in this case: list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .so.2) should work. 2) He could use find_file Now if we consider this is a bug, then with your modification HasValidSuffix is ill-named since it is more like ContainsValidSuffix or MatchesValidSuffix. With this modification one could now find a not-properly-installed library (missing links) without noticing it. What is your purpose here, do you want to ensure that you find a particular version of a lib? IMO searching for an exact file name like find_library(MYLIB libfoo.so.2) is useful regardless of the expected library type. The only reason CMake requires the library prefix and suffix to appear in the name is to prevent things like find_library(MYLIB python) from locating the python executable which is called just python. We check for both the prefix and suffix to ensure the file name looks like a library before considering it raw. Back before CMake 2.6 started using full paths to link it was not possible to link to library file that did not look exactly like a library (proper prefix and suffix). Now that we can pass the exact file name to the linker we can have a softer test for what looks like a lib. -Brad -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Finding versioned libraries
2012/2/15 Brad King brad.k...@kitware.com: On 2/15/2012 9:18 AM, Eric Noulard wrote: If the user does not trust find_library for checking proper extension then: 1) He could modify/append CMAKE_FIND_LIBRARY_SUFFIXES in this case: list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .so.2) should work. 2) He could use find_file Now if we consider this is a bug, then with your modification HasValidSuffix is ill-named since it is more like ContainsValidSuffix or MatchesValidSuffix. With this modification one could now find a not-properly-installed library (missing links) without noticing it. What is your purpose here, do you want to ensure that you find a particular version of a lib? IMO searching for an exact file name like find_library(MYLIB libfoo.so.2) is useful regardless of the expected library type. The only reason CMake requires the library prefix and suffix to appear in the name is to prevent things like find_library(MYLIB python) from locating the python executable which is called just python. We check for both the prefix and suffix to ensure the file name looks like a library before considering it raw. ok I see. Back before CMake 2.6 started using full paths to link it was not possible to link to library file that did not look exactly like a library (proper prefix and suffix). Now that we can pass the exact file name to the linker we can have a softer test for what looks like a lib. ok too, no more question then :-] -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
[cmake-developers] Ninja help
Where at are the versions of Ninja that I need to use with CMake for: Windows: Mac: Linux: I have seen several git branches mentioned in emails, and it is not clear to me where to get the right Ninja for CMake on all platforms. To setup nightly testing, is there a master git branch that we should test against? This would let us know if Ninja breaks CMake support right away. Thanks. -Bill -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Ninja help
On 2/15/2012 11:20 AM, Nicolas Desprès wrote: For compiling and testing you can find all the information in the HACKING file. Well, this is ugly: --HACKING Windows development on Windows: - install mingw, msys, and python - in the mingw shell, put Python in your path, and: python bootstrap.py - to reconfigure, run 'python configure.py' - remember to strip the resulting executable if size matters to you - you'll need to rename ninja.exe into my-ninja.exe during development, otherwise ninja won't be able to overwrite itself when building --HACKING It would be really nice if ninja had a CMake build system with it for windows development. It basically looks like a bunch of c++ files. Having to have python to build ninja is a pain for setting up a visual studio ninja dashboard. -Bill -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Ninja help
2012/2/15 Bill Hoffman bill.hoff...@kitware.com On 2/15/2012 11:20 AM, Nicolas Desprès wrote: For compiling and testing you can find all the information in the HACKING file. Well, this is ugly: --HACKING Windows development on Windows: - install mingw, msys, and python - in the mingw shell, put Python in your path, and: python bootstrap.py - to reconfigure, run 'python configure.py' - remember to strip the resulting executable if size matters to you - you'll need to rename ninja.exe into my-ninja.exe during development, otherwise ninja won't be able to overwrite itself when building --HACKING It would be really nice if ninja had a CMake build system with it for windows development. It basically looks like a bunch of c++ files. Having to have python to build ninja is a pain for setting up a visual studio ninja dashboard. I was arguing in favor of this approach on the mailing list but some people came up with patches for the Python bootstrap script quickly and they have been applied. Ninja likes to be standalone as much as possible even if it requires Python and for development the Google Test and re2c. Also I think, since the Ninja generator was not available in CMake it was kind of a chicken and egg problem. Several forks on github already provides a CMakeLists.txt for Ninja. I think if some people are willing to maintain them (this include myself but my spare time is not that responsive unfortunately :-( ) and if the merge of the ninja generator in cmake is coming, Evan will accept a parallel build-system without any objections. -- Nicolas Desprès -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Ninja help
2012/2/15 Richard Wackerbarth rich...@nfsnet.org Regretfully, testing the Ninja Generator for the nightly CMake dashboard is not as simple as would be desired. First, you have to bootstrap using a recent version of CMake (I am using my default Unix Makefile build for the nightly dashboard) Yes, you have to build CMake twice. Once with the Unix Makefiles generator and once with the Ninja generator. I don't think it is such a big deal. I have done during all the time I spent developing the beginning of the Ninja Generator. And then, on MacOSX 10.6, it fails on some of the tests :( It is on my todo list to try to fix that bug on MacOSX 10.7, as soon as I find the time... Can give a deadline unfortunately :( I will now try to add it to one of my FreeBSD builds. That will give interesting feedback. Thx. -Nico 2012/2/15 Bill Hoffman bill.hoff...@kitware.com On 2/15/2012 11:20 AM, Nicolas Desprès wrote: For compiling and testing you can find all the information in the HACKING file. Well, this is ugly: --HACKING Windows development on Windows: - install mingw, msys, and python - in the mingw shell, put Python in your path, and: python bootstrap.py - to reconfigure, run 'python configure.py' - remember to strip the resulting executable if size matters to you - you'll need to rename ninja.exe into my-ninja.exe during development, otherwise ninja won't be able to overwrite itself when building --HACKING It would be really nice if ninja had a CMake build system with it for windows development. It basically looks like a bunch of c++ files. Having to have python to build ninja is a pain for setting up a visual studio ninja dashboard. I was arguing in favor of this approach on the mailing list but some people came up with patches for the Python bootstrap script quickly and they have been applied. Ninja likes to be standalone as much as possible even if it requires Python and for development the Google Test and re2c. Also I think, since the Ninja generator was not available in CMake it was kind of a chicken and egg problem. Several forks on github already provides a CMakeLists.txt for Ninja. I think if some people are willing to maintain them (this include myself but my spare time is not that responsive unfortunately :-( ) and if the merge of the ninja generator in cmake is coming, Evan will accept a parallel build-system without any objections. -- Nicolas Desprès -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers -- Nicolas Desprès -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Ninja help
On Wed, Feb 15, 2012 at 7:12 PM, Bill Hoffman bill.hoff...@kitware.comwrote: On 2/15/2012 1:01 PM, David Cole wrote: But this is true with every CMake generator *except* for the Unix Makefiles generator. And you don't have to build it twice. On most of our other dashboards, we simply use an installation of a recent stable release as the CMake/ctest that drives the dashboard. Right, so just build the most recent ninja capable cmake you can, and use that to drive the dashboard. BTW, I am working on seeing how the windows build works, and the stage/ninja-generator branch does not build ninja stuff on windows. # Ninja only works on UNIX. IF(UNIX) I assume this is old, and should be fixed? Yes support for Windows and MacOSX is not yet included in the patch you have merged AFAIK. I think that would be part of the stabilisation work on this generator as soon as it is on the dashboard. Few bugs are remaining on MacOSX and Ninja is building on Windows. I don't known how many bugs in cmake's test suite fails on Windows yet. -- Nicolas Desprès -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Ninja help
On 2/15/2012 1:01 PM, David Cole wrote: But this is true with every CMake generator *except* for the Unix Makefiles generator. And you don't have to build it twice. On most of our other dashboards, we simply use an installation of a recent stable release as the CMake/ctest that drives the dashboard. Right, so just build the most recent ninja capable cmake you can, and use that to drive the dashboard. BTW, I am working on seeing how the windows build works, and the stage/ninja-generator branch does not build ninja stuff on windows. # Ninja only works on UNIX. IF(UNIX) I assume this is old, and should be fixed? -Bill -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
[cmake-developers] ninja spaces in the path do not work on linux
- On linux spaces in the path do not work, I get this error: http://www.cdash.org/CDash/viewBuildError.php?buildid=2009436 -Bill -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] CTest vs. gcov
So if no lines are covered then it reports 'Covered=false' which leads CDash to entirely ignoring the line count and not showing a link to the file. In contrast it does that when collecting files using CTEST_EXTRA_COVERAGE_GLOB: covSumFile \tFile Name=\ cmXMLSafe(fileName) \ FullPath=\ cmXMLSafe(i-c_str()) \ Covered=\true\\n \t\tLOCTested0/LOCTested\n \t\tLOCUnTested untested /LOCUnTested\n Covered is always set to true here. So the quick and dirty fix I used was to change the one line to \ Covered=\ (tested+untested 0 ? true:false) \\n Pushed as 58d75e22ae3ed4279b0596eeab73063719bb61d0 to next. Eike signature.asc Description: This is a digitally signed message part. -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Making Config.cmake files easier to write
On Tuesday 14 February 2012, Alexander Neundorf wrote: On Tuesday 14 February 2012, Yury G. Kudryashov wrote: Alexander Neundorf wrote: On Tuesday 14 February 2012, Yury G. Kudryashov wrote: will substitute @PACKAGE_INCLUDE_INSTALL_DIR@ by ../../../include and @PACKAGE_MYPKGDATA_INSTALL_DIR@ by ../../../share/mypkg (both transformed to be relative to DESTINATION). A problem I see here (and which we discussed already before on kde- buildsystem) is the handling of the install() command. I thought a bit about a syntax like this, which I would like: configure_config_file(BarConfig.cmake.in BarConfig.cmake INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} PATH_VARS INCLUDE_INSTALL_DIR DATA_INSTALL_DIR EXPORT_FILE BarExport.cmake) Why do you need EXPORT_FILE parameter? How can you use it? Include automatically? Then you need VERSION_FILE parameter as well. but this can't work, can it ? In the BarConfig.cmake file there would still be either a set(BAR_INCLUDE_DIR @INCLUDE_INSTALL_DIR@) which would work for absolute paths, or a set(BAR_INCLUDE_DIR ${SomePrefix}/@INCLUDE_INSTALL_DIR@) which would work only for relative paths, but a simple set() cannot work for both cases. Am I missing something ? You'll have in BarConfig.cmake.in set(BAR_INCLUDE_DIR @PACKAGE_HELPER_INCLUDE_INSTALL_DIR@) After configure_config_file() you'll have # At top get_filename_component(_PKG_CURRENT_DIR ${CURRENT_LIST_FILE} PATH) Just a tip: since 2.8.3 or so there is ${CMAKE_CURRENT_LIST_DIR} get_filename_component(_PKG_PREFIX_PATH ${_PKG_CURRENT_DIR}/../../.. ABSOLUTE) The ../../../ will be also calculated by the macro, using RELATIVE_PATH and the DESTINATION parameter, right ? #in place of your set() set(BAR_INCLUDE_DIR ${_PKG_PREFIX_PATH}/include) Do you have a working example ? Not yet. I think about something like this (not tested). foreach(var ${PACAKGE_HELPER_PATH_VARS}) if(NOT DEFINED ${var}) message(FATAL_ERROR ...) else if(IS_ABSOLUTE ${${var}}) file(RELATIVE_PATH PACKAGE_HELPER_${var} ${CMAKE_INSTALL_PREFIX} ${${var}}) else() set(PACKAGE_HELPER_${var} ${${var}}) endif() endforeach() It would be nice to make those PACKAGE_HELPER_* vars local to configure_config_file() function. If it's a function(), they are local automatically. Also still not tested, but now it should have the right prefix: foreach(var ${PACAKGE_HELPER_PATH_VARS}) if(NOT DEFINED ${var}) message(FATAL_ERROR ...) else if(IS_ABSOLUTE ${${var}}) string(REPLACE ${CMAKE_INSTALL_PREFIX} \${_PKG_PREFIX_PATH} PACKAGE_HELPER_${var} ${${var}} else() set(PACKAGE_HELPER_${var} ${${var}}) endif() else() set(PACKAGE_HELPER_${var} \${_PKG_PREFIX_PATH}/${${var}}) endif() endforeach() Ok, a working ConfigureConfigFile.cmake is attached, together with example files, input and the configured output and the driving CMakeLists.txt. The call now looks like this: configure_config_file(BarConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/BarConfig.cmake INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} PATH_VARS INCLUDE_INSTALL_DIR BIN_INSTALL_DIR FOO_INSTALL_DIR ... ) and in the Config.cmake.in file you have to put: @CONFIG_HELPER_DIRS_INIT@ set_and_check(BAR_INCLUDE_DIR @CONFIG_HELPER_INCLUDE_INSTALL_DIR@) set(BAR_DATA_DIR@CONFIG_HELPER_DATA_INSTALL_DIR@) The set_and_check() macro is provided by the @CONFIG_HELPER_DIRS_INIT@, it sets the variable and checks that the given directory or file exists. IMO it's a bit much macro magic. I'll also try an alternative approach tomorrow. Comments ? Alex # set the version of myself set(BAR_VERSION_MAJOR @BAR_VERSION_MAJOR@) set(BAR_VERSION_MINOR @BAR_VERSION_MINOR@) set(BAR_VERSION_PATCH @BAR_VERSION_PATCH@) set(BAR_VERSION ${BAR_VERSION_MAJOR}.${BAR_VERSION_MINOR}.${BAR_VERSION_PATCH} ) # get_filename_component(CONFIG_PREFIX_DIR ${CMAKE_CURRENT_LIST_DIR}/@CONFIG_RELATIVE_PATH@ ABSOLUTE) @CONFIG_HELPER_DIRS_INIT@ set_and_check(BAR_INCLUDE_DIR @CONFIG_HELPER_INCLUDE_INSTALL_DIR@) set_and_check(BAR_BIN_DIR @CONFIG_HELPER_BIN_INSTALL_DIR@) set(BAR_DATA_DIR@CONFIG_HELPER_DATA_INSTALL_DIR@) set(BAR_BAR_DIR @CONFIG_HELPER_BAR_INSTALL_DIR@) set(BAR_FOO_DIR @CONFIG_HELPER_FOO_INSTALL_DIR@) # what is my include directory set(BAR_INCLUDES ${BAR_INCLUDE_DIR}) # import the exported targets include(${CMAKE_CURRENT_LIST_DIR}/BarTargets.cmake) # set the expected library variable set(BAR_LIBRARIES bar ) cmake_minimum_required(VERSION 2.8.7) project(Bar) # the version number, needed for # - the library version # - version detection by
Re: [cmake-developers] Making Config.cmake files easier to write
On 2/15/2012 4:50 PM, Alexander Neundorf wrote: Ok, a working ConfigureConfigFile.cmake is attached, together with example files, input and the configured output and the driving CMakeLists.txt. Nice! Alternative name ideas: CMakePackageHelper [1] ConfigureCMakePackage ConfigureCMakePackageFile ConfigurePackage ConfigurePackageFile ConfigurePackageConfig [1] Generic name for helper APIs so we can add more macros later. In this case the macro can perhaps be called: cmake_package_config The call now looks like this: configure_config_file(BarConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/BarConfig.cmake INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} PATH_VARS INCLUDE_INSTALL_DIR BIN_INSTALL_DIR FOO_INSTALL_DIR ... ) Good. Note that configure_file automatically treats a relative path for the output file w.r.t. the build tree. Therefore the second arg can be just BarConfig.cmake. and in the Config.cmake.in file you have to put: @CONFIG_HELPER_DIRS_INIT@ Good. Did you consider other prefixes? I'm okay with CONFIG_HELPER_ but I wonder if there is something better. Alternatively it could be configured by an option to the macro. set_and_check(BAR_INCLUDE_DIR @CONFIG_HELPER_INCLUDE_INSTALL_DIR@) set(BAR_DATA_DIR@CONFIG_HELPER_DATA_INSTALL_DIR@) The set_and_check() macro is provided by the @CONFIG_HELPER_DIRS_INIT@, it sets the variable and checks that the given directory or file exists. Okay. The set_and_check macro is perhaps overkill. I've never done an explicit existence check on such directories in a package configuration file. Let's not mix that into this feature yet. I don't feel strongly about this though because a user can always not use it. IMO it's a bit much macro magic. IMO it's simpler than your previous proposal. It is better for all the magic to be at configuration time and not at load time. Thanks, -Brad -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Ninja help
On 15.02.2012 18:17, Bill Hoffman wrote: On 2/15/2012 11:20 AM, Nicolas Desprès wrote: For compiling and testing you can find all the information in the HACKING file. Well, this is ugly: --HACKING Windows development on Windows: - install mingw, msys, and python - in the mingw shell, put Python in your path, and: python bootstrap.py - to reconfigure, run 'python configure.py' - remember to strip the resulting executable if size matters to you - you'll need to rename ninja.exe into my-ninja.exe during development, otherwise ninja won't be able to overwrite itself when building --HACKING It would be really nice if ninja had a CMake build system with it for windows development. It basically looks like a bunch of c++ files. Having to have python to build ninja is a pain for setting up a visual studio ninja dashboard. -Bill Hi Bill, here is up-to-date cmake file: https://github.com/syntheticpp/dartruntime/tree/cmake It works on Win, Linux, Mac and ll gtest based unit test passes. The cmake file is in misc/. I also asked for adding this one file to the official code, but as always, adding a new build system is like wanting them switching religion... Feel free to patch this file for your needs, or ask for new features I will add them. Peter -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Ninja help
Hi Bill, here is up-to-date cmake file: https://github.com/syntheticpp/dartruntime/tree/cmake Sorry, CP error, I mean: https://github.com/syntheticpp/ninja/tree/cmake It works on Win, Linux, Mac and ll gtest based unit test passes. The cmake file is in misc/. I also asked for adding this one file to the official code, but as always, adding a new build system is like wanting them switching religion... Feel free to patch this file for your needs, or ask for new features I will add them. Peter -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] ninja broken on windows?
On 15.02.2012 19:31, Bill Hoffman wrote: OK, so ninja does not seem to work on windows for me... I got ninja from here: git://github.com/martine/ninja.git branch master I got cmake from here: remotes/stage/ninja-generator I removed the if(UNIX) in the cmake tree and built cmake with ninja support. I've patched Peter C.'s branch for Windows: https://github.com/syntheticpp/CMake/commits/ninja-generator-pr-win It compiles fine, but the generator defines some obsolete variables. ATM vanilla ninja doesn't support response files for long command line argument. There is a patch in the pipe line, but the maintainer seems too busy to work on ninja. I've patched ninja with response file support and it builds CMake with the current generator: https://github.com/syntheticpp/ninja/tree/token-splitter But I don't think I could get this patch upstream (the command line is parsed for ''). In summary: - use the CMakeLists.txt from https://github.com/syntheticpp/ninja/tree/cmake - on Windows use ninja from https://github.com/syntheticpp/ninja/tree/token-splitter and wait and see what happens with official ninja Peter -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] ninja broken on windows?
On 2/15/2012 5:52 PM, Peter Kümmel wrote: In summary: - use the CMakeLists.txt from https://github.com/syntheticpp/ninja/tree/cmake - on Windows use ninja from https://github.com/syntheticpp/ninja/tree/token-splitter and wait and see what happens with official ninja I can live without the CMakeLists.txt to build ninja. The python thing works pretty easy. However, having to pull different clones of ninja to test for Windows ninja cmake builds is an issue. What are the chances of this being accepted upstream? Are there objections? -Bill -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [CMake] Some modules I cooked up the last few months. (mercurial etc.)
Hi Again, After reading the module maintainers wiki page I made a mantis (minze_zr) and cdash account. If there is any use for the modules I will create a git account somewhere to host my modules. I hope to hear from some of the cmake maintainers how (or if) to proceed next. Met vriendelijke groet, Minze Zwerver van Ovost Automatisering Op di 14 feb 2012 16:23:18 CET, Minze A. Zwerver schreef: Hi There, First of all thanks for CMAKE , is has made my work a lot easier the last couple of years. We produce software for a number of platforms and cmake keeps me sane (as far as that's possible). I've got a few modules I hope some other people might find usefull. With permission of my employer I offer them for potential inclusion. They might need some polish , but for me at least they work. Also I include a patch to get ExternalProject.cmake working with mercurial. (against version 2.8.7) -- 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] $TARGET_FILE:tgt in the add_custom_command()
Hi, Thanks for your explanation. I will choose a different project name to avoid this issue. Thanks again! Regards, Alexey -Original Message- From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Michael Wild Sent: Tuesday, February 14, 2012 7:49 PM To: cmake@cmake.org Subject: Re: [CMake] $TARGET_FILE:tgt in the add_custom_command() On 02/14/2012 04:36 PM, aaron.mead...@thomsonreuters.com wrote: *Looks like '+' is not a valid character for the target name. * * * *Specifically, cmGeneratorExpression.cxx does not have it as part of the regular expression to match target names: (line 23 on) * * * * * this-TargetInfo.compile(^\\$TARGET (|_SONAME|_LINKER) // File with what purpose? _FILE(|_NAME|_DIR): // Filename component. ([A-Za-z0-9_.-]+) // Target name. $); * * *(In case you're unfamiliar with regular expressions, that + is just to denote 1 or more of the things between the [ and ] . ) * * * *I tried adding + to that list, but I'm not sure how (if it's possible) to escape it (and it resulted in a regular expression compile error (runtime)). I'd suggest using something else instead of a + in your target name. * * * *Aaron Meadows* * * *From:*cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] *On Behalf Of *Kozlovskiy, Alexey *Sent:* Tuesday, February 14, 2012 5:38 AM *To:* cmake@cmake.org *Subject:* [CMake] $TARGET_FILE:tgt in the add_custom_command() Hi, If the project name has a symbols - or + the $TARGET_FILE:tgt in the add_custom_command() return Error: Error evaluating generator expression For example: SET ( PROJECT_NAME 00010-Liquid+Gas_as_capture ) set ( SRCS_MAIN_CPT main.c ) add_executable ( ${ PROJECT_NAME } ${SRCS_MAIN_CPT} ) add_custom_command ( TARGET ${ PROJECT_NAME } POST_BUILD COMMAND $TARGET_FILE:${ PROJECT_NAME } ARGS $TARGET_FILE_DIR:${ PROJECT_NAME }/110.cnf COMMENT Running cpt.exe... ) When I run the CMake I received the following error: CMake Error at problems.rt.Cmake:114 (add_custom_command): Error evaluating generator expression: $TARGET_FILE:00010-Liquid+Gas_as_capture Expression syntax not recognized. Is this a bug or some syntax limitation? Regards, Alexey As a work-around use a different target name which is clean and then use the OUTPUT_NAME target property to get the desired file name. Michael -- 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] How to have a static/shared option in a Find script ?
Hello, I am trying to write a Find script for a library called DIM. It is something basic but I have a problem with caching. I have an option to force choosing the static library over the shared one : Then, I decide what is the name of the library to search depending on DIM_USE_STATIC and I find it with find_library : The problem is that modifying DIM_USE_STATIC in ccmake doesn't work even though DIM_LIB_NAME is correct (ie. libdim.a). DIM_LIBRARY sticks to the previous value (the shared library). I know that find_library will not run again if it has already found the library in the past, thus how should I do ? Thank you in advance for your help, Barth -- View this message in context: http://cmake.3232098.n2.nabble.com/How-to-have-a-static-shared-option-in-a-Find-script-tp7287655p7287655.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] Ninja + CMake on a dashboard?
On Tue, Feb 14, 2012 at 11:00 PM, David Cole david.c...@kitware.com wrote: Does anybody on this list have the capacity to volunteer to run / submit a CMake dashboard using the new experimental Ninja generator? (It's now a topic branch on our stage that has been merged to 'next' -- so it is included in the nightly binaries available from Kitware...) Before we can merge it to 'master' and make it part of our next release, it would be fabulous to have a regularly submitting dashboard for it. Any volunteers? I may have an Ubuntu box and maybe a OS X 10.7 machine, depending on what is required. What do I have to setup? Is the machine required to be up and running all the time? Cheers, -- Nicolas Desprès -- 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] Ninja + CMake on a dashboard?
On 2/15/2012 10:27 AM, Nicolas Desprès wrote: = I may have an Ubuntu box and maybe a OS X 10.7 machine, depending on what is required. What do I have to setup? Is the machine required to be up and running all the time? Cheers, It is required that the machine submit once a day. To submit it needs to pull from git and send xml to CDash. There is some info from here: http://www.cmake.org/cmake/resources/testing.html Ninja will be a bit tricky to setup, as you will most likely have to pull ninja from some git somewhere and build that first before you can use it for the CMake dashboard. -Bill -- 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] [cmake-developers] Ninja help
Last night, David indicated that, after installing Ninja, it should be as simple as running the standard nightly submission for CMake but using Ninja as the CTEST_CMAKE_GENERATOR. I am trying to do that right now, but I am running into a bootstrap issue. I think that I have to first convert my system version of CMake to a recent next in order to get it to even attempt to run. Richard On Feb 15, 2012, at 9:47 AM, Bill Hoffman wrote: Where at are the versions of Ninja that I need to use with CMake for: Windows: Mac: Linux: I have seen several git branches mentioned in emails, and it is not clear to me where to get the right Ninja for CMake on all platforms. To setup nightly testing, is there a master git branch that we should test against? This would let us know if Ninja breaks CMake support right away. Thanks. -Bill -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers -- 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] Ninja + CMake on a dashboard?
On Wed, Feb 15, 2012 at 10:45:04AM -0500, Bill Hoffman wrote: On 2/15/2012 10:27 AM, Nicolas Desprès wrote: = I may have an Ubuntu box and maybe a OS X 10.7 machine, depending on what is required. What do I have to setup? Is the machine required to be up and running all the time? Cheers, It is required that the machine submit once a day. To submit it needs to pull from git and send xml to CDash. I note that Kitware has machines set up to run dashboards for the Makefile generator. Is there any reason why some of those machines can't be set up to run double duty as Ninja dashboards, especially given that the work is only required once a day? Thanks, -- Peter -- 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] Ninja + CMake on a dashboard?
On Wed, Feb 15, 2012 at 4:45 PM, Bill Hoffman bill.hoff...@kitware.comwrote: On 2/15/2012 10:27 AM, Nicolas Desprès wrote: = I may have an Ubuntu box and maybe a OS X 10.7 machine, depending on what is required. What do I have to setup? Is the machine required to be up and running all the time? Cheers, It is required that the machine submit once a day. To submit it needs to pull from git and send xml to CDash. What's happens if it misses some day because the machine is not running for any reason ? Weekend, maintenance, etc... ? There is some info from here: http://www.cmake.org/cmake/**resources/testing.htmlhttp://www.cmake.org/cmake/resources/testing.html Thanks for the pointer. Ninja will be a bit tricky to setup, as you will most likely have to pull ninja from some git somewhere and build that first before you can use it for the CMake dashboard. That's should not be a problem since I already have this kind of setup on my machine. I will ask for authorization and I'll get back to you ASAP. Cheers, -- Nicolas Desprès -- 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] ctest return code
Hello, I'm able to run my unittests and build everything using a ctest -S script, and also submit the results to cdash. However, I would like to determine if the unittests fail in the bash script where I run ctest in. But it doesn't return an error code when the unittests fail. How can I determine this? Thanks, Best regards, Tom, -- 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] Ninja + CMake on a dashboard?
On 14 February 2012 22:00, David Cole david.c...@kitware.com wrote: Does anybody on this list have the capacity to volunteer to run / submit a CMake dashboard using the new experimental Ninja generator? (It's now a topic branch on our stage that has been merged to 'next' -- so it is included in the nightly binaries available from Kitware...) Before we can merge it to 'master' and make it part of our next release, it would be fabulous to have a regularly submitting dashboard for it. Any volunteers? Perhaps it is worth looking at the GCC Compile Farm? http://gcc.gnu.org/wiki/CompileFarm -- Matt Williams http://milliams.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] ctest return code
Are you using ctest_build and ctest_test in your -S script? If so, then ctest should fail with a non-zero result when there are build errors or test failures. Are you saying that you have test failures, but ctest returns 0? Can you share your script, or reproduce this with a minimal example project? Thx, David On Wed, Feb 15, 2012 at 11:14 AM, Tom Deblauwe tom.debla...@traficon.comwrote: Hello, I'm able to run my unittests and build everything using a ctest -S script, and also submit the results to cdash. However, I would like to determine if the unittests fail in the bash script where I run ctest in. But it doesn't return an error code when the unittests fail. How can I determine this? Thanks, Best regards, Tom, -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/** opensource/opensource.htmlhttp://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/**CMake_FAQhttp://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/**listinfo/cmakehttp://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] Ninja + CMake on a dashboard?
On 2/15/2012 11:03 AM, Nicolas Desprès wrote: What's happens if it misses some day because the machine is not running for any reason ? Weekend, maintenance, etc... ? Not a bit deal, unless it is missing more often than not. I would say 95% up would be fine. If it is up and down all the time, it is more annoying than useful. That's should not be a problem since I already have this kind of setup on my machine. That would be great. -Bill -- 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] Ninja + CMake on a dashboard?
On Wednesday 15 February 2012, Peter Collingbourne wrote: On Wed, Feb 15, 2012 at 10:45:04AM -0500, Bill Hoffman wrote: On 2/15/2012 10:27 AM, Nicolas Desprès wrote: = I may have an Ubuntu box and maybe a OS X 10.7 machine, depending on what is required. What do I have to setup? Is the machine required to be up and running all the time? Cheers, It is required that the machine submit once a day. To submit it needs to pull from git and send xml to CDash. I note that Kitware has machines set up to run dashboards for the Makefile generator. Is there any reason why some of those machines can't be set up to run double duty as Ninja dashboards, The machines are already more than running as double duty: multiple builds of cmake, vtk, itk, paraview, etc. Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Ninja + CMake on a dashboard?
On Wed, Feb 15, 2012 at 6:09 PM, Bill Hoffman bill.hoff...@kitware.comwrote: On 2/15/2012 11:04 AM, Peter Collingbourne wrote: On Wed, Feb 15, 2012 at 10:45:04AM -0500, Bill Hoffman wrote: I note that Kitware has machines set up to run dashboards for the Makefile generator. Is there any reason why some of those machines can't be set up to run double duty as Ninja dashboards, especially given that the work is only required once a day? Thanks, No, we are going to set some up as well. Basically it is a human resource problem. One has to figure out how to build ninja and from where before a dashbaord can be setup. If someone out there is a ninja fan, a dashboard would be appreciated. Bill, If I give you a shell script that can be run by cron and that do the job, could you add it to your build-farm? I know how to do all the bootstrapping stuff. I just have never done any cdash integration/submission but with the documentation you gave me I could probably write it but maybe not test it except it there is a dashboard where I can test. I don't have my own dashboard yet. -Nico -- 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] Ninja + CMake on a dashboard?
2012/2/15 Nicolas Desprès nicolas.desp...@gmail.com On Wed, Feb 15, 2012 at 6:09 PM, Bill Hoffman bill.hoff...@kitware.comwrote: On 2/15/2012 11:04 AM, Peter Collingbourne wrote: On Wed, Feb 15, 2012 at 10:45:04AM -0500, Bill Hoffman wrote: I note that Kitware has machines set up to run dashboards for the Makefile generator. Is there any reason why some of those machines can't be set up to run double duty as Ninja dashboards, especially given that the work is only required once a day? Thanks, No, we are going to set some up as well. Basically it is a human resource problem. One has to figure out how to build ninja and from where before a dashbaord can be setup. If someone out there is a ninja fan, a dashboard would be appreciated. Bill, If I give you a shell script that can be run by cron and that do the job, could you add it to your build-farm? I know how to do all the bootstrapping stuff. I just have never done any cdash integration/submission but with the documentation you gave me I could probably write it but maybe not test it except it there is a dashboard where I can test. I don't have my own dashboard yet. Feel free to test right on the CMake dashboard itself. Arbitrary submissions that show up in the Nightly section or the Experimental section are ok with us. You don't need your own CDash server... In fact, we want you to send to ours. -- 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] ctest return code
On 2/15/2012 2:44 PM, Tom Deblauwe wrote: Hello, In attachment a project which illustrates the problem. Just change the directory in the ctest script continuous_dashboard.cmake to where your source is. Then i run ctest in my bash script. I'm in git bash on windows now, but I get the problem on linux too. tdb@PCTDBP /c/werk/cmake_tests $ ctest -S dashboard/continuous_dashboard.cmake -VV \ ... 1: Test timeout computed to be: 600 1/1 Test #1: testMylibTest ***Failed 0.05 sec 0% tests passed, 1 tests failed out of 1 Total Test time (real) = 2.44 sec The following tests FAILED: 1 - testMylibTest (Failed) Then after ctest exits I do: tdb@PCTDBP /c/werk/cmake_tests $ echo $? 0 As you can see: the test failed, but ctest just returns 0. That is because the ctest -S script worked. If you want it to fail, you will have to modify the continuous_dashboard.cmake script to look at the results of ctest_test and then use a message(FATAL_ERROR tests failed) if there was a failing test. -Bill -- 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] ctest return code
Is this just a git bash shell thing, then...? Do you get zero if you run it in a Windows cmd prompt, too? What does this give you? Start Run cmd C: cd \werk\cmake_tests ctest -S dashboard/continuous_**dashboard.cmake -VV echo %ERRORLEVEL% On Wed, Feb 15, 2012 at 2:44 PM, Tom Deblauwe tom.debla...@traficon.comwrote: Hello, In attachment a project which illustrates the problem. Just change the directory in the ctest script continuous_dashboard.cmake to where your source is. Then i run ctest in my bash script. I'm in git bash on windows now, but I get the problem on linux too. tdb@PCTDBP /c/werk/cmake_tests $ ctest -S dashboard/continuous_**dashboard.cmake -VV Ctest then runs, and this is the last of the output, in which you can see that it builds but that the unittest fails. .== Build: 3 succeeded, 0 failed, 2 up-to-date, 0 skipped == Size of output: 1K Command exited with the value: 0 MakeCommand:C:\PROGRA~2\**MI30EB~1\Common7\IDE\devenv.**comhttp://devenv.comProject.sln /build Relea se /project ALL_BUILD 0 Compiler errors 0 Compiler warnings SetCTestConfiguration:**BuildDirectory:c:/werk/cmake_**tests/bld-Release SetCTestConfiguration:**SourceDirectory:c:/werk/cmake_**tests/prog Test project C:/werk/cmake_tests/bld-**Release Constructing a list of tests Done constructing a list of tests Checking test dependency graph... Checking test dependency graph end test 1 Start 1: testMylibTest 1: Test command: C:\werk\cmake_tests\bld-**Release\mylib\test\mylib\** release\testMy lib.exe 1: Test timeout computed to be: 600 1/1 Test #1: testMylibTest ***Failed0.05 sec 0% tests passed, 1 tests failed out of 1 Total Test time (real) = 2.44 sec The following tests FAILED: 1 - testMylibTest (Failed) Then after ctest exits I do: tdb@PCTDBP /c/werk/cmake_tests $ echo $? 0 As you can see: the test failed, but ctest just returns 0. Best regards, Tom, -- 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] ctest return code
Hello, It is apparently a combination of the two things, first I had to check the RETURN_VALUE of the ctest_test command and then issue a fatal_error when not zero. Secondly: This works if I test it like you suggest in a command window: the %errorlevel% is set. However in the git bash shell thingy on windows, I always get 0. I tried it now in linux too, and there the echo $? is working and is showing me the error code instead of 0. So thanks to both for the suggestions! Best regards, Tom, Op 15/02/2012 21:12, David Cole schreef: Is this just a git bash shell thing, then...? Do you get zero if you run it in a Windows cmd prompt, too? What does this give you? Start Run cmd C: cd \werk\cmake_tests ctest -S dashboard/continuous_dashboard.cmake -VV echo %ERRORLEVEL% On Wed, Feb 15, 2012 at 2:44 PM, Tom Deblauwe tom.debla...@traficon.com mailto:tom.debla...@traficon.com wrote: Hello, In attachment a project which illustrates the problem. Just change the directory in the ctest script continuous_dashboard.cmake to where your source is. Then i run ctest in my bash script. I'm in git bash on windows now, but I get the problem on linux too. tdb@PCTDBP /c/werk/cmake_tests $ ctest -S dashboard/continuous_dashboard.cmake -VV Ctest then runs, and this is the last of the output, in which you can see that it builds but that the unittest fails. .== Build: 3 succeeded, 0 failed, 2 up-to-date, 0 skipped == Size of output: 1K Command exited with the value: 0 MakeCommand:C:\PROGRA~2\MI30EB~1\Common7\IDE\devenv.com http://devenv.com Project.sln /build Relea se /project ALL_BUILD 0 Compiler errors 0 Compiler warnings SetCTestConfiguration:BuildDirectory:c:/werk/cmake_tests/bld-Release SetCTestConfiguration:SourceDirectory:c:/werk/cmake_tests/prog Test project C:/werk/cmake_tests/bld-Release Constructing a list of tests Done constructing a list of tests Checking test dependency graph... Checking test dependency graph end test 1 Start 1: testMylibTest 1: Test command: C:\werk\cmake_tests\bld-Release\mylib\test\mylib\release\testMy lib.exe 1: Test timeout computed to be: 600 1/1 Test #1: testMylibTest ***Failed0.05 sec 0% tests passed, 1 tests failed out of 1 Total Test time (real) = 2.44 sec The following tests FAILED: 1 - testMylibTest (Failed) Then after ctest exits I do: tdb@PCTDBP /c/werk/cmake_tests $ echo $? 0 As you can see: the test failed, but ctest just returns 0. Best regards, Tom, -- *Tom Deblauwe* *RD Engineer* Traficon International N.V. Vlamingstraat 19 B-8560 Wevelgem Belgium Tel.: +32 (0)56 37.22.00 Fax: +32 (0)56 37.21.96 URL: www.traficon.com http://www.traficon.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
[CMake] Semicolons in windows path list for ExternalProject_Add or ExP_Add_Step
Hi, Apologies in advance if I missed/misread something in the FAQ and the email threads I've found so far about semicolons. I am using Windows 7 64-bit, CMake 2.8.7, and Visual Studio 10 Win64 generator with msbuild, VC++ Express 2010, Windows SDK7.1. I need to pass a windows-style path list through ExternalProject_Add and ExternalProject_Add_Step. Minimal example: cmake_minimum_required(VERSION 2.8) include(ExternalProject) ExternalProject_Add( hello_world URL C:/temp BUILD_COMMAND ${CMAKE_BUILD_TOOL} /p:VCBuildAdditionalLinkLibraryPaths=MORE;BETTER;PATHLIST ) When I generate the project, the path list separator is converted to spaces, so when it gets to VCBuild from msbuild it is interpreted as multiple arguments and fails. from hello_world.vcxproj: ... if %errorlevel% neq 0 goto :cmEnd C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /p:VCBuildAdditionalLinkLibraryPaths=MORE BETTER PATHLIST if %errorlevel% neq 0 goto :cmEnd In the real project, I am using $ENV{LIB} (=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Lib\amd64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\X64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64) I've tried string(REPLACE..) for escaping in various ways, but at best I end up with extra slashes and at worst no spaces between paths. I also tried permutations of -D and LIST_SEPARATOR to no avail. Thanks very much for any suggestions. -Isaiah -- 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] ctest return code
On 2/15/2012 3:57 PM, Tom Deblauwe wrote: It is apparently a combination of the two things, first I had to check the RETURN_VALUE of the ctest_test command and then issue a fatal_error when not zero. Secondly: This works if I test it like you suggest in a command window: the %errorlevel% is set. However in the git bash shell thingy on windows, I always get 0. I tried it now in linux too, and there the echo $? is working and is showing me the error code instead of 0. OK, I was wrong. It should work. It is just git bash that is broken... -Bill -- 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] How to have a static/shared option in a Find script ?
On 02/15/2012 03:48 PM, Barth wrote: Hello, I am trying to write a Find script for a library called DIM. It is something basic but I have a problem with caching. I have an option to force choosing the static library over the shared one : Then, I decide what is the name of the library to search depending on DIM_USE_STATIC and I find it with find_library : The problem is that modifying DIM_USE_STATIC in ccmake doesn't work even though DIM_LIB_NAME is correct (ie. libdim.a). DIM_LIBRARY sticks to the previous value (the shared library). I know that find_library will not run again if it has already found the library in the past, thus how should I do ? Thank you in advance for your help, Barth Probably, you just need to reset DIM_LIBRARY to an empty string in ccmake each time you change DIM_USE_STATIC; see the FIND_LIBRARY() documentation for more information: If the library is found the result is stored in the variable and the search will not be repeated *unless the variable is cleared*. However, a conceptually cleaner approach is to consider the shared and the static version of a library as two components of a multi-component package, and write the find module / configuration file accordingly: (1) Use FIND_LIBRARY() to look for the shared and the static library and define DIM_SHARED_LIBRARY and DIM_STATIC_LIBRARY in the cache. (2) Inspect DIM_FIND_COMPONENTS to see which flavor has been requested, defaulting to shared if no components have been requested at all. (3) Warn or bail out if shared and static have both been requested unless they can be used together - rare but not impossible a priori. (4) DIM_USE_STATIC decides if DIM_LIBRARIES receives DIM_STATIC_LIBRARY or DIM_SHARED_LIBRARY, and because DIM_LIBRARIES is not cached, it can be set anew each time FIND_PACKAGE(DIM ...) is called, so the issue you report on will go away. IMO, most packages providing a library with shared and static versions should be considered in this manner, as this would be a robust mean to specifically select one or the other without the need to reset cache entries or bother with CMAKE_FIND_LIBRARY_SUFFIXES or the like. BTW, this approach would also account for the long-standing annoyance how to have FIND_LIBRARY() differentiate between a static library and an import library on Windows; each library type would simply have its own FIND_LIBRARY() call, and this would make things much easier. Regards, Michael -- 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] How to have a static/shared option in a Find script ?
Hello, A great thanks for your extensive reply ! I am going to implement the clean approach following your advices. Best regards, Barth On 02/16/2012 12:47 AM, Michael Hertling [via CMake] wrote: On 02/15/2012 03:48 PM, Barth wrote: Hello, I am trying to write a Find script for a library called DIM. It is something basic but I have a problem with caching. I have an option to force choosing the static library over the shared one : Then, I decide what is the name of the library to search depending on DIM_USE_STATIC and I find it with find_library : The problem is that modifying DIM_USE_STATIC in ccmake doesn't work even though DIM_LIB_NAME is correct (ie. libdim.a). DIM_LIBRARY sticks to the previous value (the shared library). I know that find_library will not run again if it has already found the library in the past, thus how should I do ? Thank you in advance for your help, Barth Probably, you just need to reset DIM_LIBRARY to an empty string in ccmake each time you change DIM_USE_STATIC; see the FIND_LIBRARY() documentation for more information: If the library is found the result is stored in the variable and the search will not be repeated *unless the variable is cleared*. However, a conceptually cleaner approach is to consider the shared and the static version of a library as two components of a multi-component package, and write the find module / configuration file accordingly: (1) Use FIND_LIBRARY() to look for the shared and the static library and define DIM_SHARED_LIBRARY and DIM_STATIC_LIBRARY in the cache. (2) Inspect DIM_FIND_COMPONENTS to see which flavor has been requested, defaulting to shared if no components have been requested at all. (3) Warn or bail out if shared and static have both been requested unless they can be used together - rare but not impossible a priori. (4) DIM_USE_STATIC decides if DIM_LIBRARIES receives DIM_STATIC_LIBRARY or DIM_SHARED_LIBRARY, and because DIM_LIBRARIES is not cached, it can be set anew each time FIND_PACKAGE(DIM ...) is called, so the issue you report on will go away. IMO, most packages providing a library with shared and static versions should be considered in this manner, as this would be a robust mean to specifically select one or the other without the need to reset cache entries or bother with CMAKE_FIND_LIBRARY_SUFFIXES or the like. BTW, this approach would also account for the long-standing annoyance how to have FIND_LIBRARY() differentiate between a static library and an import library on Windows; each library type would simply have its own FIND_LIBRARY() call, and this would make things much easier. Regards, Michael -- 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 If you reply to this email, your message will be added to the discussion below: http://cmake.3232098.n2.nabble.com/How-to-have-a-static-shared-option-in-a-Find-script-tp7287655p7289496.html To unsubscribe from How to have a static/shared option in a Find script ?, click here http://cmake.3232098.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=7287655code=YmFydGhlbGVteS52b24uaGFsbGVyQGNlcm4uY2h8NzI4NzY1NXwxNDQ2NTQ5NDE=. NAML http://cmake.3232098.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml -- View this message in context: http://cmake.3232098.n2.nabble.com/How-to-have-a-static-shared-option-in-a-Find-script-tp7287655p7290177.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
[Cmake-commits] CMake branch, next, updated. v2.8.7-2620-g6d1de03
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via 6d1de03ade6f3d6006c33e05ffadf65ba677b3cb (commit) via 630ea5f7049370557280c495b4b4b5b1616d4edb (commit) via a8b57149351168425f4040c8b99167238cca041d (commit) from 0fad59a04fb216fe47c4beaf7debe0aaf7de97b2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6d1de03ade6f3d6006c33e05ffadf65ba677b3cb commit 6d1de03ade6f3d6006c33e05ffadf65ba677b3cb Merge: 0fad59a 630ea5f Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Wed Feb 15 14:21:59 2012 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Wed Feb 15 14:21:59 2012 -0500 Merge topic 'findlibrary-versioned-libraries' into next 630ea5f Find_library(): allow searching for versioned shared objects a8b5714 KWSys Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=630ea5f7049370557280c495b4b4b5b1616d4edb commit 630ea5f7049370557280c495b4b4b5b1616d4edb Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Wed Feb 15 19:55:57 2012 +0100 Commit: Rolf Eike Beer e...@sf-mail.de CommitDate: Wed Feb 15 20:21:24 2012 +0100 Find_library(): allow searching for versioned shared objects This did not work because find_library() did only treat the given name as complete filename if is matched PREFIX.*SUFFIX: find_library(MYLIB libfoo.so.2) Now it is also taken as a whole if the name matches PREFIX.*SUFFIX\..*. diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 2fa2cca..a726849 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -354,13 +354,23 @@ void cmFindLibraryHelper::RegexFromList(std::string out, // bool cmFindLibraryHelper::HasValidSuffix(std::string const name) { - // Check if the given name ends in a valid library suffix. for(std::vectorstd::string::const_iterator si = this-Suffixes.begin(); si != this-Suffixes.end(); ++si) { -std::string const suffix = *si; -if(name.length() suffix.length() - name.substr(name.size()-suffix.length()) == suffix) +std::string suffix = *si; +if(name.length() = suffix.length()) + { + continue; + } +// Check if the given name ends in a valid library suffix. +if(name.substr(name.size()-suffix.length()) == suffix) + { + return true; + } +// Check if a valid library suffix is somewhere in the name, +// this may happen e.g. for versioned shared libraries: libfoo.so.2 +suffix += .; +if(name.find(suffix) != name.npos) { return true; } diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index b505019..3e716cf 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -199,7 +199,7 @@ CONFIGURE_FILE( ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/dummylib.lib COPYONLY IMMEDIATE) -FOREACH (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl) +FOREACH (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl;.so.2) CONFIGURE_FILE( ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/libdummylib${ext} @@ -216,6 +216,12 @@ FIND_LIBRARY(FIND_DUMMY_LIB PATHS ${Complex_BINARY_DIR}/Library DOC find dummy lib) +FIND_LIBRARY(FIND_DUMMY_LIB_VERSIONED + NAMES libdummylib.so.2 + PATHS ${Complex_BINARY_DIR}/Library + DOC find versioned dummy lib + NO_DEFAULT_PATH) + # # Test SET_SOURCE_FILES_PROPERTIES # diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 1901d99..e6a9fb3 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -849,6 +849,23 @@ int main() } #endif +#ifndef FIND_DUMMY_LIB_VERSIONED + cmFailed(the CONFIGURE_FILE command is broken, + FIND_DUMMY_LIB_VERSIONED is not defined.); +#else + const char *libmatch = strstr(FIND_DUMMY_LIB_VERSIONED, +/libdummylib.so.2); + if(libmatch == NULL || strlen(libmatch) != strlen(/libdummylib.so.2)) +{ +cmFailed(the FIND_LIBRARY or CONFIGURE_FILE command is broken, + FIND_DUMMY_LIB_VERSIONED == , FIND_DUMMY_LIB_VERSIONED); +} + else +{ +cmPassed(FIND_DUMMY_LIB_VERSIONED == , FIND_DUMMY_LIB_VERSIONED); +} +#endif + // -- // Test SET_SOURCE_FILES_PROPERTIES diff --git a/Tests/Complex/cmTestConfigure.h.in
[Cmake-commits] CMake branch, next, updated. v2.8.7-2622-gfd1e615
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via fd1e615063d36571be7c59345b66b5752555ba06 (commit) via 5f721e9ec8e8f84ee08b8e950a3b80425d14bf66 (commit) from 6d1de03ade6f3d6006c33e05ffadf65ba677b3cb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd1e615063d36571be7c59345b66b5752555ba06 commit fd1e615063d36571be7c59345b66b5752555ba06 Merge: 6d1de03 5f721e9 Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Wed Feb 15 15:20:46 2012 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Wed Feb 15 15:20:46 2012 -0500 Merge topic 'findlibrary-versioned-libraries' into next 5f721e9 fix test for versioned libraries http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f721e9ec8e8f84ee08b8e950a3b80425d14bf66 commit 5f721e9ec8e8f84ee08b8e950a3b80425d14bf66 Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Wed Feb 15 21:15:37 2012 +0100 Commit: Rolf Eike Beer e...@sf-mail.de CommitDate: Wed Feb 15 21:19:50 2012 +0100 fix test for versioned libraries diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 3e716cf..4a693ed 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -199,7 +199,7 @@ CONFIGURE_FILE( ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/dummylib.lib COPYONLY IMMEDIATE) -FOREACH (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl;.so.2) +FOREACH (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl;${CMAKE_SHARED_LIBRARY_SUFFIX}.2) CONFIGURE_FILE( ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/libdummylib${ext} @@ -217,11 +217,16 @@ FIND_LIBRARY(FIND_DUMMY_LIB ${Complex_BINARY_DIR}/Library DOC find dummy lib) FIND_LIBRARY(FIND_DUMMY_LIB_VERSIONED - NAMES libdummylib.so.2 + NAMES libdummylib${CMAKE_SHARED_LIBRARY_SUFFIX}.2 PATHS ${Complex_BINARY_DIR}/Library DOC find versioned dummy lib NO_DEFAULT_PATH) +IF(NOT FIND_DUMMY_LIB_VERSIONED MATCHES /libdummylib${CMAKE_SHARED_LIBRARY_SUFFIX}.2) + MESSAGE(SEND_ERROR FIND_DUMMY_LIB_VERSIONED is not set correctly: + ${FIND_DUMMY_LIB_VERSIONED}) +ENDIF() + # # Test SET_SOURCE_FILES_PROPERTIES # diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index e6a9fb3..1901d99 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -849,23 +849,6 @@ int main() } #endif -#ifndef FIND_DUMMY_LIB_VERSIONED - cmFailed(the CONFIGURE_FILE command is broken, - FIND_DUMMY_LIB_VERSIONED is not defined.); -#else - const char *libmatch = strstr(FIND_DUMMY_LIB_VERSIONED, -/libdummylib.so.2); - if(libmatch == NULL || strlen(libmatch) != strlen(/libdummylib.so.2)) -{ -cmFailed(the FIND_LIBRARY or CONFIGURE_FILE command is broken, - FIND_DUMMY_LIB_VERSIONED == , FIND_DUMMY_LIB_VERSIONED); -} - else -{ -cmPassed(FIND_DUMMY_LIB_VERSIONED == , FIND_DUMMY_LIB_VERSIONED); -} -#endif - // -- // Test SET_SOURCE_FILES_PROPERTIES diff --git a/Tests/Complex/cmTestConfigure.h.in b/Tests/Complex/cmTestConfigure.h.in index 03cf3dc..7741b6f 100644 --- a/Tests/Complex/cmTestConfigure.h.in +++ b/Tests/Complex/cmTestConfigure.h.in @@ -48,7 +48,6 @@ // Test FIND_LIBRARY #define FIND_DUMMY_LIB ${FIND_DUMMY_LIB} -#define FIND_DUMMY_LIB_VERSIONED ${FIND_DUMMY_LIB_VERSIONED} // Test SET_SOURCE_FILES_PROPERTIES --- Summary of changes: Tests/Complex/CMakeLists.txt |9 +++-- Tests/Complex/Executable/complex.cxx | 17 - Tests/Complex/cmTestConfigure.h.in |1 - 3 files changed, 7 insertions(+), 20 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits
[Cmake-commits] CMake branch, next, updated. v2.8.7-2630-g733ac6b
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via 733ac6bd2dc822daa6b6d58a789cbd081ef6a037 (commit) via 14dadbde809d5091de44ef880376f69f6be2e23e (commit) from 4daa71ed4ae3e8cf98b7e39281569fd30a6a7b95 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=733ac6bd2dc822daa6b6d58a789cbd081ef6a037 commit 733ac6bd2dc822daa6b6d58a789cbd081ef6a037 Merge: 4daa71e 14dadbd Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Wed Feb 15 15:55:39 2012 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Wed Feb 15 15:55:39 2012 -0500 Merge topic 'improve-findglut' into next 14dadbd FindGLUT: honor REQUIRED (#12466) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=14dadbde809d5091de44ef880376f69f6be2e23e commit 14dadbde809d5091de44ef880376f69f6be2e23e Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Wed Feb 8 20:05:06 2012 +0100 Commit: Rolf Eike Beer e...@sf-mail.de CommitDate: Wed Feb 15 21:54:51 2012 +0100 FindGLUT: honor REQUIRED (#12466) diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake index af88997..8205779 100644 --- a/Modules/FindGLUT.cmake +++ b/Modules/FindGLUT.cmake @@ -64,25 +64,23 @@ ELSE (WIN32) ENDIF (WIN32) -SET( GLUT_FOUND NO ) -IF(GLUT_INCLUDE_DIR) - IF(GLUT_glut_LIBRARY) -# Is -lXi and -lXmu required on all platforms that have it? -# If not, we need some way to figure out what platform we are on. -SET( GLUT_LIBRARIES - ${GLUT_glut_LIBRARY} - ${GLUT_Xmu_LIBRARY} - ${GLUT_Xi_LIBRARY} - ${GLUT_cocoa_LIBRARY} - ) -SET( GLUT_FOUND YES ) - -#The following deprecated settings are for backwards compatibility with CMake1.4 -SET (GLUT_LIBRARY ${GLUT_LIBRARIES}) -SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR}) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLUT REQUIRED_VARS GLUT_glut_LIBRARY GLUT_INCLUDE_DIR) + +IF (GLUT_FOUND) + # Is -lXi and -lXmu required on all platforms that have it? + # If not, we need some way to figure out what platform we are on. + SET( GLUT_LIBRARIES +${GLUT_glut_LIBRARY} +${GLUT_Xmu_LIBRARY} +${GLUT_Xi_LIBRARY} +${GLUT_cocoa_LIBRARY} +) - ENDIF(GLUT_glut_LIBRARY) -ENDIF(GLUT_INCLUDE_DIR) + #The following deprecated settings are for backwards compatibility with CMake1.4 + SET (GLUT_LIBRARY ${GLUT_LIBRARIES}) + SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR}) +ENDIF(GLUT_FOUND) MARK_AS_ADVANCED( GLUT_INCLUDE_DIR --- Summary of changes: Modules/FindGLUT.cmake | 34 -- 1 files changed, 16 insertions(+), 18 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits
[Cmake-commits] CMake branch, next, updated. v2.8.7-2632-g2128373
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via 2128373082002cd11c2e3802d8346fc6d83df6f3 (commit) via 087bea35c158f336a3193a97b06bdce3d8ce35f8 (commit) from 733ac6bd2dc822daa6b6d58a789cbd081ef6a037 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2128373082002cd11c2e3802d8346fc6d83df6f3 commit 2128373082002cd11c2e3802d8346fc6d83df6f3 Merge: 733ac6b 087bea3 Author: Bill Hoffman bill.hoff...@kitware.com AuthorDate: Wed Feb 15 22:46:33 2012 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Wed Feb 15 22:46:33 2012 -0500 Merge topic 'fix_fortran_dir_two_dirs' into next 087bea3 Allow two cmake_add_fortran_subdirectory calls in the same project. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=087bea35c158f336a3193a97b06bdce3d8ce35f8 commit 087bea35c158f336a3193a97b06bdce3d8ce35f8 Author: Bill Hoffman bill.hoff...@kitware.com AuthorDate: Wed Feb 15 22:42:31 2012 -0500 Commit: Bill Hoffman bill.hoff...@kitware.com CommitDate: Wed Feb 15 22:42:31 2012 -0500 Allow two cmake_add_fortran_subdirectory calls in the same project. Configure the build_mingw.cmake.in config_mingw.cmake.in files into the binary directory of the directory being built, not the top level binary directory for the project. diff --git a/Modules/CMakeAddFortranSubdirectory.cmake b/Modules/CMakeAddFortranSubdirectory.cmake index ddb79fb..abd9100 100644 --- a/Modules/CMakeAddFortranSubdirectory.cmake +++ b/Modules/CMakeAddFortranSubdirectory.cmake @@ -50,7 +50,7 @@ include(CheckLanguage) include(ExternalProject) include(CMakeParseArguments) -function(_setup_mingw_config_and_build source_dir) +function(_setup_mingw_config_and_build source_dir build_dir) # Look for a MinGW gfortran. find_program(MINGW_GFORTRAN NAMES gfortran @@ -91,11 +91,11 @@ function(_setup_mingw_config_and_build source_dir) string(REPLACE \\ MINGW_PATH ${MINGW_PATH}) configure_file( ${_MS_MINGW_SOURCE_DIR}/CMakeAddFortranSubdirectory/config_mingw.cmake.in -${CMAKE_CURRENT_BINARY_DIR}/config_mingw.cmake +${build_dir}/config_mingw.cmake @ONLY) configure_file( ${_MS_MINGW_SOURCE_DIR}/CMakeAddFortranSubdirectory/build_mingw.cmake.in -${CMAKE_CURRENT_BINARY_DIR}/build_mingw.cmake +${build_dir}/build_mingw.cmake @ONLY) endfunction() @@ -144,15 +144,15 @@ function(cmake_add_fortran_subdirectory subdir) endif() endforeach() # create build and configure wrapper scripts - _setup_mingw_config_and_build(${source_dir}) + _setup_mingw_config_and_build(${source_dir} ${build_dir}) # create the external project externalproject_add(${project_name}_build SOURCE_DIR ${source_dir} BINARY_DIR ${build_dir} CONFIGURE_COMMAND ${CMAKE_COMMAND} --P ${CMAKE_CURRENT_BINARY_DIR}/config_mingw.cmake +-P ${build_dir}/config_mingw.cmake BUILD_COMMAND ${CMAKE_COMMAND} --P ${CMAKE_CURRENT_BINARY_DIR}/build_mingw.cmake +-P ${build_dir}/build_mingw.cmake INSTALL_COMMAND ) # make the external project always run make with each build --- Summary of changes: Modules/CMakeAddFortranSubdirectory.cmake | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits
[Cmake-commits] CMake branch, master, updated. v2.8.7-377-ge2042b6
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, master has been updated via e2042b68d36e0881bfc00f926a275dda3d6cbc9d (commit) from a8b57149351168425f4040c8b99167238cca041d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e2042b68d36e0881bfc00f926a275dda3d6cbc9d commit e2042b68d36e0881bfc00f926a275dda3d6cbc9d Author: KWSys Robot kwro...@kitware.com AuthorDate: Thu Feb 16 00:05:07 2012 -0500 Commit: KWSys Robot kwro...@kitware.com CommitDate: Thu Feb 16 00:05:07 2012 -0500 KWSys Nightly Date Stamp diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 0e6cf93..1c285d0 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2012) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 15) +SET(KWSYS_DATE_STAMP_DAY 16) --- Summary of changes: Source/kwsys/kwsysDateStamp.cmake |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits
[Cmake-commits] CMake branch, next, updated. v2.8.7-2634-g4e006d6
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via 4e006d6624ce569e2760b1ddc1f44838d3e2fe6a (commit) via 3b488228032e32f03a639af3a084a4e5ad3201bd (commit) from 2128373082002cd11c2e3802d8346fc6d83df6f3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4e006d6624ce569e2760b1ddc1f44838d3e2fe6a commit 4e006d6624ce569e2760b1ddc1f44838d3e2fe6a Merge: 2128373 3b48822 Author: Alexander Neundorf neund...@kde.org AuthorDate: Thu Feb 16 02:30:36 2012 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Thu Feb 16 02:30:36 2012 -0500 Merge topic 'FindGetTextFixMultipleTargets' into next 3b48822 FindGetText: fix multiple targets with the same name problem (CMP0002) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3b488228032e32f03a639af3a084a4e5ad3201bd commit 3b488228032e32f03a639af3a084a4e5ad3201bd Author: Alex Neundorf neund...@kde.org AuthorDate: Sun Feb 12 18:57:28 2012 +0100 Commit: Alex Neundorf neund...@kde.org CommitDate: Sun Feb 12 18:57:28 2012 +0100 FindGetText: fix multiple targets with the same name problem (CMP0002) The functions in FindGettext create a custom target. If the functions are called multiple times, multiple times the same target is created. This works only if CMP0002 is set to OLD. With this patch there is only one central target created, and each invocation of the function creates a target with a unique name and make the central target depend on this one. Alex diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake index 635090b..6dbc026 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -61,6 +61,17 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext INCLUDE(CMakeParseArguments) +FUNCTION(_GETTEXT_GET_UNIQUE_TARGET_NAME _name _unique_name) + SET(propertyName _GETTEXT_UNIQUE_COUNTER_${_name}) + GET_PROPERTY(currentCounter GLOBAL PROPERTY ${propertyName}) + IF(NOT currentCounter) + SET(currentCounter 1) + ENDIF() + SET(${_unique_name} ${_name}_${currentCounter} PARENT_SCOPE) + MATH(EXPR currentCounter ${currentCounter} + 1) + SET_PROPERTY(GLOBAL PROPERTY ${propertyName} ${currentCounter} ) +ENDFUNCTION() + MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg) # make it a real variable, so we can modify it here SET(_firstPoFile ${_firstPoFileArg}) @@ -94,7 +105,15 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg) ENDFOREACH (_currentPoFile ) - ADD_CUSTOM_TARGET(translations ${_addToAll} DEPENDS ${_gmoFiles}) + IF(NOT TARGET translations) + ADD_CUSTOM_TARGET(translations) + ENDIF() + + _GETTEXT_GET_UNIQUE_TARGET_NAME(translations uniqueTargetName) + + ADD_CUSTOM_TARGET(${uniqueTargetName} ${_addToAll} DEPENDS ${_gmoFiles}) + + ADD_DEPENDENCIES(translations ${uniqueTargetName}) ENDMACRO(GETTEXT_CREATE_TRANSLATIONS ) @@ -133,11 +152,20 @@ FUNCTION(GETTEXT_PROCESS_POT_FILE _potFile) LIST(APPEND _gmoFiles ${_gmoFile}) ENDFOREACH (_lang ) + IF(NOT TARGET potfiles) + ADD_CUSTOM_TARGET(potfiles) + ENDIF() + + _GETTEXT_GET_UNIQUE_TARGET_NAME( potfiles uniqueTargetName) + IF(_parsedArguments_ALL) - ADD_CUSTOM_TARGET(potfiles ALL DEPENDS ${_gmoFiles}) + ADD_CUSTOM_TARGET(${uniqueTargetName} ALL DEPENDS ${_gmoFiles}) ELSE(_parsedArguments_ALL) - ADD_CUSTOM_TARGET(potfiles DEPENDS ${_gmoFiles}) + ADD_CUSTOM_TARGET(${uniqueTargetName} DEPENDS ${_gmoFiles}) ENDIF(_parsedArguments_ALL) + + ADD_DEPENDENCIES(potfiles ${uniqueTargetName}) + ENDFUNCTION(GETTEXT_PROCESS_POT_FILE) @@ -165,11 +193,21 @@ FUNCTION(GETTEXT_PROCESS_PO_FILES _lang) LIST(APPEND _gmoFiles ${_gmoFile}) ENDFOREACH(_current_PO_FILE) + + IF(NOT TARGET pofiles) + ADD_CUSTOM_TARGET(pofiles) + ENDIF() + + _GETTEXT_GET_UNIQUE_TARGET_NAME( pofiles uniqueTargetName) + IF(_parsedArguments_ALL) - ADD_CUSTOM_TARGET(pofiles ALL DEPENDS ${_gmoFiles}) + ADD_CUSTOM_TARGET(${uniqueTargetName} ALL DEPENDS ${_gmoFiles}) ELSE(_parsedArguments_ALL) - ADD_CUSTOM_TARGET(pofiles DEPENDS ${_gmoFiles}) + ADD_CUSTOM_TARGET(${uniqueTargetName} DEPENDS ${_gmoFiles}) ENDIF(_parsedArguments_ALL) + + ADD_DEPENDENCIES(pofiles ${uniqueTargetName}) + ENDFUNCTION(GETTEXT_PROCESS_PO_FILES) IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) --- Summary of changes: Modules/FindGettext.cmake | 48 1 files changed, 43 insertions(+), 5