Re: [CMake] --build-run-dir for CTest
Hi, Not sure if this helps, but here how I use the build dir: * in the top CMakeLists.txt I have this: set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}) * tests are added as (this is done in the CMakeLists.txt that where the sources for xxx1 are located, for example src/tests/xxx1/CMakeLists.txt): add_executable(xxx1 xxx1.cpp) add_test(xxx1 ${EXECUTABLE_OUTPUT_PATH}/xxx1) If I build the package in build/ (with cd build; cmake ..; make), I end up with xxx1 in the build/ dir (the intermediate object files are still located in build/src/tests/xxx1, just the final executable is stored under build/). With this scheme I was able to run unit-tests, do coverage and memory testing and publish the results on the public CDash server. Cheers, Ionutz On Mon, Jan 19, 2009 at 2:08 PM, Adolfo Rodríguez dof...@gmail.com wrote: Hi all, This is my first post to the list. My question, I believe, is the same one that Tron Thomas recently posted, and still remains unanswered in the list: What is the --build-run-dir for CTest supposed to do? I tried to use it to run a unit test from a specific directory and that did not work. How can someone specify the working directory for a unit test? Or stated otherwise, does CTest provide a mechanism for specifying the working directory of a test executable?, as opposed to what the add_test command specifies by default: The test will be run with the current working directory set to the CMakeList.txt files corresponding directory in the binary tree. I am using CMake/CTest 2.6 pathch 0, as distributed by OpenSUSE. Thanks in advance, Adolfo Rodríguez Tsouroukdissian ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to properly write a Module/PackageConfig.cmake file
Why not provide a pkg-config .pc file that can be used by your users? The syntax of .pc files is quite simple and your user can use pkg_check_module once the .pc is installed (or even use some some other build system that knows how to handle pkg-config, like autotools). Cheers, Ionutz On Mon, Nov 24, 2008 at 6:00 PM, Pablo Yanez Trujillo [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi I'm reading http://www.cmake.org/cmake/help/cmake2.6docs.html#command:find_package for the usage of FIND_PACKAGE, but I'm not interested in using the FIND_PACKAGE command but to write a Module so that anybody is able to use FIND_PACKAGE(myLib ...). I don't really unterstand what exactly is done by FIND_PACKAGE. The docu states that FIND_PACKAGES searches for FindmyLib.cmake and executes it. If the package is found then the variables myLib_FOUND is set. But who sets this variable? FIND_PACKAGE or FindmyLib.cmake? And how does FIND_PACKAGE know that a package was not found? My second question is: the simple signature is of FIND_PACKAGE is find_package(package [version] [EXACT] [QUIET] [[REQUIRED|COMPONENTS] [components...]]) How does FindmyLib.cmake get the version argument of the FIND_PACKAGE call? What is really the difference between FindmyLib.cmake and myLibConfig.cmake? When should I write the first one and when the second one? Or should I always write both? Thanks Pablo - -- Pablo Yanez Trujillo http://klingsor.informatik.uni-freiburg.de My public key: http://klingsor.informatik.uni-freiburg.de/gpg/supertux.asc -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkkqz6oACgkQDzf8xo+0xRVq0gCgptCb+qTUa7/4tgk60Iy1jfEc pNMAoIx3S4WF3B1UPBmjnlyx1JgzcEeH =8UHN -END PGP SIGNATURE- ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Output directory
I dump all my apps in the CMAKE_BUILD_DIR with: set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}) On Mon, Nov 24, 2008 at 6:23 PM, Robert Dailey [EMAIL PROTECTED] wrote: Is there a way to change what directory object files and executables/libraries are placed in? Thanks. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Convenience lib vs static library
Would it be possible to add support for libtool in a cmake module? I understand that this would be against cmake's policy of not depending on external apps, but it could be a transient solution until full fledged support for convenience libs is added into cmake. Has anybody already made such a libtool module for cmake? Cheers, Ionutz On Sun, Nov 23, 2008 at 11:04 AM, Andreas Pakulat [EMAIL PROTECTED] wrote: On 23.11.08 08:53:44, Ioan Calin Borcoman wrote: Isn't a static lib still better than nothing? I was thinking at the same thing this morning - why not use static libs and simply don't install them. I agree, this still has the problem of missing lib dependencies that you have to solve by hand (with convenience libs, if you have libB that depends on libA, you simply need to link with libB and the linker solves your dependencies automatically; with static libs I guess you'll need to link with -lB -lA), but I guess static libs could cover a vast number of cases where an autotools developer would use a convenience lib. Am I missing something? This is Ok for building an executable, but linking a static lib into a shared lib is completely unportable and not supported on all operating systems that cmake supports. Thats why its not done. Andreas -- Your life would be very empty if you had nothing to regret. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Complaint about if..endif
Does this apply to else(), too? And could you please update the man page? Thanx. Ionutz On Sat, Nov 22, 2008 at 7:53 AM, Philip Lowman [EMAIL PROTECTED] wrote: On Sat, Nov 22, 2008 at 12:17 AM, Robert Dailey [EMAIL PROTECTED] wrote: Hi, Why must endif() contain the same expression as the associated if() command? Isn't CMake smart enough to know that a simple occurrence of endif() simply matches the previous if(), regardless of its expression list? Are there any plans to simplify this? The way it is now is redundant and boilerplate. On CMake 2.6.x you no longer have to match the endif(). If you're still using CMake 2.4.x you can set CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS. http://www.vtk.org/Wiki/CMake_Useful_Variables -- Philip Lowman ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake won't clean generated files for Xcode
Hi, I've attached my CxxTest module, maybe you find them useful. It is creating the runned files under CMAKE_BUILD_DIR, so there is no CMAKE_SOURCE_DIR pollution (of course, this is useful only if you do out of source builds, but I guess all cmake users do that, right?). The module is based on what I've found on the CMake wiki page and assumes the CxxTest is located under ${CMAKE_SOURCE_DIR}/thirdparty/cxxtest. Cheers, Ionutz On Sun, Nov 23, 2008 at 3:31 AM, Tron Thomas [EMAIL PROTECTED] wrote: I am trying to configure a project with CMake that uses the CxxTest testing framework. CxxTest will generate source files that may be added into application that test the software. A macro has been written that will create custom commands for generated the needed source file. However, when I used CMake to create a Xcode project on Mac OS X, the clean process will not delete the files generated by CxxTest. This is true even when using the SET_DIRECTORY_PROPERTIES command with the ADDITIONAL_MAKE_CLEAN_FILES. What can be done so the Xcode will delete these files when necessary? ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake # # cxxtest # # ADD_CXXXTEST(RUNNERNAME TESTNAME [OTHER SOURCES]): # RUNNERNAME: name of the runner executable # TESTNAME: name of the test source # option( ENABLE_CXXTEST Check for CxxTest and compile sandbox apps that use CxxTest ON ) if( ENABLE_CXXTEST ) find_package(PythonInterp REQUIRED) set(CXXTEST_DIR ${CMAKE_SOURCE_DIR}/thirdparty/cxxtest) set(CXXTEST_INCLUDE_DIRS ${CXXTEST_DIR}) set(CXXTESTGEN ${CXXTEST_DIR}/cxxtestgen.py) macro(ADD_CXXTEST RUNNERNAME TESTNAME ARGN) message(STATUS adding cxxtest: ${EXECUTABLE_OUTPUT_PATH}/${RUNNERNAME}) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runner_${RUNNERNAME}.cpp COMMAND ${PYTHON_EXECUTABLE} ${CXXTESTGEN} --runner=ErrorPrinter -o ${CMAKE_CURRENT_BINARY_DIR}/runner_${RUNNERNAME}.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${TESTNAME} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${TESTNAME} ) add_executable(${RUNNERNAME} ${CMAKE_CURRENT_BINARY_DIR}/runner_${RUNNERNAME}.cpp ${ARGN} ) add_test(${RUNNERNAME} ${EXECUTABLE_OUTPUT_PATH}/${RUNNERNAME}) endmacro(ADD_CXXTEST) message(STATUS cxxtest enabled) else( ENABLE_CXXTEST ) message(STATUS cxxunit disabled) endif( ENABLE_CXXTEST ) ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Convenience lib vs static library
Isn't a static lib still better than nothing? I was thinking at the same thing this morning - why not use static libs and simply don't install them. I agree, this still has the problem of missing lib dependencies that you have to solve by hand (with convenience libs, if you have libB that depends on libA, you simply need to link with libB and the linker solves your dependencies automatically; with static libs I guess you'll need to link with -lB -lA), but I guess static libs could cover a vast number of cases where an autotools developer would use a convenience lib. Am I missing something? Ionutz On Sun, Nov 23, 2008 at 1:30 AM, Óscar Fuentes [EMAIL PROTECTED] wrote: Sean Soria [EMAIL PROTECTED] writes: cmake claims to not support convenience libraries. Isn't building a static library and then linking it into other libraries the same as a convenience library? A convenience library works as an object file at link time: it is included on the final executable as any other object file. A static library does not have this quality: the linker picks the library's contents only if there is something elsewhere that requires it (i.e. a reference to a symbol defined on some object file contained on the library). -- Oscar ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] set CPACK_SOURCE_PACKAGE_FILE_NAME when running make package_source
Works great. Good for learning new tricks, too ;-) Thanx. On Tue, Nov 11, 2008 at 6:05 PM, Eric NOULARD [EMAIL PROTECTED] wrote: Le Tue, 11 Nov 2008 17:55:03 +0200, Ioan Calin Borcoman [EMAIL PROTECTED] a écrit : Hi, Is it possible to change the CPACK_SOURCE_PACKAGE_FILE_NAME when I run make package_source? I don't know, but I decide to do it differently. I would like to set it to a value like foo-`date +%Y%m%d_%H%M`. Is it possible? I do use a custom made UsePackageBackup.cmake macro attached to this mail for the same need. If you add: INCLUDE(UsePackageBackup) after INCLUDE(CPack) in your main CMakeLists.txt then you will have new package_source_backup target which will create a dated source package file. The macro use TGZ generator but you may change this easily from within the UsePackageBackup.cmake -- Erk ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] set CPACK_SOURCE_PACKAGE_FILE_NAME when running make package_source
Hi, Is it possible to change the CPACK_SOURCE_PACKAGE_FILE_NAME when I run make package_source? I would like to set it to a value like foo-`date +%Y%m%d_%H%M`. Is it possible? Thanx Ionutz ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] CTest/CDash and git
Hi, Are there any plans to support git in CTest/CDash? Thanx, Ionutz ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CTest/CDash and git
This is cool :) On Sat, Nov 8, 2008 at 5:05 PM, Brad King [EMAIL PROTECTED] wrote: Ioan Calin Borcoman wrote: Hi, Are there any plans to support git in CTest/CDash? Yes: http://www.cmake.org/Bug/view.php?id=6994 I've been working on it on and off for a while. I'll update the above entry when something is ready. -Brad ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] cdash, gcov and cxxtest
Hi, While playing with cxxtest, gcov and cdash, I've discovered that cxxtest framework uses a lot of helper files and this screws the final code coverage. Is it possible to tell CDash or CTest to ignore some of the coverage data? Thanx, Ionutz ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] link_libraries
Hi, I have a dir with a lot of small example apps that all link with the same libs. The link_libraries is much more convenient in this case than writing a target_link_libraries line for each example target. Why is the link_libraries deprecated? Will it be removed in the future? Thanx. Ionutz ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] using gcov with cmake
Hi, I am trying to use gcov with cmake (I'm new to both gcov and cmake). My first attempt was like this: add_executable(hello main.cpp) set(CMAKE_CXX_FLAGS -fprofile-arcs -ftest-coverage) target_link_libraries(hello -fprofile-arcs) As recommended, I've created a build dir and did the compilation from there: $ cmake .. $ make $ ./hello The problem is that no coverage data was produced. Then I've changed the CMakeLists.txt to this: include(CTest) add_executable(hello main.cpp) add_test(hello_test ${EXECUTABLE_OUTPUT_PATH}/hello) add_definitions(-fprofile-arcs -ftest-coverage) target_link_libraries(hello -fprofile-arcs) Then run this from the build dir: $ cmake .. $ make $ make test $ make ExperimentalCoverage Now coverage worked and I've got the coverage output under build/Testing/CoverageInfo. If I run make Experimental all the above steps are run, but I don't understand very well if the results are really uploaded and if yes, where can I view them. On the console I get something like Drop site: http://public.kitware.com/cgi-bin/HTTPUploadDartFile.cgi Uploaded: ... Using HTTP trigger method Trigger site: http://public.kitware.com/cgi-bin/Submit-Random-TestingResults.cgi Dart server triggered... Submission successful Now my questions: 1. is this the way to do a code coverage? why no coverage is produced when I run the hello app? 2. is there a way to store and convert all the test/coverage/etc results normally uploaded to a dart server into a local directory for local browsing? 3. is there a better way to test/do coverage? Thanx, Ionutz ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake