From Matt.Bolger at csiro.au Mon Sep 1 01:17:39 2014 From: Matt.Bolger at csiro.au (Matt.Bolger at csiro.au) Date: Mon, 1 Sep 2014 05:17:39 +0000 Subject: [CMake] CPack RPM generator with @ characters in filename Message-ID: Hi, We're trying to package Qt as part of our app and the RPM generator doesn't like the '@' in some of the QML image file names (not that I blame it :)). I found some mention of this earlier this year http://www.cmake.org/pipermail/cmake/2014-March/057124.html. The simple example below (pointing to the Qt QML dir) shows the issue. I tried listing all the files individually with escape characters but it still ends up with @PROTECTED_AT@ in install_manifest.txt Is there any way around this and/or should a bug be raised for this? Thanks Matt CMakeLists.txt: cmake_minimum_required(VERSION 3.0.0) project(myqmlapp NONE) set(CPACK_PACKAGE_VERSION_MAJOR 0) set(CPACK_PACKAGE_VERSION_MINOR 1) set(CPACK_PACKAGE_VERSION_PATCH 0) find_path(CMAKE_EXECUTABLES_DIR cmake${CMAKE_EXECUTABLE_SUFFIX}) set(CMAKE_INSTALL_PREFIX "/opt/myqmlapp") set(CPACK_GENERATOR RPM) set(CPACK_RPM_PACKAGE_NAME "myqmlapp") set(CPACK_PACKAGE_FILE_NAME "myqmlapp") install(DIRECTORY "/home/builder/Qt/5.3/gcc_64/qml/" DESTINATION "qml") include(CPack) Result: File not found: /home/builder/BuildArea/cpack/_CPack_Packages/Linux/RPM/myqmlapp/usr/qml/QtQuick/Controls/Styles/Base/images/arrow-down at PROTECTED_AT@2x.png File not found: /home/builder/BuildArea/cpack/_CPack_Packages/Linux/RPM/myqmlapp/usr/qml/QtQuick/Controls/Styles/Base/images/arrow-right at PROTECTED_AT@2x.png File not found: /home/builder/BuildArea/cpack/_CPack_Packages/Linux/RPM/myqmlapp/usr/qml/QtQuick/Controls/Styles/Base/images/arrow-left at PROTECTED_AT@2x.png File not found: /home/builder/BuildArea/cpack/_CPack_Packages/Linux/RPM/myqmlapp/usr/qml/QtQuick/Controls/Styles/Base/images/arrow-up at PROTECTED_AT@2x.png File not found: /home/builder/BuildArea/cpack/_CPack_Packages/Linux/RPM/myqmlapp/usr/qml/QtQuick/Controls/Styles/Base/images/check at PROTECTED_AT@2x.png -------------- next part -------------- An HTML attachment was scrubbed... URL: From lode.leroy at gmail.com Mon Sep 1 03:55:09 2014 From: lode.leroy at gmail.com (Lode Leroy) Date: Mon, 1 Sep 2014 09:55:09 +0200 Subject: [CMake] long paths generated Message-ID: Hello cmake users, I'm trying to convert a big project from make to cmake, and I'm seeing paths like /home/lode/prj/test/cmake/ext/build/lib1/CMakeFiles/lib1.dir/home/lode/prj/test/cmake/ext/prj2/src where I would want to see /home/lode/prj/test/cmake/ext/build/lib1/CMakeFiles/lib1.dir/prj2/src ie. I do not want the base directory repeated in the generated paths. I can see that it's because of the "../" in the CMakeLists, but is there a way of preventing this? (I'll be building on windows, and the source dirs can have quite long names) I had hoped that "set(CMAKE_SOURCE_DIR /home/lode/prj/test/cmake/ext)" would do this for me, as all files I will be using are below this folder, but the "top-level-CMakeLists is not in the "top-level directory... The structure I am trying to implement is illustrated below. I have the following files: prj1/mak/CMakeLists.txt prj1/src/main1.c prj2/mak/CMakeLists.txt prj2/src/lib1.c with this content: ========== prj1/mak/CMakeLists.txt ========== add_subdirectory(../../prj2/mak lib1) link_libraries(lib1) add_executable(main1 ../src/main1.c) ========== prj1/src/main1.c ========== int main(int argc, char* argv[]) { f1(); } ========== prj2/mak/CMakeLists.txt ========== add_library(lib1 ../src/lib1.c) ========== prj2/src/lib1.c ========== int f1() { return 0; } ========== ========== now when building in "/home/lode/prj/test/cmake/ext" using cmake, as follows: mkdir build cd build cmake ../prj1/mak I get sub-directories that include the full path of the top of my source tree... find lib1 lib1/ lib1/CMakeFiles lib1/CMakeFiles/CMakeDirectoryInformation.cmake lib1/CMakeFiles/lib1.dir lib1/CMakeFiles/lib1.dir/build.make lib1/CMakeFiles/lib1.dir/cmake_clean.cmake lib1/CMakeFiles/lib1.dir/cmake_clean_target.cmake lib1/CMakeFiles/lib1.dir/depend.make lib1/CMakeFiles/lib1.dir/DependInfo.cmake lib1/CMakeFiles/lib1.dir/flags.make lib1/CMakeFiles/lib1.dir/home lib1/CMakeFiles/lib1.dir/home/lode lib1/CMakeFiles/lib1.dir/home/lode/prj lib1/CMakeFiles/lib1.dir/home/lode/prj/test lib1/CMakeFiles/lib1.dir/home/lode/prj/test/cmake lib1/CMakeFiles/lib1.dir/home/lode/prj/test/cmake/ext lib1/CMakeFiles/lib1.dir/home/lode/prj/test/cmake/ext/prj2 lib1/CMakeFiles/lib1.dir/home/lode/prj/test/cmake/ext/prj2/src lib1/CMakeFiles/lib1.dir/link.txt lib1/CMakeFiles/lib1.dir/progress.make lib1/CMakeFiles/progress.marks lib1/cmake_install.cmake lib1/Makefile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Andreas.Metz at hydrometer.de Mon Sep 1 07:06:39 2014 From: Andreas.Metz at hydrometer.de (Andreas.Metz at hydrometer.de) Date: Mon, 1 Sep 2014 13:06:39 +0200 Subject: [CMake] Merge "VS: Use full path to sources to allow deeper trees with VS >= 10" fix to release Message-ID: Hi CMakers, I was running into a "using to long path" issue with CMake. Here some short notes about my setup: OS: Windows 7 Dev: MS Visual Studio 10 CMake: 2.8.12 (tested it also with 3.0.1) In our project (it is based on the CIAO/TAO framework) some files will be generated automatically through an IDL compiler. Through that process the root of the project will be based on those generated files. Additional source files, placed in a complete other folder, will be referenced through relative paths to the project folder. The project itself consists of several subfolders and the length of the paths can go up to 100 letters (which should still be ok for CMake and Visual Studio) but through adding some file into another folder, the relative path description can grow up to more then 250 letters: (e.g. c:\path\to\current\dir\..\..\..\relative\path\to\source.c) As the project is already quite big, and the concept on how we store our files is not a thing we can change quite easily, I was looking if it is possible that CMake will generate always absolute paths. By default, CMake was not able to generate absolute paths, also the CMAKE_USE_RELATIVE_PATHES flag had no effect on my project. After some investigations I found out, that a solution was already submitted by the CMake dev team through the following change: http://cmake.org/gitweb?p=cmake.git;a=commit;h=0d048384694b7285ef739153757b57791d4ebb93 But it seems, that it did not make it into the release branches. My question is now, is there any reason why that fix, besides serval other changes to the "cmVisualStudio10TargetGenerator.cxx" did not made it into a new CMake release? After I found out, that a solution is already available I downloaded the nightly build binaries form the 1st of september and voila it worked. In addition CMake will print out a warning, that informs me that we have a path that is too long. Thats why I wanna ask you guys here, how I should proceed. Should I add a bug although a solution already exists? Kind regards, Andreas Bitte ?berlegen Sie, ob Sie diese Nachricht wirklich ausdrucken m?ssen/ before printing, think about environmental responsibility. Hydrometer GmbH, Industriestra?e 13, 91522 Ansbach Telefon + 49 981 1806 0, Telefax +49 981 1806 615 Sitz der Gesellschaft: Ansbach, Registergericht: Ansbach HRB 69 Gesch?ftsf?hrer: Frank Gutzeit (Sprecher), Dr.-Ing. Robert Westphal, Thomas Gastner, Adam Mechel Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enth?lt vertrauliche und/oder rechtlich gesch?tzte Informationen. Informieren Sie uns bitte, wenn Sie diese E-Mail f?lschlicherweise erhalten haben. Bitte l?schen Sie in diesem Fall die Nachricht. Jede unerlaubte Form der Reproduktion, Bekanntgabe, ?nderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt. The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Theodore.Papadopoulo at inria.fr Mon Sep 1 12:37:49 2014 From: Theodore.Papadopoulo at inria.fr (Theodore Papadopoulo) Date: Mon, 01 Sep 2014 18:37:49 +0200 Subject: [CMake] CPack and file checks... Message-ID: <5404A0DD.6010803@inria.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm a little bit annoyed by the following lines in CPack.cmake (2.8.12): macro(cpack_check_file_exists file description) if(NOT EXISTS "${file}") message(SEND_ERROR "CPack ${description} file: \"${file}\" could not be found.") endif() endmacro() cpack_check_file_exists("${CPACK_PACKAGE_DESCRIPTION_FILE}" "package description") cpack_check_file_exists("${CPACK_RESOURCE_FILE_LICENSE}" "license resource") cpack_check_file_exists("${CPACK_RESOURCE_FILE_README}" "readme resource") cpack_check_file_exists("${CPACK_RESOURCE_FILE_WELCOME}" "welcome resource") I'm in a configuration where these files are not available at configure time (a super-project and the files are in sub-projects). While I appreciate the fact that errors are raised as early as possible, here it becomes a blocker as I have no simple way to disable this test. I's argue that these tests should really happen at cpack time not at configure time... or at least one should have a way to disable them. In the meantime, my only solution is to touch some dummy files and to overwrite them later, unless someone has a cleaner solution... Thank's Theo. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlQEoN0ACgkQEr8WrU8nPV17DgCeKh1BoeGsrLYAfrLdcpWqj4pW 6ugAn3NSHqOmRmqO5SJz5N/U4OfusFSe =jNTa -----END PGP SIGNATURE----- From dlrdave at aol.com Mon Sep 1 15:33:22 2014 From: dlrdave at aol.com (David Cole) Date: Mon, 1 Sep 2014 15:33:22 -0400 Subject: [CMake] Merge "VS: Use full path to sources to allow deeper trees with VS >= 10" fix to release In-Reply-To: References: Message-ID: <8D19432BA0C964A-1284-183DA@webmail-vm008.sysops.aol.com> No need to add a bug for this... it's fixed already in 'master' -- that means it will automatically appear in the next major release of CMake. The current release is 3.0.1, and any critical bug fixes going into CMake for a patch release will appear in 3.0.2, 3.0.3, and so on. (This particular fix, however, is not slated for a 3.0.x patch release...) The next major release will likely be CMake 3.1 -- and the fix you've found will be in that release automatically, as it will be based on 'master' when it is created. HTH, David C. From chuck.atkins at kitware.com Mon Sep 1 16:09:57 2014 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Mon, 1 Sep 2014 16:09:57 -0400 Subject: [CMake] Merge "VS: Use full path to sources to allow deeper trees with VS >= 10" fix to release In-Reply-To: <8D19432BA0C964A-1284-183DA@webmail-vm008.sysops.aol.com> References: <8D19432BA0C964A-1284-183DA@webmail-vm008.sysops.aol.com> Message-ID: > > The next major release will likely be CMake 3.1 -- and the fix you've > found will be in that release automatically, as it will be based on > 'master' when it is created. > > Related, it should also include support for extended length paths at the cmake level. This converts paths to the special \\?\D:\foo1\...\foo90\...\fooetc.\bar syntax for cmake filesystem commands like rmdir, delete, etc., which lets Windows operate on paths up to 32k in length. It's yet to be tested though as to whether or not the extended length path syntax can work inside generators. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dank at kegel.com Mon Sep 1 16:22:05 2014 From: dank at kegel.com (Dan Kegel) Date: Mon, 1 Sep 2014 13:22:05 -0700 Subject: [CMake] cmake gives poor warning on missing double-quote? Message-ID: If you leave off a doublequote somewhere, you will get confusing messages like "CMake Warning (dev) in CMakeLists.txt: Syntax Warning in cmake code at /home/joe/foo/CMakeLists.txt:66:79 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it." on every following line that uses a double quote. Seems like this situation could be improved. (Checked with both 2.8.11 and 3.0.1.) From Matt.Bolger at csiro.au Mon Sep 1 23:52:29 2014 From: Matt.Bolger at csiro.au (Matt.Bolger at csiro.au) Date: Tue, 2 Sep 2014 03:52:29 +0000 Subject: [CMake] CPack RPM generator with @ characters in filename In-Reply-To: References: Message-ID: After a little more looking around in the bug tracker I see there is already an open issue for this. http://www.cmake.org/Bug/view.php?id=14782 Removing the PROTECTED_AT change to CPackRPM.cmake provides a work around for now. Thanks Matt From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Matt.Bolger at csiro.au Sent: Monday, 1 September 2014 3:18 PM To: cmake at cmake.org Subject: [ExternalEmail] [CMake] CPack RPM generator with @ characters in filename Hi, We're trying to package Qt as part of our app and the RPM generator doesn't like the '@' in some of the QML image file names (not that I blame it :)). I found some mention of this earlier this year http://www.cmake.org/pipermail/cmake/2014-March/057124.html. The simple example below (pointing to the Qt QML dir) shows the issue. I tried listing all the files individually with escape characters but it still ends up with @PROTECTED_AT@ in install_manifest.txt Is there any way around this and/or should a bug be raised for this? Thanks Matt CMakeLists.txt: cmake_minimum_required(VERSION 3.0.0) project(myqmlapp NONE) set(CPACK_PACKAGE_VERSION_MAJOR 0) set(CPACK_PACKAGE_VERSION_MINOR 1) set(CPACK_PACKAGE_VERSION_PATCH 0) find_path(CMAKE_EXECUTABLES_DIR cmake${CMAKE_EXECUTABLE_SUFFIX}) set(CMAKE_INSTALL_PREFIX "/opt/myqmlapp") set(CPACK_GENERATOR RPM) set(CPACK_RPM_PACKAGE_NAME "myqmlapp") set(CPACK_PACKAGE_FILE_NAME "myqmlapp") install(DIRECTORY "/home/builder/Qt/5.3/gcc_64/qml/" DESTINATION "qml") include(CPack) Result: File not found: /home/builder/BuildArea/cpack/_CPack_Packages/Linux/RPM/myqmlapp/usr/qml/QtQuick/Controls/Styles/Base/images/arrow-down at PROTECTED_AT@2x.png File not found: /home/builder/BuildArea/cpack/_CPack_Packages/Linux/RPM/myqmlapp/usr/qml/QtQuick/Controls/Styles/Base/images/arrow-right at PROTECTED_AT@2x.png File not found: /home/builder/BuildArea/cpack/_CPack_Packages/Linux/RPM/myqmlapp/usr/qml/QtQuick/Controls/Styles/Base/images/arrow-left at PROTECTED_AT@2x.png File not found: /home/builder/BuildArea/cpack/_CPack_Packages/Linux/RPM/myqmlapp/usr/qml/QtQuick/Controls/Styles/Base/images/arrow-up at PROTECTED_AT@2x.png File not found: /home/builder/BuildArea/cpack/_CPack_Packages/Linux/RPM/myqmlapp/usr/qml/QtQuick/Controls/Styles/Base/images/check at PROTECTED_AT@2x.png -------------- next part -------------- An HTML attachment was scrubbed... URL: From jzakrzewski at e2e.ch Tue Sep 2 03:29:20 2014 From: jzakrzewski at e2e.ch (Jakub Zakrzewski) Date: Tue, 2 Sep 2014 07:29:20 +0000 Subject: [CMake] cmake gives poor warning on missing double-quote? In-Reply-To: References: Message-ID: Hi, I don't think there's anything that can be done about it. CMake supports multi-line strings, what means that the parser cannot detect missing quote right away. In theory on such error the parser can be made to go back to opening quote and analyze the string to give a suggestion, but this is complicated. Just take a look: set(MY_VAR "value) set(ANOTHER "other") For a human it's clear that, unless someone intentionally obfuscates the code, there's a double quote missing. But the parser sees it like this: set(MY_VAR "value)\nset(ANOTHER "other") Because string would not be analyzed: set(MY_VAR "whatever"other") And this corresponds directly to the error message: there's no space after what appears to be a closing quote. -- Gruesse, Jakub -----Original Message----- From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Dan Kegel Sent: Montag, 1. September 2014 22:22 To: cmake Subject: [CMake] cmake gives poor warning on missing double-quote? If you leave off a doublequote somewhere, you will get confusing messages like "CMake Warning (dev) in CMakeLists.txt: Syntax Warning in cmake code at /home/joe/foo/CMakeLists.txt:66:79 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it." on every following line that uses a double quote. Seems like this situation could be improved. (Checked with both 2.8.11 and 3.0.1.) -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake From dlrdave at aol.com Tue Sep 2 06:31:25 2014 From: dlrdave at aol.com (David Cole) Date: Tue, 2 Sep 2014 06:31:25 -0400 Subject: [CMake] cmake gives poor warning on missing double-quote? In-Reply-To: References: Message-ID: <8D194B02E7084BA-15CC-6C6@webmail-m269.sysops.aol.com> Yes, but the warning text could certainly mention a missing closing quote as a possible cause, and it could also avoid repeating itself infinitely... The first occurence should be enough to pinpoint the problem upon investigation. Presumably, Dan, this was followed by an error of some sort as well...? I imagine this would be a tough one to figure out if there were not an error after the warning. Thanks for the report. Anybody perusing the list have a patch suggestion to deal with this? David C. From dank at kegel.com Tue Sep 2 17:06:33 2014 From: dank at kegel.com (Dan Kegel) Date: Tue, 2 Sep 2014 14:06:33 -0700 Subject: [CMake] Fun with lists and execute_process Message-ID: http://www.cmake.org/Wiki/CMake/Language_Syntax does explain about semicolons, strings, and lists, but the consequences are still kind of surprising. Newbies like me have to write little programs to feel our way towards an understanding of what works. For example, I wanted to pass a space-separated list of things as a single argument to an external program, and I didn't get what was going on until I wrote a tiny program to explore the problem in isolation. Here it is, on the off chance some other newbie will dredge it up in a search and find it useful. cmake_minimum_required(VERSION 2.8.11) project(blah) # foo.pl is the single line # print STDERR "args are: ".join(',', at ARGV)."\n"; function(foo) execute_process(COMMAND perl foo.pl ${ARGN}) endfunction() # Works; passes two arguments foo( --libs "foo.a bar.a" ) set(LIBS foo.a) list(APPEND LIBS bar.a) # Fails; passes three arguments, despite the quotes foo( --libs "${LIBS}" ) STRING(REGEX REPLACE ";" " " XLIBS "${LIBS}" ) # Works; passes two arguments foo( --libs "${XLIBS}" ) From karsten at bolding-burchard.com Wed Sep 3 04:12:21 2014 From: karsten at bolding-burchard.com (Karsten Bolding) Date: Wed, 3 Sep 2014 10:12:21 +0200 Subject: [CMake] includes_Fortran.rsp not used Message-ID: Hello I'm trying to cross-compile a Fortran program using mingw32-w64 on Linux. I need to link to NetCDF and during the cmake process the following file is generated: CMakeFiles/output.dir/includes_Fortran.rsp with the following content: -I/home/kb/build/gotm/i686-w64-mingw32-gfortran -I/home/kb/GOTM/gotm-git/src/../ include -I/home/kb/GOTM/gotm-git/src/util -I/home/kb/build/gotm/i686-w64-mingw32 -gfortran/modules -I/home/kb/mingw32-w64/4.8/i686/include This looks OK but when I do the compilation with VERBOSE=1 I get: [ 90%] Building Fortran object CMakeFiles/output.dir/output/ncdfout.F90.o /usr/bin/i686-w64-mingw32-gfortran -DFORTRAN95 -DNETCDF_FMT -DREAL_4B="real(4)" -D_FABM_ -static -ffree-line-length-none -O3 @CMakeFiles/output.dir/includes_Fortran.rsp -c /home/kb/GOTM/gotm-git/src/output/ncdfout.F90 -o CMakeFiles/output.dir/output/ncdfout.F90.o i.e. the include_Fortran.rsp is listed on the command line but does not seem to be used: Any ideas what is wrong? When I do a straight Linux compile (gfortran or ifort) no includes_Fortran.rsp is generated. Karsten -------------- next part -------------- An HTML attachment was scrubbed... URL: From yanbzhu at cisco.com Wed Sep 3 11:10:02 2014 From: yanbzhu at cisco.com (Yanbo Zhu (yanbzhu)) Date: Wed, 3 Sep 2014 15:10:02 +0000 Subject: [CMake] Remove Source Suffix from Object In-Reply-To: References: Message-ID: Environment: Centos 64bit Question is: Currently, the makefiles generated by cmake generate object files that contains the source suffix (.c, .cpp), for example do_stuff.c gets compiled to do_stuff.c.o. How do I change it so that cmake generates makefiles that generates do_stuff.o (without the .c) Some Background: I?m trying to set up a project to generate code coverage. The issue I?m running into now is that the .gcno and .gcda files that are generated at compile and runtime contain the source file suffixes. For Example: Cmake generates a makefile to compile do_stuff.c. When I run make, it generates do_stuff.c.o. This then generates do_stuff.c.gcno. When I run the unit test, it generates do_stuff.c.gcda. On the surface, this isn?t a problem. However, we are using cobertura, which uses gcov, which assumes that the the coverage file names do not contain the suffix. That is, it wants do_stuff.gcda and do_stuff.gcno. By default, gcovr cannot find any coverage or run files, and so the code coverage is broken. If I manually run the compile command and set the ?o to do_stuff.o (as opposed to do_stuff.c.o) it all works as expected. I can think of some linux script hacks that I can run to do all sorts of softlink magic to get it to work, but ideally I?d like to fix this within cmake. Thank you, -Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From rjvbertin at gmail.com Wed Sep 3 13:37:30 2014 From: rjvbertin at gmail.com (=?ISO-8859-1?Q?Ren=E9_J=2EV=2E?= Bertin) Date: Wed, 03 Sep 2014 19:37:30 +0200 Subject: [CMake] how to define global compiler flags that are inserted before user-defined flags? Message-ID: <2812308.uVWPNuUYvL@portia.local> I was referred here from http://public.kitware.com/Bug/view.php?id=15127 ... so here goes: KDE defines a number of compiler options that are (supposedly) required but that include optimisation options. These settings are defined in system-wide .cmake files like FindKDE4Internal.cmake and get applied *after* user-specified settings have been applied. They even seem to override tweaks made directly in CMakeCache.txt (to CMAKE_CXX_FLAGS_RELEASE or _RELWITHDEBINFO). Even if user-specified compiler flags do make it to the list in the generated *.make files, the KDE/system-defined options are *appended* to the list, causing -O2 to override -O3 or -g -g3. Is it possible to specify the KDE/system options in such a way that they appear at the start of the options list in the *.make files? With user-defined I mean specified on the commandline, through the environment, or (even) by editing CMakeCache.txt . I raised an issue about this on bugs.kde.org, but it could be constructive to be able to propose a solution/alternative (and I guess the real experts are here, not on kde.org ;) ). Regards, Ren? Bertin From mike.jackson at bluequartz.net Wed Sep 3 15:31:16 2014 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Wed, 3 Sep 2014 15:31:16 -0400 Subject: [CMake] Ctest building with Multiple Processors Message-ID: I am exploring CTest/CDash with out project and I was trying to figure out how to have CTest use all my cores for builds. So far no luck with some snippets from Google. So far I have the following in a file called CTestConfig.cmake at the top level of my project. set(CTEST_PROJECT_NAME "DREAM3D") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "my.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=DREAM3D") set(CTEST_DROP_SITE_CDASH TRUE) # Use multiple CPU cores to build include(ProcessorCount) ProcessorCount(N) if(NOT N EQUAL 0) if(NOT WIN32) set(CTEST_BUILD_FLAGS "-j${N}") endif(NOT WIN32) set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) endif() And then I execute CTest like this from my terminal ctest -D Experimental but monitoring my processors says that only a single processor is being used. Thanks for any help --- Mike Jackson www.bluequartz.net From fungos at gmail.com Wed Sep 3 17:14:46 2014 From: fungos at gmail.com (fungos) Date: Wed, 3 Sep 2014 17:14:46 -0400 Subject: [CMake] Problem creating a Platform with Unix Makefiles (on windows) Message-ID: Hello, I'm trying to create a new platform (closed for game dev) and I got it working with Ninja generator, but when I try to use Unix Makefiles generator it will give the output at and of the email. Yup, Unix Makefiles on Windows, that is correct and it works if I use toolchain overrides in the CMakeLists.txt but not as a Platform.cmake via set(CMAKE_SYSTEM_NAME ...). For some reason it will overwrite my compiler settings after "Configuring done" and set as NOTFOUND. Any hints? ps. the set(CMAKE_SYSTEM_NAME myPlatform) is before everything and is working with Ninja generator. ps2. also, I've added this to the platform file: set(CMAKE_C_COMPILER_FORCED TRUE) set(CMAKE_CXX_COMPILER_FORCED TRUE) (and correctly setup every other toolchain variable) Thank you, Danny Error: The C compiler identification is unknown The CXX compiler identification is unknown Check for working C compiler: mwcceppc.exe Check for working C compiler: mwcceppc.exe -- works Detecting C compiler ABI info Detecting C compiler ABI info - failed Check for working CXX compiler: mwcceppc.exe Check for working CXX compiler: mwcceppc.exe -- works Detecting CXX compiler ABI info Detecting CXX compiler ABI info - failed Configuring done You have changed variables that require your cache to be deleted. Configure will be re-run and you may have to reset some variables. The following variables have changed: CMAKE_C_COMPILER= CMAKE_C_COMPILER-NOTFOUND CMAKE_CXX_COMPILER= CMAKE_CXX_COMPILER-NOTFOUND CMake Error at C:/cmake/share/cmake-3.0/Modules/CMakeDetermineCCompiler.cmake:57 (message): Could not find compiler set in environment variable CC: CMAKE_C_COMPILER-NOTFOUND. Call Stack (most recent call first): CMakeLists.txt:13 (project) CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKE_C_COMPILER_ENV_VAR CMake Error: Could not find cmake module file: C:/TempBuild/CMakeFiles/3.0.20140901-g19b17/CMakeCCompiler.cmake CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKE_CXX_COMPILER_ENV_VAR CMake Error: Could not find cmake module file: C:/TempBuild/CMakeFiles/3.0.20140901-g19b17/CMakeCXXCompiler.cmake CMake Error at CMakeLists.txt:13 (project): No CMAKE_C_COMPILER could be found. Tell CMake where to find the compiler by setting the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH. CMake Error at CMakeLists.txt:13 (project): No CMAKE_CXX_COMPILER could be found. Tell CMake where to find the compiler by setting the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH. Configuring incomplete, errors occurred! See also "C:/TempBuild/CMakeFiles/CMakeOutput.log". -------------- next part -------------- An HTML attachment was scrubbed... URL: From saadrustam at gmail.com Wed Sep 3 18:09:37 2014 From: saadrustam at gmail.com (Saad Khattak) Date: Wed, 3 Sep 2014 18:09:37 -0400 Subject: [CMake] Visual Studio 2013 warning MSB8028 Message-ID: I have a solution with multiple projects including a CMake INSTALL project for installing the binaries. With CMake Version 3.0 I am receiving the following warning for each of my projects in the solution: "warning MSB8028: The intermediate directory (myProject.dir\Debug\) contains files shared from another project (myProject.vcxproj). This can lead to incorrect clean and rebuild behavior." where myProject is replaced by the name of each of the projects in the solution. Previous cmake versions did not produce this warning with VS 2013. I am not sure how to resolve this warning as the recommended fix is to ensure that the "Intermediate Directory" variable for each project is unique. As far as I can tell, it is indeed unique. I could not find any topics with respect to this warning and CMake. Appreciate any help regarding this behaviour. If it is deemed a bug, then I will file a bug report. - Saad -------------- next part -------------- An HTML attachment was scrubbed... URL: From dearvoid at gmail.com Thu Sep 4 01:01:20 2014 From: dearvoid at gmail.com (Clark Wang) Date: Thu, 4 Sep 2014 13:01:20 +0800 Subject: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ... Message-ID: Hi, I don't understand why the following code would not print "true" (tested with cmake-3.0): set(a b) set(b c) if(a STREQUAL b OR a STREQUAL c) message("true") endif() >From my understanding, no matter how magic the if command interprets its arguments, one of the expressions (a STREQUAL b) and (a STREQUAL c) must be true but I'm wrong. Anyone has a reasonable explanation? Thanks. -clark -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuck.atkins at kitware.com Thu Sep 4 01:36:23 2014 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Thu, 4 Sep 2014 01:36:23 -0400 Subject: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ... In-Reply-To: References: Message-ID: Hi Clark The expression inside the if statement has it's variables dereferenced before evaluating and the non-variables are treated as constant expressions. In this case, a resolves to "b", b resolves to "c", and c is not a variable so it's treated as the constant expression "c". Thus if(a STREQUAL b OR a STREQUAL c) gets evaluated as if( ("b" STREQUAL "c") OR ("b" STREQUAL "c") ) which is clearly false. Hope that helps. - Chuck -------------- next part -------------- An HTML attachment was scrubbed... URL: From dearvoid at gmail.com Thu Sep 4 01:44:20 2014 From: dearvoid at gmail.com (Clark Wang) Date: Thu, 4 Sep 2014 13:44:20 +0800 Subject: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ... In-Reply-To: References: Message-ID: On Thu, Sep 4, 2014 at 1:36 PM, Chuck Atkins wrote: > Hi Clark > > The expression inside the if statement has it's variables dereferenced > before evaluating and the non-variables are treated as constant > expressions. In this case, a resolves to "b", b resolves to "c", and c is > not a variable so it's treated as the constant expression "c". Thus > > > if(a STREQUAL b OR a STREQUAL c) > > gets evaluated as > > if( ("b" STREQUAL "c") OR ("b" STREQUAL "c") ) > Thanks a lot. It's clear now. But is there a way to check if the value of the variable a equals to "b" or "c"? -clark > > which is clearly false. Hope that helps. > > - Chuck > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dearvoid at gmail.com Thu Sep 4 01:58:14 2014 From: dearvoid at gmail.com (Clark Wang) Date: Thu, 4 Sep 2014 13:58:14 +0800 Subject: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ... In-Reply-To: References: Message-ID: On Thu, Sep 4, 2014 at 1:44 PM, Clark Wang wrote: > On Thu, Sep 4, 2014 at 1:36 PM, Chuck Atkins > wrote: > >> Hi Clark >> >> The expression inside the if statement has it's variables dereferenced >> before evaluating and the non-variables are treated as constant >> expressions. In this case, a resolves to "b", b resolves to "c", and c is >> not a variable so it's treated as the constant expression "c". Thus >> >> >> if(a STREQUAL b OR a STREQUAL c) >> >> gets evaluated as >> >> if( ("b" STREQUAL "c") OR ("b" STREQUAL "c") ) >> > > Thanks a lot. It's clear now. But is there a way to check if the value of > the variable a equals to "b" or "c"? > Found http://stackoverflow.com/questions/19982340/cmake-compare-to-empty-string-with-strequal-failed which suggests to use if(a MATCHES "^b$"). -clark > > -clark > >> >> which is clearly false. Hope that helps. >> >> - Chuck >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuck.atkins at kitware.com Thu Sep 4 02:00:46 2014 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Thu, 4 Sep 2014 02:00:46 -0400 Subject: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ... In-Reply-To: References: Message-ID: > But is there a way to check if the value of the variable a equals to "b" or "c"? Directly: if(a STREQUAL "b" OR a STREQUAL "c") But its a bit clumsy. Better would be to match a regex: if(a MATCHES "^(b|c)$") -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Thu Sep 4 02:31:40 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Thu, 04 Sep 2014 08:31:40 +0200 Subject: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ... In-Reply-To: References: Message-ID: <5408074C.1020800@gmail.com> On 09/04/2014 08:00 AM, Chuck Atkins wrote: > > But is there a way to check if the value of the variable a equals to > "b" or "c"? > > Directly: > if(a STREQUAL "b" OR a STREQUAL "c") b is dereferenced as a variable even if it is quoted. Nils From ruslan_baratov at yahoo.com Thu Sep 4 05:08:19 2014 From: ruslan_baratov at yahoo.com (Ruslan Baratov) Date: Thu, 04 Sep 2014 13:08:19 +0400 Subject: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ... In-Reply-To: References: Message-ID: <54082C03.4030606@yahoo.com> On 04-Sep-14 09:58, Clark Wang wrote: > On Thu, Sep 4, 2014 at 1:44 PM, Clark Wang > wrote: > > On Thu, Sep 4, 2014 at 1:36 PM, Chuck Atkins > > wrote: > > Hi Clark > > The expression inside the if statement has it's variables > dereferenced before evaluating and the non-variables are > treated as constant expressions. In this case, a resolves to > "b", b resolves to "c", and c is not a variable so it's > treated as the constant expression "c". Thus > > > if(a STREQUAL b OR a STREQUAL c) > > gets evaluated as > > if( ("b" STREQUAL "c") OR ("b" STREQUAL "c") ) > > > Thanks a lot. It's clear now. But is there a way to check if the > value of the variable a equals to "b" or "c"? > > > Found > http://stackoverflow.com/questions/19982340/cmake-compare-to-empty-string-with-strequal-failed > which suggests to use if(a MATCHES "^b$"). The core of the problem is that command "if(... STREQUAL ...)" has ambiguous syntax ``. So the result depends on what the left/right side is (if variable -> use variable value, if not, use string as-is). Command `if(a MATCHES ...)` has the same flaw: `if( MATCHES regex)`: # MYSTRING undefined if(MYSTRING MATCHES "^MYSTRING$") # go here even MYSTRING is not defined (string "MYSTRING" used) endif() set(MYSTRING "B") set(A "MYSTRING") if("${A}" MATCHES "^MYSTRING$") # do *not* go here even A is MYSTRING (use *variable* MYSTRING) endif() One of the solution that doesn't suffer from ambiguity is `string(COMPARE EQUAL )`: string(COMPARE EQUAL "${MYSTRING}" "MYSTRING" is_equal) if(is_equal) # only if MYSTRING defined and is "MYSTRING" endif() string(COMPARE EQUAL "${A}" "MYSTRING" is_equal) if(is_equal) # only if A defined and is a string "MYSTRING" (works even if MYSTRING variable defined) endif() -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Thu Sep 4 05:09:42 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Thu, 04 Sep 2014 11:09:42 +0200 Subject: [CMake] building from source - manpages? In-Reply-To: <1594581.bqkbeo01Ss@patux> References: <1594581.bqkbeo01Ss@patux> Message-ID: <54082C56.6080508@gmail.com> On 09/04/2014 10:52 AM, Ren? J.V. Bertin wrote: > I'm trying to whip up an Ubuntu PPA for the latest release. I've gotten to the point where the package builder wants to bundle the manpages, but cannot find them. Is there a build dependency for generating these that I'm missing? Since 3.0 CMake uses the sphinx documentation generator. On Ubuntu the package is called "python-sphinx". If you are using the bootstrap script for the build I think you need to also pass --sphinx-man . If you are using cmake to build cmake instead you need -DSPHINX_MAN=ON . Nils From norulez at me.com Thu Sep 4 04:36:00 2014 From: norulez at me.com (NoRulez) Date: Thu, 04 Sep 2014 10:36:00 +0200 Subject: [CMake] [Cdash] Show results from the bullseye coverage in CDash In-Reply-To: <8D16E2C3F70CAF6-F70-18DF8@webmail-vm070.sysops.aol.com> References: <8D16E2C3F70CAF6-F70-18DF8@webmail-vm070.sysops.aol.com> Message-ID: <18944E47-25C3-4A78-B0B0-7BAF9FFA97C0@me.com> Ok then what could be the problem? It also shows 0% coverage sometimes. With bullshtml on the other hand the output seems to be ok. Best Regards Am 15.07.2014 um 12:11 schrieb David Cole : >>> There is an option (which should be on by default) in the >>> "Miscellaneous" section of the project settings, which is >>> called: "Show coverage code". > >> Thanks, this solves the problem. The option wasn't checked. > > The option should be *OFF* by default. > > If the intent is not to show your code (because it's private, for > example), then having it OFF is the safe default. Having it OFF by > default and making a mistake results in emails like this... along with > a quick and easy solution to the problem. Having it ON by default and > making a mistake would result in the loss of privacy, which is by far a > worse consequence, with no solution whatsoever. Please keep the default > value *OFF*. > > > Thanks, > David C. > > From dlrdave at aol.com Thu Sep 4 06:17:06 2014 From: dlrdave at aol.com (David Cole) Date: Thu, 4 Sep 2014 06:17:06 -0400 Subject: [CMake] [Cdash] Show results from the bullseye coverage in CDash Message-ID: <8D1964083604EC0-15CC-11EB0@webmail-m269.sysops.aol.com> Sometimes an unfortunate network interruption (even a very brief one, at just the wrong time...) can cause my bullseye dashboards to report "0%" coverage. I use the license manager for Bullseye, so the build machine needs network access to the license manager machine when turning coverage on and off with the "cov01" Bullseye tool. If there is no network access at "call cov01 -1" time, then trying to turn on coverage measurement cannot succeed, and the result is a coverage build without any coverage data: 0%. You can probably tell if this is happening to you or not by paying attention to the return value of cov01. I suspect it returns an error code in this condition, but my scripts just ignore it and continue with the build anyhow. HTH, David C. From sklist at kitterman.com Thu Sep 4 07:23:48 2014 From: sklist at kitterman.com (Scott Kitterman) Date: Thu, 04 Sep 2014 07:23:48 -0400 Subject: [CMake] building from source - manpages? In-Reply-To: <1619963.JKmBa1v8pl@patux> References: <1594581.bqkbeo01Ss@patux> <54082C56.6080508@gmail.com> <1619963.JKmBa1v8pl@patux> Message-ID: <7968427.sjCkOTRdGq@scott-latitude-e6320> On Thursday, September 04, 2014 13:06:50 Ren? J.V. Bertin wrote: > On Thursday September 04 2014 11:09:42 Nils Gladitz wrote: > >If you are using the bootstrap script for the build I think you need to > >also pass --sphinx-man . > > > >If you are using cmake to build cmake instead you need -DSPHINX_MAN=ON . > > Thanks, that did the trick. Of course I immediately bumped into another file > that got moved and thus not found during the package generation. Immediate > being a very relative term ... after a full rebuild and running all tests. > > Not really the place to ask, but surely there must be a way to adapt those > debian/*.install files without having to go through a whole rebuild for > each change? Include -nc (no clean) in your dpkg-buildpackage invocation (which you might be doing indirectly via another tool like debuild) and the clean rule will be skipped so the build picks back up ~where it left off. Scott K From chuck.atkins at kitware.com Thu Sep 4 08:48:14 2014 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Thu, 4 Sep 2014 08:48:14 -0400 Subject: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ... In-Reply-To: <54082C03.4030606@yahoo.com> References: <54082C03.4030606@yahoo.com> Message-ID: > Command `if(a MATCHES ...)` has the same flaw: `if( > MATCHES regex)`: > .. > set(MYSTRING "B") > set(A "MYSTRING") > if("${A}" MATCHES "^MYSTRING$") > # do *not* go here even A is MYSTRING (use *variable* MYSTRING) > endif() > This should work without dereferencing A, i.e.: if(A MATCHES "^MYSTRING$") # Bingo endif() -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruslan_baratov at yahoo.com Thu Sep 4 09:25:21 2014 From: ruslan_baratov at yahoo.com (Ruslan Baratov) Date: Thu, 04 Sep 2014 17:25:21 +0400 Subject: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ... In-Reply-To: References: <54082C03.4030606@yahoo.com> Message-ID: <54086841.5080403@yahoo.com> On 04-Sep-14 16:48, Chuck Atkins wrote: > > Command `if(a MATCHES ...)` has the same flaw: > `if( MATCHES regex)`: > .. > set(MYSTRING "B") > set(A "MYSTRING") > if("${A}" MATCHES "^MYSTRING$") > # do *not* go here even A is MYSTRING (use *variable* MYSTRING) > endif() > > > This should work without dereferencing A, i.e.: > > if(A MATCHES "^MYSTRING$") > # Bingo > endif() Yes, but what if you need to combine some values, like: `if("${A}-${B}" MATCHES ...)`? Note that `if(A MATCHES "first-part" AND B MATCHES "second-part")` is not the solutions in some cases, for example: if("${A}${B}" MATCHES "/home/my/dir-A/") should work for both A,B = {"/home/", "my/dir-A/"} and {"/home/my/", "dir-A/"} Also you always need keep in mind that it's not a string, but a regular expression, example: set(A "path/to/test/project") set(B "path/to/test.project") message("A and B same dir?") if(A MATCHES "^${B}$") message("surprise") endif() -------------- next part -------------- An HTML attachment was scrubbed... URL: From andlind at gmail.com Thu Sep 4 10:09:08 2014 From: andlind at gmail.com (Anders Lindgren) Date: Thu, 4 Sep 2014 16:09:08 +0200 Subject: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ... In-Reply-To: References: Message-ID: As other has pointed out, this is caused by "if" interpreting its arguments as variables, if there is a variable with that name, and quoting the value don't help. However, by embedded both argument in some extra text, you can make sure that the argument don't form a valid variable name. To apply this idea to your original example: set(a b) set(b c) if(">${a}<" STREQUAL ">b<" OR ">${a}<" STREQUAL ">c<") message("true") endif() Another thing you can do to ensure that you don't fall into this trap is to use distinct variable names. I.e. use variable names that don't naturally occur in other situations in you CMakeLists:s. In your example "b" is used both as the name of a variable and as a value. -- Anders Lindgren On Thu, Sep 4, 2014 at 7:01 AM, Clark Wang wrote: > Hi, > > I don't understand why the following code would not print "true" (tested > with cmake-3.0): > > set(a b) > set(b c) > if(a STREQUAL b OR a STREQUAL c) > message("true") > endif() > > From my understanding, no matter how magic the if command interprets its > arguments, one of the expressions (a STREQUAL b) and (a STREQUAL c) must be > true but I'm wrong. Anyone has a reasonable explanation? > > Thanks. > > -clark > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruslan_baratov at yahoo.com Thu Sep 4 10:38:21 2014 From: ruslan_baratov at yahoo.com (Ruslan Baratov) Date: Thu, 04 Sep 2014 18:38:21 +0400 Subject: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ... In-Reply-To: References: Message-ID: <5408795D.4060104@yahoo.com> On 04-Sep-14 18:09, Anders Lindgren wrote: > make sure that the argument don't form a valid variable name. It's not possible > > set(a b) > set(b c) > if(">${a}<" STREQUAL ">b<" OR ">${a}<" STREQUAL ">c<") > message("true") > endif() How about that: set(a "") # variable `a` is empty set("><" ">b<") if(">${a}<" STREQUAL ">b<") message("Value of variable with name `a` is `b`!") endif() From post at hendrik-sattler.de Thu Sep 4 12:40:49 2014 From: post at hendrik-sattler.de (Hendrik Sattler) Date: Thu, 04 Sep 2014 18:40:49 +0200 Subject: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ... In-Reply-To: <5408795D.4060104@yahoo.com> References: <5408795D.4060104@yahoo.com> Message-ID: <2483fd2d-d13d-4e76-b1aa-2b7632c81ed0@email.android.com> On 4. September 2014 16:38:21 MESZ, Ruslan Baratov via CMake wrote: >On 04-Sep-14 18:09, Anders Lindgren wrote: >> make sure that the argument don't form a valid variable name. >It's not possible > >> >> set(a b) >> set(b c) >> if(">${a}<" STREQUAL ">b<" OR ">${a}<" STREQUAL ">c<") >> message("true") >> endif() >How about that: > >set(a "") # variable `a` is empty >set("><" ">b<") > >if(">${a}<" STREQUAL ">b<") > message("Value of variable with name `a` is `b`!") >endif() I really do not understand this argument. Do you have so little control over your build tool (and that's what CMake is)? Nobody makes variables like this. Maybe to break the build script on purpose. And then, it breaks, so what? HS From dev at codyps.com Thu Sep 4 13:36:35 2014 From: dev at codyps.com (Cody P Schafer) Date: Thu, 4 Sep 2014 13:36:35 -0400 Subject: [CMake] If execute_process generates embedded newlines in a variable, they are not properly escaped when used in add_custom_target() Message-ID: Example: # cat CMakeLists.txt execute_process(COMMAND echo master WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE BRANCH ) add_custom_target(do-it COMMAND echo "${BRANCH}" COMMAND echo "${BRANCH}" ) # cmake . -GNinja >/dev/null # echo $? 0 # ninja ninja: error: # Examining the build.ninja file shows: build CMakeFiles/do-it: CUSTOM_COMMAND COMMAND = cd /home/cody/foo && echo master && echo master (That is a newline before the '&&') Make output is similarly flawed, but recovers due to more lenient syntax: CMakeFiles/do-it: echo master echo master From hobbes1069 at gmail.com Thu Sep 4 15:50:41 2014 From: hobbes1069 at gmail.com (Richard Shaw) Date: Thu, 4 Sep 2014 14:50:41 -0500 Subject: [CMake] GNUInstallDirs on Fedora problem Message-ID: I'm hoping I'm just missing something really obvious but I recently discovered the module GNUInstallDirs which is great. But I just tried converting over to it on one of my projects and although my system is definitely x86_64 the libraries are getting installed to lib not lib64. I looked through the source and it seems the CMAKE_SIZEOF_VOID_P is being used to make the determination. I added a debug message to my project for CMAKE_SIZEOF_VOID_P and it shows nothing, but per the module if it's not defined then it should show me a warning, however if I try: $ cmake --system-information | grep SIZEOF_VOID_P CMAKE_SIZEOF_VOID_P "8" I get the right answer, but it's still installing to lib not lib64... Any ideas? Thanks, Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Thu Sep 4 16:44:33 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Thu, 04 Sep 2014 22:44:33 +0200 Subject: [CMake] GNUInstallDirs on Fedora problem In-Reply-To: References: Message-ID: <5408CF31.7080209@gmail.com> On 04.09.2014 21:50, Richard Shaw wrote: > I'm hoping I'm just missing something really obvious but I recently > discovered the module GNUInstallDirs which is great. But I just tried > converting over to it on one of my projects and although my system is > definitely x86_64 the libraries are getting installed to lib not lib64. > > I looked through the source and it seems the CMAKE_SIZEOF_VOID_P is > being used to make the determination. > > I added a debug message to my project for CMAKE_SIZEOF_VOID_P and it > shows nothing, but per the module if it's not defined then it should > show me a warning, however if I try: > > $ cmake --system-information | grep SIZEOF_VOID_P > CMAKE_SIZEOF_VOID_P "8" > > I get the right answer, but it's still installing to lib not lib64... > > Any ideas? Are you including the module before your first project() call? project() sets up compilers and among other things runs the compile test that determines and sets CMAKE_SIZEOF_VOID_P. Nils From nico.schloemer at gmail.com Thu Sep 4 17:12:56 2014 From: nico.schloemer at gmail.com (=?UTF-8?Q?Nico_Schl=C3=B6mer?=) Date: Thu, 4 Sep 2014 23:12:56 +0200 Subject: [CMake] execute_process: OUTPUT_FILE vs. ERROR_FILE Message-ID: Hi all, referring to the documentation of execute_process() [1], is there a defined behavior about what happens if OUTPUT_FILE and ERROR_FILE point to the same file? Cheers, Nico [1] http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:execute_process From iosif.neitzke+cmake at gmail.com Thu Sep 4 17:14:43 2014 From: iosif.neitzke+cmake at gmail.com (Iosif Neitzke) Date: Thu, 4 Sep 2014 16:14:43 -0500 Subject: [CMake] Ctest building with Multiple Processors In-Reply-To: References: Message-ID: Does ctest -j , or ctest --parallel behave differently? http://www.cmake.org/cmake/help/v3.0/manual/ctest.1.html On Wed, Sep 3, 2014 at 2:31 PM, Michael Jackson wrote: > I am exploring CTest/CDash with out project and I was trying to figure out how to have CTest use all my cores for builds. So far no luck with some snippets from Google. So far I have the following in a file called CTestConfig.cmake at the top level of my project. > > set(CTEST_PROJECT_NAME "DREAM3D") > set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") > > set(CTEST_DROP_METHOD "http") > set(CTEST_DROP_SITE "my.cdash.org") > set(CTEST_DROP_LOCATION "/submit.php?project=DREAM3D") > set(CTEST_DROP_SITE_CDASH TRUE) > > # Use multiple CPU cores to build > include(ProcessorCount) > ProcessorCount(N) > if(NOT N EQUAL 0) > if(NOT WIN32) > set(CTEST_BUILD_FLAGS "-j${N}") > endif(NOT WIN32) > set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) > > endif() > > > And then I execute CTest like this from my terminal > > ctest -D Experimental > > > but monitoring my processors says that only a single processor is being used. > > Thanks for any help > > --- > Mike Jackson www.bluequartz.net > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From fungos at gmail.com Thu Sep 4 23:46:30 2014 From: fungos at gmail.com (fungos) Date: Thu, 4 Sep 2014 23:46:30 -0400 Subject: [CMake] Game developers using CMake? Is CMake viable for this industry? Experiences? Message-ID: Hello everyone, I really hope to get some response to this email :) I'm evaluating a build system to manage some big projects in a game studio from a very known game company. We develop and have projects for PC, PS3, PS4, Xbox 360, Xbox One, Nintendo WiiU, Nintendo 3DS and Nintendo Wii. Recently we had some changes that got us to discuss our current building system: Visual Studio + various VSI + Incredibuild. So I put CMake into the discussion for it being easy to use, having easy maintenance and project generation. Previously, I had some experience with open source projects and CMake was always trivial, since it has support to a large set of compilers and has assorted generators. Now after trying to implement a Nintendo Wii toolchain I had a better insight on CMake limitations and I got to reevaluate it and compare with alternatives. So, finally, why I'm here? TL;DR 1. I would like to know if there are other developers from game industry that want share their experiences with CMake and possibly other systems. 2. I saw some old messages on this list about people trying to support/hack cmake to get it working with some of these closed platforms. So I would also like to know if there was any progress at all or every effort turned into ashes. 3. I've seen some questions about if CMake/Kitware have any interest in contributions on this area, but I've never found a reply from some of the core developers. What is the reason for this? Is this objective too hard to achieve or there are no interest? Thank you, Danny Angelo Carminati Grein -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Fri Sep 5 03:49:16 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Fri, 05 Sep 2014 09:49:16 +0200 Subject: [CMake] Game developers using CMake? Is CMake viable for this industry? Experiences? In-Reply-To: References: Message-ID: <54096AFC.4010208@gmail.com> On 09/05/2014 05:46 AM, fungos wrote: > 3. I've seen some questions about if CMake/Kitware have any interest in > contributions on this area, but I've never found a reply from some of > the core developers. What is the reason for this? Is this objective too > hard to achieve or there are no interest? If you are willing to contribute and are looking for feedback from CMake developers for your proposals you should also bring this up on the developer mailing list. I think in general contributions that support new platforms are quite welcome as long as continued maintenance and automated integration testing can be provided. Nils From nilsgladitz at gmail.com Fri Sep 5 03:56:03 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Fri, 05 Sep 2014 09:56:03 +0200 Subject: [CMake] execute_process: OUTPUT_FILE vs. ERROR_FILE In-Reply-To: References: Message-ID: <54096C93.3020209@gmail.com> On 09/04/2014 11:12 PM, Nico Schl?mer wrote: > referring to the documentation of execute_process() [1], is there a > defined behavior about what happens if OUTPUT_FILE and ERROR_FILE > point to the same file? On windows execute_process() will fail and complain that the file is already being used by another process. Nils From norulez at me.com Fri Sep 5 04:51:09 2014 From: norulez at me.com (NoRulez) Date: Fri, 05 Sep 2014 10:51:09 +0200 Subject: [CMake] [Cdash] Show results from the bullseye coverage in CDash Message-ID: <18BA988B-51F3-4733-9F2B-50FC1DDF151E@me.com> We do not use a license manager. The following files are created in the Testing/Temporary folder: [DATE]-[TIME]-covbr.stderr [DATE]-[TIME]-covbr.stdout [DATE]-[TIME]-covsrc.stderr [DATE]-[TIME]-covsrc.stdout LastCoverage_[DATE]-[TIME].log Which shows the symbols which are normally shown in CDash when a file is selected (e.g.: --> and so on) Best Regards > Am 04.09.2014 um 12:17 schrieb David Cole : > > Sometimes an unfortunate network interruption (even a very brief one, > at just the wrong time...) can cause my bullseye dashboards to report > "0%" coverage. I use the license manager for Bullseye, so the build > machine needs network access to the license manager machine when > turning coverage on and off with the "cov01" Bullseye tool. If there is > no network access at "call cov01 -1" time, then trying to turn on > coverage measurement cannot succeed, and the result is a coverage build > without any coverage data: 0%. > > You can probably tell if this is happening to you or not by paying > attention to the return value of cov01. I suspect it returns an error > code in this condition, but my scripts just ignore it and continue with > the build anyhow. > > HTH, > David C. > > From dlrdave at aol.com Fri Sep 5 06:45:47 2014 From: dlrdave at aol.com (David Cole) Date: Fri, 5 Sep 2014 06:45:47 -0400 Subject: [CMake] [Cdash] Show results from the bullseye coverage in CDash In-Reply-To: <18BA988B-51F3-4733-9F2B-50FC1DDF151E@me.com> References: <18BA988B-51F3-4733-9F2B-50FC1DDF151E@me.com> Message-ID: <8D1970DAF9C6626-15CC-19901@webmail-m269.sysops.aol.com> When the coverage shows "0%" is there any indication that the ctest_submit for the coverage step failed? (i.e. do you log the output of ctest, and does it show anything about failing to submit?) That's another type of intermittent network blip that I see, where there's a successful local build, but the submit of a piece of the dashboard fails occasionally. D From dlrdave at aol.com Fri Sep 5 07:12:49 2014 From: dlrdave at aol.com (David Cole) Date: Fri, 5 Sep 2014 07:12:49 -0400 Subject: [CMake] Ctest building with Multiple Processors In-Reply-To: References: Message-ID: <8D1971176455D3E-15CC-19AA1@webmail-m269.sysops.aol.com> No, they do not behave differently. "-j" and "--parallel" are aliases for each other, using either one goes through exactly the same command line argument processing code... HTH, David C. From ruslan_baratov at yahoo.com Fri Sep 5 07:19:31 2014 From: ruslan_baratov at yahoo.com (Ruslan Baratov) Date: Fri, 05 Sep 2014 15:19:31 +0400 Subject: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ... In-Reply-To: <2483fd2d-d13d-4e76-b1aa-2b7632c81ed0@email.android.com> References: <5408795D.4060104@yahoo.com> <2483fd2d-d13d-4e76-b1aa-2b7632c81ed0@email.android.com> Message-ID: <54099C43.8050504@yahoo.com> On 04-Sep-14 20:40, Hendrik Sattler wrote: > > On 4. September 2014 16:38:21 MESZ, Ruslan Baratov via CMake wrote: >> On 04-Sep-14 18:09, Anders Lindgren wrote: >>> make sure that the argument don't form a valid variable name. >> It's not possible >> >>> set(a b) >>> set(b c) >>> if(">${a}<" STREQUAL ">b<" OR ">${a}<" STREQUAL ">c<") >>> message("true") >>> endif() >> How about that: >> >> set(a "") # variable `a` is empty >> set("><" ">b<") >> >> if(">${a}<" STREQUAL ">b<") >> message("Value of variable with name `a` is `b`!") >> endif() > I really do not understand this argument. > Do you have so little control over your build tool (and that's what CMake is)? > Nobody makes variables like this. Maybe to break the build script on purpose. And then, it breaks, so what? > > HS > The solution ">...<" not changing the reason of the problem - ambiguity. It's just making things more obscure. My example prove that statement "make sure that the argument don't form a valid variable name" by creating string ">...<" is wrong. Here is example of how "strange" names can appear: # User's code macro(set_version package component version) set("${package}-${CMAKE_DEBUG_POSTFIX}_${component}" "${version}") endmacro() set(CMAKE_DEBUG_POSTFIX d) if(Somepackage_FOUND) set(pack_name "Somepackage") set(pack_component "Somecomp") set(pack_version "1.2.3") else() set(pack_name "") set(pack_component "") set(pack_version "") endif() set_version("${pack_name}" "${component}" "${version}") find_package(...) # User call my code here If package not found the variable "-d_" is defined and empty. Some user choose "-" and "_", the other choose ">" and "<". I don't want to blame/teach *users* for creating such names. The important thing is that it will not ruin my code. Cheers, Ruslo From mike.jackson at bluequartz.net Fri Sep 5 08:52:21 2014 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Fri, 5 Sep 2014 08:52:21 -0400 Subject: [CMake] Ctest building with Multiple Processors In-Reply-To: References: Message-ID: Actually my interpretation of the manual says that the _tests_ will be run in parallel. What I want is the _Build_ to be run in parallel. Thanks Mike Jackson On Sep 4, 2014, at 5:14 PM, Iosif Neitzke wrote: > Does ctest -j , or ctest --parallel behave differently? > > http://www.cmake.org/cmake/help/v3.0/manual/ctest.1.html > > On Wed, Sep 3, 2014 at 2:31 PM, Michael Jackson > wrote: >> I am exploring CTest/CDash with out project and I was trying to figure out how to have CTest use all my cores for builds. So far no luck with some snippets from Google. So far I have the following in a file called CTestConfig.cmake at the top level of my project. >> >> set(CTEST_PROJECT_NAME "DREAM3D") >> set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") >> >> set(CTEST_DROP_METHOD "http") >> set(CTEST_DROP_SITE "my.cdash.org") >> set(CTEST_DROP_LOCATION "/submit.php?project=DREAM3D") >> set(CTEST_DROP_SITE_CDASH TRUE) >> >> # Use multiple CPU cores to build >> include(ProcessorCount) >> ProcessorCount(N) >> if(NOT N EQUAL 0) >> if(NOT WIN32) >> set(CTEST_BUILD_FLAGS "-j${N}") >> endif(NOT WIN32) >> set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) >> >> endif() >> >> >> And then I execute CTest like this from my terminal >> >> ctest -D Experimental >> >> >> but monitoring my processors says that only a single processor is being used. >> >> Thanks for any help >> >> --- >> Mike Jackson www.bluequartz.net >> >> -- >> >> Powered by www.kitware.com >> >> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ >> >> Kitware offers various services to support the CMake community. For more information on each offering, please visit: >> >> CMake Support: http://cmake.org/cmake/help/support.html >> CMake Consulting: http://cmake.org/cmake/help/consulting.html >> CMake Training Courses: http://cmake.org/cmake/help/training.html >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/cmake From chuck.atkins at kitware.com Fri Sep 5 09:33:21 2014 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Fri, 5 Sep 2014 09:33:21 -0400 Subject: [CMake] Ctest building with Multiple Processors In-Reply-To: References: Message-ID: > Actually my interpretation of the manual says that the _tests_ will be run > in parallel. What I want is the _Build_ to be run in parallel. > Indeed that is just the parallel test execution. Parallel build is usually generator specific, controlled through CTEST_BUILD_FLAGS. For example: if you're using "Unix Makefiles": ... set(CTEST_SITE "wopr.kitwarein.com") set(CTEST_BUILD_NAME "Fedora20_Intel-2013-SP1-U3") set(CTEST_BUILD_CONFIGURATION Release) set(CTEST_CMAKE_GENERATOR "Unix Makefiles") *set(CTEST_BUILD_FLAGS -j8)* ... This will call "make -j8" for the build instead of just "make". If using the ninja generator, the build will be parallel by default, or you can specify a "-j" flag to override that number. Visual Studio gets a bit tricky though since you can paralleling at both the target and file level so if not careful, you can end up with N^2 build processes. What generator are you using? -------------- next part -------------- An HTML attachment was scrubbed... URL: From hobbes1069 at gmail.com Fri Sep 5 09:44:10 2014 From: hobbes1069 at gmail.com (Richard Shaw) Date: Fri, 5 Sep 2014 08:44:10 -0500 Subject: [CMake] Using PUBLIC_HEADER property to install headers, but only 1st one is installed Message-ID: Am I doing something wrong or is this a known bug? I have a list of about 5 headers, CODEC2_PUBLIC_HEADERS. I used set_target_properties( PROPERTIES PUBLIC_HEADER ${CODEC2_PUBLIC_HEADERS}) then in the install target I added: PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/codec2 When I do a "make install" only the first file in the list is installed... CMake version is 2.8.12.2 Thanks, Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Fri Sep 5 09:52:42 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Fri, 05 Sep 2014 15:52:42 +0200 Subject: [CMake] Using PUBLIC_HEADER property to install headers, but only 1st one is installed In-Reply-To: References: Message-ID: <5409C02A.6080908@gmail.com> On 09/05/2014 03:44 PM, Richard Shaw wrote: > Am I doing something wrong or is this a known bug? > > I have a list of about 5 headers, CODEC2_PUBLIC_HEADERS. > > I used set_target_properties( PROPERTIES PUBLIC_HEADER > ${CODEC2_PUBLIC_HEADERS}) The remaining items in ${CODEC2_PUBLIC_HEADERS} are interpreted as pairs of property name and value. You can prevent this by quoting "${CODEC2_PUBLIC_HEADERS}" or by using set_property() instead. Nils From mike.jackson at bluequartz.net Fri Sep 5 11:09:56 2014 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Fri, 5 Sep 2014 11:09:56 -0400 Subject: [CMake] Ctest building with Multiple Processors In-Reply-To: References: Message-ID: <76B5E216-1AEA-422C-BB7E-A48AC5DC22C4@bluequartz.net> What generator? All of them of course. I am trying to setup our "build bots" on several environments including OS X, Linux and Windows. I have ninja built and installed on the Windows machine. I would _prefer_ to use Visual Studio and ninja so that we have a sanity check to make sure both types of project files can be built correctly, configured, build and the software packaged. We are eventually going to try to get "nightlies" of our software going also. Thanks Mike Jackson dream3d.bluequartz.net github.com/dream3d/dream3d On Sep 5, 2014, at 9:33 AM, Chuck Atkins wrote: > > Actually my interpretation of the manual says that the _tests_ will be run in parallel. What I want is the _Build_ to be run in parallel. > > Indeed that is just the parallel test execution. Parallel build is usually generator specific, controlled through CTEST_BUILD_FLAGS. For example: if you're using "Unix Makefiles": > > ... > set(CTEST_SITE "wopr.kitwarein.com") > set(CTEST_BUILD_NAME "Fedora20_Intel-2013-SP1-U3") > set(CTEST_BUILD_CONFIGURATION Release) > set(CTEST_CMAKE_GENERATOR "Unix Makefiles") > set(CTEST_BUILD_FLAGS -j8) > ... > > This will call "make -j8" for the build instead of just "make". If using the ninja generator, the build will be parallel by default, or you can specify a "-j" flag to override that number. Visual Studio gets a bit tricky though since you can paralleling at both the target and file level so if not careful, you can end up with N^2 build processes. What generator are you using? > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From chuck.atkins at kitware.com Fri Sep 5 11:49:19 2014 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Fri, 5 Sep 2014 11:49:19 -0400 Subject: [CMake] Ctest building with Multiple Processors In-Reply-To: <76B5E216-1AEA-422C-BB7E-A48AC5DC22C4@bluequartz.net> References: <76B5E216-1AEA-422C-BB7E-A48AC5DC22C4@bluequartz.net> Message-ID: The easiest option with visual studio is to use the /mp compiler flag by setting it in the CFLAGS and CXXFLAGS environment variables in your ctest script. This will parallelize each target across all CPUs. Target-level parallelism may or may not also happen since that's dependent on your local configuration and VS version; Older versions used devenv.exe to drive the build, in which case it's target-level parallelism is only configurable through the IDE, where as newer VS versions can be driven with MSBuild directly and use the /maxcpucount:N switch in the CTEST_BUILD_FLAGS. Unfortunately on Windows and VS builds there's not really a simple answer. - Chuck On Fri, Sep 5, 2014 at 11:09 AM, Michael Jackson < mike.jackson at bluequartz.net> wrote: > What generator? All of them of course. I am trying to setup our "build > bots" on several environments including OS X, Linux and Windows. I have > ninja built and installed on the Windows machine. I would _prefer_ to use > Visual Studio and ninja so that we have a sanity check to make sure both > types of project files can be built correctly, configured, build and the > software packaged. We are eventually going to try to get "nightlies" of our > software going also. > > Thanks > Mike Jackson > dream3d.bluequartz.net > github.com/dream3d/dream3d > > On Sep 5, 2014, at 9:33 AM, Chuck Atkins wrote: > > > > > Actually my interpretation of the manual says that the _tests_ will be > run in parallel. What I want is the _Build_ to be run in parallel. > > > > Indeed that is just the parallel test execution. Parallel build is > usually generator specific, controlled through CTEST_BUILD_FLAGS. For > example: if you're using "Unix Makefiles": > > > > ... > > set(CTEST_SITE "wopr.kitwarein.com") > > set(CTEST_BUILD_NAME "Fedora20_Intel-2013-SP1-U3") > > set(CTEST_BUILD_CONFIGURATION Release) > > set(CTEST_CMAKE_GENERATOR "Unix Makefiles") > > set(CTEST_BUILD_FLAGS -j8) > > ... > > > > This will call "make -j8" for the build instead of just "make". If > using the ninja generator, the build will be parallel by default, or you > can specify a "-j" flag to override that number. Visual Studio gets a bit > tricky though since you can paralleling at both the target and file level > so if not careful, you can end up with N^2 build processes. What generator > are you using? > > -- > > > > Powered by www.kitware.com > > > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > > > CMake Support: http://cmake.org/cmake/help/support.html > > CMake Consulting: http://cmake.org/cmake/help/consulting.html > > CMake Training Courses: http://cmake.org/cmake/help/training.html > > > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/cmake > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.hoffman at kitware.com Fri Sep 5 14:40:01 2014 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Fri, 05 Sep 2014 14:40:01 -0400 Subject: [CMake] Ctest building with Multiple Processors In-Reply-To: References: <76B5E216-1AEA-422C-BB7E-A48AC5DC22C4@bluequartz.net> Message-ID: <540A0381.2080009@kitware.com> On 9/5/2014 11:49 AM, Chuck Atkins wrote: > > Unfortunately on Windows and VS builds there's not really a simple answer. My blog might be of help: http://www.kitware.com/blog/home/post/434 -Bill From becker.tobi at gmail.com Fri Sep 5 14:40:37 2014 From: becker.tobi at gmail.com (Tobias Becker) Date: Fri, 5 Sep 2014 20:40:37 +0200 Subject: [CMake] Useful extensions for CMake blog post Message-ID: Hi, I thought you might enjoy 400 extra functions for doing more complicated things with cmake (also comes with an interactive cmake console which is implemented in pure cmake). Some features: * maps,(structural variables) * object oriented programming with cmake language (prototypical inheritance) * extended list functionality (like slice, push, pop, ...) * lambdas * dynamic functions (call functions without knowing its name) * ... Here is the link: http://thetoeb.de/2014/09/05/useful-extensions-for-cmake/ I'm sharing these functions (a lot of time went into them) and hope someone might find them useful. If you have suggestions you can write them into github or as a comment on the blog. They tested and are part of a pure cmake package manager which I'm still working on. Kind Regards, Tobias -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlrdave at aol.com Fri Sep 5 15:09:43 2014 From: dlrdave at aol.com (David Cole) Date: Fri, 5 Sep 2014 15:09:43 -0400 Subject: [CMake] Useful extensions for CMake blog post In-Reply-To: References: Message-ID: <8D1975415A06C5A-15CC-1D348@webmail-m269.sysops.aol.com> Wow. From biddisco at cscs.ch Fri Sep 5 17:07:43 2014 From: biddisco at cscs.ch (Biddiscombe, John A.) Date: Fri, 5 Sep 2014 21:07:43 +0000 Subject: [CMake] ctest/cdash question Message-ID: Sorry if this is off topic for the list. If I ctest ?D ExperimentalStart ctest ?D ExperimentalTest ?R test1 ctest ?D ExperimentalSubmit Then ctest ?D ExperimentalStart ctest ?D ExperimentalTest ?R test2 ctest ?D ExperimentalSubmit It appears as two entries on the dashboard, but I?d like to have both together like this ctest ?D ExperimentalStart ctest ?D ExperimentalTest ?R test1 ctest ?D ExperimentalTest ?R test2 ctest ?D ExperimentalSubmit Except that the test2 xml overwrites the test1 xml And I can?t run ctest ?D ExperimentalTest ?R test1|test2 Because it comes from multiple scripts that are triggered independently. So the question becomes ? is it possible to run tests separately, but have them merged into one test submission on the Cdash dashboard? (I tried a simple xml merge of the files, but it didn?t work as expected, so I thought I?d ask here before spending more time no it) Thanks JB -- John Biddiscombe, email:biddisco @.at.@ cscs.ch http://www.cscs.ch/ CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07 Via Trevano 131, 6900 Lugano, Switzerland | Fax: +41 (91) 610.82.82 From middleton.ted at gmail.com Fri Sep 5 18:44:05 2014 From: middleton.ted at gmail.com (Ted Middleton) Date: Fri, 5 Sep 2014 15:44:05 -0700 Subject: [CMake] How to build and reference dlopen-able libraries? Message-ID: Just wondering if there's a nice way of getting a library target's includes but not linking to it, so I can use dlopen() on it instead. If I want to build a shared library that gets implicitly loaded by an executable, I would do this: mylib/CMakeLists.txt: add_library( mylib SHARED src/mylibmain.c src/mylibsomething.c ) target_include_directories( mylib PRIVATE src PUBLIC inc ) target_link_libraries( mylib png ) myexe/CMakeLists.txt: add_executable( myexe src/main.c src/stuff.c ) target_include_directories( myexe PRIVATE src ) target_link_libraries( myexe PRIVATE mylib ) What I really want, though, is for mylib's public include dir to be accessible to myexe, but I don't want myexe to link to mylib - I'm going to load it with dlopen()/LoadLibrary(). Do I have to do something like this: myexe/CMakeLists.txt: get_property( mylibincs TARGET mylib PROPERTY INTERFACE_INCLUDE_DIRECTORIES ) add_executable( myexe src/main.c src/stuff.c ) target_include_directories( myexe PRIVATE src ${mylibincs} ) #target_link_libraries not necessary This must be really simple, but I can't seem to find anything about it on the cmake wikis or through google. There's a very old post from 2006 or so (pre target properties, it uses include_directories()). -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Fri Sep 5 19:16:10 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Sat, 06 Sep 2014 01:16:10 +0200 Subject: [CMake] How to build and reference dlopen-able libraries? In-Reply-To: References: Message-ID: <540A443A.7010708@gmail.com> On 06.09.2014 00:44, Ted Middleton wrote: > Just wondering if there's a nice way of getting a library target's > includes but not linking to it, so I can use dlopen() on it instead. > If I want to build a shared library that gets implicitly loaded by an > executable, I would do this: > > mylib/CMakeLists.txt: > add_library( mylib SHARED src/mylibmain.c src/mylibsomething.c ) > target_include_directories( mylib PRIVATE src PUBLIC inc ) > target_link_libraries( mylib png ) > > myexe/CMakeLists.txt: > add_executable( myexe src/main.c src/stuff.c ) > target_include_directories( myexe PRIVATE src ) > target_link_libraries( myexe PRIVATE mylib ) > > What I really want, though, is for mylib's public include dir to be > accessible to myexe, but I don't want myexe to link to mylib - I'm > going to load it with dlopen()/LoadLibrary(). Do I have to do > something like this: > > myexe/CMakeLists.txt: > get_property( mylibincs TARGET mylib PROPERTY > INTERFACE_INCLUDE_DIRECTORIES ) > add_executable( myexe src/main.c src/stuff.c ) > target_include_directories( myexe PRIVATE src ${mylibincs} ) > #target_link_libraries not necessary > > > This must be really simple, but I can't seem to find anything about it > on the cmake wikis or through google. There's a very old post from > 2006 or so (pre target properties, it uses include_directories()). Try target_include_directories(myexe PRIVATE $) Nils From dlrdave at aol.com Fri Sep 5 21:18:19 2014 From: dlrdave at aol.com (David Cole) Date: Fri, 5 Sep 2014 21:18:19 -0400 Subject: [CMake] ctest/cdash question In-Reply-To: References: Message-ID: <37B7E9BE-7B57-43F5-A895-FB0D138F104C@aol.com> Not off topic at all. Try start, test, submit, test, submit. Should work. Start is the thing that writes a new time stamp tag, and all that follows should be associated with the most recent start's tag. HTH, David C. > On Sep 5, 2014, at 5:07 PM, "Biddiscombe, John A." wrote: > > Sorry if this is off topic for the list. > > If I > ctest ?D ExperimentalStart > ctest ?D ExperimentalTest ?R test1 > ctest ?D ExperimentalSubmit > > Then > ctest ?D ExperimentalStart > ctest ?D ExperimentalTest ?R test2 > ctest ?D ExperimentalSubmit > > It appears as two entries on the dashboard, but I?d like to have both together like this > > ctest ?D ExperimentalStart > ctest ?D ExperimentalTest ?R test1 > ctest ?D ExperimentalTest ?R test2 > ctest ?D ExperimentalSubmit > > Except that the test2 xml overwrites the test1 xml > > And I can?t run > ctest ?D ExperimentalTest ?R test1|test2 > Because it comes from multiple scripts that are triggered independently. > > So the question becomes ? is it possible to run tests separately, but have them merged into one test submission on the Cdash dashboard? (I tried a simple xml merge of the files, but it didn?t work as expected, so I thought I?d ask here before spending more time no it) > > Thanks > > JB > -- > John Biddiscombe, email:biddisco @.at.@ cscs.ch > http://www.cscs.ch/ > CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07 > Via Trevano 131, 6900 Lugano, Switzerland | Fax: +41 (91) 610.82.82 > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From saadrustam at gmail.com Fri Sep 5 22:25:29 2014 From: saadrustam at gmail.com (Saad Khattak) Date: Fri, 5 Sep 2014 22:25:29 -0400 Subject: [CMake] Visual Studio 2013 warning MSB8028 In-Reply-To: References: Message-ID: For future reference: The solution is to delete your build folder and generate the projects again. Not sure what is changed by CMake in 3.0 but VS does not like it unless the build folder is cleaned. On Wed, Sep 3, 2014 at 6:09 PM, Saad Khattak wrote: > I have a solution with multiple projects including a CMake INSTALL project > for installing the binaries. With CMake Version 3.0 I am receiving the > following warning for each of my projects in the solution: > "warning MSB8028: The intermediate directory (myProject.dir\Debug\) > contains files shared from another project (myProject.vcxproj). This can > lead to incorrect clean and rebuild behavior." > > where myProject is replaced by the name of each of the projects in the > solution. > > Previous cmake versions did not produce this warning with VS 2013. I am > not sure how to resolve this warning as the recommended fix is to ensure > that the "Intermediate Directory" variable for each project is unique. As > far as I can tell, it is indeed unique. > > I could not find any topics with respect to this warning and CMake. > Appreciate any help regarding this behaviour. If it is deemed a bug, then I > will file a bug report. > > - Saad > -------------- next part -------------- An HTML attachment was scrubbed... URL: From d3ck0r at gmail.com Fri Sep 5 23:49:44 2014 From: d3ck0r at gmail.com (J Decker) Date: Fri, 5 Sep 2014 20:49:44 -0700 Subject: [CMake] How to build and reference dlopen-able libraries? In-Reply-To: <540A443A.7010708@gmail.com> References: <540A443A.7010708@gmail.com> Message-ID: you'll need separate includes for dlopen thing, because you'll need the functions declares are pointers... void (*f)( void ); or typedefed as functions typedef void (*some_function_type)( void ); some_function_type f; Or better include all those in a structure struct dl_interface { void (*f)( void ); } lib_interface; void Init(void ) { int dl = dlopen( "lib", 0 ); lib_interface.f = dlsym( dl, "f" ); } but none of that will be given by external headers. On Fri, Sep 5, 2014 at 4:16 PM, Nils Gladitz wrote: > On 06.09.2014 00:44, Ted Middleton wrote: > >> Just wondering if there's a nice way of getting a library target's >> includes but not linking to it, so I can use dlopen() on it instead. If I >> want to build a shared library that gets implicitly loaded by an >> executable, I would do this: >> >> mylib/CMakeLists.txt: >> add_library( mylib SHARED src/mylibmain.c src/mylibsomething.c ) >> target_include_directories( mylib PRIVATE src PUBLIC inc ) >> target_link_libraries( mylib png ) >> >> myexe/CMakeLists.txt: >> add_executable( myexe src/main.c src/stuff.c ) >> target_include_directories( myexe PRIVATE src ) >> target_link_libraries( myexe PRIVATE mylib ) >> >> What I really want, though, is for mylib's public include dir to be >> accessible to myexe, but I don't want myexe to link to mylib - I'm going to >> load it with dlopen()/LoadLibrary(). Do I have to do something like this: >> >> myexe/CMakeLists.txt: >> get_property( mylibincs TARGET mylib PROPERTY >> INTERFACE_INCLUDE_DIRECTORIES ) >> add_executable( myexe src/main.c src/stuff.c ) >> target_include_directories( myexe PRIVATE src ${mylibincs} ) >> #target_link_libraries not necessary >> >> >> This must be really simple, but I can't seem to find anything about it on >> the cmake wikis or through google. There's a very old post from 2006 or so >> (pre target properties, it uses include_directories()). >> > > Try target_include_directories(myexe PRIVATE $ INTERFACE_INCLUDE_DIRECTORIES>) > > Nils > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From biddisco at cscs.ch Sat Sep 6 03:34:36 2014 From: biddisco at cscs.ch (Biddiscombe, John A.) Date: Sat, 6 Sep 2014 07:34:36 +0000 Subject: [CMake] ctest/cdash question In-Reply-To: <37B7E9BE-7B57-43F5-A895-FB0D138F104C@aol.com> Message-ID: David Of course. So simple, I just tried it and it works, that will save me a lot of script tweaking. Thanks very much JB On 06/09/14 03:18, "David Cole" wrote: >Not off topic at all. > >Try start, test, submit, test, submit. Should work. > >Start is the thing that writes a new time stamp tag, and all that follows >should be associated with the most recent start's tag. > > >HTH, >David C. > > > >> On Sep 5, 2014, at 5:07 PM, "Biddiscombe, John A." >>wrote: >> >> Sorry if this is off topic for the list. >> >> If I >> ctest ?D ExperimentalStart >> ctest ?D ExperimentalTest ?R test1 >> ctest ?D ExperimentalSubmit >> >> Then >> ctest ?D ExperimentalStart >> ctest ?D ExperimentalTest ?R test2 >> ctest ?D ExperimentalSubmit >> >> It appears as two entries on the dashboard, but I?d like to have both >>together like this >> >> ctest ?D ExperimentalStart >> ctest ?D ExperimentalTest ?R test1 >> ctest ?D ExperimentalTest ?R test2 >> ctest ?D ExperimentalSubmit >> >> Except that the test2 xml overwrites the test1 xml >> >> And I can?t run >> ctest ?D ExperimentalTest ?R test1|test2 >> Because it comes from multiple scripts that are triggered independently. >> >> So the question becomes ? is it possible to run tests separately, but >>have them merged into one test submission on the Cdash dashboard? (I >>tried a simple xml merge of the files, but it didn?t work as expected, >>so I thought I?d ask here before spending more time no it) >> >> Thanks >> >> JB >> -- >> John Biddiscombe, email:biddisco @.at.@ cscs.ch >> http://www.cscs.ch/ >> CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07 >> Via Trevano 131, 6900 Lugano, Switzerland | Fax: +41 (91) 610.82.82 >> >> >> -- >> >> Powered by www.kitware.com >> >> Please keep messages on-topic and check the CMake FAQ at: >>http://www.cmake.org/Wiki/CMake_FAQ >> >> Kitware offers various services to support the CMake community. For >>more information on each offering, please visit: >> >> CMake Support: http://cmake.org/cmake/help/support.html >> CMake Consulting: http://cmake.org/cmake/help/consulting.html >> CMake Training Courses: http://cmake.org/cmake/help/training.html >> >> Visit other Kitware open-source projects at >>http://www.kitware.com/opensource/opensource.html >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/cmake From post at hendrik-sattler.de Sat Sep 6 03:58:47 2014 From: post at hendrik-sattler.de (Hendrik Sattler) Date: Sat, 06 Sep 2014 09:58:47 +0200 Subject: [CMake] How to build and reference dlopen-able libraries? In-Reply-To: References: <540A443A.7010708@gmail.com> Message-ID: On 6. September 2014 05:49:44 MESZ, J Decker wrote: >you'll need separate includes for dlopen thing, because you'll need the >functions declares are pointers... Not really >void (*f)( void ); >or typedefed as functions >typedef void (*some_function_type)( void ); >some_function_type f; Usually, for dlopen usage, these function pointers are defined by the using application, not by the library. You can dlopen any (C) library and none of them provides those function pointers or typedefs like you purpose. HS From d3ck0r at gmail.com Sat Sep 6 04:08:51 2014 From: d3ck0r at gmail.com (J Decker) Date: Sat, 6 Sep 2014 01:08:51 -0700 Subject: [CMake] How to build and reference dlopen-able libraries? In-Reply-To: References: <540A443A.7010708@gmail.com> Message-ID: And without defining variables to get the functions stored into, how do you propose to actually use the functions loaded? Standard headers will provide prototypes, but those will be useless. On Sat, Sep 6, 2014 at 12:58 AM, Hendrik Sattler wrote: > > > On 6. September 2014 05:49:44 MESZ, J Decker wrote: > >you'll need separate includes for dlopen thing, because you'll need the > >functions declares are pointers... > > Not really > > >void (*f)( void ); > >or typedefed as functions > >typedef void (*some_function_type)( void ); > >some_function_type f; > > Usually, for dlopen usage, these function pointers are defined by the > using application, not by the library. You can dlopen any (C) library and > none of them provides those function pointers or typedefs like you purpose. > > HS > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlrdave at aol.com Sat Sep 6 05:32:47 2014 From: dlrdave at aol.com (David Cole) Date: Sat, 6 Sep 2014 05:32:47 -0400 Subject: [CMake] ctest/cdash question In-Reply-To: References: Message-ID: <8D197CCA72C54EA-1768-1F06F@webmail-m244.sysops.aol.com> You're welcome. One caveat to mention with this sort of submit pattern (submitting multiple build or test chunks to a single row on the CDash dashboard) is that it messes up the incremental +n/-n compare-to-previous-submission numbers of build warnings and errors, and number of test passes and failures. CDash computes those numbers based on the assumption that a submit ought to be compared to the previous submit... But that's only true in the default submission pattern of sending one set of build results and one set of test results for a single row. When you send multiples, the +/- numbers become irrelevant noise with the current CDash. It could probably be fixed to reflect this submit pattern, as well, but this is work that has yet to be done. D From biddisco at cscs.ch Sat Sep 6 06:29:25 2014 From: biddisco at cscs.ch (Biddiscombe, John A.) Date: Sat, 6 Sep 2014 10:29:25 +0000 Subject: [CMake] ctest/cdash question In-Reply-To: <8D197CCA72C54EA-1768-1F06F@webmail-m244.sysops.aol.com> Message-ID: David OK, understood. Currently, the buildbot is running 145 unit tests, then 52 regression tests in separate steps, every dashboard line has +145 and -52 respectively so the +/- numbers can?t get much worse! My dashboard is 1.8.2 which dates back a few years. Just seeing the red/green (and one row per machine) will already be helpful. Yours JB On 06/09/14 11:32, "David Cole" wrote: >You're welcome. > >One caveat to mention with this sort of submit pattern (submitting >multiple build or test chunks to a single row on the CDash dashboard) >is that it messes up the incremental +n/-n >compare-to-previous-submission numbers of build warnings and errors, >and number of test passes and failures. > >CDash computes those numbers based on the assumption that a submit >ought to be compared to the previous submit... But that's only true in >the default submission pattern of sending one set of build results and >one set of test results for a single row. When you send multiples, the >+/- numbers become irrelevant noise with the current CDash. It could >probably be fixed to reflect this submit pattern, as well, but this is >work that has yet to be done. > > >D > From alexey.petruchik at gmail.com Sat Sep 6 10:02:56 2014 From: alexey.petruchik at gmail.com (Alexey Petruchik) Date: Sat, 6 Sep 2014 17:02:56 +0300 Subject: [CMake] Get Visual Studio target Arch Message-ID: I want to use different library folders for x64/x86/arm architectures. Cmake has different generators for each arch: "Visual Studio 12 2013", "Visual Studio 12 2013 ARM", "Visual Studio 12 2013 Win64". Is there any cmake var to get visual studio target arch? CMAKE_SYSTEM_PROCESSOR is always AMD64 for me no matter what generator I'm using. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fraser.hutchison at gmail.com Sat Sep 6 13:23:58 2014 From: fraser.hutchison at gmail.com (Fraser Hutchison) Date: Sat, 06 Sep 2014 18:23:58 +0100 Subject: [CMake] Useful extensions for CMake blog post In-Reply-To: <8D1975415A06C5A-15CC-1D348@webmail-m269.sysops.aol.com> References: <8D1975415A06C5A-15CC-1D348@webmail-m269.sysops.aol.com> Message-ID: <540B432E.8010004@googlemail.com> Indeed! On 05/09/2014 20:09, David Cole via CMake wrote: > Wow. > From mike.jackson at bluequartz.net Sat Sep 6 15:30:59 2014 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Sat, 6 Sep 2014 15:30:59 -0400 Subject: [CMake] Ctest building with Multiple Processors In-Reply-To: <540A0381.2080009@kitware.com> References: <76B5E216-1AEA-422C-BB7E-A48AC5DC22C4@bluequartz.net> <540A0381.2080009@kitware.com> Message-ID: Is there a blog or other web site that would walk me through setting up a "Build Bot" on Windows for automated building/testing and submission to CDash? Thanks Mike Jackson On Sep 5, 2014, at 2:40 PM, Bill Hoffman wrote: > On 9/5/2014 11:49 AM, Chuck Atkins wrote: >> >> Unfortunately on Windows and VS builds there's not really a simple answer. > > My blog might be of help: > http://www.kitware.com/blog/home/post/434 > > -Bill > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From awl03 at doc.ic.ac.uk Sun Sep 7 05:32:31 2014 From: awl03 at doc.ic.ac.uk (Alexander Lamaison) Date: Sun, 07 Sep 2014 10:32:31 +0100 Subject: [CMake] Usage requirements for external project dependencies Message-ID: <86fvg3lqs0.fsf@doc.ic.ac.uk> What is the best way to manage usage requirements for projects and packages that are not part of your source tree? Using find_package() to locate a dependency typically results in code like: add_executable(my_exe ${SOURCES}) find_package(Foo) target_compile_definitions(my_exe SOME_DEF_NEEDED_TO_USE_FOO) target_include_directories(my_exe ${FOO_INCLUDE_DIR}) target_link_libraries(my_exe ${FOO_LIBRARIES}) where the include directories, compiler definitions and libraries (Foo's usage requirements) have to be found by reading the FindFoo.cmake documentation. Since 2.8.11, CMake has a much better approach for propagating usage requirements between targets in the source tree [1]. The source target specifies target_compile_definitions/include_directories/link_libraries itself using the PUBLIC or INTERFACE keyword. Any target that links with the source target automatically inherits all the usage requirements. What I would like is to be able to do is: add_executable(my_exe ${SOURCES}) find_package(Foo) target_link_libraries(my_exe Foo) and have it Just Work. Is that possible? I've tried doing it with ExternalProject instead of find_package: add_executable(my_exe ${SOURCES}) ExternalProject_Add(Foo ...) # FAILS HERE target_include_directories(Foo INTERFACE ...) target_link_libraries(my_exe Foo) But that fails with "target_include_directories called with non-compilable target type". Is there a better way? Is there something I'm missing? I'd love to see a solution where adding a dependency with the Hunter package manager [2] becomes a one-liner once you know the package name. Right now, you still have to know the package-specific usage requirements every time. [1] http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html#build-specification-and-usage-requirements [2] https://github.com/ruslo/hunter Thanks, Alex -- Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org) From post at hendrik-sattler.de Sun Sep 7 07:04:23 2014 From: post at hendrik-sattler.de (Hendrik Sattler) Date: Sun, 07 Sep 2014 13:04:23 +0200 Subject: [CMake] Usage requirements for external project dependencies In-Reply-To: <86fvg3lqs0.fsf@doc.ic.ac.uk> References: <86fvg3lqs0.fsf@doc.ic.ac.uk> Message-ID: <49c32c9d-6d94-41e7-85ae-5d96265fb960@email.android.com> On 7. September 2014 11:32:31 MESZ, Alexander Lamaison wrote: >What I would like is to be able to do is: > >add_executable(my_exe ${SOURCES}) >find_package(Foo) >target_link_libraries(my_exe Foo) > >and have it Just Work. Is that possible? Yes, you just have to create an IMPORTED library target and manually set the INTERFACE_* properties for it. If you name the target with :: in it, then CMake knows that it's a target and not a library file base name. HS From yaoyansi at aliyun.com Sun Sep 7 10:23:45 2014 From: yaoyansi at aliyun.com (yaoyansi) Date: Sun, 07 Sep 2014 22:23:45 +0800 Subject: [CMake] =?utf-8?q?My_definitions_are_written_into_codeblocks_proj?= =?utf-8?q?ect_file_but_they_can=27t_be_shown_in_CodeBloks_IDE?= Message-ID: <2fe9c5ad-894a-4027-97b0-8a19336a3ccc@aliyun.com> I use cmake 2.8.11 on CentOS 7 x64. My cmake files and the generated CodeBlocks project files are attached, and here is a code section of my CMakeLists.txtset(MAYA_COMPILE_DEFINITIONS ?? ?REQUIRE_IOSTREAM _BOOL LINUX _LINUX LINUX_64) set(MAYA_COMPILE_FLAGS ?? ?"-m64 -g -pthread -pipe -fPIC -Wno-deprecated -fno-gnu-keywords" ) set(MAYA_LINK_FLAGS ?? ?"-shared -m64 -g -pthread -pipe -fPIC -Wno-deprecated -fno-gnu-keywords -Wl,-Bsymbolic" ) SET_TARGET_PROPERTIES( ${MY_PROJECT_NAME} ?? ?PROPERTIES ?? ??? ?COMPILE_DEFINITIONS?? ??? ?"${MAYA_COMPILE_DEFINITIONS}" ?? ??? ?COMPILE_FLAGS?? ??? ??? ?"${MAYA_COMPILE_FLAGS}" ?? ??? ?LINK_FLAGS?? ??? ??? ?"${MAYA_LINK_FLAGS}" ?? ??? ?PREFIX?? ??? ??? ??? ?"" ?? ??? ?SUFFIX?? ??? ??? ??? ?${MAYA_EXTENSION} ?? ??? ?OUTPUT_NAME?? ??? ??? ?${MY_PROJECT_NAME} ?? ??? ?LIBRARY_OUTPUT_DIRECTORY?? ?${CMAKE_CURRENT_SOURCE_DIR}/../../plug-ins )When I open the generated CodeBlocks project file dynamic_enum.cbp, I can't find any definitions in Project's build options window. My screenshot is attached either. But, when I open dynamic_enum.cbp with gedit, I can find these definitions. here it is:???????? ??????????? ??????????? ??????????? ??????????? ??????????? I don't know how to deal with it now. Is there any thing wrong in my CMakeLists.txt?Could you give me any help? Thank you in advance.Cheersyaoyansi -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dynamic_enum_cmake.zip Type: application/octet-stream Size: 40600 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot from 2014-09-07 22_12_38.png Type: application/octet-stream Size: 97008 bytes Desc: not available URL: From yaoyansi at aliyun.com Sun Sep 7 10:36:57 2014 From: yaoyansi at aliyun.com (yaoyansi) Date: Sun, 07 Sep 2014 22:36:57 +0800 Subject: [CMake] =?utf-8?q?How_can_I_find_the_values_of_COMPILE=5FFLAGS_an?= =?utf-8?q?d_LINK=5FFLAGS_in_cmake-generated_CodeBloks_files=3F?= Message-ID: <1df712dc-3f21-4b65-a5be-9f55d1b7e538@aliyun.com> Hi all,I use cmake 2.8.11 on CentOS 7 x64. My cmake files and the generated CodeBlocks project files are attached, and here is a code section of my CMakeLists.txt set(MAYA_COMPILE_FLAGS ?? ?"-m64 -g -pthread -pipe -fPIC -Wno-deprecated -fno-gnu-keywords" ) set(MAYA_LINK_FLAGS ?? ?"-shared -m64 -g -pthread -pipe -fPIC -Wno-deprecated -fno-gnu-keywords -Wl,-Bsymbolic" ) SET_TARGET_PROPERTIES( ${MY_PROJECT_NAME} ?? ?PROPERTIES ?? ??? ?COMPILE_DEFINITIONS?? ??? ?"${MAYA_COMPILE_DEFINITIONS}" ?? ??? ?COMPILE_FLAGS?? ??? ??? ?"${MAYA_COMPILE_FLAGS}" ?? ??? ?LINK_FLAGS?? ??? ??? ?"${MAYA_LINK_FLAGS}" ?? ??? ?PREFIX?? ??? ??? ??? ?"" ?? ??? ?SUFFIX?? ??? ??? ??? ?${MAYA_EXTENSION} ?? ??? ?OUTPUT_NAME?? ??? ??? ?${MY_PROJECT_NAME} ?? ??? ?LIBRARY_OUTPUT_DIRECTORY?? ?${CMAKE_CURRENT_SOURCE_DIR}/../../plug-ins ) When I open the generated file dynamic_enum.cbp with CodeBlocks IDE, I can't find any value of COMPILE_FLAGS and LINK_FLAGS in Project's build options window. And, when I open dynamic_enum.cbp with gedit, I can't find any values of COMPILE_FLAGS and LINK_FLAGS too.But when I build the project, I can find these value in CodeBlocks's build log window, here it is:/usr/bin/g++? -fPIC -g -shared -m64 -g -pthread -pipe -fPIC -Wno-deprecated -fno-gnu-keywords -Wl,-Bsymbolic?? -shared -Wl,-soname,dynamic_enum.so -o /home/user0/dev/mymagicbox/dynamic_enum/plug-ins/dynamic_enum.so CMakeFiles/dynamic_enum.dir/home/user0/dev/mymagicbox/dynamic_enum/src/dynamic_enum.cpp.o CMakeFiles/dynamic_enum.dir/home/user0/dev/mymagicbox/dynamic_enum/src/plugin.cpp.o? -L/usr/autodesk/maya2015-x64/lib -lFoundation -lOpenMaya -lOpenMayaUI -Wl,-rpath,/usr/autodesk/maya2015-x64/lib I don't know how to check the value of COMPILE_FLAGS and LINK_FLAGS in CodeBlocks IDE. Is there any thing wrong in my CMakeLists.txt? Could you give me any help? Thank you in advance. Cheers yaoyansi -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dynamic_enum_cmake.zip Type: application/octet-stream Size: 40600 bytes Desc: not available URL: From biddisco at cscs.ch Mon Sep 8 04:29:59 2014 From: biddisco at cscs.ch (Biddiscombe, John A.) Date: Mon, 8 Sep 2014 08:29:59 +0000 Subject: [CMake] getting the BuildID from cdash/ctest after a submit Message-ID: <50320452A334BD42A5EC72BAD214509918E29DC6@MBX210.d.ethz.ch> The dashboard I'm setting up is so helpful. Thanks cdash/ctest people. After a submit, is it possible to get the ID so that I can generate URLs that point to the test fails (because the buildbot is on another site and I'd like to generate links back to the dashboard on it) example URL : http://cdash.cscs.ch/viewTest.php?onlyfailed&buildid=5644 the only thing I need is the 5644 I think Is there any way of getting this from cdash after doing a ctest -D ExperimentalSubmit step Thanks JB -- John Biddiscombe, email:biddisco @.at.@ cscs.ch http://www.cscs.ch/ CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07 Via Trevano 131, 6900 Lugano, Switzerland | Fax: +41 (91) 610.82.82 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.petruchik at gmail.com Mon Sep 8 08:15:36 2014 From: alexey.petruchik at gmail.com (Alexey Petruchik) Date: Mon, 8 Sep 2014 15:15:36 +0300 Subject: [CMake] Get Visual Studio target Arch In-Reply-To: References: Message-ID: I dont want to go dirty way with if ("${CMAKE_GENERATOR}" STREQUAL ...) On Sat, Sep 6, 2014 at 5:02 PM, Alexey Petruchik wrote: > I want to use different library folders for x64/x86/arm architectures. > Cmake has different generators for each arch: "Visual Studio 12 > 2013", "Visual Studio 12 2013 ARM", "Visual Studio 12 2013 Win64". Is there > any cmake var to get visual studio target arch? CMAKE_SYSTEM_PROCESSOR is > always AMD64 for me no matter what generator I'm using. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From post at hendrik-sattler.de Mon Sep 8 08:31:06 2014 From: post at hendrik-sattler.de (Hendrik Sattler) Date: Mon, 08 Sep 2014 14:31:06 +0200 Subject: [CMake] Get Visual Studio target Arch In-Reply-To: References: Message-ID: <4bf7a20e-7bde-451a-ba40-00b15169a97f@email.android.com> Hi, I'm also interested in an answer to this question. IMHO the definition of CMAKE_SYSTEM_PROCESSOR is broken for Visual Studio generators although it matches the help entry. HS On 6. September 2014 16:02:56 MESZ, Alexey Petruchik wrote: >I want to use different library folders for x64/x86/arm architectures. >Cmake has different generators for each arch: "Visual Studio 12 >2013", "Visual Studio 12 2013 ARM", "Visual Studio 12 2013 Win64". Is >there >any cmake var to get visual studio target arch? CMAKE_SYSTEM_PROCESSOR >is >always AMD64 for me no matter what generator I'm using. > > >------------------------------------------------------------------------ > >-- > >Powered by www.kitware.com > >Please keep messages on-topic and check the CMake FAQ at: >http://www.cmake.org/Wiki/CMake_FAQ > >Kitware offers various services to support the CMake community. For >more information on each offering, please visit: > >CMake Support: http://cmake.org/cmake/help/support.html >CMake Consulting: http://cmake.org/cmake/help/consulting.html >CMake Training Courses: http://cmake.org/cmake/help/training.html > >Visit other Kitware open-source projects at >http://www.kitware.com/opensource/opensource.html > >Follow this link to subscribe/unsubscribe: >http://public.kitware.com/mailman/listinfo/cmake -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.petruchik at gmail.com Mon Sep 8 08:51:33 2014 From: alexey.petruchik at gmail.com (Alexey Petruchik) Date: Mon, 8 Sep 2014 15:51:33 +0300 Subject: [CMake] Get Visual Studio target Arch In-Reply-To: References: Message-ID: There are also CMAKE_CL_64\CMAKE_FORCE_WIN64\CMAKE_FORCE_IA64 vars. But it seems to be a x64-only hack not a good generic solution On Mon, Sep 8, 2014 at 3:15 PM, Alexey Petruchik wrote: > I dont want to go dirty way with if ("${CMAKE_GENERATOR}" STREQUAL ...) > > > On Sat, Sep 6, 2014 at 5:02 PM, Alexey Petruchik < > alexey.petruchik at gmail.com> wrote: > >> I want to use different library folders for x64/x86/arm architectures. >> Cmake has different generators for each arch: "Visual Studio 12 >> 2013", "Visual Studio 12 2013 ARM", "Visual Studio 12 2013 Win64". Is there >> any cmake var to get visual studio target arch? CMAKE_SYSTEM_PROCESSOR is >> always AMD64 for me no matter what generator I'm using. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Mon Sep 8 09:01:18 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Mon, 08 Sep 2014 15:01:18 +0200 Subject: [CMake] Get Visual Studio target Arch In-Reply-To: References: Message-ID: <540DA89E.8070105@gmail.com> On 09/08/2014 02:51 PM, Alexey Petruchik wrote: > There are also CMAKE_CL_64\CMAKE_FORCE_WIN64\CMAKE_FORCE_IA64 vars. But > it seems to be a x64-only hack not a good generic solution There seem to be MSVC_C_ARCHITECTURE_ID and MSVC_CXX_ARCHITECTURE_ID though given that I don't see them documented they are probably considered internal. Nils From alexey.petruchik at gmail.com Mon Sep 8 10:41:17 2014 From: alexey.petruchik at gmail.com (Alexey Petruchik) Date: Mon, 8 Sep 2014 17:41:17 +0300 Subject: [CMake] Get Visual Studio target Arch In-Reply-To: <540DA89E.8070105@gmail.com> References: <540DA89E.8070105@gmail.com> Message-ID: It would be really great to get comprehensive answer from one of cmake devs. On Mon, Sep 8, 2014 at 4:01 PM, Nils Gladitz wrote: > On 09/08/2014 02:51 PM, Alexey Petruchik wrote: > >> There are also CMAKE_CL_64\CMAKE_FORCE_WIN64\CMAKE_FORCE_IA64 vars. But >> it seems to be a x64-only hack not a good generic solution >> > > There seem to be MSVC_C_ARCHITECTURE_ID and MSVC_CXX_ARCHITECTURE_ID > though given that I don't see them documented they are probably considered > internal. > > Nils > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlrdave at aol.com Mon Sep 8 12:08:53 2014 From: dlrdave at aol.com (David Cole) Date: Mon, 8 Sep 2014 12:08:53 -0400 Subject: [CMake] Ctest building with Multiple Processors Message-ID: <8D1999651C01335-1768-2BBF9@webmail-m244.sysops.aol.com> I wrote this blog post a couple years ago claiming "one way to run a dashboard on windows": http://cmake.blogspot.com/2012/09/one-way-to-run-dashboard-on-windows.html As with all such things, there are, of course, multiple ways to solve "the problem." At the time I wrote it, I trusted Visual Studio to do its best at building the projects in parallel without passing any explicit flags to do so. If you really need to squeeze out the best build time, but you still want to use the VS compiler, I would recommend setting up an environment for using ninja in conjunction with the VS compiler. If you need more advice than all this once you hit a specific issue, do ask further questions once you have them. HTH, David C. From dlrdave at aol.com Mon Sep 8 12:29:57 2014 From: dlrdave at aol.com (David Cole) Date: Mon, 8 Sep 2014 12:29:57 -0400 Subject: [CMake] getting the BuildID from cdash/ctest after a submit Message-ID: <8D19999434E1BF5-1768-2BF71@webmail-m244.sysops.aol.com> No, but if you go to the "Tests Query" page, and set up a filter, you can construct a URL for showing the failed tests with a given build name and site name for the date in question... Almost as good. Start here: http://cdash.cscs.ch/queryTests.php?project=HPX&date=2014-09-08 (found from the project's dashboard page by clicking on "Dashboard > Tests Query" drop down menu) - Choose "Status" "is" "Failed" - Click the "+" button to add another criteria - Choose "Site" "is" "x86_64-boost-1550_debug" - Click the "+" button to add another criteria - Choose "Build name" "is" "intel-130" - Click "Apply" to execute the filter - Click "Create Hyperlink" to construct a URL you can come back to see the filtered results without repeating all that effort. Gives me a long URL that looks like this: http://cdash.cscs.ch/queryTests.php?project=HPX&date=2014-09-08&filtercount=3&showfilters=1&filtercombine=and&field1=status/string&compare1=61&value1=Failed&field2=site/string&compare2=61&value2=x86_64-boost-1550_debug&field3=buildname/string&compare3=61&value3=intel-130 CDash could be modified to return the build id for a submit operation, but only when it is processing submissions synchronously as it receives them. In the asynchronous case, the build id is unknown until later, so it would be impossible to return the value at submit time. HTH, David C. From damiannohales at gmail.com Mon Sep 8 13:44:33 2014 From: damiannohales at gmail.com (=?UTF-8?Q?Dami=C3=A1n_Nohales?=) Date: Mon, 8 Sep 2014 14:44:33 -0300 Subject: [CMake] Developing GResource support in CMake Message-ID: Hello there, I was trying to develop a CMake module to add GResource (a GLib component) support for CMake. For people that doesn't know about GResource, it's a component that helps to add files bundled to the binary file. The component provides an utility called "glib-compile-resources" that generates an .h and .c file with the bundle code, these files are generated from an XML file that contains the list of files to be bundled. This utility also can be used to get the plain list of files that are going to be bundled, separated by lines. So, the module needs to works as the following: - It has function called gresource_add_file (I'm planning to add support to add multiple files at once, but for now is fine), this functions accepts the GResource XML file and returns a variable with the name of generated .h and .c files to be used to compile an executable. - When the XML file changes or any of the specified files in the XML file changes, the .h and .c files needs to be regenerated on make. I attach my current work, it partially works, my problem is that I generate the files-to-be-bundled list at configure time (the glib-compile-resources --generate-dependencies call) to get .h and .c files dependencies, so, for example, let say I do the following: 1) Create my XML with file-a.png and file-b.png specified to be bundled, add it to my CMakeLists.txt through gresource_add_file function. 2) If I modify my XML, file-a.png or file-b.png, the GResource .h and .c are regenerated on make as expected. 3) Let say I want to add file-c.png to my XML, I run make again, the .h and .c files are regenerated since I modified the XML file. 4) Now I modify only file-c.png, I run make again, but the .h and .c files are NOT regenerated. If you see my code, the problem is obvious, as I mentioned, I am generating the files-to-be-bundled list at configure time... so, when I add file-c.png, this list is not refreshed since didn't run cmake again. Any ideas on how to do it right? It's quite tricky, I can't figure out the working solution, can I generate dependencies for add_custom_command dynamically with a shell call that is executed as is by target buildsystem? Thanks in advance! Dami?n. -------------- next part -------------- A non-text attachment was scrubbed... Name: GResource.cmake Type: text/x-cmake Size: 1911 bytes Desc: not available URL: From gerhard.olsson at volvo.com Mon Sep 8 13:45:41 2014 From: gerhard.olsson at volvo.com (Olsson Gerhard) Date: Mon, 8 Sep 2014 17:45:41 +0000 Subject: [CMake] Compilation logs: Workaround for no appendfile Message-ID: <289541F89243ED47BC4BAE6C83560E9E47191DDA@SEGOTNC5181-N1.vcn.ds.volvo.net> ARM DS-5 compiler (armcc compiler 5.04) Platform: Windows and Linux Armcc (as well as arasm, armlink etc) has option '-errors=file 'to log compilation messages (warnings and errors) to a logfile instead of stdout. There is no possibility from what I have found out to append to a log file, all output overwrites the log. Background: We cannot change some 3rd party code and cannot suppress all compilation warnings. The workaround is to parse the logs. If printed to the console, the messages are mixed up with progress and license messages. Other compilers has the possibility to append to logs, but not armcc what I can find. A workaround would be to CMake to save stdout to a logfile. May be possible, but I am not sure that is a good solution. Another is to log to unique logname, include the compiled file in the logname. I am not sure how that can be done in CMake. Any hints how to do this? /Gerhard -------------- next part -------------- An HTML attachment was scrubbed... URL: From gjasny at googlemail.com Mon Sep 8 15:06:00 2014 From: gjasny at googlemail.com (Gregor Jasny) Date: Mon, 08 Sep 2014 21:06:00 +0200 Subject: [CMake] Get Visual Studio target Arch In-Reply-To: References: Message-ID: <540DFE18.3080809@googlemail.com> On 06/09/14 16:02, Alexey Petruchik wrote: > I want to use different library folders for x64/x86/arm architectures. > Cmake has different generators for each arch: "Visual Studio 12 > 2013", "Visual Studio 12 2013 ARM", "Visual Studio 12 2013 Win64". Is there > any cmake var to get visual studio target arch? CMAKE_SYSTEM_PROCESSOR is > always AMD64 for me no matter what generator I'm using. All the already available stuff in cmake is not sufficient. Especially if you start to cross compile. I use the pre-defined C/C++ preprocessor symbols for that: include(CheckSymbolExists) if(WIN32) check_symbol_exists("_M_AMD64" "" RTC_ARCH_X64) if(NOT RTC_ARCH_X64) check_symbol_exists("_M_IX86" "" RTC_ARCH_X86) endif(NOT RTC_ARCH_X64) # add check for arm here # see http://msdn.microsoft.com/en-us/library/b0084kay.aspx else(WIN32) check_symbol_exists("__i386__" "" RTC_ARCH_X86) check_symbol_exists("__x86_64__" "" RTC_ARCH_X64) check_symbol_exists("__arm__" "" RTC_ARCH_ARM) endif(WIN32) Now you could write: if(RTC_ARCH_X64) set(MY_LIB_DIR x64) elseif(RTC_ARCH_X86) set(MY_LIB_DIR x86) elseif(RTC_ARCH_ARM) set(MY_LIB_DIR x86) else() message(FATAL_ERROR "Unknown architecture") endif() I hope this helps. Thanks, Gregor From d3ck0r at gmail.com Mon Sep 8 17:18:50 2014 From: d3ck0r at gmail.com (J Decker) Date: Mon, 8 Sep 2014 14:18:50 -0700 Subject: [CMake] Request for added script intelligence Message-ID: Can something like ... SET( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP 1 ) if( ${CMAKE_BUILD_TYPE} MATCHES "[dD][eE][bB][uU][gG]" ) SET( CMAKE_INSTALL_DEBUG_LIBRARIES 1 ) SET( CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY 1 ) endif( ${CMAKE_BUILD_TYPE} MATCHES "[dD][eE][bB][uU][gG]" ) INCLUDE(InstallRequiredSystemLibraries) INSTALL( FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ${BINARY_OUTPUT_DIR} ) be added to 'InstallRequiredSystemLibraries' Or what is the appropriate variable instead of CMAKE_BUILD_TYPE to use for parallel builds? In any case, can some intelligence for selecting to install debug system libraries instead of just release be added? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jamesbigler at gmail.com Mon Sep 8 17:27:02 2014 From: jamesbigler at gmail.com (James Bigler) Date: Mon, 8 Sep 2014 15:27:02 -0600 Subject: [CMake] replacement for link_directories that support generator expressions Message-ID: Is there an equivalent command to link_directories that support generator expressions? link_directories( $<$:${PROG_LIBRARY_DIRS_RELWITHDEBCRT}> ) link_directories( $>:${PROG_LIBRARY_DIRS}> ) Basically I want to use PROG_LIBRARY_DIRS_RELWITHDEBCRT for Debug builds and PROG_LIBRARY_DIRS for everything else. I'm sure I can go and use set_target_properties or something like that, but I was wondering if there was some way I could make this work, before I have to do a much larger change. James -------------- next part -------------- An HTML attachment was scrubbed... URL: From d3ck0r at gmail.com Mon Sep 8 17:56:41 2014 From: d3ck0r at gmail.com (J Decker) Date: Mon, 8 Sep 2014 14:56:41 -0700 Subject: [CMake] Files always install Message-ID: This is sort of a place holder... I have defined set( CMAKE_INSTALL_MESSAGE "LAZY" ) I have a CMakeLists.txt that may be added multiple times that does SET( BASE_IMAGES ${CMAKE_CURRENT_SOURCE_DIR}/frame_border.png ${CMAKE_CURRENT_SOURCE_DIR}/sky.jpg ${CMAKE_CURRENT_SOURCE_DIR}/dial2a.png ${CMAKE_CURRENT_SOURCE_DIR}/dial2.png ${CMAKE_CURRENT_SOURCE_DIR}/dial1a.png ${CMAKE_CURRENT_SOURCE_DIR}/dial1.png ) if( INSTALL_FRAME_BORDER ) INSTALL( FILES ${BASE_IMAGES} DESTINATION ${INSTALL_FRAME_BORDER} ) endif( INSTALL_FRAME_BORDER ) ----- which is included in one place set( INSTALL_FRAME_BORDER ${INTERFACE_OUTPUT_DIR}/images ) add_subdirectory( data ) This command doesn't work, it says 'no directory INSTALL' when the directory is actually '.' (after --build)... I'd like to know what's triggering the copy. The file is up-to-date and, is the only one in the set that does this. C:\tools\unix\cmake\bin\cmake.exe --trace --build . --config Debug --target INSTALL This command usually has "-- /m:4 /v:m" appended to it, and --trace also doesn't respect -- as end of command line options ------------ My output's last 3 lines are ------------------ -- Install configuration: "Debug" -- Installing: C:/General/Build/sack/debug_out/core/bin/images/sky.jpg -- Installing: C:/General/Build/sack/debug_out/core/bin/images/sky.jpg ---------- cmake_install.cmake has these lines referencing sky.jpg /* installs to .../bin/images */ /*${CMAKE_BINARY_DIR}/data/cmake_installl.cmake */ if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/images" TYPE FILE MESSAGE_LAZY FILES "c:/General/Work/sack/data/frame_border.png" "c:/General/Work/sack/data/sky.jpg" "c:/General/Work/sack/data/dial2a.png" "c:/General/Work/sack/data/dial2.png" "c:/General/Work/sack/data/dial1a.png" "c:/General/Work/sack/data/dial1.png" ) endif() /* installs to .../resources/images */ /* ${CMAKE_BINARY_DIR}/src/msgsvr/testdisplay/cmake_install.cmake */ if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/resources/images" TYPE FILE MESSAGE_LAZY FILES "c:/General/Work/sack/src/msgsvr/testdisplay/background.jpg" "c:/General/Work/sack/src/msgsvr/testdisplay/daub.png" "c:/General/Work/sack/src/msgsvr/testdisplay/playagain.jpg" "c:/General/Work/sack/src/msgsvr/testdisplay/playing.jpg" "c:/General/Work/sack/src/msgsvr/testdisplay/sky.jpg" "c:/General/Work/sack/src/msgsvr/testdisplay/slot_strip.2.jpg" "c:/General/Work/sack/src/msgsvr/testdisplay/slot_strip.jpg" ) endif() ------------------------- There's only the 2 references and the image is only reported as installed twice into bin/images ... but it is 'installed' every time... whereas all of the other files that are referenced with it are not. Any idea how I can figure out why? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Mon Sep 8 18:06:26 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Tue, 09 Sep 2014 00:06:26 +0200 Subject: [CMake] replacement for link_directories that support generator expressions In-Reply-To: References: Message-ID: <540E2862.1060702@gmail.com> On 08.09.2014 23:27, James Bigler wrote: > Is there an equivalent command to link_directories that support > generator expressions? > > link_directories( > $<$:${PROG_LIBRARY_DIRS_RELWITHDEBCRT}> ) > link_directories( $>:${PROG_LIBRARY_DIRS}> ) > > Basically I want to use PROG_LIBRARY_DIRS_RELWITHDEBCRT for Debug > builds and PROG_LIBRARY_DIRS for everything else. > > I'm sure I can go and use set_target_properties or something like > that, but I was wondering if there was some way I could make this > work, before I have to do a much larger change. > The documentation for link_directories() notes that the command is rarely necessary since target_link_libraries() takes absolute paths. target_link_libraries() itself understands generator expressions. What is your use case for link_directories()? If absolutely need be a viable though I guess not portable and possibly frowned upon workaround might be something like: target_link_libraries(foo PRIVATE -Lfoo/$/bar) # assumes -L adds a linker directory Given that target_link_libraries() also allows (non library) linker options. Nils From dlrdave at aol.com Mon Sep 8 20:40:10 2014 From: dlrdave at aol.com (David Cole) Date: Mon, 8 Sep 2014 20:40:10 -0400 Subject: [CMake] Request for added script intelligence In-Reply-To: References: Message-ID: <8D199DDBE8ADAC8-1768-2F067@webmail-m244.sysops.aol.com> I don't think that's a good idea. The Debug libraries are supposed to be non-redistributable. (At least that used to be true... is it still true?) To Debug a VS-built project, you have to run it on a machine with VS installed, so there's not a compelling need to "install" the debug libraries anyway. The capability is in there if you *must* have an install tree with Debug libraries in it for some reason, but it's not supposed to be the norm, and I don't think we should make it easy to do. If you're going to go against the license terms, you should have to do it explicitly in your own code... not as a side effect of a default behavior that CMake provides. Just my opinion, David C. From d3ck0r at gmail.com Mon Sep 8 20:53:30 2014 From: d3ck0r at gmail.com (J Decker) Date: Mon, 8 Sep 2014 17:53:30 -0700 Subject: [CMake] Request for added script intelligence In-Reply-To: <8D199DDBE8ADAC8-1768-2F067@webmail-m244.sysops.aol.com> References: <8D199DDBE8ADAC8-1768-2F067@webmail-m244.sysops.aol.com> Message-ID: Then it should be default in debug build not copy the release libraries which are unreferenced anyway. 'sides that... I'm only asking for the leading intelligence before the include, and not including the INSTALL line. I'm not asking to change having to add a INSTALL rule... just having a better default list of what should be copied. On Mon, Sep 8, 2014 at 5:40 PM, David Cole wrote: > I don't think that's a good idea. > > The Debug libraries are supposed to be non-redistributable. (At least that > used to be true... is it still true?) To Debug a VS-built project, you have > to run it on a machine with VS installed, so there's not a compelling need > to "install" the debug libraries anyway. > > The capability is in there if you *must* have an install tree with Debug > libraries in it for some reason, but it's not supposed to be the norm, and > I don't think we should make it easy to do. > > If you're going to go against the license terms, you should have to do it > explicitly in your own code... not as a side effect of a default behavior > that CMake provides. > > > Just my opinion, > David C. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sonyablade2010 at hotmail.com Tue Sep 9 07:34:08 2014 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Tue, 9 Sep 2014 12:34:08 +0100 Subject: [CMake] Corrupted CmakeLists.txt File how to heal it ? Message-ID: Dear All, I find ti very difficult to configure the project which has the following CMakeLists.txt at the attachement.The CMakeLists is automatically created with FireBreath Python script (fbgen.py) and is supposed to run on Win32/64 compiled with MSVS10~13 and MinGW compilers. After compilation it is supposed to create a osgWeb plugin of OpenSceneGraph library which will be used in Web applications for rendering. I Use Cmake-GUI 2.8.12.2 to configure the CMakeLists.txt file but no matter which compiler I set ( I prefer Code::Blocks MinGW Makefile) Cmake-GUI produces the "Error in configurition process, project files may be invalid" dialog, with following report, CMake Error at CMakeLists.txt:11 (Project): project PROJECT called with incorrect number of arguments CMake Error at CMakeLists.txt:39 (include_platform): Unknown CMake command "include_platform". Configuring incomplete, errors occurred! What is wrong here I 'll appreciate your guidance, -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CMakeLists.txt URL: From nico.schloemer at gmail.com Tue Sep 9 07:45:11 2014 From: nico.schloemer at gmail.com (=?UTF-8?Q?Nico_Schl=C3=B6mer?=) Date: Tue, 9 Sep 2014 14:45:11 +0300 Subject: [CMake] INCLUDE() guards Message-ID: Hi all, I have a project with multiple interdependent subpackages here, each of which has its own export config file. The dependency hierarchy is reflected in the `INCLUDE()` statements in the export files. I would like to avoid that an export config file is included more than once, so I'm guarding the files with ``` IF(NOT _CONFIG_INCLUDED) SET(_CONFIG_INCLUDED 1) [...] [...] ENDIF() ``` This looks very much like the old C/C++ `#ifdef` `#include` header guards, so I was wondering if this is an appropriate pattern for CMake too. Or maybe there is another CMake command that already does exactly what I want? Cheers, Nico From nilsgladitz at gmail.com Tue Sep 9 07:56:15 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Tue, 09 Sep 2014 13:56:15 +0200 Subject: [CMake] Corrupted CmakeLists.txt File how to heal it ? In-Reply-To: References: Message-ID: <540EEADF.1020906@gmail.com> On 09/09/2014 01:34 PM, Sonya Blade wrote: > I Use Cmake-GUI 2.8.12.2 to configure the CMakeLists.txt file but no > matter which compiler I set ( I prefer Code::Blocks MinGW Makefile) > Cmake-GUI produces the "Error in configurition process, project files > may be invalid" dialog, with following report, > > /CMake Error at CMakeLists.txt:11 (Project): > project PROJECT called with incorrect number of arguments > > / > /CMake Error at CMakeLists.txt:39 (include_platform): > Unknown CMake command "include_platform". > > / > /Configuring incomplete, errors occurred!/ > / > / > What is wrong here I 'll appreciate your guidance, Is it possible that this isn't the top-level CMakeLists.txt? It looks like the PLUGIN_NAME variable isn't set which is probably why project() complains. Also I see nothing that would define the include_platform() function/macro which is missing. Maybe both the variable and the function/macro are set up in a parent CMakeLists.txt? Nils From sonyablade2010 at hotmail.com Tue Sep 9 08:05:20 2014 From: sonyablade2010 at hotmail.com (Sonya Blade) Date: Tue, 9 Sep 2014 13:05:20 +0100 Subject: [CMake] Corrupted CmakeLists.txt File how to heal it ? In-Reply-To: <540EEADF.1020906@gmail.com> References: , <540EEADF.1020906@gmail.com> Message-ID: Hi Nils,You guess is correct it is not top level CMakeLists.txt, but actually originator instruct to do soand even instruct to add the additional lines to sub-level CMakeLists.txt. Probably I misinterpreted it,and probably this is what he meant:"Add the additional lines to the sub level CmakeLists but run the top-level Cmakelists file". In in case modifying the auto generated code sounds weird to me, as a more experienced user than me do you spot any abnormalities by runing a quick eye at the code below ? Originator Quote (OSG Cookbook){When we have the CMakeLists.txt file in the project folder (in projects/osgWeb), open it with any text editor and modify the last few lines: find_path( OPENSCENEGRAPH_ROOT include/osg/Node PATHS$ENV{OSG_ROOT} )include_directories( ${OPENSCENEGRAPH_ROOT}/include )link_directories( ${Boost_LIBRARY_DIRS}${OPENSCENEGRAPH_ROOT}/lib )include_platform()target_link_libraries(${PROJECT_NAME} OpenThreadsosg osgDB osgGA osgViewer)}Regards, > Date: Tue, 9 Sep 2014 13:56:15 +0200 > From: nilsgladitz at gmail.com > To: sonyablade2010 at hotmail.com; cmake at cmake.org > Subject: Re: [CMake] Corrupted CmakeLists.txt File how to heal it ? > > On 09/09/2014 01:34 PM, Sonya Blade wrote: > > I Use Cmake-GUI 2.8.12.2 to configure the CMakeLists.txt file but no > > matter which compiler I set ( I prefer Code::Blocks MinGW Makefile) > > Cmake-GUI produces the "Error in configurition process, project files > > may be invalid" dialog, with following report, > > > > /CMake Error at CMakeLists.txt:11 (Project): > > project PROJECT called with incorrect number of arguments > > > > / > > /CMake Error at CMakeLists.txt:39 (include_platform): > > Unknown CMake command "include_platform". > > > > / > > /Configuring incomplete, errors occurred!/ > > / > > / > > What is wrong here I 'll appreciate your guidance, > > Is it possible that this isn't the top-level CMakeLists.txt? > > It looks like the PLUGIN_NAME variable isn't set which is probably why > project() complains. > > Also I see nothing that would define the include_platform() > function/macro which is missing. > > Maybe both the variable and the function/macro are set up in a parent > CMakeLists.txt? > > Nils -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlrdave at aol.com Tue Sep 9 08:13:31 2014 From: dlrdave at aol.com (David Cole) Date: Tue, 9 Sep 2014 08:13:31 -0400 Subject: [CMake] Request for added script intelligence In-Reply-To: References: <8D199DDBE8ADAC8-1768-2F067@webmail-m244.sysops.aol.com> Message-ID: <8D19A3E9A7E80AB-1768-31817@webmail-m244.sysops.aol.com> Let's see if anybody else chimes in with an opinion. I've already given mine, and I don't think there's a good argument for making installing the debug runtime libraries any easier than it already is. You can certainly write a wrapper script around the existing CMake InstallRequiredSystemLibraries that has additional logic surrounding it. Whatever the case, if any change to CMake is proposed, it should take Visual Studio generator usage into account: i.e. -- do not rely on CMAKE_BUILD_TYPE, as it is typically empty/not set in a multi-configuration VS build. Thanks, David C. From nilsgladitz at gmail.com Tue Sep 9 08:18:38 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Tue, 09 Sep 2014 14:18:38 +0200 Subject: [CMake] Corrupted CmakeLists.txt File how to heal it ? In-Reply-To: References: , <540EEADF.1020906@gmail.com> Message-ID: <540EF01E.8000401@gmail.com> On 09/09/2014 02:05 PM, Sonya Blade wrote: > Hi Nils, > You guess is correct it is not top level CMakeLists.txt, but actually > originator instruct to do so > and even instruct to add the additional lines to sub-level > CMakeLists.txt. Probably I misinterpreted it, > and probably this is what he meant: > "Add the additional lines to the sub level CmakeLists but run the > top-level Cmakelists file". > > In in case modifying the auto generated code sounds weird to me, as a > more experienced user than me > do you spot any abnormalities by runing a quick eye at the code below ? > > Originator Quote (OSG Cookbook) > { > /When we have the CMakeLists.txt file in the project folder (in projects// > /osgWeb), open it with any text editor and modify the last few lines:/ > / > / > /find_path( OPENSCENEGRAPH_ROOT include/osg/Node PATHS/ > /$ENV{OSG_ROOT} )/ > /include_directories( ${OPENSCENEGRAPH_ROOT}/include )/ > /link_directories( ${Boost_LIBRARY_DIRS}/ > /${OPENSCENEGRAPH_ROOT}/lib )/ > /include_platform()/ > /target_link_libraries(${PROJECT_NAME} OpenThreads/ > /osg osgDB osgGA osgViewer)/ > } If the issue is with the generator you might want to bring this up with the project maintainers. Generated CMake projects are a bit of an oddity given that most CMake projects are handwritten and CMake itself does not provide the facilities used for the generation. Nils From vincent.lzhang at gmail.com Tue Sep 9 10:14:42 2014 From: vincent.lzhang at gmail.com (Vincent L.Zhang) Date: Tue, 9 Sep 2014 22:14:42 +0800 Subject: [CMake] ITK compiling problem with CMake Message-ID: Hi, I'm learning ITK for some image registration project. But just at the first step, I met a problem compiling it with CMake. The CMakeError log as following: *Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.* *Compiler: * *Build flags: * *Id flags: * *The output was:* *The System cannot find the file specified.* *Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.* *Compiler: * *Build flags: * *Id flags: * *The output was:* *The System cannot find the file specified.* The OS on my computer is Windows 8.1 with Visual Studio 2012 Pro. It seems a CMake problem, but I don't know how to solve. I'll appreciate your help. Yours, Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From damiannohales at gmail.com Tue Sep 9 10:36:33 2014 From: damiannohales at gmail.com (=?UTF-8?Q?Dami=C3=A1n_Nohales?=) Date: Tue, 9 Sep 2014 11:36:33 -0300 Subject: [CMake] Dinamically generated dependencies Message-ID: Hi, I am trying to generate file that depends on a set of files that can change throughout different make invocations. To understand it better, let's show you the code: ----------- cmake_minimum_required(VERSION 2.8) project(demo-one C) add_custom_command( OUTPUT "${CMAKE_BINARY_DIR}/generated.c" COMMAND generate -o "${CMAKE_BINARY_DIR}/generated.c" DEPENDS "$(shell generate-dependencies-list)" COMMENT "Generating generated.c" ) add_executable(main main.c "${CMAKE_BINARY_DIR}/generated.c") ----------- So, I want to generate the file generated.c with the "generate" command and this files needs to be regenerated when the files specified by "generated-dependencies-list" command changes. As you may notice, "generated-dependencies-list" can generate different set of files throughout different make invocations, so is not feasible to get the result of "generated-dependencies-list" at configure time to then pass the result to add_custom_command. Actually the above code somewhat works, but it looks like a hack that will only work for Makefile backend, also the make rule doesn't look as what I'm expecting, after all, it's a hack: generated.c: ../$(shell\ generate-dependencies-list) Has CMake any feature to achieve this? Basically, I want this rule or something to get the same result: generated.c: $(shell generate-dependencies-list) From tom.kacvinsky at vectorcast.com Tue Sep 9 11:02:18 2014 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Tue, 9 Sep 2014 11:02:18 -0400 Subject: [CMake] Building library with a collection of source + pre-existing object files (which are not compiled via the cmake build system) Message-ID: Hi, I have not been able to find this in the cmake documentation. I have a collection of source that needs to be compiled via the cmake build system, plus a collection of object files that were compiled outside the cmake build system. I want to combine the two of these to make a shared library, but apparently add_library only takes a list of source files. Is there a way of getting cmake to build a shared library with the collection of source and object files I have? I know I could make an archive of the object files and use that library in target_link_libraries, but I would like to avoid this if I can. Thanks, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Tue Sep 9 11:25:54 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Tue, 09 Sep 2014 17:25:54 +0200 Subject: [CMake] Building library with a collection of source + pre-existing object files (which are not compiled via the cmake build system) In-Reply-To: References: Message-ID: <540F1C02.7010700@gmail.com> On 09.09.2014 17:02, Tom Kacvinsky wrote: > Hi, > > I have not been able to find this in the cmake documentation. I have a > collection of source that needs to be compiled via the cmake build > system, plus a collection of object files that were compiled outside > the cmake build system. I want to combine the two of these to make a > shared library, but apparently add_library only takes a list of source > files. Is there a way of getting cmake to build a shared library with > the collection of source and object files I have? I know I could make > an archive of the object files and use that library in > target_link_libraries, but I would like to avoid this if I can. > You should be able to list your object files like regular source files. If they have known object file extensions they should be detected as such (.obj, .o, .lo). Otherwise you can try setting the EXTERNAL_OBJECT[1] source file property for them. Nils [1] www.cmake.org/cmake/help/v3.0/prop_sf/EXTERNAL_OBJECT.html From tom.kacvinsky at vectorcast.com Tue Sep 9 11:31:44 2014 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Tue, 9 Sep 2014 11:31:44 -0400 Subject: [CMake] Building library with a collection of source + pre-existing object files (which are not compiled via the cmake build system) In-Reply-To: <540F1C02.7010700@gmail.com> References: <540F1C02.7010700@gmail.com> Message-ID: Thank you, Nils. Tom On Tue, Sep 9, 2014 at 11:25 AM, Nils Gladitz wrote: > On 09.09.2014 17:02, Tom Kacvinsky wrote: > >> Hi, >> >> I have not been able to find this in the cmake documentation. I have a >> collection of source that needs to be compiled via the cmake build system, >> plus a collection of object files that were compiled outside the cmake >> build system. I want to combine the two of these to make a shared library, >> but apparently add_library only takes a list of source files. Is there a >> way of getting cmake to build a shared library with the collection of >> source and object files I have? I know I could make an archive of the >> object files and use that library in target_link_libraries, but I would >> like to avoid this if I can. >> >> > You should be able to list your object files like regular source files. > If they have known object file extensions they should be detected as such > (.obj, .o, .lo). > Otherwise you can try setting the EXTERNAL_OBJECT[1] source file property > for them. > > Nils > > [1] www.cmake.org/cmake/help/v3.0/prop_sf/EXTERNAL_OBJECT.html > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nico.schloemer at gmail.com Wed Sep 10 19:07:09 2014 From: nico.schloemer at gmail.com (=?UTF-8?Q?Nico_Schl=C3=B6mer?=) Date: Thu, 11 Sep 2014 02:07:09 +0300 Subject: [CMake] missing INTERFACE_LINK_LIBRARIES in target export files Message-ID: Hi all, in a CMake project of mine, I build shared libraries and link against third-party shared libraries. In the export target files, I find ``` add_library(mylib SHARED IMPORTED) ``` as expected, but I'm *missing* anything along the lines of ``` set_target_properties(mylib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" INTERFACE_LINK_LIBRARIES "/usr/lib/lapack.so" ) ``` Any idea why this isn't present? Note that I'm *not* using the `PRIVATE` keyword in `TARGET_LINK_LIBRARIES()`. Cheers, Nico From ravi.raman at Xoriant.Com Thu Sep 11 01:59:55 2014 From: ravi.raman at Xoriant.Com (Ravi Raman) Date: Thu, 11 Sep 2014 05:59:55 +0000 Subject: [CMake] Incorrect object file name on cmake compilation Message-ID: <769e221bf04c4bfda62238f36dbbbcc2@XORMUM-MBX01.India.XoriantCorp.com> Hi, We are working on a cmake project. The issue is that the cmake build is successful but after the execution of cmake build step, the name of the object file is incorrect. On compilation of the source file main.cpp, the name of the object file is coming incorrectly as main.cpp.obj instead of main.obj To simulate the problem, please find attached herewith a zip file that contains CMakeLists.txt main.cpp main.rc The source list contains "main.cpp" and the resource file "main.rc" Please note the following: 1. This problem occurs only when the resource file main.rc is present in the list. 2. This problem does not occur when the resource file main.rc is excluded from the list OR if the resource file has a name other than main.rc Thanks & Regards Ravi Raman Xoriant Solutions Pvt. Ltd 4th Floor, Winchester, Hiranandani Business Park, Powai, Mumbai 400076, INDIA. Tel: +91 22 30511000,9930100026 Extn: 2144 Voip No. 4088344495/96/97/98 Voip Extn:1178| Fax: +91 22 30511111 ravi.raman at xoriant.com| http://www.xoriant.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ObjFileName.zip Type: application/x-zip-compressed Size: 656 bytes Desc: ObjFileName.zip URL: From petr.kmoch at gmail.com Thu Sep 11 02:41:08 2014 From: petr.kmoch at gmail.com (Petr Kmoch) Date: Thu, 11 Sep 2014 08:41:08 +0200 Subject: [CMake] Incorrect object file name on cmake compilation In-Reply-To: <769e221bf04c4bfda62238f36dbbbcc2@XORMUM-MBX01.India.XoriantCorp.com> References: <769e221bf04c4bfda62238f36dbbbcc2@XORMUM-MBX01.India.XoriantCorp.com> Message-ID: Hi Ravi. In what sense is the name "incorrect?" There is no correct/incorrect way to name object files in relation to the source file name; it can be arbitrary, as long as it's correctly passed on to the linker. I believe CMake chooses to append ".obj" to the whole file name if there is more than one file with the same base name. But why should this be a problem? Petr On Thu, Sep 11, 2014 at 7:59 AM, Ravi Raman wrote: > Hi, > > > > We are working on a cmake project. > > > > The issue is that the cmake build is successful but after the execution of > cmake build step, the name of the object file is incorrect. On compilation > of the source file main.cpp, the name of the object file is coming > incorrectly as main.cpp.obj instead of main.obj > > > > To simulate the problem, please find attached herewith a zip file that > contains > > CMakeLists.txt > > main.cpp > > main.rc > > The source list contains ?main.cpp? and the resource file ?main.rc? > > > > Please note the following: > > 1. This problem occurs only when the resource file main.rc is > present in the list. > > 2. This problem does not occur when the resource file main.rc is > excluded from the list OR if the resource file has a name other than main.rc > > > > Thanks & Regards > > > > *Ravi Raman * > > *Xoriant Solutions Pvt. Ltd* > > 4th Floor, Winchester, Hiranandani Business Park, Powai, Mumbai 400076, > INDIA. > > Tel: +91 22 30511000,9930100026 Extn: 2144 Voip No. 4088344495/96/97/98 > Voip Extn:1178| Fax: +91 22 30511111 > > ravi.raman at xoriant.com | http://www.xoriant.com > > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ravi.raman at Xoriant.Com Thu Sep 11 03:49:23 2014 From: ravi.raman at Xoriant.Com (Ravi Raman) Date: Thu, 11 Sep 2014 07:49:23 +0000 Subject: [CMake] Incorrect object file name on cmake compilation In-Reply-To: References: <769e221bf04c4bfda62238f36dbbbcc2@XORMUM-MBX01.India.XoriantCorp.com> Message-ID: Hi, Thanks Petr for your reply. By incorrect I meant instead of the conventional main.obj, we get main.cpp.obj. I understood what you are saying. We have found a solution for this in our cmake code. We have explicitly set the /Fo compiler flag for main.cpp. With that it creates main.obj for main.cpp and also main.res for main.rc Thanks & Regards Ravi Raman Xoriant Solutions Pvt. Ltd 4th Floor, Winchester, Hiranandani Business Park, Powai, Mumbai 400076, INDIA. Tel: +91 22 30511000,9930100026 Extn: 2144 Voip No. 4088344495/96/97/98 Voip Extn:1178| Fax: +91 22 30511111 ravi.raman at xoriant.com| http://www.xoriant.com From: Petr Kmoch [mailto:petr.kmoch at gmail.com] Sent: Thursday, September 11, 2014 12:11 PM To: Ravi Raman Cc: cmake at cmake.org Subject: Re: [CMake] Incorrect object file name on cmake compilation Hi Ravi. In what sense is the name "incorrect?" There is no correct/incorrect way to name object files in relation to the source file name; it can be arbitrary, as long as it's correctly passed on to the linker. I believe CMake chooses to append ".obj" to the whole file name if there is more than one file with the same base name. But why should this be a problem? Petr On Thu, Sep 11, 2014 at 7:59 AM, Ravi Raman > wrote: Hi, We are working on a cmake project. The issue is that the cmake build is successful but after the execution of cmake build step, the name of the object file is incorrect. On compilation of the source file main.cpp, the name of the object file is coming incorrectly as main.cpp.obj instead of main.obj To simulate the problem, please find attached herewith a zip file that contains CMakeLists.txt main.cpp main.rc The source list contains ?main.cpp? and the resource file ?main.rc? Please note the following: 1. This problem occurs only when the resource file main.rc is present in the list. 2. This problem does not occur when the resource file main.rc is excluded from the list OR if the resource file has a name other than main.rc Thanks & Regards Ravi Raman Xoriant Solutions Pvt. Ltd 4th Floor, Winchester, Hiranandani Business Park, Powai, Mumbai 400076, INDIA. Tel: +91 22 30511000,9930100026 Extn: 2144 Voip No. 4088344495/96/97/98 Voip Extn:1178| Fax: +91 22 30511111 ravi.raman at xoriant.com| http://www.xoriant.com -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake -------------- next part -------------- An HTML attachment was scrubbed... URL: From andi at lisas.de Thu Sep 11 04:01:17 2014 From: andi at lisas.de (Andreas Mohr) Date: Thu, 11 Sep 2014 10:01:17 +0200 Subject: [CMake] Incorrect object file name on cmake compilation In-Reply-To: Message-ID: <20140911080117.GA6423@rhlx01.hs-esslingen.de> Hi, > Date: Thu, 11 Sep 2014 07:49:23 +0000 > From: Ravi Raman > Hi, > > Thanks Petr for your reply. By incorrect I meant instead of the conventional main.obj, we get main.cpp.obj. > I understood what you are saying. We have found a solution for this in our cmake code. Good, so you've found a "solution" - to which, umm, I dare ask... "problem" exactly? :) > We have explicitly set the /Fo compiler flag for main.cpp. With that it creates main.obj for main.cpp and also main.res for main.rc Why does this need some manual effort (and of manually adding a very specific compiler flag syntax, in fact!) when it ideally/normally/usually shouldn't, one would want to ask. Perhaps this "issue" is indicative of an asymmetric/incomplete mechanism or configuration in CMake or this specific CMake environment, which one might want to discover and fix, in order to have the need for any manual tweaking (in all sufficiently standard cases) avoided in all future deployments... Thanks, Andreas Mohr From petr.kmoch at gmail.com Thu Sep 11 04:18:39 2014 From: petr.kmoch at gmail.com (Petr Kmoch) Date: Thu, 11 Sep 2014 10:18:39 +0200 Subject: [CMake] Incorrect object file name on cmake compilation In-Reply-To: <20140911080117.GA6423@rhlx01.hs-esslingen.de> References: <20140911080117.GA6423@rhlx01.hs-esslingen.de> Message-ID: I was wondering about this as well. Ravi, what is your motivation for having object file names of a particular format? I don't think I've ever had to care what object files in our builds are called. Petr On Thu, Sep 11, 2014 at 10:01 AM, Andreas Mohr wrote: > Hi, > > > Date: Thu, 11 Sep 2014 07:49:23 +0000 > > From: Ravi Raman > > > Hi, > > > > Thanks Petr for your reply. By incorrect I meant instead of the > conventional main.obj, we get main.cpp.obj. > > I understood what you are saying. We have found a solution for this in > our cmake code. > > Good, so you've found a "solution" - to which, umm, I dare ask... > "problem" exactly? :) > > > We have explicitly set the /Fo compiler flag for main.cpp. With that it > creates main.obj for main.cpp and also main.res for main.rc > > Why does this need some manual effort (and of manually adding a very > specific compiler flag syntax, in fact!) > when it ideally/normally/usually shouldn't, > one would want to ask. > Perhaps this "issue" is indicative of an asymmetric/incomplete mechanism > or configuration > in CMake or this specific CMake environment, which one might want to > discover and fix, > in order to have the need for any manual tweaking (in all sufficiently > standard cases) > avoided in all future deployments... > > Thanks, > > Andreas Mohr > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ravi.raman at Xoriant.Com Thu Sep 11 04:25:27 2014 From: ravi.raman at Xoriant.Com (Ravi Raman) Date: Thu, 11 Sep 2014 08:25:27 +0000 Subject: [CMake] Incorrect object file name on cmake compilation In-Reply-To: References: <20140911080117.GA6423@rhlx01.hs-esslingen.de> Message-ID: <7d606bd359944c8785a05ddf2261c906@XORMUM-MBX01.India.XoriantCorp.com> Actually, in our project, the names of the object files matter because these object files go as an input to a object file comparison tool that compares object file names. So, there are 2 sets of object files, one coming from cmake build and one from Visual Studio build. The set coming from cmake build was having this object file naming with extension .cpp.obj. That was the reason for looking into this issue. Thanks & Regards Ravi Raman Xoriant Solutions Pvt. Ltd 4th Floor, Winchester, Hiranandani Business Park, Powai, Mumbai 400076, INDIA. Tel: +91 22 30511000,9930100026 Extn: 2144 Voip No. 4088344495/96/97/98 Voip Extn:1178| Fax: +91 22 30511111 ravi.raman at xoriant.com| http://www.xoriant.com From: Petr Kmoch [mailto:petr.kmoch at gmail.com] Sent: Thursday, September 11, 2014 1:49 PM To: Andreas Mohr Cc: cmake at cmake.org; Ravi Raman Subject: Re: [CMake] Incorrect object file name on cmake compilation I was wondering about this as well. Ravi, what is your motivation for having object file names of a particular format? I don't think I've ever had to care what object files in our builds are called. Petr On Thu, Sep 11, 2014 at 10:01 AM, Andreas Mohr > wrote: Hi, > Date: Thu, 11 Sep 2014 07:49:23 +0000 > From: Ravi Raman > Hi, > > Thanks Petr for your reply. By incorrect I meant instead of the conventional main.obj, we get main.cpp.obj. > I understood what you are saying. We have found a solution for this in our cmake code. Good, so you've found a "solution" - to which, umm, I dare ask... "problem" exactly? :) > We have explicitly set the /Fo compiler flag for main.cpp. With that it creates main.obj for main.cpp and also main.res for main.rc Why does this need some manual effort (and of manually adding a very specific compiler flag syntax, in fact!) when it ideally/normally/usually shouldn't, one would want to ask. Perhaps this "issue" is indicative of an asymmetric/incomplete mechanism or configuration in CMake or this specific CMake environment, which one might want to discover and fix, in order to have the need for any manual tweaking (in all sufficiently standard cases) avoided in all future deployments... Thanks, Andreas Mohr -------------- next part -------------- An HTML attachment was scrubbed... URL: From andi at lisas.de Thu Sep 11 05:19:05 2014 From: andi at lisas.de (Andreas Mohr) Date: Thu, 11 Sep 2014 11:19:05 +0200 Subject: [CMake] Incorrect object file name on cmake compilation In-Reply-To: <7d606bd359944c8785a05ddf2261c906@XORMUM-MBX01.India.XoriantCorp.com> References: <20140911080117.GA6423@rhlx01.hs-esslingen.de> <7d606bd359944c8785a05ddf2261c906@XORMUM-MBX01.India.XoriantCorp.com> Message-ID: <20140911091905.GA6098@rhlx01.hs-esslingen.de> On Thu, Sep 11, 2014 at 08:25:27AM +0000, Ravi Raman wrote: > Actually, in our project, the names of the object files matter because > these object files go as an input to a object file comparison tool that > compares object file names. So, there are 2 sets of object files, one > coming from cmake build and one from Visual Studio build. > > The set coming from cmake build was having this object file naming with > extension .cpp.obj. > > That was the reason for looking into this issue. Ah, so that means we're talking about this issue having come up due to expectations about object naming being somewhat "usual" (as opposed to CMake-configured naming), of an *external tool*, rather than due to uneasiness/issues detected within the CMake workflow itself. So, that means: - CMake handling likely *is* consistent (at least in regard to this aspect) - the external tool does not like it :) - a manual specific compiler flag setting was configured to fall back to previously "usual" object naming So, my thoughts on this are that it would be best to have the external tool offer an option to support custom object file naming patterns, since naming of internally generated object files may easily differ in various build systems. Manually adding a very specific /Fo option *can* be done, but: - this manual tweak might then cause incompatibilities with internal CMake assumptions (quite possibly there are CMake configuration variables/mechanisms to generically switch this naming pattern though) - it's extremely compiler-specific (read: not environment-generic) So, I would recommend going the "improve external tool support" route instead (or resort to figuring out CMake config mechanisms to generically switch object naming). Andreas Mohr From dlrdave at aol.com Thu Sep 11 05:54:48 2014 From: dlrdave at aol.com (David Cole) Date: Thu, 11 Sep 2014 05:54:48 -0400 Subject: [CMake] Incorrect object file name on cmake compilation In-Reply-To: <20140911091905.GA6098@rhlx01.hs-esslingen.de> References: <20140911080117.GA6423@rhlx01.hs-esslingen.de> <7d606bd359944c8785a05ddf2261c906@XORMUM-MBX01.India.XoriantCorp.com> <20140911091905.GA6098@rhlx01.hs-esslingen.de> Message-ID: <8D19BBD8EB4F225-37B0-400B8@webmail-m223.sysops.aol.com> I think (Ravi, correct me if I'm wrong) that they're transitioning to CMake from a previously purely Visual Studio build system, and they're writing some tools to validate that the builds are ending up "the same." So it's not really a "problem" for anybody -- I think he was just looking for an explanation of why CMake would change the obj file name. D From ravi.raman at Xoriant.Com Thu Sep 11 07:04:13 2014 From: ravi.raman at Xoriant.Com (Ravi Raman) Date: Thu, 11 Sep 2014 11:04:13 +0000 Subject: [CMake] Incorrect object file name on cmake compilation In-Reply-To: <8D19BBD8EB4F225-37B0-400B8@webmail-m223.sysops.aol.com> References: <20140911080117.GA6423@rhlx01.hs-esslingen.de> <7d606bd359944c8785a05ddf2261c906@XORMUM-MBX01.India.XoriantCorp.com> <20140911091905.GA6098@rhlx01.hs-esslingen.de> <8D19BBD8EB4F225-37B0-400B8@webmail-m223.sysops.aol.com> Message-ID: <1f4c74684dd44e3f831adcc0647dc351@XORMUM-MBX01.India.XoriantCorp.com> Yes. That's correct David. I was actually looking for an explanation why the object file name is coming with the suffix .cpp.obj instead of the conventional .obj. It was kind of a problem for me because the object file comparison tool uses the object file name as the reference for object file comparison. Thanks & Regards Ravi Raman Xoriant Solutions Pvt. Ltd 4th Floor, Winchester,?Hiranandani Business Park, Powai,?Mumbai 400076, INDIA. Tel: +91 22 30511000,9930100026 Extn: 2144 Voip No. 4088344495/96/97/98 Voip Extn:1178| Fax: +91 22 30511111 ravi.raman at xoriant.com|?http://www.xoriant.com -----Original Message----- From: David Cole [mailto:dlrdave at aol.com] Sent: Thursday, September 11, 2014 3:25 PM To: andi at lisas.de; Ravi Raman Cc: cmake at cmake.org Subject: Re: [CMake] Incorrect object file name on cmake compilation I think (Ravi, correct me if I'm wrong) that they're transitioning to CMake from a previously purely Visual Studio build system, and they're writing some tools to validate that the builds are ending up "the same." So it's not really a "problem" for anybody -- I think he was just looking for an explanation of why CMake would change the obj file name. D From jos at vandenoever.info Thu Sep 11 08:42:18 2014 From: jos at vandenoever.info (Jos van den Oever) Date: Thu, 11 Sep 2014 14:42:18 +0200 Subject: [CMake] Ninja generator does not clean up non-empty directories Message-ID: <3098689.pMDFayMRHS@lapjos> Hi all, Ninja does not clean out non-empty directories. Given this CMakeLists.txt: ====== cmake_minimum_required(VERSION 2.8) add_custom_command( OUTPUT dir COMMAND ${CMAKE_COMMAND} -E make_directory dir COMMAND ${CMAKE_COMMAND} -E touch dir/file ) add_custom_target( dir-target DEPENDS dir ) ====== the follow commands work fine: $ cmake -GUnix Makefiles srcdir ... $ make Scanning dependencies of target dir-target [100%] Generating dir [100%] Built target dir-target $ make clean $ But with Ninja, this fails: $ cmake -GNina srcdir .. $ ninja [1/1] Generating dir $ ninja clean [1/1] Cleaning all built files... FAILED: /home/oever/.nix-profile/bin/ninja -t clean ninja: error: remove(dir): Directory not empty Cleaning... 0 files. ninja: build stopped: subcommand failed. I assume this is a bug. I tried creating a bug db account, but could not get past the captcha, so I'm writing here. Cheers, Jos From iosif.neitzke+cmake at gmail.com Thu Sep 11 10:07:58 2014 From: iosif.neitzke+cmake at gmail.com (Iosif Neitzke) Date: Thu, 11 Sep 2014 09:07:58 -0500 Subject: [CMake] Should CPack command-line options -P and -R do more? Message-ID: For a project that uses include(CPack) and produces CPack_Example-0.1.1-Linux.sh when "cpack" is run and produces CPack_Example-0.1.1-Linux.exe when "cpack -G NSIS" is run, am I remiss for thinking that cpack -G NSIS -P NEW_NAME -R 3.1.4 should produce "NEW_NAME-3.1.4-Linux.exe"? As always, thanks. From fungos at gmail.com Thu Sep 11 10:45:13 2014 From: fungos at gmail.com (fungos) Date: Thu, 11 Sep 2014 10:45:13 -0400 Subject: [CMake] Link step more than once Message-ID: Hi, How can I create two linker steps with different flags for the same target at the same build? Example: target: X link: linker.exe libs_for_a linker_flags_for_a -o A/X.bin link: linker.exe libs_for_b linker_flags_for_b -o B/X.bin Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From shooter.vm at gmail.com Thu Sep 11 10:51:42 2014 From: shooter.vm at gmail.com (=?UTF-8?Q?Vojtech_Ma=C5=A1ek?=) Date: Thu, 11 Sep 2014 16:51:42 +0200 Subject: [CMake] dependencies Message-ID: Hi, I am working at team developing RPM pacage generator. Now I am solving a problem how can i get dependencies using cmake. Basically we need to get paths to libs like they are cached in CmakeCache.txt, is it somehow possible before calling cmake and then parsing the file ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From hobbes1069 at gmail.com Thu Sep 11 11:29:07 2014 From: hobbes1069 at gmail.com (Richard Shaw) Date: Thu, 11 Sep 2014 10:29:07 -0500 Subject: [CMake] dependencies In-Reply-To: References: Message-ID: On Thu, Sep 11, 2014 at 9:51 AM, Vojtech Ma?ek wrote: > Hi, I am working at team developing RPM pacage generator. > Now I am solving a problem how can i get dependencies using cmake. > Basically we need to get paths to libs like they are cached in > CmakeCache.txt, is it somehow possible before calling cmake and then > parsing the file ? > I'm a Fedora packager so I'm curious how you're going to do this. Are you planning on running something like "rpm -q --whatprovides " to do this? rpmbuild will generate requirements automatically as long as there is a soname dependency, so for the most part that would be redundant except for non-library dependencies (python, perl, php, etc. or binary dependencies). Thanks, Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.maynard at kitware.com Thu Sep 11 11:31:45 2014 From: robert.maynard at kitware.com (Robert Maynard) Date: Thu, 11 Sep 2014 11:31:45 -0400 Subject: [CMake] Link step more than once In-Reply-To: References: Message-ID: Are you trying to generate two different libraries from the same target? On Thu, Sep 11, 2014 at 10:45 AM, fungos wrote: > Hi, > > How can I create two linker steps with different flags for the same target > at the same build? > > Example: > > target: X > link: linker.exe libs_for_a linker_flags_for_a -o A/X.bin > link: linker.exe libs_for_b linker_flags_for_b -o B/X.bin > > Thanks > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From bill.hoffman at kitware.com Thu Sep 11 11:40:44 2014 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Thu, 11 Sep 2014 11:40:44 -0400 Subject: [CMake] Incorrect object file name on cmake compilation In-Reply-To: <1f4c74684dd44e3f831adcc0647dc351@XORMUM-MBX01.India.XoriantCorp.com> References: <20140911080117.GA6423@rhlx01.hs-esslingen.de> <7d606bd359944c8785a05ddf2261c906@XORMUM-MBX01.India.XoriantCorp.com> <20140911091905.GA6098@rhlx01.hs-esslingen.de> <8D19BBD8EB4F225-37B0-400B8@webmail-m223.sysops.aol.com> <1f4c74684dd44e3f831adcc0647dc351@XORMUM-MBX01.India.XoriantCorp.com> Message-ID: <5411C27C.4080006@kitware.com> On 9/11/2014 7:04 AM, Ravi Raman wrote: > Yes. That's correct David. I was actually looking for an explanation > why the object file name is coming with the suffix .cpp.obj instead > of the conventional .obj. It was kind of a problem for me because the > object file comparison tool uses the object file name as the > reference for object file comparison. The reason is to assure that we have unique names for the object files. Imagine a project that had main.c main.cxx and main.F90. They could not all go to main.o. Instead of having to search for duplicates like that and special case them, CMake uses a consistent and unique name for the object files. Really old CMake used to create main.o and issues like this showed up. -Bill From Gilles.Khouzam at microsoft.com Thu Sep 11 11:36:16 2014 From: Gilles.Khouzam at microsoft.com (Gilles Khouzam) Date: Thu, 11 Sep 2014 15:36:16 +0000 Subject: [CMake] Get Visual Studio target Arch In-Reply-To: <540DFE18.3080809@googlemail.com> References: <540DFE18.3080809@googlemail.com> Message-ID: <5e1e26af926d4a4692beb5063ad29731@CY1PR0301MB0713.namprd03.prod.outlook.com> Hi Greg, You might want to check out our current fork of CMake on http://cmakems.codeplex.com. I've just added support for multiplatform support for Windows Phone and Windows Store app in a similar way that it is done for iOS. You can try the build on http://cmakems.codeplex.com/releases/view/132284 or use the MSMultiPlatform branch. This will generate one solution that can target Win32/ARM/x64 placing each architecture in a folder based on the platform name (using the $(Platform) variable in VS. To enable this, add the following define: CMAKE_VS_EFFECTIVE_PLATFORMS=Win32;ARM;x64 and code for all three platforms will be generated. We'd love to understand the type of issues you might run into with this and how we can make it better. Thanks ~Gilles -----Original Message----- From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Gregor Jasny Sent: Monday, September 8, 2014 12:06 To: cmake at cmake.org; Alexey Petruchik Subject: Re: [CMake] Get Visual Studio target Arch On 06/09/14 16:02, Alexey Petruchik wrote: > I want to use different library folders for x64/x86/arm architectures. > Cmake has different generators for each arch: "Visual Studio 12 2013", > "Visual Studio 12 2013 ARM", "Visual Studio 12 2013 Win64". Is there > any cmake var to get visual studio target arch? CMAKE_SYSTEM_PROCESSOR > is always AMD64 for me no matter what generator I'm using. All the already available stuff in cmake is not sufficient. Especially if you start to cross compile. I use the pre-defined C/C++ preprocessor symbols for that: include(CheckSymbolExists) if(WIN32) check_symbol_exists("_M_AMD64" "" RTC_ARCH_X64) if(NOT RTC_ARCH_X64) check_symbol_exists("_M_IX86" "" RTC_ARCH_X86) endif(NOT RTC_ARCH_X64) # add check for arm here # see http://msdn.microsoft.com/en-us/library/b0084kay.aspx else(WIN32) check_symbol_exists("__i386__" "" RTC_ARCH_X86) check_symbol_exists("__x86_64__" "" RTC_ARCH_X64) check_symbol_exists("__arm__" "" RTC_ARCH_ARM) endif(WIN32) Now you could write: if(RTC_ARCH_X64) set(MY_LIB_DIR x64) elseif(RTC_ARCH_X86) set(MY_LIB_DIR x86) elseif(RTC_ARCH_ARM) set(MY_LIB_DIR x86) else() message(FATAL_ERROR "Unknown architecture") endif() I hope this helps. Thanks, Gregor -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake From robert.maynard at kitware.com Thu Sep 11 12:26:14 2014 From: robert.maynard at kitware.com (Robert Maynard) Date: Thu, 11 Sep 2014 12:26:14 -0400 Subject: [CMake] [ANNOUNCE] CMake 3.0.2 Released Message-ID: We are pleased to announce that CMake 3.0.2 is now available for download. Please use the latest release from our download page: http://www.cmake.org/download/ Thanks for your support! ------------------------------------------------------------------------- Changes in 3.0.2 since 3.0.1: Alan W. Irwin (1): ExternalProject: Avoid infinite loop on file download hash mismatch Brad King (6): CMP0047: Fix CMAKE_COMPILER_IS_GNU(CC|CXX) in OLD behavior CMP0022: Fix version documented to support LINK_PUBLIC/LINK_PRIVATE cmListFileLexer: Fix lexing of single '[' character (#15092) Xcode: Generate per-target file references (#15111) Fix finding binutils when cross-compiling with Clang CMake 3.0.2 Christian Svensson (2): KWIML: Teach ABI.h about OpenRISC 1000 KWSys CPU: Add support for OpenRISC 1000 Stephen Kelly (2): QtAutogen: Use the basename for resource files. QtAutogen: Fix use of multiple ui files in a single target. Tim Blechmann (1): BundleUtilities: Allow Info.plist files which use CR line endings From fungos at gmail.com Thu Sep 11 12:53:23 2014 From: fungos at gmail.com (fungos) Date: Thu, 11 Sep 2014 12:53:23 -0400 Subject: [CMake] Link step more than once In-Reply-To: References: Message-ID: Yes, we can say that.. in reality I need two outputs for a single target, but these outputs are generated almost exactly with just 2 different linker flags removed. On Thu, Sep 11, 2014 at 11:31 AM, Robert Maynard wrote: > Are you trying to generate two different libraries from the same target? > > On Thu, Sep 11, 2014 at 10:45 AM, fungos wrote: > > Hi, > > > > How can I create two linker steps with different flags for the same > target > > at the same build? > > > > Example: > > > > target: X > > link: linker.exe libs_for_a linker_flags_for_a -o A/X.bin > > link: linker.exe libs_for_b linker_flags_for_b -o B/X.bin > > > > Thanks > > > > > > -- > > > > Powered by www.kitware.com > > > > Please keep messages on-topic and check the CMake FAQ at: > > http://www.cmake.org/Wiki/CMake_FAQ > > > > Kitware offers various services to support the CMake community. For more > > information on each offering, please visit: > > > > CMake Support: http://cmake.org/cmake/help/support.html > > CMake Consulting: http://cmake.org/cmake/help/consulting.html > > CMake Training Courses: http://cmake.org/cmake/help/training.html > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/cmake > -- Animal Liberation Front http://www.animal-liberation.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.maynard at kitware.com Thu Sep 11 13:20:14 2014 From: robert.maynard at kitware.com (Robert Maynard) Date: Thu, 11 Sep 2014 13:20:14 -0400 Subject: [CMake] Link step more than once In-Reply-To: References: Message-ID: Generally the easiest way is to have two targets that share the same source files but have different linker flags. On Thu, Sep 11, 2014 at 12:53 PM, fungos wrote: > Yes, we can say that.. in reality I need two outputs for a single target, > but these outputs are generated almost exactly with just 2 different linker > flags removed. > > > On Thu, Sep 11, 2014 at 11:31 AM, Robert Maynard > wrote: >> >> Are you trying to generate two different libraries from the same target? >> >> On Thu, Sep 11, 2014 at 10:45 AM, fungos wrote: >> > Hi, >> > >> > How can I create two linker steps with different flags for the same >> > target >> > at the same build? >> > >> > Example: >> > >> > target: X >> > link: linker.exe libs_for_a linker_flags_for_a -o A/X.bin >> > link: linker.exe libs_for_b linker_flags_for_b -o B/X.bin >> > >> > Thanks >> > >> > >> > -- >> > >> > Powered by www.kitware.com >> > >> > Please keep messages on-topic and check the CMake FAQ at: >> > http://www.cmake.org/Wiki/CMake_FAQ >> > >> > Kitware offers various services to support the CMake community. For more >> > information on each offering, please visit: >> > >> > CMake Support: http://cmake.org/cmake/help/support.html >> > CMake Consulting: http://cmake.org/cmake/help/consulting.html >> > CMake Training Courses: http://cmake.org/cmake/help/training.html >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/cmake > > > > > -- > Animal Liberation Front > http://www.animal-liberation.com/ From fungos at gmail.com Thu Sep 11 14:09:15 2014 From: fungos at gmail.com (fungos) Date: Thu, 11 Sep 2014 14:09:15 -0400 Subject: [CMake] Link step more than once In-Reply-To: References: Message-ID: Ok, but will this _recompile_ the sources for each target? We must use the same generated object files for the two outputs, the only difference must be the linker flags. On Thu, Sep 11, 2014 at 1:20 PM, Robert Maynard wrote: > Generally the easiest way is to have two targets that share the same > source files but have different linker flags. > > On Thu, Sep 11, 2014 at 12:53 PM, fungos wrote: > > Yes, we can say that.. in reality I need two outputs for a single target, > > but these outputs are generated almost exactly with just 2 different > linker > > flags removed. > > > > > > On Thu, Sep 11, 2014 at 11:31 AM, Robert Maynard > > wrote: > >> > >> Are you trying to generate two different libraries from the same target? > >> > >> On Thu, Sep 11, 2014 at 10:45 AM, fungos wrote: > >> > Hi, > >> > > >> > How can I create two linker steps with different flags for the same > >> > target > >> > at the same build? > >> > > >> > Example: > >> > > >> > target: X > >> > link: linker.exe libs_for_a linker_flags_for_a -o A/X.bin > >> > link: linker.exe libs_for_b linker_flags_for_b -o B/X.bin > >> > > >> > Thanks > >> > > >> > > >> > -- > >> > > >> > Powered by www.kitware.com > >> > > >> > Please keep messages on-topic and check the CMake FAQ at: > >> > http://www.cmake.org/Wiki/CMake_FAQ > >> > > >> > Kitware offers various services to support the CMake community. For > more > >> > information on each offering, please visit: > >> > > >> > CMake Support: http://cmake.org/cmake/help/support.html > >> > CMake Consulting: http://cmake.org/cmake/help/consulting.html > >> > CMake Training Courses: http://cmake.org/cmake/help/training.html > >> > > >> > Visit other Kitware open-source projects at > >> > http://www.kitware.com/opensource/opensource.html > >> > > >> > Follow this link to subscribe/unsubscribe: > >> > http://public.kitware.com/mailman/listinfo/cmake > > > > > > > > > > -- > > Animal Liberation Front > > http://www.animal-liberation.com/ > -- Animal Liberation Front http://www.animal-liberation.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuck.atkins at kitware.com Thu Sep 11 14:19:02 2014 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Thu, 11 Sep 2014 14:19:02 -0400 Subject: [CMake] Link step more than once In-Reply-To: References: Message-ID: Sounds like what you want is an object library, http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library: set(FOO_SOURCES Foo1.cxx Bar2.cxx FooBar3.cxx ) add_library(FooObjLib OBJECT ${FOO_SOURCES}) add_executable(A $) set_target_properties(A PROPERTIES LINK_FLAGS "/Special /Flags /For /A") add_executable(B $) set_target_properties(B PROPERTIES LINK_FLAGS "/Special /Flags /For /B") - Chuck On Thu, Sep 11, 2014 at 2:09 PM, fungos wrote: > Ok, but will this _recompile_ the sources for each target? We must use the > same generated object files for the two outputs, the only difference must > be the linker flags. > > On Thu, Sep 11, 2014 at 1:20 PM, Robert Maynard < > robert.maynard at kitware.com> wrote: > >> Generally the easiest way is to have two targets that share the same >> source files but have different linker flags. >> >> On Thu, Sep 11, 2014 at 12:53 PM, fungos wrote: >> > Yes, we can say that.. in reality I need two outputs for a single >> target, >> > but these outputs are generated almost exactly with just 2 different >> linker >> > flags removed. >> > >> > >> > On Thu, Sep 11, 2014 at 11:31 AM, Robert Maynard >> > wrote: >> >> >> >> Are you trying to generate two different libraries from the same >> target? >> >> >> >> On Thu, Sep 11, 2014 at 10:45 AM, fungos wrote: >> >> > Hi, >> >> > >> >> > How can I create two linker steps with different flags for the same >> >> > target >> >> > at the same build? >> >> > >> >> > Example: >> >> > >> >> > target: X >> >> > link: linker.exe libs_for_a linker_flags_for_a -o A/X.bin >> >> > link: linker.exe libs_for_b linker_flags_for_b -o B/X.bin >> >> > >> >> > Thanks >> >> > >> >> > >> >> > -- >> >> > >> >> > Powered by www.kitware.com >> >> > >> >> > Please keep messages on-topic and check the CMake FAQ at: >> >> > http://www.cmake.org/Wiki/CMake_FAQ >> >> > >> >> > Kitware offers various services to support the CMake community. For >> more >> >> > information on each offering, please visit: >> >> > >> >> > CMake Support: http://cmake.org/cmake/help/support.html >> >> > CMake Consulting: http://cmake.org/cmake/help/consulting.html >> >> > CMake Training Courses: http://cmake.org/cmake/help/training.html >> >> > >> >> > Visit other Kitware open-source projects at >> >> > http://www.kitware.com/opensource/opensource.html >> >> > >> >> > Follow this link to subscribe/unsubscribe: >> >> > http://public.kitware.com/mailman/listinfo/cmake >> > >> > >> > >> > >> > -- >> > Animal Liberation Front >> > http://www.animal-liberation.com/ >> > > > > -- > Animal Liberation Front > http://www.animal-liberation.com/ > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From glhenni at sandia.gov Thu Sep 11 14:29:57 2014 From: glhenni at sandia.gov (Hennigan, Gary L) Date: Thu, 11 Sep 2014 18:29:57 +0000 Subject: [CMake] FW: Parallel GNU make issue In-Reply-To: References: Message-ID: <7c56c515adbe4caebd8d273e96dd5a57@ES02AMSNLNT.srn.sandia.gov> I have a strange, and very frustrating, problem. I have a pretty large piece of software that I build nightly as part of regression testing of my own software. All of the software uses CMake and I use a ctest script, via "ctest -S [script file]", for my nightly regression testing . As I stated, this is a pretty large collection of software but during development it's not a huge issue because the build is quite parallelizable via GNU make's "-j N" option. On my nightly test platform, a 64-core machine, I can build the whole thing in about an hour. A nice manageable amount of time for a nightly regression test. Unfortunately when I run the build process via ctest something is causing the parallel make to fail and I'm lucky if the build takes under 15 hours. Barely practical for a nightly test. I'm not sure how to find out what's going on. After the ctest build I can go into the build directory, do a "make clean" and then a "make -j 12", for example, and the build flies. Of course I can build the software entirely outside of ctest and it too flies. Only when the build happens as part of ctest does it seem to revert to, essentially, a "make -j 1" and slow to a crawl. I can look at the process tree, via "ps -ef", during the ctest build and I see the root invocation of gmake and it's fine. For example, it typically looks something like: PID PPID C STIME TTY TIME CMD 6141 6283 96 11:41 pts/0 00:24:40 ctest -VV -S ctest_nightly.cmake -DPROCESSORCOUNT=12 8032 6141 0 11:42 pts/0 00:00:00 /usr/bin/gmake -i -j 12 8035 8032 0 11:42 pts/0 00:00:00 /usr/bin/gmake -f CMakeFiles/Makefile2 all 851 8035 0 11:52 pts/0 00:00:00 /usr/bin/gmake -f packages/ml/src/CMakeFiles/ml.dir/build.make 27797 8035 0 11:46 pts/0 00:00:00 /usr/bin/gmake -f packages/moocho/src/CMakeFiles/moocho.dir/build.make You can see that the parent make, PID 8032 which is started via ctest (PID 6141), has the appropriate flag, "-j 12", but at this point in the build it's compiling one file at a time. Another odd thing is that I think the build starts out fine, invoking multiple file compilations simultaneously, but after a couple of minutes it reverts to essentially the "make -j 1" behavior. It's like the GNU make jobserver is failing, but I'm not getting any error messages from GNU make to that affect. If anyone has any suggestions on how I can figure this out I'd appreciate it. Apologies for the lengthy explanation. I've been pulling my hair out trying to figure out how to solve this issue. Thanks in advance, Gary -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuck.atkins at kitware.com Thu Sep 11 15:02:50 2014 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Thu, 11 Sep 2014 15:02:50 -0400 Subject: [CMake] FW: Parallel GNU make issue In-Reply-To: <7c56c515adbe4caebd8d273e96dd5a57@ES02AMSNLNT.srn.sandia.gov> References: <7c56c515adbe4caebd8d273e96dd5a57@ES02AMSNLNT.srn.sandia.gov> Message-ID: Hi Gary, Do you see either of these two warning messages show up: "warning: -jN forced in submake: disabling jobserver mode." or "warning: jobserver unavailable: using -j1. Add `+' to parent make rule." These warnings often accompany the forced serialization of a parallel make build, although usually they show up regardless of the launch method, i.e. ctests vs manual make. These warnings are often indicative of a particular problem in super-build scenarios.. - Chuck On Thu, Sep 11, 2014 at 2:29 PM, Hennigan, Gary L wrote: > I have a strange, and very frustrating, problem. I have a pretty large > piece of software that I build nightly as part of regression testing of my > own software. All of the software uses CMake and I use a ctest script, via > ?ctest ?S [script file]?, for my nightly regression testing . As I stated, > this is a pretty large collection of software but during development it?s > not a huge issue because the build is quite parallelizable via GNU make?s > ?-j N? option. On my nightly test platform, a 64-core machine, I can build > the whole thing in about an hour. A nice manageable amount of time for a > nightly regression test. Unfortunately when I run the build process via > ctest something is causing the parallel make to fail and I?m lucky if the > build takes under 15 hours. Barely practical for a nightly test. > > I?m not sure how to find out what?s going on. After the ctest build I can > go into the build directory, do a ?make clean? and then a ?make ?j 12?, for > example, and the build flies. Of course I can build the software entirely > outside of ctest and it too flies. Only when the build happens as part of > ctest does it seem to revert to, essentially, a ?make ?j 1? and slow to a > crawl. > > I can look at the process tree, via ?ps ?ef?, during the ctest build and I > see the root invocation of gmake and it?s fine. For example, it typically > looks something like: > > PID PPID C STIME TTY TIME CMD > 6141 6283 96 11:41 pts/0 00:24:40 ctest -VV -S ctest_nightly.cmake > -DPROCESSORCOUNT=12 > 8032 6141 0 11:42 pts/0 00:00:00 /usr/bin/gmake -i *-j 12* > 8035 8032 0 11:42 pts/0 00:00:00 /usr/bin/gmake -f > CMakeFiles/Makefile2 all > 851 8035 0 11:52 pts/0 00:00:00 /usr/bin/gmake -f > packages/ml/src/CMakeFiles/ml.dir/build.make > 27797 8035 0 11:46 pts/0 00:00:00 /usr/bin/gmake -f > packages/moocho/src/CMakeFiles/moocho.dir/build.make > > You can see that the parent make, PID 8032 which is started via ctest (PID > 6141), has the appropriate flag, ?-j 12?, but at this point in the build > it?s compiling one file at a time. Another odd thing is that I think the > build starts out fine, invoking multiple file compilations simultaneously, > but after a couple of minutes it reverts to essentially the ?make ?j 1? > behavior. It?s like the GNU make jobserver is failing, but I?m not getting > any error messages from GNU make to that affect. > > If anyone has any suggestions on how I can figure this out I?d appreciate > it. > > Apologies for the lengthy explanation. I?ve been pulling my hair out > trying to figure out how to solve this issue. > > Thanks in advance, > Gary > > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nico.schloemer at gmail.com Thu Sep 11 15:07:20 2014 From: nico.schloemer at gmail.com (=?UTF-8?Q?Nico_Schl=C3=B6mer?=) Date: Thu, 11 Sep 2014 22:07:20 +0300 Subject: [CMake] missing INTERFACE_LINK_LIBRARIES in target export files In-Reply-To: References: Message-ID: Excuses; I found the target property setting in the respective `myLibTargets-none.cmake` file: ``` set_target_properties(myLib PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_NONE "/usr/lib/liblapack.so" IMPORTED_LOCATION_NONE "${_IMPORT_PREFIX}/lib/x86_64-linux-gnu/libmylib.so.1.0" IMPORTED_SONAME_NONE "libmylib.so.1" ) ``` Cheers, Nico On Thu, Sep 11, 2014 at 2:07 AM, Nico Schl?mer wrote: > Hi all, > > in a CMake project of mine, I build shared libraries and link against > third-party shared libraries. In the export target files, I find > ``` > add_library(mylib SHARED IMPORTED) > ``` > as expected, but I'm *missing* anything along the lines of > ``` > set_target_properties(mylib PROPERTIES > INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" > INTERFACE_LINK_LIBRARIES "/usr/lib/lapack.so" > ) > ``` > Any idea why this isn't present? Note that I'm *not* using the > `PRIVATE` keyword in `TARGET_LINK_LIBRARIES()`. > > Cheers, > Nico From glhenni at sandia.gov Thu Sep 11 16:09:07 2014 From: glhenni at sandia.gov (Hennigan, Gary L) Date: Thu, 11 Sep 2014 20:09:07 +0000 Subject: [CMake] FW: Parallel GNU make issue Message-ID: <1b6ef86f492e42a8a2d29a7f6ffd1d43@ES02AMSNLNT.srn.sandia.gov> Thanks for the reply Chuck. Unfortunately there is no such message. I?m not even sure the GNU make jobserver is the problem. It?s just that the symptom is the same as if that were happening. Am I comparing apples to apples when I go into the build directory created via ctest and invoking gmake manually, and comparing that to the way ctest is invoking gmake? Manually, after I notice the ctest build has regressed to a single compile at a time, I kill ctest then I go to the build directory it created and do gmake clean find . ?name ?*.o? ?print|xargs rm touch CMakeCache.txt gmake ?j 10 As I said, there?s a dramatic difference between the two. The manual build proceeds as I would expect and is done within an hour. The ctest build takes many times longer. I should?ve mentioned that I?m using the 2.8.12.2 version of the tools. Gary From: Chuck Atkins [mailto:chuck.atkins at kitware.com] Sent: Thursday, September 11, 2014 1:03 PM To: Hennigan, Gary L Cc: cmake at cmake.org Subject: [EXTERNAL] Re: [CMake] FW: Parallel GNU make issue Hi Gary, Do you see either of these two warning messages show up: "warning: -jN forced in submake: disabling jobserver mode." or "warning: jobserver unavailable: using -j1. Add `+' to parent make rule." These warnings often accompany the forced serialization of a parallel make build, although usually they show up regardless of the launch method, i.e. ctests vs manual make. These warnings are often indicative of a particular problem in super-build scenarios.. - Chuck On Thu, Sep 11, 2014 at 2:29 PM, Hennigan, Gary L > wrote: I have a strange, and very frustrating, problem. I have a pretty large piece of software that I build nightly as part of regression testing of my own software. All of the software uses CMake and I use a ctest script, via ?ctest ?S [script file]?, for my nightly regression testing . As I stated, this is a pretty large collection of software but during development it?s not a huge issue because the build is quite parallelizable via GNU make?s ?-j N? option. On my nightly test platform, a 64-core machine, I can build the whole thing in about an hour. A nice manageable amount of time for a nightly regression test. Unfortunately when I run the build process via ctest something is causing the parallel make to fail and I?m lucky if the build takes under 15 hours. Barely practical for a nightly test. I?m not sure how to find out what?s going on. After the ctest build I can go into the build directory, do a ?make clean? and then a ?make ?j 12?, for example, and the build flies. Of course I can build the software entirely outside of ctest and it too flies. Only when the build happens as part of ctest does it seem to revert to, essentially, a ?make ?j 1? and slow to a crawl. I can look at the process tree, via ?ps ?ef?, during the ctest build and I see the root invocation of gmake and it?s fine. For example, it typically looks something like: PID PPID C STIME TTY TIME CMD 6141 6283 96 11:41 pts/0 00:24:40 ctest -VV -S ctest_nightly.cmake -DPROCESSORCOUNT=12 8032 6141 0 11:42 pts/0 00:00:00 /usr/bin/gmake -i -j 12 8035 8032 0 11:42 pts/0 00:00:00 /usr/bin/gmake -f CMakeFiles/Makefile2 all 851 8035 0 11:52 pts/0 00:00:00 /usr/bin/gmake -f packages/ml/src/CMakeFiles/ml.dir/build.make 27797 8035 0 11:46 pts/0 00:00:00 /usr/bin/gmake -f packages/moocho/src/CMakeFiles/moocho.dir/build.make You can see that the parent make, PID 8032 which is started via ctest (PID 6141), has the appropriate flag, ?-j 12?, but at this point in the build it?s compiling one file at a time. Another odd thing is that I think the build starts out fine, invoking multiple file compilations simultaneously, but after a couple of minutes it reverts to essentially the ?make ?j 1? behavior. It?s like the GNU make jobserver is failing, but I?m not getting any error messages from GNU make to that affect. If anyone has any suggestions on how I can figure this out I?d appreciate it. Apologies for the lengthy explanation. I?ve been pulling my hair out trying to figure out how to solve this issue. Thanks in advance, Gary -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake -------------- next part -------------- An HTML attachment was scrubbed... URL: From fungos at gmail.com Thu Sep 11 16:16:27 2014 From: fungos at gmail.com (fungos) Date: Thu, 11 Sep 2014 16:16:27 -0400 Subject: [CMake] Link step more than once In-Reply-To: References: Message-ID: Cool, this did the trick. It was needed a post-build step to rename the target but it works. Thank you On Thu, Sep 11, 2014 at 2:19 PM, Chuck Atkins wrote: > Sounds like what you want is an object library, > http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library: > > set(FOO_SOURCES > Foo1.cxx > Bar2.cxx > FooBar3.cxx > ) > add_library(FooObjLib OBJECT ${FOO_SOURCES}) > > add_executable(A $) > set_target_properties(A PROPERTIES LINK_FLAGS "/Special /Flags /For /A") > > add_executable(B $) > set_target_properties(B PROPERTIES LINK_FLAGS "/Special /Flags /For /B") > > > - Chuck > > On Thu, Sep 11, 2014 at 2:09 PM, fungos wrote: > >> Ok, but will this _recompile_ the sources for each target? We must use >> the same generated object files for the two outputs, the only difference >> must be the linker flags. >> >> On Thu, Sep 11, 2014 at 1:20 PM, Robert Maynard < >> robert.maynard at kitware.com> wrote: >> >>> Generally the easiest way is to have two targets that share the same >>> source files but have different linker flags. >>> >>> On Thu, Sep 11, 2014 at 12:53 PM, fungos wrote: >>> > Yes, we can say that.. in reality I need two outputs for a single >>> target, >>> > but these outputs are generated almost exactly with just 2 different >>> linker >>> > flags removed. >>> > >>> > >>> > On Thu, Sep 11, 2014 at 11:31 AM, Robert Maynard >>> > wrote: >>> >> >>> >> Are you trying to generate two different libraries from the same >>> target? >>> >> >>> >> On Thu, Sep 11, 2014 at 10:45 AM, fungos wrote: >>> >> > Hi, >>> >> > >>> >> > How can I create two linker steps with different flags for the same >>> >> > target >>> >> > at the same build? >>> >> > >>> >> > Example: >>> >> > >>> >> > target: X >>> >> > link: linker.exe libs_for_a linker_flags_for_a -o A/X.bin >>> >> > link: linker.exe libs_for_b linker_flags_for_b -o B/X.bin >>> >> > >>> >> > Thanks >>> >> > >>> >> > >>> >> > -- >>> >> > >>> >> > Powered by www.kitware.com >>> >> > >>> >> > Please keep messages on-topic and check the CMake FAQ at: >>> >> > http://www.cmake.org/Wiki/CMake_FAQ >>> >> > >>> >> > Kitware offers various services to support the CMake community. For >>> more >>> >> > information on each offering, please visit: >>> >> > >>> >> > CMake Support: http://cmake.org/cmake/help/support.html >>> >> > CMake Consulting: http://cmake.org/cmake/help/consulting.html >>> >> > CMake Training Courses: http://cmake.org/cmake/help/training.html >>> >> > >>> >> > Visit other Kitware open-source projects at >>> >> > http://www.kitware.com/opensource/opensource.html >>> >> > >>> >> > Follow this link to subscribe/unsubscribe: >>> >> > http://public.kitware.com/mailman/listinfo/cmake >>> > >>> > >>> > >>> > >>> > -- >>> > Animal Liberation Front >>> > http://www.animal-liberation.com/ >>> >> >> >> >> -- >> Animal Liberation Front >> http://www.animal-liberation.com/ >> >> -- >> >> Powered by www.kitware.com >> >> Please keep messages on-topic and check the CMake FAQ at: >> http://www.cmake.org/Wiki/CMake_FAQ >> >> Kitware offers various services to support the CMake community. For more >> information on each offering, please visit: >> >> CMake Support: http://cmake.org/cmake/help/support.html >> CMake Consulting: http://cmake.org/cmake/help/consulting.html >> CMake Training Courses: http://cmake.org/cmake/help/training.html >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/cmake >> > > -- Animal Liberation Front http://www.animal-liberation.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From nico.schloemer at gmail.com Thu Sep 11 16:51:21 2014 From: nico.schloemer at gmail.com (=?UTF-8?Q?Nico_Schl=C3=B6mer?=) Date: Thu, 11 Sep 2014 23:51:21 +0300 Subject: [CMake] install(EXPORT ...) includes target "B" which requires target "A" that is not in the export set Message-ID: Hi all, One of my projects contains two libraries libA and libB, where libB depends on libA, and both are exporting their configuration through the usual `INSTALL(EXPORT ...)` mechanisms. I'm getting errors of the type ``` CMake Error: install(EXPORT "SEACASNemesis-exports" ...) includes target "nemesis" which requires target "exodus" that is not in the export set. ``` now, and I'm not quite sure what they mean. Do all of my export files have to be self-contained? In other projects of mine, CMake was happy to produce target files with ``` set_target_properties(teuchosnumerics PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_NONE "B;A;/usr/lib/liblapack.so;/usr/lib/libblas.so" IMPORTED_LOCATION_NONE "${_IMPORT_PREFIX}/lib/x86_64-linux-gnu/libB.so.11.11" IMPORTED_SONAME_NONE "libB.so.11" ) ``` without A appearing in the same target file. Cheers, Nico From robert.maynard at kitware.com Thu Sep 11 16:52:13 2014 From: robert.maynard at kitware.com (Robert Maynard) Date: Thu, 11 Sep 2014 16:52:13 -0400 Subject: [CMake] Link step more than once In-Reply-To: References: Message-ID: Set the OUTPUT_NAME or OUTPUT_NAME_ property on the target to change what the name of the generated library will be. This will eliminate the need for a post-build step. On Thu, Sep 11, 2014 at 4:16 PM, fungos wrote: > Cool, this did the trick. It was needed a post-build step to rename the > target but it works. > Thank you > > On Thu, Sep 11, 2014 at 2:19 PM, Chuck Atkins > wrote: >> >> Sounds like what you want is an object library, >> http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library: >> >> set(FOO_SOURCES >> Foo1.cxx >> Bar2.cxx >> FooBar3.cxx >> ) >> add_library(FooObjLib OBJECT ${FOO_SOURCES}) >> >> add_executable(A $) >> set_target_properties(A PROPERTIES LINK_FLAGS "/Special /Flags /For /A") >> >> add_executable(B $) >> set_target_properties(B PROPERTIES LINK_FLAGS "/Special /Flags /For /B") >> >> >> - Chuck >> >> On Thu, Sep 11, 2014 at 2:09 PM, fungos wrote: >>> >>> Ok, but will this _recompile_ the sources for each target? We must use >>> the same generated object files for the two outputs, the only difference >>> must be the linker flags. >>> >>> On Thu, Sep 11, 2014 at 1:20 PM, Robert Maynard >>> wrote: >>>> >>>> Generally the easiest way is to have two targets that share the same >>>> source files but have different linker flags. >>>> >>>> On Thu, Sep 11, 2014 at 12:53 PM, fungos wrote: >>>> > Yes, we can say that.. in reality I need two outputs for a single >>>> > target, >>>> > but these outputs are generated almost exactly with just 2 different >>>> > linker >>>> > flags removed. >>>> > >>>> > >>>> > On Thu, Sep 11, 2014 at 11:31 AM, Robert Maynard >>>> > wrote: >>>> >> >>>> >> Are you trying to generate two different libraries from the same >>>> >> target? >>>> >> >>>> >> On Thu, Sep 11, 2014 at 10:45 AM, fungos wrote: >>>> >> > Hi, >>>> >> > >>>> >> > How can I create two linker steps with different flags for the same >>>> >> > target >>>> >> > at the same build? >>>> >> > >>>> >> > Example: >>>> >> > >>>> >> > target: X >>>> >> > link: linker.exe libs_for_a linker_flags_for_a -o A/X.bin >>>> >> > link: linker.exe libs_for_b linker_flags_for_b -o B/X.bin >>>> >> > >>>> >> > Thanks >>>> >> > >>>> >> > >>>> >> > -- >>>> >> > >>>> >> > Powered by www.kitware.com >>>> >> > >>>> >> > Please keep messages on-topic and check the CMake FAQ at: >>>> >> > http://www.cmake.org/Wiki/CMake_FAQ >>>> >> > >>>> >> > Kitware offers various services to support the CMake community. For >>>> >> > more >>>> >> > information on each offering, please visit: >>>> >> > >>>> >> > CMake Support: http://cmake.org/cmake/help/support.html >>>> >> > CMake Consulting: http://cmake.org/cmake/help/consulting.html >>>> >> > CMake Training Courses: http://cmake.org/cmake/help/training.html >>>> >> > >>>> >> > Visit other Kitware open-source projects at >>>> >> > http://www.kitware.com/opensource/opensource.html >>>> >> > >>>> >> > Follow this link to subscribe/unsubscribe: >>>> >> > http://public.kitware.com/mailman/listinfo/cmake >>>> > >>>> > >>>> > >>>> > >>>> > -- >>>> > Animal Liberation Front >>>> > http://www.animal-liberation.com/ >>> >>> >>> >>> >>> -- >>> Animal Liberation Front >>> http://www.animal-liberation.com/ >>> >>> -- >>> >>> Powered by www.kitware.com >>> >>> Please keep messages on-topic and check the CMake FAQ at: >>> http://www.cmake.org/Wiki/CMake_FAQ >>> >>> Kitware offers various services to support the CMake community. For more >>> information on each offering, please visit: >>> >>> CMake Support: http://cmake.org/cmake/help/support.html >>> CMake Consulting: http://cmake.org/cmake/help/consulting.html >>> CMake Training Courses: http://cmake.org/cmake/help/training.html >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/cmake >> >> > > > > -- > Animal Liberation Front > http://www.animal-liberation.com/ From a.neundorf-work at gmx.net Thu Sep 11 17:32:54 2014 From: a.neundorf-work at gmx.net (Alexander Neundorf) Date: Thu, 11 Sep 2014 23:32:54 +0200 Subject: [CMake] install(EXPORT ...) includes target "B" which requires target "A" that is not in the export set In-Reply-To: References: Message-ID: <2577942.fKZjTPQ2tg@tuxedo.neundorf.net> On Thursday, September 11, 2014 23:51:21 Nico Schl?mer wrote: > Hi all, > > One of my projects contains two libraries libA and libB, where libB > depends on libA, and both are exporting their configuration through > the usual `INSTALL(EXPORT ...)` mechanisms. > I'm getting errors of the type > ``` > CMake Error: install(EXPORT "SEACASNemesis-exports" ...) includes > target "nemesis" which requires target "exodus" that is not in the > export set. > ``` > now, and I'm not quite sure what they mean. Do all of my export files > have to be self-contained? IIRC, it should complain if it detects that a target is needed which is not exported at all. Alex From bill.hoffman at kitware.com Thu Sep 11 17:28:31 2014 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Thu, 11 Sep 2014 17:28:31 -0400 Subject: [CMake] FW: Parallel GNU make issue In-Reply-To: <1b6ef86f492e42a8a2d29a7f6ffd1d43@ES02AMSNLNT.srn.sandia.gov> References: <1b6ef86f492e42a8a2d29a7f6ffd1d43@ES02AMSNLNT.srn.sandia.gov> Message-ID: <541213FF.3020802@kitware.com> On 9/11/2014 4:09 PM, Hennigan, Gary L wrote: > Thanks for the reply Chuck. Do you have an external projects in this build? -Bill From dlrdave at aol.com Thu Sep 11 21:15:42 2014 From: dlrdave at aol.com (David Cole) Date: Thu, 11 Sep 2014 21:15:42 -0400 Subject: [CMake] FW: Parallel GNU make issue In-Reply-To: <1b6ef86f492e42a8a2d29a7f6ffd1d43@ES02AMSNLNT.srn.sandia.gov> References: <1b6ef86f492e42a8a2d29a7f6ffd1d43@ES02AMSNLNT.srn.sandia.gov> Message-ID: <8D19C3E352A769F-2B64-432D5@webmail-m253.sysops.aol.com> Is there a significant amount of output from make? What does make do if it's running low on RAM? ctest may be holding onto "too much" memory trying to process the output if it's very large... Just a thought -- worth a look, though. D From iosif.neitzke+cmake at gmail.com Thu Sep 11 21:42:11 2014 From: iosif.neitzke+cmake at gmail.com (Iosif Neitzke) Date: Thu, 11 Sep 2014 20:42:11 -0500 Subject: [CMake] Should CPack command-line options -P and -R do more? In-Reply-To: References: Message-ID: Or are these customizing CPack command line options mostly meant to be used with a CPACK_PROJECT_CONFIG_FILE? On Thu, Sep 11, 2014 at 9:07 AM, Iosif Neitzke wrote: > For a project that uses include(CPack) and produces > CPack_Example-0.1.1-Linux.sh when "cpack" is run and produces > CPack_Example-0.1.1-Linux.exe when "cpack -G NSIS" is run, am I remiss > for thinking that > > cpack -G NSIS -P NEW_NAME -R 3.1.4 > > should produce "NEW_NAME-3.1.4-Linux.exe"? > > As always, thanks. From dank at kegel.com Fri Sep 12 16:34:34 2014 From: dank at kegel.com (Dan Kegel) Date: Fri, 12 Sep 2014 13:34:34 -0700 Subject: [CMake] Something like CTEST_CUSTOM_PRE_TEST, but for individual projects? Message-ID: I'm porting a large project with many subdirectories from autotools to cmake and ctest. It's going well, but I ran into a question on how to do test setup/teardown. I've got CTEST_CUSTOM_PRE_TEST working nicely, but now I need different conditions for each directory's worth of tests. Is there anything like CTEST_CUSTOM_PRE_TEST that gets run at the beginning of each subprojects' tests? From anton.deguet at jhu.edu Sat Sep 13 13:36:46 2014 From: anton.deguet at jhu.edu (Anton Deguet) Date: Sat, 13 Sep 2014 12:36:46 -0500 Subject: [CMake] ExternalProject_Add always try to connect to SVN server Message-ID: <3D6B0544-B331-48F0-A09C-48F31E2B025C@jhu.edu> Hello, I'm wondering if I'm doing something wrong using ExternalProject_Add for a subversion repository. I would expect the following behavior: - First run, see if local copy of code has been checked out. If not 'svn checkout'. Fails if not connected to internet. - Consecutive runs: - if svn local revision different from SVN_REVISION, do a `svn update` to revision specified in ExternalProject_Add - if svn local revision same as requested, do nothing I'm having some issues with the last case, i.e. the code is checked out and 'svn info' tells me I have the desired revision but somehow the build process is still trying to reach the svn server. Since I'm working off the grid, my build fails. Questions: - Did I do something wrong or set an options somewhere that forces CMake to check the SVN server systematically? - Is there an option or command I can set to build when not connected to internet? Sincerely, Anton CMake version: 2.8.12.2 on Ubuntu 14.04 Code: include (ExternalProject) set (cisstJSON_PREFIX cisstJSONExternal) set (CISST_JSON_SVN_REPOSITORY http://svn.code.sf.net/p/jsoncpp/code/trunk/jsoncpp) set (CISST_JSON_SVN_REVISION 276) ExternalProject_Add (cisstJSONExternal PREFIX ${cisstJSON_PREFIX} SVN_REPOSITORY ${CISST_JSON_SVN_REPOSITORY} SVN_REVISION -r ${CISST_JSON_SVN_REVISION} CMAKE_CACHE_ARGS -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} -DOPTION_BUILD_EXAMPLES:BOOL=OFF -DJSONCPP_WITH_TESTS:BOOL=OFF -DJSONCPP_WITH_POST_BUILD_UNITTEST:BOOL=OFF -DCMAKE_INSTALL_PREFIX:FILEPATH=${cisst_BINARY_DIR}/cisstJSON INSTALL_DIR ${cisst_BINARY_DIR}/cisstJSON TIMEOUT 3 ) From dank at kegel.com Sun Sep 14 13:35:39 2014 From: dank at kegel.com (Dan Kegel) Date: Sun, 14 Sep 2014 10:35:39 -0700 Subject: [CMake] Spurious errors with Visual Studio generator Message-ID: I'm getting spurious errors like error opening key: Software\Microsoft\VisualStudio\10.0\vsmacros\OtherProjects7 error opening key: Software\Microsoft\VisualStudio\10.0\vsmacros\RecordingProject7 with cmake 3.0.1 and Visual Studio 2010 (but not 2013). This was reported once before, http://www.cmake.org/pipermail/cmake/2010-February/035321.html This is on a buildbot that's been in use for some time, with only one user. Only very occasionally is the IDE used; mostly it's doing unattended builds. The errors don't seem to cause any problem, but they sure are confusing when trying to track down unrelated errors. From daniele.domenichelli at gmail.com Mon Sep 15 06:01:35 2014 From: daniele.domenichelli at gmail.com (Daniele E. Domenichelli) Date: Mon, 15 Sep 2014 12:01:35 +0200 Subject: [CMake] CMAKE_CFG_INTDIR Message-ID: <5416B8FF.4080209@gmail.com> Hello, Is there an alternative variable for CMAKE_CFG_INTDIR that can be used in configure time, instead of build time? If there is not, is it safe to assume that the name of the directory is equal to the name of the current configuration? Cheers, Daniele From dlrdave at aol.com Mon Sep 15 06:43:32 2014 From: dlrdave at aol.com (David Cole) Date: Mon, 15 Sep 2014 06:43:32 -0400 Subject: [CMake] Spurious errors with Visual Studio generator In-Reply-To: References: Message-ID: <8D19EE90739E08A-8F0-501@webmail-m253.sysops.aol.com> What happens when you run VS "manually" as the buildbot user....? Any warnings or errors? From dlrdave at aol.com Mon Sep 15 07:01:01 2014 From: dlrdave at aol.com (David Cole) Date: Mon, 15 Sep 2014 07:01:01 -0400 Subject: [CMake] ExternalProject_Add always try to connect to SVN server In-Reply-To: <3D6B0544-B331-48F0-A09C-48F31E2B025C@jhu.edu> References: <3D6B0544-B331-48F0-A09C-48F31E2B025C@jhu.edu> Message-ID: <8D19EEB788E2D62-8F0-609@webmail-m253.sysops.aol.com> If you are using SVN_REVISION with a specific revision number like that, you can do: UPDATE_COMMAND "" because there is never any need to update after the initial checkout at that revision. If you then later change to another revision, the parameters to the svn checkout ("dowload") step change when you change the revision number, and it should do another checkout on a subsequent build after that. HTH, David C. From bill.hoffman at kitware.com Mon Sep 15 09:14:15 2014 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Mon, 15 Sep 2014 09:14:15 -0400 Subject: [CMake] ITK compiling problem with CMake In-Reply-To: References: Message-ID: <5416E627.6010507@kitware.com> Can you post more of the output from the configure step? What generator are you using? On 9/9/2014 10:14 AM, Vincent L.Zhang wrote: > Hi, > > I'm learning ITK for some image registration project. But just at the > first step, I met a problem compiling it with CMake. The CMakeError log > as following: > > /Compiling the C compiler identification source file > "CMakeCCompilerId.c" failed./ > /Compiler: / > /Build flags: / > /Id flags: / > / > / > /The output was:/ > /The System cannot find the file specified./ > / > / > / > / > /Compiling the CXX compiler identification source file > "CMakeCXXCompilerId.cpp" failed./ > /Compiler: / > /Build flags: / > /Id flags: / > / > / > /The output was:/ > /The System cannot find the file specified./ > / > / > The OS on my computer is Windows 8.1 with Visual Studio 2012 Pro. It > seems a CMake problem, but I don't know how to solve. I'll appreciate > your help. > > Yours, > Vincent > > -- Bill Hoffman Kitware, Inc. 28 Corporate Drive Clifton Park, NY 12065 bill.hoffman at kitware.com http://www.kitware.com 518 881-4905 (Direct) 518 371-3971 x105 Fax (518) 371-4573 From yujing5b5d at gmail.com Mon Sep 15 10:13:42 2014 From: yujing5b5d at gmail.com (Yu Jing) Date: Mon, 15 Sep 2014 22:13:42 +0800 Subject: [CMake] how to force assign sequence in multi-thread in cmake Message-ID: <05FE4097-4F5A-4A7B-B302-98C62F75E6F4@gmail.com> I had asked in http://stackoverflow.com/questions/25841602 , someone told me maybe here is a better place to ask. I am writing a project base on crfpp , a external project. I use cmake to integerate this project as follow . firstly , I add a extenal project like this: EXTERNALPROJECT_ADD( CRFPP_EX_PROJ GIT_REPOSITORY git at github.com:yujing5b5d/crfpp.git PREFIX ${CMAKE_CURRENT_BINARY_DIR} CONFIGURE_COMMAND ./configure BUILD_COMMAND make -j8 BUILD_IN_SOURCE 1 INSTALL_COMMAND cp .libs/libcrfpp.a ${PROJECT_BINARY_DIR}/lib && cp crfpp.h ${PROJECT_BINARY_DIR}/include ) this will generate some .a file and copy a header file crfpp.h to folder ${PROJECT_BINARY_DIR}/include , which is included in my project. and then , use the ${PROJECT_BINARY_DIR}/include as include path as follow . INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ) finally , when I compile the main project , code like this : ADD_EXECUTABLE(cmake_sample main.cc) ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) TARGET_LINK_LIBRARIES(cmake_sample crfpp) In general , if I just build a build folder, compile like this : cmake .. make It may works fine, compile the external project first , and copy the header file to desired place , and then continue compile main.cc in my project . But if I use compile command as multi-thread like this : cmake .. make -j8 It will not works because my main.cc and the external project are processed at same time, so it report a error like this : /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found #include "crfpp.h" // crfpp ^ 1 error generated. This crfpp.h will generated after CRFPP_EX_PROJ , but in multi-thread environment , the sequence is quite different . My Question is : Is it possible that force let my project compile after these external projects all finished . BE CAREFUL , I'm not sure is this the problem of my use of ADD_DEPENDENCIES , I also wrote ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) but it seems not works ? Thanks for any help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dank at kegel.com Mon Sep 15 11:21:40 2014 From: dank at kegel.com (Dan Kegel) Date: Mon, 15 Sep 2014 08:21:40 -0700 Subject: [CMake] Spurious errors with Visual Studio generator In-Reply-To: <8D19EE90739E08A-8F0-501@webmail-m253.sysops.aol.com> References: <8D19EE90739E08A-8F0-501@webmail-m253.sysops.aol.com> Message-ID: On Mon, Sep 15, 2014 at 3:43 AM, David Cole wrote: > What happens when you run VS "manually" as the buildbot user....? Any > warnings or errors? VS never threw errors; only cmake itself did. As the user 'buildbot', everything's peachy, the IDE is fine and cmake doesn't output any errors. But the registry keys in question are in HKCU, so they're user-specific. And when an automated build happens, it's done by a service, so it's the user SYSTEM. (Dangerous, isn't it?) Since the SYSTEM user has never run the IDE, those keys probably aren't set, thus the errors. In my case, the right thing to do would probably be to configure the service to run as the interactive buildbot user, or something. I may try that next time I set up a buildslave. - Dan From post at hendrik-sattler.de Mon Sep 15 13:29:58 2014 From: post at hendrik-sattler.de (Hendrik Sattler) Date: Mon, 15 Sep 2014 19:29:58 +0200 Subject: [CMake] CMAKE_CFG_INTDIR In-Reply-To: <5416B8FF.4080209@gmail.com> References: <5416B8FF.4080209@gmail.com> Message-ID: <4a37a61d-33fa-4bdf-bf3b-7ba6cb765b42@email.android.com> On 15. September 2014 12:01:35 MESZ, "Daniele E. Domenichelli" wrote: >Hello, > > >Is there an alternative variable for CMAKE_CFG_INTDIR that can be used >in configure time, instead of build time? > >If there is not, is it safe to assume that the name of the directory is >equal to the name of the current configuration? The variable is called CMAKE_BUILD_TYPE and is only valid for generators that build a single configuration, e.g. Makefile generators and Ninja. HS From dank at kegel.com Mon Sep 15 14:31:57 2014 From: dank at kegel.com (Dan Kegel) Date: Mon, 15 Sep 2014 11:31:57 -0700 Subject: [CMake] Trouble using CTestCustom.cmake to start a background job on Windows Message-ID: I'd like to use CTestCustom.cmake to start a background job when tests start, and kill it when tests finish. Works great on Mac and Linux, but for some reason, on Windows ctest wants to wait for the background job to finish before starting the tests. If I create CTestCustom.cmake containing set(CTEST_CUSTOM_PRE_TEST C:/foo/startjob.bat) and c:/foo/startjob.bat contains start /b myjob.exe echo Job started. the job does start, and the echo occurs, but no tests are started unless I kill myjob.exe :-( Looking at the cmake source, and using Process Monitor, I can't quite tell where ctest is waiting for myjob.exe to finish. If I were a real man, I'd build ctest myself and run it under a debugger, I guess. I worked around this by writing a tiny C program that calls CreateProcess with background-y flags and doesn't wait for the process to end, but it'd be nice if that wasn't needed. From alexey.petruchik at gmail.com Mon Sep 15 17:08:20 2014 From: alexey.petruchik at gmail.com (Alexey Petruchik) Date: Tue, 16 Sep 2014 00:08:20 +0300 Subject: [CMake] Get Visual Studio target Arch In-Reply-To: <5e1e26af926d4a4692beb5063ad29731@CY1PR0301MB0713.namprd03.prod.outlook.com> References: <540DFE18.3080809@googlemail.com> <5e1e26af926d4a4692beb5063ad29731@CY1PR0301MB0713.namprd03.prod.outlook.com> Message-ID: Hi, Gilles. First of all it is great to hear that Microsoft engineers are aware of cmake and even maintain fork that adds more Visual Studio compatibility. Great work! Adding ability to generate one unified solution with multiple architecture support is nice. It is really much better than regenerating solution for each platform all the time. But I dont see how this solves my original issue. Actually it even make it worse. What I want to do is to specify different CMAKE_LIBRARY_PATH for different target arch so when I build my project for Win32 arch I'll use prebuilt libs from win32/libs/x86 forlder, and when I build for x64 arch - win32/libs/x64 folder. Of course I can rename my folders so they correspond to $(Platform) var in VS but this doesn't look like a solid solution for me. I still cant really make some arch specific ifdefs in my cmake scripts using this approach. In my opinion we should fix CMAKE_SYSTEM_PROCESSOR behaviour on Windows. It doesnt look sane for me when var that should be defined as "The name of the CPU CMake is building for." is defined as AMD64 for ARM build. Another wish is that installer of your fork should by default install to different dir than vanilla cmake and even have different binary names. This will make easier side by side installation of cmakems and vanilla cmake. Regards, Alexey On Thu, Sep 11, 2014 at 6:36 PM, Gilles Khouzam < Gilles.Khouzam at microsoft.com> wrote: > Hi Greg, > > You might want to check out our current fork of CMake on > http://cmakems.codeplex.com. I've just added support for multiplatform > support for Windows Phone and Windows Store app in a similar way that it is > done for iOS. > > You can try the build on http://cmakems.codeplex.com/releases/view/132284 > or use the MSMultiPlatform branch. This will generate one solution that can > target Win32/ARM/x64 placing each architecture in a folder based on the > platform name (using the $(Platform) variable in VS. > > To enable this, add the following define: > CMAKE_VS_EFFECTIVE_PLATFORMS=Win32;ARM;x64 and code for all three platforms > will be generated. We'd love to understand the type of issues you might run > into with this and how we can make it better. > > Thanks > ~Gilles > > -----Original Message----- > From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Gregor Jasny > Sent: Monday, September 8, 2014 12:06 > To: cmake at cmake.org; Alexey Petruchik > Subject: Re: [CMake] Get Visual Studio target Arch > > On 06/09/14 16:02, Alexey Petruchik wrote: > > I want to use different library folders for x64/x86/arm architectures. > > Cmake has different generators for each arch: "Visual Studio 12 2013", > > "Visual Studio 12 2013 ARM", "Visual Studio 12 2013 Win64". Is there > > any cmake var to get visual studio target arch? CMAKE_SYSTEM_PROCESSOR > > is always AMD64 for me no matter what generator I'm using. > > All the already available stuff in cmake is not sufficient. Especially if > you start to cross compile. > > I use the pre-defined C/C++ preprocessor symbols for that: > > include(CheckSymbolExists) > > if(WIN32) > check_symbol_exists("_M_AMD64" "" RTC_ARCH_X64) > if(NOT RTC_ARCH_X64) > check_symbol_exists("_M_IX86" "" RTC_ARCH_X86) > endif(NOT RTC_ARCH_X64) > # add check for arm here > # see http://msdn.microsoft.com/en-us/library/b0084kay.aspx > else(WIN32) > check_symbol_exists("__i386__" "" RTC_ARCH_X86) > check_symbol_exists("__x86_64__" "" RTC_ARCH_X64) > check_symbol_exists("__arm__" "" RTC_ARCH_ARM) > endif(WIN32) > > Now you could write: > > if(RTC_ARCH_X64) > set(MY_LIB_DIR x64) > elseif(RTC_ARCH_X86) > set(MY_LIB_DIR x86) > elseif(RTC_ARCH_ARM) > set(MY_LIB_DIR x86) > else() > message(FATAL_ERROR "Unknown architecture") > endif() > > I hope this helps. > > Thanks, > Gregor > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dank at kegel.com Mon Sep 15 23:00:19 2014 From: dank at kegel.com (Dan Kegel) Date: Mon, 15 Sep 2014 20:00:19 -0700 Subject: [CMake] Something like CTEST_CUSTOM_PRE_TEST, but for individual projects? In-Reply-To: References: Message-ID: Well, foo. Turns out CTEST_CUSTOM_PRE_TEST behaves differently than I expected. If you run ctest in a subdirectory, CTestCustom.cmake isn't executed. So the top-level one isn't inherited by the subdirectories, as it were. Are we supposed to have a copy of CTestCustom.cmake in each project? Which ones get run when? On Fri, Sep 12, 2014 at 1:34 PM, Dan Kegel wrote: > I'm porting a large project with many subdirectories from autotools to > cmake and ctest. > It's going well, but I ran into a question on how to do test setup/teardown. > I've got CTEST_CUSTOM_PRE_TEST working nicely, but now I need different > conditions for each directory's worth of tests. Is there anything like > CTEST_CUSTOM_PRE_TEST that gets run at the beginning of each subprojects' > tests? From petr.kmoch at gmail.com Tue Sep 16 02:30:37 2014 From: petr.kmoch at gmail.com (Petr Kmoch) Date: Tue, 16 Sep 2014 08:30:37 +0200 Subject: [CMake] how to force assign sequence in multi-thread in cmake In-Reply-To: <05FE4097-4F5A-4A7B-B302-98C62F75E6F4@gmail.com> References: <05FE4097-4F5A-4A7B-B302-98C62F75E6F4@gmail.com> Message-ID: Hi. I've never worked with ExternalProject myself, so I can't comment with certainty, but from what I understand, the correct way of using ExternalProject is to add your own project as an ExternalProject as well. Basically, the toplevel CMakeList becomes a superbuild which *only* does ExternalProject_Add() calls and does not add any libraries/executables directly. After you build the superbuild once to get all the dependencies correct, you switch to the "external" project of your own code and work with that normally. Petr On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing wrote: > I had asked in http://stackoverflow.com/questions/25841602 , someone > told me maybe here is a better place to ask. > > I am writing a project base on crfpp , a external project. I use cmake to > integerate this project as follow . > > firstly , I add a extenal project like this: > > EXTERNALPROJECT_ADD( > CRFPP_EX_PROJ > GIT_REPOSITORY git at github.com:yujing5b5d/crfpp.git > PREFIX ${CMAKE_CURRENT_BINARY_DIR} > CONFIGURE_COMMAND ./configure > BUILD_COMMAND make -j8 > BUILD_IN_SOURCE 1 > INSTALL_COMMAND cp .libs/libcrfpp.a ${PROJECT_BINARY_DIR}/lib && cp crfpp.h ${PROJECT_BINARY_DIR}/include > ) > > this will generate some .a file and copy a header file crfpp.h to folder > ${PROJECT_BINARY_DIR}/include , which is included in my project. > > and then , use the ${PROJECT_BINARY_DIR}/include as include path as > follow . > > INCLUDE_DIRECTORIES( > ${PROJECT_SOURCE_DIR}/include > ${PROJECT_BINARY_DIR}/include) > > finally , when I compile the main project , code like this : > > ADD_EXECUTABLE(cmake_sample main.cc) > ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) > TARGET_LINK_LIBRARIES(cmake_sample crfpp) > > In general , if I just build a build folder, compile like this : > > cmake .. > make > > It may works fine, compile the external project first , and copy the > header file to desired place , and then continue compile main.cc in my > project . But if I use compile command as multi-thread like this : > > cmake .. > make -j8 > > It will not works because my main.cc and the external project are > processed at same time, so it report a error like this : > > /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found#include "crfpp.h" // crfpp > ^1 error generated. > > This crfpp.h will generated after CRFPP_EX_PROJ , but in multi-thread > environment , the sequence is quite different . > > My Question is : Is it possible that force let my project compile after > these external projects all finished . BE CAREFUL , I'm not sure is this > the problem of my use of ADD_DEPENDENCIES , I also wrote > > ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) > > but it seems not works ? > > Thanks for any help. > > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rajeevkumar235813 at gmail.com Tue Sep 16 02:43:40 2014 From: rajeevkumar235813 at gmail.com (Rajeev Kumar) Date: Tue, 16 Sep 2014 12:13:40 +0530 Subject: [CMake] Code Coverage & Bullseye Message-ID: Hi, I am trying to configure the code coverage using the ctest script. I took help from : http://www.cmake.org/Wiki/CTest/Coverage My script looks like this: *cmake_minimum_required(VERSION 3.0)set(CTEST_SOURCE_DIRECTORY /Users/rajekumar/work/test-codes/Test)set(CTEST_BINARY_DIRECTORY /Users/rajekumar/work/test-codes/Test/out/)#set(CTEST_SITE "http://oak-vcs187.lab.nbttech.com ")set(CTEST_BUILD_NAME "MacOSX")set(CTEST_CMAKE_GENERATOR "Xcode")set(CTEST_BUILD_COMMAND "xcodebuild")set(CTEST_COVERAGE_COMMAND "/usr/bin/gcov")set(ENV{COVFILE} "${CTEST_BINARY_DIRECTORY}/CMake.cov")ctest_empty_binary_directory("${CTEST_BINARY_DIRECTORY}")ctest_start("Experimental")#ctest_update()set(CTEST_PROJECT_SUBPROJECTS SportTest SampleTest InterceptTest)foreach(subproject ${CTEST_PROJECT_SUBPROJECTS}) set_property(GLOBAL PROPERTY SubProject ${subproject}) set_property(GLOBAL PROPERTY Label ${subproject}) ctest_configure() set(CTEST_BUILD_TARGET ${subproject}) ctest_build(APPEND) ctest_test(INCLUDE_LABEL ${subproject}) ctest_coverage() ctest_submit()endforeach()* *But after running I am getting following error:Performing coverage run covsrc with COVFILE=[/Users/rajekumar/work/test-codes/Test/out//CMake.cov]Cannot find :covsrcerror running covsrc:Error running bullseye summary. globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/CMakeFiles/ALL_BUILD.dir globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/CMakeFiles/Continuous.dir globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/CMakeFiles/Experimental.dir globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/CMakeFiles/Nightly.dir globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/CMakeFiles/NightlyMemoryCheck.dir globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/CMakeFiles/ZERO_CHECK.dir globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/intercepttest1/CMakeFiles/intercepttest1.dir globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/intercepttest2/CMakeFiles/intercepttest2.dir globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/sporttest1/CMakeFiles/sporttest1.dir globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/sporttest2/CMakeFiles/sporttest2.dir globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/test/CMakeFiles/Sample.dir Cannot find any GCov coverage files. Cannot find any Python Trace.py coverage files.Cannot find coverage.py XML file: /Users/rajekumar/work/test-codes/Test/out/coverage.xml Cannot find foobar GTM coverage file: /Users/rajekumar/work/test-codes/Test/out/gtm_coverage.mcov Cannot find Cache coverage file: /Users/rajekumar/work/test-codes/Test/out/cache_coverage.cmcov Cannot find any coverage files. Ignoring Coverage request.* I was under the impression that I only need gcov & lcov for code coverage. Is Bullseye is mandatory for code coverage using ctest ??? Is there any way to perform code coverage through ctest without using bullseye ?? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From micha.hergarden at gmail.com Tue Sep 16 02:55:24 2014 From: micha.hergarden at gmail.com (Micha Hergarden) Date: Tue, 16 Sep 2014 08:55:24 +0200 Subject: [CMake] how to force assign sequence in multi-thread in cmake In-Reply-To: References: <05FE4097-4F5A-4A7B-B302-98C62F75E6F4@gmail.com> Message-ID: <5417DEDC.1070205@gmail.com> Hello all, I do use the ExternalProject to prebuild some binaries, without the 'superproject' setup, and it does seem to work. Using the add_dependencies, I can make sure some third party libs are prebuild before I start to build my project. I have seen some issues with ExternalProject (failing to extract, or build), but they are too rare to pinpoint and create a bugreport. What exactly does not work? Is the external project not build at all, or just not in time? Regards, Micha On 09/16/2014 08:30 AM, Petr Kmoch wrote: > Hi. > > I've never worked with ExternalProject myself, so I can't comment with > certainty, but from what I understand, the correct way of using > ExternalProject is to add your own project as an ExternalProject as > well. Basically, the toplevel CMakeList becomes a superbuild which > *only* does ExternalProject_Add() calls and does not add any > libraries/executables directly. After you build the superbuild once to > get all the dependencies correct, you switch to the "external" project > of your own code and work with that normally. > > Petr > > On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing > wrote: > > I had asked in http://stackoverflow.com/questions/25841602 , > someone told me maybe here is a better place to ask. > > I am writing a project base on crfpp , a external project. I use > cmake to integerate this project as follow . > > firstly , I add a extenal project like this: > > |EXTERNALPROJECT_ADD( > CRFPP_EX_PROJ > GIT_REPOSITORY git at github.com:yujing5b5d/crfpp.git > PREFIX ${CMAKE_CURRENT_BINARY_DIR} > CONFIGURE_COMMAND ./configure > BUILD_COMMAND make -j8 > BUILD_IN_SOURCE 1 > INSTALL_COMMAND cp .libs/libcrfpp.a ${PROJECT_BINARY_DIR}/lib && cp crfpp.h ${PROJECT_BINARY_DIR}/include > )| > > this will generate some .a file and copy a header > file |crfpp.h| to folder |${PROJECT_BINARY_DIR}/include| , which > is included in my project. > > and then , use the |${PROJECT_BINARY_DIR}/include| as include path > as follow . > > |INCLUDE_DIRECTORIES( > ${PROJECT_SOURCE_DIR}/include > ${PROJECT_BINARY_DIR}/include > )| > > finally , when I compile the main project , code like this : > > |ADD_EXECUTABLE(cmake_sample main.cc) > ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) > TARGET_LINK_LIBRARIES(cmake_sample crfpp)| > > In general , if I just build a build folder, compile like this : > > |cmake .. > make| > > It may works fine, compile the external project first , and copy > the header file to desired place , and then continue compile > main.cc in my project . But if I use compile > command as multi-thread like this : > > |cmake .. > make -j8| > > It will not works because my main.cc and the > external project are processed at same time, so it report a error > like this : > > |/Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found > #include "crfpp.h" // crfpp > ^ > 1 error generated.| > > This |crfpp.h| will generated after |CRFPP_EX_PROJ| , but in > multi-thread environment , the sequence is quite different . > > My Question is : Is it possible that force let my project compile > after these external projects all finished . BE CAREFUL , I'm not > sure is this the problem of my use of |ADD_DEPENDENCIES| , I also > wrote > > |ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ)| > > but it seems not works ? > > Thanks for any help. > > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. > For more information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From yujing5b5d at gmail.com Tue Sep 16 03:17:50 2014 From: yujing5b5d at gmail.com (Yu Jing) Date: Tue, 16 Sep 2014 15:17:50 +0800 Subject: [CMake] how to force assign sequence in multi-thread in cmake In-Reply-To: <5417DEDC.1070205@gmail.com> References: <05FE4097-4F5A-4A7B-B302-98C62F75E6F4@gmail.com> <5417DEDC.1070205@gmail.com> Message-ID: I am in OSX 10.9.4 , a sample in github is : https://github.com/yujing5b5d/cmake_sample after git clone this project , a operation like this : ------------------------------------------------------------------------------------------------------------ yu:cmake_sample yu$ mkdir build yu:cmake_sample yu$ cd build/ yu:build yu$ cmake .. ?. # skip some useless output -- Configuring done -- Generating done -- Build files have been written to: /Users/yu/Workspace/res/cmake_sample/build yu:build yu$ make -j8 ### <<<<<<<<<<<<<<< Scanning dependencies of target LEVELDB_EX_PROJ Scanning dependencies of target iniparser Scanning dependencies of target relfiles Scanning dependencies of target CRFPP_EX_PROJ Scanning dependencies of target iniparser_static [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o Creating directories for 'CRFPP_EX_PROJ' Creating directories for 'LEVELDB_EX_PROJ' Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o [ 30%] [ 35%] Performing download step (git clone) for 'LEVELDB_EX_PROJ' Performing download step (git clone) for 'CRFPP_EX_PROJ' /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found #include "crfpp.h" // crfpp ^ Cloning into 'CRFPP_EX_PROJ'... Cloning into 'LEVELDB_EX_PROJ'... Linking C static library ../libiniparser.a Linking C shared library ../libiniparser.dylib [ 35%] [ 35%] Built target iniparser_static Built target iniparser Scanning dependencies of target cmake_sample [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found #include "crfpp.h" // crfpp ^ 1 error generated. 1 error generated. make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1 make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1 make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2 ?. ------------------------------------------------------------------------------------------------------------ BE CAREFUL OF THIS LINE : >> yu:build yu$ make -j8 the ExternalProject CRFPP_EX_PROJ?s result contains copy a crfpp.h header to a special path, after this process , we can use #include ?crfpp.h" ,and If I use make -j8 this means 8 jobs can be running at the same time, I can not constraints and let my compiler compile my main.cc after CRFPP_EX_PROJ finished. Of course , I?m not sure is this my misuse this project . On Sep 16, 2014, at 14:55, Micha Hergarden wrote: > Hello all, > > I do use the ExternalProject to prebuild some binaries, without the 'superproject' setup, and it does seem to work. Using the add_dependencies, I can make sure some third party libs are prebuild before I start to build my project. I have seen some issues with ExternalProject (failing to extract, or build), but they are too rare to pinpoint and create a bugreport. > > What exactly does not work? Is the external project not build at all, or just not in time? > > Regards, > Micha > > On 09/16/2014 08:30 AM, Petr Kmoch wrote: >> Hi. >> >> I've never worked with ExternalProject myself, so I can't comment with certainty, but from what I understand, the correct way of using ExternalProject is to add your own project as an ExternalProject as well. Basically, the toplevel CMakeList becomes a superbuild which *only* does ExternalProject_Add() calls and does not add any libraries/executables directly. After you build the superbuild once to get all the dependencies correct, you switch to the "external" project of your own code and work with that normally. >> >> Petr >> >> On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing wrote: >> I had asked in http://stackoverflow.com/questions/25841602 , someone told me maybe here is a better place to ask. >> >> I am writing a project base on crfpp , a external project. I use cmake to integerate this project as follow . >> >> firstly , I add a extenal project like this: >> >> EXTERNALPROJECT_ADD( >> CRFPP_EX_PROJ >> GIT_REPOSITORY git at github.com:yujing5b5d/crfpp.git >> PREFIX ${CMAKE_CURRENT_BINARY_DIR} >> CONFIGURE_COMMAND ./configure >> BUILD_COMMAND make -j8 >> BUILD_IN_SOURCE 1 >> INSTALL_COMMAND cp .libs/libcrfpp.a ${PROJECT_BINARY_DIR}/lib && cp crfpp.h ${PROJECT_BINARY_DIR}/include >> ) >> this will generate some .a file and copy a header file crfpp.h to folder ${PROJECT_BINARY_DIR}/include , which is included in my project. >> >> and then , use the ${PROJECT_BINARY_DIR}/include as include path as follow . >> >> INCLUDE_DIRECTORIES( >> ${PROJECT_SOURCE_DIR}/include >> ${PROJECT_BINARY_DIR}/include >> ) >> finally , when I compile the main project , code like this : >> >> ADD_EXECUTABLE(cmake_sample main.cc) >> ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) >> TARGET_LINK_LIBRARIES(cmake_sample crfpp) >> In general , if I just build a build folder, compile like this : >> >> cmake .. >> make >> It may works fine, compile the external project first , and copy the header file to desired place , and then continue compile main.cc in my project . But if I use compile command as multi-thread like this : >> >> cmake .. >> make -j8 >> It will not works because my main.cc and the external project are processed at same time, so it report a error like this : >> >> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >> #include "crfpp.h" // crfpp >> ^ >> 1 error generated. >> This crfpp.h will generated after CRFPP_EX_PROJ , but in multi-thread environment , the sequence is quite different . >> >> My Question is : Is it possible that force let my project compile after these external projects all finished . BE CAREFUL , I'm not sure is this the problem of my use of ADD_DEPENDENCIES , I also wrote >> >> ADD_DEPENDENCIES(< >> span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">cmake_sample CRFPP_EX_PROJ) >> but it seems not works ? >> >> Thanks for any help. >> >> >> >> -- >> >> Powered by www.kitware.com >> >> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ >> >> Kitware offers various services to support the CMake community. For more information on each offering, please visit: >> >> CMake Support: http://cmake.org/cmake/help/support.html >> CMake Consulting: http://cmake.org/cmake/help/consulting.html >> CMake Training Courses: http://cmake.org/cmake/help/training.html >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/cmake >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From micha.hergarden at gmail.com Tue Sep 16 03:27:01 2014 From: micha.hergarden at gmail.com (Micha Hergarden) Date: Tue, 16 Sep 2014 09:27:01 +0200 Subject: [CMake] how to force assign sequence in multi-thread in cmake In-Reply-To: References: <05FE4097-4F5A-4A7B-B302-98C62F75E6F4@gmail.com> <5417DEDC.1070205@gmail.com> Message-ID: <5417E645.2000603@gmail.com> It may be that you have line 63 and 64 the wrong way around: ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(lib) The externalproject is added in lib, but you add a dependency on it in src. CMake will descend in the subdirectories in the order you supply them. Does reversing the directories help? Regards, Micha On 09/16/2014 09:17 AM, Yu Jing wrote: > I am in OSX 10.9.4 , a sample in github is > : https://github.com/yujing5b5d/cmake_sample > after git clone this project , a operation like this : > ------------------------------------------------------------------------------------------------------------ > > *yu:cmake_sample yu$ mkdir build* > *yu:cmake_sample yu$ cd build/* > *yu:build yu$ cmake ..* > ?. # skip some useless output > -- Configuring done > -- Generating done > -- Build files have been written to: > /Users/yu/Workspace/res/cmake_sample/build > *yu:build yu$ make -j8 ### <<<<<<<<<<<<<<<* > Scanning dependencies of target LEVELDB_EX_PROJ > Scanning dependencies of target iniparser > Scanning dependencies of target relfiles > Scanning dependencies of target CRFPP_EX_PROJ > Scanning dependencies of target iniparser_static > [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object > lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o > Creating directories for 'CRFPP_EX_PROJ' > Creating directories for 'LEVELDB_EX_PROJ' > Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o > Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o > [ 30%] [ 35%] Performing download step (git clone) for 'LEVELDB_EX_PROJ' > Performing download step (git clone) for 'CRFPP_EX_PROJ' > /Users/yu/Workspace/res/cmake_sample/src/main.cc > :3:10: fatal error: 'crfpp.h' file not found > #include "crfpp.h" // crfpp > ^ > Cloning into 'CRFPP_EX_PROJ'... > Cloning into 'LEVELDB_EX_PROJ'... > Linking C static library ../libiniparser.a > Linking C shared library ../libiniparser.dylib > [ 35%] [ 35%] Built target iniparser_static > Built target iniparser > Scanning dependencies of target cmake_sample > [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o > /Users/yu/Workspace/res/cmake_sample/src/main.cc > :3:10: fatal error: 'crfpp.h' file not found > #include "crfpp.h" // crfpp > ^ > 1 error generated. > 1 error generated. > make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1 > make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1 > make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2 > make[1]: *** Waiting for unfinished jobs.... > make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2 > ?. > ------------------------------------------------------------------------------------------------------------ > > BE CAREFUL OF THIS LINE : > *>> yu:build yu$ make -j8* > * > * > the ExternalProject CRFPP_EX_PROJ?s result contains copy a crfpp.h > header to a special path, after this process , we can use #include > ?crfpp.h" ,and If I use > make -j8 > this means 8 jobs can be running at the same time, I can not > constraints and let my compiler compile my main.cc > after CRFPP_EX_PROJ finished. > > Of course , I?m not sure is this my misuse this project . > > > > On Sep 16, 2014, at 14:55, Micha Hergarden > wrote: > >> Hello all, >> >> I do use the ExternalProject to prebuild some binaries, without the >> 'superproject' setup, and it does seem to work. Using the >> add_dependencies, I can make sure some third party libs are prebuild >> before I start to build my project. I have seen some issues with >> ExternalProject (failing to extract, or build), but they are too rare >> to pinpoint and create a bugreport. >> >> What exactly does not work? Is the external project not build at all, >> or just not in time? >> >> Regards, >> Micha >> >> On 09/16/2014 08:30 AM, Petr Kmoch wrote: >>> Hi. >>> >>> I've never worked with ExternalProject myself, so I can't comment >>> with certainty, but from what I understand, the correct way of using >>> ExternalProject is to add your own project as an ExternalProject as >>> well. Basically, the toplevel CMakeList becomes a superbuild which >>> *only* does ExternalProject_Add() calls and does not add any >>> libraries/executables directly. After you build the superbuild once >>> to get all the dependencies correct, you switch to the "external" >>> project of your own code and work with that normally. >>> >>> Petr >>> >>> On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing >> > wrote: >>> >>> I had asked in http://stackoverflow.com/questions/25841602 , >>> someone told me maybe here is a better place to ask. >>> >>> I am writing a project base on crfpp , a external project. I use >>> cmake to integerate this project as follow . >>> >>> firstly , I add a extenal project like this: >>> >>> |EXTERNALPROJECT_ADD( >>> CRFPP_EX_PROJ >>> GIT_REPOSITORY git at github.com:yujing5b5d/crfpp.git >>> PREFIX ${CMAKE_CURRENT_BINARY_DIR} >>> CONFIGURE_COMMAND ./configure >>> BUILD_COMMAND make -j8 >>> BUILD_IN_SOURCE 1 >>> INSTALL_COMMAND cp .libs/libcrfpp.a ${PROJECT_BINARY_DIR}/lib && cp crfpp.h ${PROJECT_BINARY_DIR}/include >>> )| >>> >>> this will generate some .a file and copy a header >>> file |crfpp.h| to folder |${PROJECT_BINARY_DIR}/include| , which >>> is included in my project. >>> >>> and then , use the |${PROJECT_BINARY_DIR}/include| as include >>> path as follow . >>> >>> |INCLUDE_DIRECTORIES( >>> ${PROJECT_SOURCE_DIR}/include >>> ${PROJECT_BINARY_DIR}/include >>> )| >>> >>> finally , when I compile the main project , code like this : >>> >>> |ADD_EXECUTABLE(cmake_sample main.cc) >>> ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) >>> TARGET_LINK_LIBRARIES(cmake_sample crfpp)| >>> >>> In general , if I just build a build folder, compile like this : >>> >>> |cmake .. >>> make| >>> >>> It may works fine, compile the external project first , and copy >>> the header file to desired place , and then continue compile >>> main.cc in my project . But if I use compile >>> command as multi-thread like this : >>> >>> |cmake .. >>> make -j8| >>> >>> It will not works because my main.cc and the >>> external project are processed at same time, so it report a >>> error like this : >>> >>> |/Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>> #include "crfpp.h" // crfpp >>> ^ >>> 1 error generated.| >>> >>> This |crfpp.h| will generated after |CRFPP_EX_PROJ| , but in >>> multi-thread environment , the sequence is quite different . >>> >>> My Question is : Is it possible that force let my project >>> compile after these external projects all finished . BE CAREFUL >>> , I'm not sure is this the problem of my use >>> of |ADD_DEPENDENCIES| , I also wrote >>> >>> |ADD_DEPENDENCIES(< >>> span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">cmake_sample CRFPP_EX_PROJ)| >>> >>> but it seems not works ? >>> >>> Thanks for any help. >>> >>> >>> >>> -- >>> >>> Powered by www.kitware.com >>> >>> Please keep messages on-topic and check the CMake FAQ at: >>> http://www.cmake.org/Wiki/CMake_FAQ >>> >>> Kitware offers various services to support the CMake community. >>> For more information on each offering, please visit: >>> >>> CMake Support: http://cmake.org/cmake/help/support.html >>> CMake Consulting: http://cmake.org/cmake/help/consulting.html >>> CMake Training Courses: http://cmake.org/cmake/help/training.html >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/cmake >>> >>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From yujing5b5d at gmail.com Tue Sep 16 04:41:37 2014 From: yujing5b5d at gmail.com (Yu Jing) Date: Tue, 16 Sep 2014 16:41:37 +0800 Subject: [CMake] how to force assign sequence in multi-thread in cmake In-Reply-To: <5417E645.2000603@gmail.com> References: <05FE4097-4F5A-4A7B-B302-98C62F75E6F4@gmail.com> <5417DEDC.1070205@gmail.com> <5417E645.2000603@gmail.com> Message-ID: <8B05041E-6ABA-411B-9854-9AA53BD51C07@gmail.com> Hello Micha , It seems doesn?t work. I updated code , and move the external project to src , and it still not work. what should be noticed is : 1. If I just use $ make as make command ,all styles are work 2. If I use in multi jobs $ make -j8 It will run abnormal (not desired sequence) . On Sep 16, 2014, at 15:27, Micha Hergarden wrote: > It may be that you have line 63 and 64 the wrong way around: > ADD_SUBDIRECTORY(src) > ADD_SUBDIRECTORY(lib) > > The externalproject is added in lib, but you add a dependency on it in src. CMake will descend in the subdirectories in the order you supply them. > Does reversing the directories help? > > Regards, > Micha > > On 09/16/2014 09:17 AM, Yu Jing wrote: >> I am in OSX 10.9.4 , a sample in github is : https://github.com/yujing5b5d/cmake_sample >> after git clone this project , a operation like this : >> ------------------------------------------------------------------------------------------------------------ >> >> yu:cmake_sample yu$ mkdir build >> yu:cmake_sample yu$ cd build/ >> yu:build yu$ cmake .. >> ?. # skip some useless output >> -- Configuring done >> -- Generating done >> -- Build files have been written to: /Users/yu/Workspace/res/cmake_sample/build >> yu:build yu$ make -j8 ### <<<<<<<<<<<<<<< >> Scanning dependencies of target LEVELDB_EX_PROJ >> Scanning dependencies of target iniparser >> Scanning dependencies of target relfiles >> Scanning dependencies of target CRFPP_EX_PROJ >> Scanning dependencies of target iniparser_static >> [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o >> Creating directories for 'CRFPP_EX_PROJ' >> Creating directories for 'LEVELDB_EX_PROJ' >> Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o >> Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o >> [ 30%] [ 35%] Performing download step (git clone) for 'LEVELDB_EX_PROJ' >> Performing download step (git clone) for 'CRFPP_EX_PROJ' >> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >> #include "crfpp.h" // crfpp >> ^ >> Cloning into 'CRFPP_EX_PROJ'... >> Cloning into 'LEVELDB_EX_PROJ'... >> Linking C static library ../libiniparser.a >> Linking C shared library ../libiniparser.dylib >> [ 35%] [ 35%] Built target iniparser_static >> Built target iniparser >> Scanning dependencies of target cmake_sample >> [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o >> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >> #include "crfpp.h" // crfpp >> ^ >> 1 error generated. >> 1 error generated. >> make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1 >> make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1 >> make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2 >> make[1]: *** Waiting for unfinished jobs.... >> make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2 >> ?. >> ------------------------------------------------------------------------------------------------------------ >> >> BE CAREFUL OF THIS LINE : >> >> yu:build yu$ make -j8 >> >> the ExternalProject CRFPP_EX_PROJ?s result contains copy a crfpp.h header to a special path, after this process , we can use #include ?crfpp.h" ,and If I use >> make -j8 >> this means 8 jobs can be running at the same time, I can not constraints and let my compiler compile my main.cc after CRFPP_EX_PROJ finished. >> >> Of course , I?m not sure is this my misuse this project . >> >> >> >> On Sep 16, 2014, at 14:55, Micha Hergarden wrote: >> >>> Hello all, >>> >>> I do use the ExternalProject to prebuild some binaries, without the 'superproject' setup, and it does seem to work. Using the add_dependencies, I can make sure some third party libs are prebuild before I start to build my project. I have seen some issues with ExternalProject (failing to extract, or build), but they are too rare to pinpoint and create a bugreport. >>> >>> What exactly does not work? Is the external project not build at all, or just not in time? >>> >>> Regards, >>> Micha >>> >>> On 09/16/2014 08:30 AM, Petr Kmoch wrote: >>>> Hi. >>>> >>>> I've never worked with ExternalProject myself, so I can't comment with certainty, but from what I understand, the correct way of using ExternalProject is to add your own project as an ExternalProject as well. Basically, the toplevel CMakeList becomes a superbuild which *only* does ExternalProject_Add() calls and does not add any libraries/executables directly. After you build the superbuild once to get all the dependencies correct, you switch to the "external" project of your own code and work with that normally. >>>> >>>> Petr >>>> >>>> On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing wrote: >>>> I had asked in http://stackoverflow.com/questions/25841602 , someone told me maybe here is a better place to ask. >>>> >>>> I am writing a project base on crfpp , a external project. I use cmake to integerate this project as follow . >>>> >>>> firstly , I add a extenal project like this: >>>> >>>> EXTERNALPROJECT_ADD( >>>> CRFPP_EX_PROJ >>>> GIT_REPOSITORY git at github.com:yujing5b5d/crfpp.git >>>> PREFIX ${CMAKE_CURRENT_BINARY_DIR} >>>> CONFIGURE_COMMAND ./configure >>>> BUILD_COMMAND make -j8 >>>> BUILD_IN_SOURCE 1 >>>> INSTALL_COMMAND cp .libs/libcrfpp.a ${PROJECT_BINARY_DIR}/lib && cp crfpp.h ${PROJECT_BINARY_DIR}/include >>>> ) >>>> this will generate some .a file and copy a header file crfpp.h to folder ${PROJECT_BINARY_DIR}/include , which is included in my project. >>>> >>>> and then , use the ${PROJECT_BINARY_DIR}/include as include path as follow . >>>> >>>> INCLUDE_DIRECTORIES( >>>> ${PROJECT_SOURCE_DIR}/include >>>> ${PROJECT_BINARY_DIR}/include >>>> ) >>>> finally , when I compile the main project , code like this : >>>> >>>> ADD_EXECUTABLE(cmake_sample main.cc) >>>> ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) >>>> TARGET_LINK_LIBRARIES(cmake_sample crfpp) >>>> In general , if I just build a build folder, compile like this : >>>> >>>> cmake .. >>>> make >>>> It may works fine, compile the external project first , and copy the header file to desired place , and then continue compile main.cc in my project . But if I use compile command as multi-thread like this : >>>> >>>> cmake .. >>>> make -j8 >>>> It will not works because my main.cc and the external project are processed at same time, so it report a error like this : >>>> >>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>>> #include "crfpp.h" // crfpp >>>> ^ >>>> 1 error generated. >>>> This crfpp.h will generated after CRFPP_EX_PROJ , but in multi-thread environment , the sequence is quite different . >>>> >>>> My Question is : Is it possible that force let my project compile after these external projects all finished . BE CAREFUL , I'm not sure is this the problem of my use of ADD_DEPENDENCIES , I also wrote >>>> >>>> ADD_DEPENDENCIES( >>>> < >>>> span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">cmake_sample CRFPP_EX_PROJ) >>>> but it seems not works ? >>>> >>>> Thanks for any help. >>>> >>>> >>>> >>>> -- >>>> >>>> Powered by www.kitware.com >>>> >>>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ >>>> >>>> Kitware offers various services to support the CMake community. For more information on each offering, please visit: >>>> >>>> CMake Support: http://cmake.org/cmake/help/support.html >>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html >>>> CMake Training Courses: http://cmake.org/cmake/help/training.html >>>> >>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/cmake >>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From loose at astron.nl Tue Sep 16 05:04:14 2014 From: loose at astron.nl (Marcel Loose) Date: Tue, 16 Sep 2014 11:04:14 +0200 Subject: [CMake] how to force assign sequence in multi-thread in cmake In-Reply-To: <8B05041E-6ABA-411B-9854-9AA53BD51C07@gmail.com> References: <05FE4097-4F5A-4A7B-B302-98C62F75E6F4@gmail.com> <5417DEDC.1070205@gmail.com> <5417E645.2000603@gmail.com> <8B05041E-6ABA-411B-9854-9AA53BD51C07@gmail.com> Message-ID: <5417FD0E.4030106@astron.nl> Hi Yu, I think you need to add an explicit dependency of main.cc on the "generated" (well, not really generated, but installed) header file crfpp.h. CMake has no clue as to what files are being compiled/installed by your external project, so you have to make this explicit. HTH, Marcel Loose. On 16/09/14 10:41, Yu Jing wrote: > Hello Micha , > > It seems doesn?t work. > I updated code , and move the external project to src , and it still > not work. > > what should be noticed is : > 1. If I just use > $ make > as make command ,all styles are work > 2. If I use in multi jobs > $ make -j8 > It will run abnormal (not desired sequence) . > > > On Sep 16, 2014, at 15:27, Micha Hergarden > wrote: > >> It may be that you have line 63 and 64 the wrong way around: >> ADD_SUBDIRECTORY(src) >> ADD_SUBDIRECTORY(lib) >> >> The externalproject is added in lib, but you add a dependency on it >> in src. CMake will descend in the subdirectories in the order you >> supply them. >> Does reversing the directories help? >> >> Regards, >> Micha >> >> On 09/16/2014 09:17 AM, Yu Jing wrote: >>> I am in OSX 10.9.4 , a sample in github is >>> : https://github.com/yujing5b5d/cmake_sample >>> after git clone this project , a operation like this : >>> ------------------------------------------------------------------------------------------------------------ >>> >>> *yu:cmake_sample yu$ mkdir build* >>> *yu:cmake_sample yu$ cd build/* >>> *yu:build yu$ cmake ..* >>> ?. # skip some useless output >>> -- Configuring done >>> -- Generating done >>> -- Build files have been written to: >>> /Users/yu/Workspace/res/cmake_sample/build >>> *yu:build yu$ make -j8 ### <<<<<<<<<<<<<<<* >>> Scanning dependencies of target LEVELDB_EX_PROJ >>> Scanning dependencies of target iniparser >>> Scanning dependencies of target relfiles >>> Scanning dependencies of target CRFPP_EX_PROJ >>> Scanning dependencies of target iniparser_static >>> [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object >>> lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o >>> Creating directories for 'CRFPP_EX_PROJ' >>> Creating directories for 'LEVELDB_EX_PROJ' >>> Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o >>> Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o >>> [ 30%] [ 35%] Performing download step (git clone) for 'LEVELDB_EX_PROJ' >>> Performing download step (git clone) for 'CRFPP_EX_PROJ' >>> /Users/yu/Workspace/res/cmake_sample/src/main.cc >>> :3:10: fatal error: 'crfpp.h' file not found >>> #include "crfpp.h" // crfpp >>> ^ >>> Cloning into 'CRFPP_EX_PROJ'... >>> Cloning into 'LEVELDB_EX_PROJ'... >>> Linking C static library ../libiniparser.a >>> Linking C shared library ../libiniparser.dylib >>> [ 35%] [ 35%] Built target iniparser_static >>> Built target iniparser >>> Scanning dependencies of target cmake_sample >>> [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o >>> /Users/yu/Workspace/res/cmake_sample/src/main.cc >>> :3:10: fatal error: 'crfpp.h' file not found >>> #include "crfpp.h" // crfpp >>> ^ >>> 1 error generated. >>> 1 error generated. >>> make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1 >>> make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1 >>> make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2 >>> make[1]: *** Waiting for unfinished jobs.... >>> make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2 >>> ?. >>> ------------------------------------------------------------------------------------------------------------ >>> >>> BE CAREFUL OF THIS LINE : >>> *>> yu:build yu$ make -j8* >>> * >>> * >>> the ExternalProject CRFPP_EX_PROJ?s result contains copy a crfpp.h >>> header to a special path, after this process , we can use #include >>> ?crfpp.h" ,and If I use >>> make -j8 >>> this means 8 jobs can be running at the same time, I can not >>> constraints and let my compiler compile my main.cc >>> after CRFPP_EX_PROJ finished. >>> >>> Of course , I?m not sure is this my misuse this project . >>> >>> >>> >>> On Sep 16, 2014, at 14:55, Micha Hergarden >>> > wrote: >>> >>>> Hello all, >>>> >>>> I do use the ExternalProject to prebuild some binaries, without the >>>> 'superproject' setup, and it does seem to work. Using the >>>> add_dependencies, I can make sure some third party libs are >>>> prebuild before I start to build my project. I have seen some >>>> issues with ExternalProject (failing to extract, or build), but >>>> they are too rare to pinpoint and create a bugreport. >>>> >>>> What exactly does not work? Is the external project not build at >>>> all, or just not in time? >>>> >>>> Regards, >>>> Micha >>>> >>>> On 09/16/2014 08:30 AM, Petr Kmoch wrote: >>>>> Hi. >>>>> >>>>> I've never worked with ExternalProject myself, so I can't comment >>>>> with certainty, but from what I understand, the correct way of >>>>> using ExternalProject is to add your own project as an >>>>> ExternalProject as well. Basically, the toplevel CMakeList becomes >>>>> a superbuild which *only* does ExternalProject_Add() calls and >>>>> does not add any libraries/executables directly. After you build >>>>> the superbuild once to get all the dependencies correct, you >>>>> switch to the "external" project of your own code and work with >>>>> that normally. >>>>> >>>>> Petr >>>>> >>>>> On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing >>>> > wrote: >>>>> >>>>> I had asked in http://stackoverflow.com/questions/25841602 , >>>>> someone told me maybe here is a better place to ask. >>>>> >>>>> I am writing a project base on crfpp , a external project. I >>>>> use cmake to integerate this project as follow . >>>>> >>>>> firstly , I add a extenal project like this: >>>>> >>>>> |EXTERNALPROJECT_ADD( >>>>> CRFPP_EX_PROJ >>>>> GIT_REPOSITORY git at github.com:yujing5b5d/crfpp.git >>>>> PREFIX ${CMAKE_CURRENT_BINARY_DIR} >>>>> CONFIGURE_COMMAND ./configure >>>>> BUILD_COMMAND make -j8 >>>>> BUILD_IN_SOURCE 1 >>>>> INSTALL_COMMAND cp .libs/libcrfpp.a ${PROJECT_BINARY_DIR}/lib && cp crfpp.h ${PROJECT_BINARY_DIR}/include >>>>> )| >>>>> >>>>> this will generate some .a file and copy a header >>>>> file |crfpp.h| to folder |${PROJECT_BINARY_DIR}/include| , >>>>> which is included in my project. >>>>> >>>>> and then , use the |${PROJECT_BINARY_DIR}/include| as include >>>>> path as follow . >>>>> >>>>> |INCLUDE_DIRECTORIES( >>>>> ${PROJECT_SOURCE_DIR}/include >>>>> ${PROJECT_BINARY_DIR}/include >>>>> )| >>>>> >>>>> finally , when I compile the main project , code like this : >>>>> >>>>> |ADD_EXECUTABLE(cmake_sample main.cc) >>>>> ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) >>>>> TARGET_LINK_LIBRARIES(cmake_sample crfpp)| >>>>> >>>>> In general , if I just build a build folder, compile like this : >>>>> >>>>> |cmake .. >>>>> make| >>>>> >>>>> It may works fine, compile the external project first , and >>>>> copy the header file to desired place , and then continue >>>>> compile main.cc in my project . But if I use >>>>> compile command as multi-thread like this : >>>>> >>>>> |cmake .. >>>>> make -j8| >>>>> >>>>> It will not works because my main.cc and the >>>>> external project are processed at same time, so it report a >>>>> error like this : >>>>> >>>>> |/Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>>>> #include "crfpp.h" // crfpp >>>>> ^ >>>>> 1 error generated.| >>>>> >>>>> This |crfpp.h| will generated after |CRFPP_EX_PROJ| , but in >>>>> multi-thread environment , the sequence is quite different . >>>>> >>>>> My Question is : Is it possible that force let my project >>>>> compile after these external projects all finished . BE >>>>> CAREFUL , I'm not sure is this the problem of my use >>>>> of |ADD_DEPENDENCIES| , I also wrote >>>>> >>>>> |ADD_DEPENDENCIES( >>>>> < >>>>> span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">cmake_sample CRFPP_EX_PROJ)| >>>>> >>>>> but it seems not works ? >>>>> >>>>> Thanks for any help. >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> Powered by www.kitware.com >>>>> >>>>> Please keep messages on-topic and check the CMake FAQ at: >>>>> http://www.cmake.org/Wiki/CMake_FAQ >>>>> >>>>> Kitware offers various services to support the CMake >>>>> community. For more information on each offering, please visit: >>>>> >>>>> CMake Support: http://cmake.org/cmake/help/support.html >>>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html >>>>> CMake Training Courses: http://cmake.org/cmake/help/training.html >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/cmake >>>>> >>>>> >>>>> >>>>> >>>> >>> >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: loose.vcf Type: text/x-vcard Size: 292 bytes Desc: not available URL: From micha.hergarden at gmail.com Tue Sep 16 05:36:26 2014 From: micha.hergarden at gmail.com (Micha Hergarden) Date: Tue, 16 Sep 2014 11:36:26 +0200 Subject: [CMake] how to force assign sequence in multi-thread in cmake In-Reply-To: <5417FD0E.4030106@astron.nl> References: <05FE4097-4F5A-4A7B-B302-98C62F75E6F4@gmail.com> <5417DEDC.1070205@gmail.com> <5417E645.2000603@gmail.com> <8B05041E-6ABA-411B-9854-9AA53BD51C07@gmail.com> <5417FD0E.4030106@astron.nl> Message-ID: <5418049A.8070403@gmail.com> Hello Yu, It seems I too needed another trick to make it work: set_property(TARGET CRFPP_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE) set_property(TARGET LEVELDB_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE) ADD_DEPENDENCIES(cmake_sample iniparser_static CRFPP_EX_PROJ LEVELDB_EX_PROJ) By default the ExternalProject_Add will add that target to the ALL target, and that confuses the Make dependency checker. I have removed those dependencies in my project. On the whole I agree with Marcel Loose and Petr Kmoch however. Combining their solution makes for a 'cleaner' project. To be honest, I am halfway of migrating my project to a superbuild as well. Take a look at the openchemistry project if you would like to see an example of that: https://github.com/OpenChemistry/openchemistry Regards, Micha Hergarden On 09/16/2014 11:04 AM, Marcel Loose wrote: > Hi Yu, > > I think you need to add an explicit dependency of main.cc on the > "generated" (well, not really generated, but installed) header file > crfpp.h. CMake has no clue as to what files are being > compiled/installed by your external project, so you have to make this > explicit. > > HTH, > Marcel Loose. > > > On 16/09/14 10:41, Yu Jing wrote: >> Hello Micha , >> >> It seems doesn?t work. >> I updated code , and move the external project to src , and it still >> not work. >> >> what should be noticed is : >> 1. If I just use >> $ make >> as make command ,all styles are work >> 2. If I use in multi jobs >> $ make -j8 >> It will run abnormal (not desired sequence) . >> >> >> On Sep 16, 2014, at 15:27, Micha Hergarden > > wrote: >> >>> It may be that you have line 63 and 64 the wrong way around: >>> ADD_SUBDIRECTORY(src) >>> ADD_SUBDIRECTORY(lib) >>> >>> The externalproject is added in lib, but you add a dependency on it >>> in src. CMake will descend in the subdirectories in the order you >>> supply them. >>> Does reversing the directories help? >>> >>> Regards, >>> Micha >>> >>> On 09/16/2014 09:17 AM, Yu Jing wrote: >>>> I am in OSX 10.9.4 , a sample in github is >>>> : https://github.com/yujing5b5d/cmake_sample >>>> after git clone this project , a operation like this : >>>> ------------------------------------------------------------------------------------------------------------ >>>> >>>> *yu:cmake_sample yu$ mkdir build* >>>> *yu:cmake_sample yu$ cd build/* >>>> *yu:build yu$ cmake ..* >>>> ?. # skip some useless output >>>> -- Configuring done >>>> -- Generating done >>>> -- Build files have been written to: >>>> /Users/yu/Workspace/res/cmake_sample/build >>>> *yu:build yu$ make -j8 ### <<<<<<<<<<<<<<<* >>>> Scanning dependencies of target LEVELDB_EX_PROJ >>>> Scanning dependencies of target iniparser >>>> Scanning dependencies of target relfiles >>>> Scanning dependencies of target CRFPP_EX_PROJ >>>> Scanning dependencies of target iniparser_static >>>> [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object >>>> lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o >>>> Creating directories for 'CRFPP_EX_PROJ' >>>> Creating directories for 'LEVELDB_EX_PROJ' >>>> Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o >>>> Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o >>>> [ 30%] [ 35%] Performing download step (git clone) for >>>> 'LEVELDB_EX_PROJ' >>>> Performing download step (git clone) for 'CRFPP_EX_PROJ' >>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc >>>> :3:10: fatal error: 'crfpp.h' file not found >>>> #include "crfpp.h" // crfpp >>>> ^ >>>> Cloning into 'CRFPP_EX_PROJ'... >>>> Cloning into 'LEVELDB_EX_PROJ'... >>>> Linking C static library ../libiniparser.a >>>> Linking C shared library ../libiniparser.dylib >>>> [ 35%] [ 35%] Built target iniparser_static >>>> Built target iniparser >>>> Scanning dependencies of target cmake_sample >>>> [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o >>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc >>>> :3:10: fatal error: 'crfpp.h' file not found >>>> #include "crfpp.h" // crfpp >>>> ^ >>>> 1 error generated. >>>> 1 error generated. >>>> make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1 >>>> make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1 >>>> make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2 >>>> make[1]: *** Waiting for unfinished jobs.... >>>> make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2 >>>> ?. >>>> ------------------------------------------------------------------------------------------------------------ >>>> >>>> BE CAREFUL OF THIS LINE : >>>> *>> yu:build yu$ make -j8* >>>> * >>>> * >>>> the ExternalProject CRFPP_EX_PROJ?s result contains copy a crfpp.h >>>> header to a special path, after this process , we can use #include >>>> ?crfpp.h" ,and If I use >>>> make -j8 >>>> this means 8 jobs can be running at the same time, I can not >>>> constraints and let my compiler compile my main.cc >>>> after CRFPP_EX_PROJ finished. >>>> >>>> Of course , I?m not sure is this my misuse this project . >>>> >>>> >>>> >>>> On Sep 16, 2014, at 14:55, Micha Hergarden >>>> > wrote: >>>> >>>>> Hello all, >>>>> >>>>> I do use the ExternalProject to prebuild some binaries, without >>>>> the 'superproject' setup, and it does seem to work. Using the >>>>> add_dependencies, I can make sure some third party libs are >>>>> prebuild before I start to build my project. I have seen some >>>>> issues with ExternalProject (failing to extract, or build), but >>>>> they are too rare to pinpoint and create a bugreport. >>>>> >>>>> What exactly does not work? Is the external project not build at >>>>> all, or just not in time? >>>>> >>>>> Regards, >>>>> Micha >>>>> >>>>> On 09/16/2014 08:30 AM, Petr Kmoch wrote: >>>>>> Hi. >>>>>> >>>>>> I've never worked with ExternalProject myself, so I can't comment >>>>>> with certainty, but from what I understand, the correct way of >>>>>> using ExternalProject is to add your own project as an >>>>>> ExternalProject as well. Basically, the toplevel CMakeList >>>>>> becomes a superbuild which *only* does ExternalProject_Add() >>>>>> calls and does not add any libraries/executables directly. After >>>>>> you build the superbuild once to get all the dependencies >>>>>> correct, you switch to the "external" project of your own code >>>>>> and work with that normally. >>>>>> >>>>>> Petr >>>>>> >>>>>> On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing >>>>> > wrote: >>>>>> >>>>>> I had asked in http://stackoverflow.com/questions/25841602 , >>>>>> someone told me maybe here is a better place to ask. >>>>>> >>>>>> I am writing a project base on crfpp , a external project. I >>>>>> use cmake to integerate this project as follow . >>>>>> >>>>>> firstly , I add a extenal project like this: >>>>>> >>>>>> |EXTERNALPROJECT_ADD( >>>>>> CRFPP_EX_PROJ >>>>>> GIT_REPOSITORY git at github.com:yujing5b5d/crfpp.git >>>>>> PREFIX ${CMAKE_CURRENT_BINARY_DIR} >>>>>> CONFIGURE_COMMAND ./configure >>>>>> BUILD_COMMAND make -j8 >>>>>> BUILD_IN_SOURCE 1 >>>>>> INSTALL_COMMAND cp .libs/libcrfpp.a ${PROJECT_BINARY_DIR}/lib && cp crfpp.h ${PROJECT_BINARY_DIR}/include >>>>>> )| >>>>>> >>>>>> this will generate some .a file and copy a header >>>>>> file |crfpp.h| to folder |${PROJECT_BINARY_DIR}/include| , >>>>>> which is included in my project. >>>>>> >>>>>> and then , use the |${PROJECT_BINARY_DIR}/include| as include >>>>>> path as follow . >>>>>> >>>>>> |INCLUDE_DIRECTORIES( >>>>>> ${PROJECT_SOURCE_DIR}/include >>>>>> ${PROJECT_BINARY_DIR}/include >>>>>> )| >>>>>> >>>>>> finally , when I compile the main project , code like this : >>>>>> >>>>>> |ADD_EXECUTABLE(cmake_sample main.cc) >>>>>> ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) >>>>>> TARGET_LINK_LIBRARIES(cmake_sample crfpp)| >>>>>> >>>>>> In general , if I just build a build folder, compile like this : >>>>>> >>>>>> |cmake .. >>>>>> < >>>>>> /span> >>>>>> make| >>>>>> >>>>>> It may works fine, compile the external project first , and >>>>>> copy the header file to desired place , and then continue >>>>>> compile main.cc in my project . But if I >>>>>> use compile command as multi-thread like this : >>>>>> >>>>>> |cmake >>>>>> . >>>>>> . >>>>>> make -j8| >>>>>> >>>>>> It will not works because my main.cc and >>>>>> the external project are processed at same time, so it report >>>>>> a error like this : >>>>>> >>>>>> |/Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>>>>> #include "crfpp.h" // crfpp >>>>>> ^ >>>>>> 1 error generated.| >>>>>> >>>>>> This |crfpp.h| will generated after |CRFPP_EX_PROJ| , but in >>>>>> multi-thread environment , the sequence is quite different . >>>>>> >>>>>> My Question is : Is it possible that force let my project >>>>>> compile after these external projects all finished . BE >>>>>> CAREFUL , I'm not sure is this the problem of my use >>>>>> of |ADD_DEPENDENCIES| , I also wrote >>>>>> >>>>>> |ADD_DEPENDENCIES( >>>>>> < >>>>>> span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">cmake_sample CRFPP_EX_PROJ)| >>>>>> >>>>>> but it seems not works ? >>>>>> >>>>>> Thanks for any help. >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Please keep messages on-topic and check the CMake FAQ at: >>>>>> http://www.cmake.org/Wiki/CMake_FAQ >>>>>> >>>>>> Kitware offers various services to support the CMake >>>>>> community. For more information on each offering, please visit: >>>>>> >>>>>> CMake Support: http://cmake.org/cmake/help/support.html >>>>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html >>>>>> CMake Training Courses: http://cmake.org/cmake/help/training.html >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Follow this link to subscribe/unsubscribe: >>>>>> http://public.kitware.com/mailman/listinfo/cmake >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >> >> >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From dlrdave at aol.com Tue Sep 16 06:36:43 2014 From: dlrdave at aol.com (David Cole) Date: Tue, 16 Sep 2014 06:36:43 -0400 Subject: [CMake] Get Visual Studio target Arch Message-ID: <8D19FB13DDCC886-18B4-9CAB@webmail-va018.sysops.aol.com> > I still cant really make some arch specific ifdefs in my cmake > scripts using this approach. That's the point of a multi-configuration, multi-architecture Visual Studio solution: you defer choosing the configuration *and* the architecture until build time. No "CMake time" decisions are possible based on the configuration or the architecture with this approach because neither is known until compile time. It is inappropriate to "choose the configuration or architecture" in CMake code with this approach, and you should re-think about it and see if you can make compile time decisions instead, possibly with #ifdef sections in your C/C++ code... Rather than re-organize your libraries, you could easily just use "win32/libs/$(Platform)" as your value when using the VS generators, and this should work. By the way, Gilles, I echo the sentiment: nice work! I wish MS had gotten involved in CMake even earlier... but welcome! HTH, David C. From yujing5b5d at gmail.com Tue Sep 16 07:42:21 2014 From: yujing5b5d at gmail.com (Yu Jing) Date: Tue, 16 Sep 2014 19:42:21 +0800 Subject: [CMake] how to force assign sequence in multi-thread in cmake In-Reply-To: <5418049A.8070403@gmail.com> References: <05FE4097-4F5A-4A7B-B302-98C62F75E6F4@gmail.com> <5417DEDC.1070205@gmail.com> <5417E645.2000603@gmail.com> <8B05041E-6ABA-411B-9854-9AA53BD51C07@gmail.com> <5417FD0E.4030106@astron.nl> <5418049A.8070403@gmail.com> Message-ID: Hello Micha, It seems still not work?. On Sep 16, 2014, at 17:36, Micha Hergarden wrote: > Hello Yu, > > It seems I too needed another trick to make it work: > set_property(TARGET CRFPP_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE) > set_property(TARGET LEVELDB_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE) > > ADD_DEPENDENCIES(cmake_sample iniparser_static CRFPP_EX_PROJ LEVELDB_EX_PROJ) > > By default the ExternalProject_Add will add that target to the ALL target, and that confuses the Make dependency checker. I have removed those dependencies in my project. On the whole I agree with Marcel Loose and Petr Kmoch however. Combining their solution makes for a 'cleaner' project. To be honest, I am halfway of migrating my project to a superbuild as well. Take a look at the openchemistry project if you would like to see an example of that: https://github.com/OpenChemistry/openchemistry > > Regards, > Micha Hergarden > > > On 09/16/2014 11:04 AM, Marcel Loose wrote: >> Hi Yu, >> >> I think you need to add an explicit dependency of main.cc on the "generated" (well, not really generated, but installed) header file crfpp.h. CMake has no clue as to what files are being compiled/installed by your external project, so you have to make this explicit. >> >> HTH, >> Marcel Loose. >> >> >> On 16/09/14 10:41, Yu Jing wrote: >>> Hello Micha , >>> >>> It seems doesn?t work. >>> I updated code , and move the external project to src , and it still not work. >>> >>> what should be noticed is : >>> 1. If I just use >>> $ make >>> as make command ,all styles are work >>> 2. If I use in multi jobs >>> $ make -j8 >>> It will run abnormal (not desired sequence) . >>> >>> >>> On Sep 16, 2014, at 15:27, Micha Hergarden wrote: >>> >>>> It may be that you have line 63 and 64 the wrong way around: >>>> ADD_SUBDIRECTORY(src) >>>> ADD_SUBDIRECTORY(lib) >>>> >>>> The externalproject is added in lib, but you add a dependency on it in src. CMake will descend in the subdirectories in the order you supply them. >>>> Does reversing the directories help? >>>> >>>> Regards, >>>> Micha >>>> >>>> On 09/16/2014 09:17 AM, Yu Jing wrote: >>>>> I am in OSX 10.9.4 , a sample in github is : https://github.com/yujing5b5d/cmake_sample >>>>> after git clone this project , a operation like this : >>>>> ------------------------------------------------------------------------------------------------------------ >>>>> >>>>> yu:cmake_sample yu$ mkdir build >>>>> yu:cmake_sample yu$ cd build/ >>>>> yu:build yu$ cmake .. >>>>> ?. # skip some useless output >>>>> -- Configuring done >>>>> -- Generating done >>>>> -- Build files have been written to: /Users/yu/Workspace/res/cmake_sample/build >>>>> yu:build yu$ make -j8 ### <<<<<<<<<<<<<<< >>>>> Scanning dependencies of target LEVELDB_EX_PROJ >>>>> Scanning dependencies of target iniparser >>>>> Scanning dependencies of target relfiles >>>>> Scanning dependencies of target CRFPP_EX_PROJ >>>>> Scanning dependencies of target iniparser_static >>>>> [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o >>>>> Creating directories for 'CRFPP_EX_PROJ' >>>>> Creating directories for 'LEVELDB_EX_PROJ' >>>>> Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o >>>>> Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o >>>>> [ 30%] [ 35%] Performing download step (git clone) for 'LEVELDB_EX_PROJ' >>>>> Performing download step (git clone) for 'CRFPP_EX_PROJ' >>>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>>>> #include "crfpp.h" // crfpp >>>>> ^ >>>>> Cloning into 'CRFPP_EX_PROJ'... >>>>> Cloning into 'LEVELDB_EX_PROJ'... >>>>> Linking C static library ../libiniparser.a >>>>> Linking C shared library ../libiniparser.dylib >>>>> [ 35%] [ 35%] Built target iniparser_static >>>>> Built target iniparser >>>>> Scanning dependencies of target cmake_sample >>>>> [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o >>>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>>>> #include "crfpp.h" // crfpp >>>>> ^ >>>>> 1 error generated. >>>>> 1 error generated. >>>>> make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1 >>>>> make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1 >>>>> make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2 >>>>> make[1]: *** Waiting for unfinished jobs.... >>>>> make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2 >>>>> ?. >>>>> ------------------------------------------------------------------------------------------------------------ >>>>> >>>>> BE CAREFUL OF THIS LINE : >>>>> >> yu:build yu$ make -j8 >>>>> >>>>> the ExternalProject CRFPP_EX_PROJ?s result contains copy a crfpp.h header to a special path, after this process , we can use #include ?crfpp.h" ,and If I use >>>>> make -j8 >>>>> this means 8 jobs can be running at the same time, I can not constraints and let my compiler compile my main.cc after CRFPP_EX_PROJ finished. >>>>> >>>>> Of course , I?m not sure is this my misuse this project . >>>>> >>>>> >>>>> >>>>> On Sep 16, 2014, at 14:55, Micha Hergarden wrote: >>>>> >>>>>> Hello all, >>>>>> >>>>>> I do use the ExternalProject to prebuild some binaries, without the 'superproject' setup, and it does seem to work. Using the add_dependencies, I can make sure some third party libs are prebuild before I start to build my project. I have seen some issues with ExternalProject (failing to extract, or build), but they are too rare to pinpoint and create a bugreport. >>>>>> >>>>>> What exactly does not work? Is the external project not build at all, or just not in time? >>>>>> >>>>>> Regards, >>>>>> Micha >>>>>> >>>>>> On 09/16/2014 08:30 AM, Petr Kmoch wrote: >>>>>>> Hi. >>>>>>> >>>>>>> I've never worked with ExternalProject myself, so I can't comment with certainty, but from what I understand, the correct way of using ExternalProject is to add your own project as an ExternalProject as well. Basically, the toplevel CMakeList becomes a superbuild which *only* does ExternalProject_Add() calls and does not add any libraries/executables directly. After you build the superbuild once to get all the dependencies correct, you switch to the "external" project of your own code and work with that normally. >>>>>>> >>>>>>> Petr >>>>>>> >>>>>>> On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing wrote: >>>>>>> I had asked in http://stackoverflow.com/questions/25841602 , someone told me maybe here is a better place to ask. >>>>>>> >>>>>>> I am writing a project base on crfpp , a external project. I use cmake to integerate this project as follow . >>>>>>> >>>>>>> firstly , I add a extenal project like this: >>>>>>> >>>>>>> EXTERNALPROJECT_ADD( >>>>>>> CRFPP_EX_PROJ >>>>>>> GIT_REPOSITORY git at github.com:yujing5b5d/crfpp.git >>>>>>> PREFIX ${CMAKE_CURRENT_BINARY_DIR} >>>>>>> CONFIGURE_COMMAND ./configure >>>>>>> BUILD_COMMAND make -j8 >>>>>>> BUILD_IN_SOURCE 1 >>>>>>> INSTALL_COMMAND cp .libs/libcrfpp.a ${PROJECT_BINARY_DIR}/lib && cp crfpp.h ${PROJECT_BINARY_DIR}/include >>>>>>> ) >>>>>>> this will generate some .a file and copy a header file crfpp.h to folder ${PROJECT_BINARY_DIR}/include , which is included in my project. >>>>>>> >>>>>>> and then , use the ${PROJECT_BINARY_DIR}/include as include path as follow . >>>>>>> >>>>>>> INCLUDE_DIRECTORIES( >>>>>>> ${PROJECT_SOURCE_DIR}/include >>>>>>> ${PROJECT_BINARY_DIR}/include >>>>>>> ) >>>>>>> finally , when I compile the main project , code like this : >>>>>>> >>>>>>> ADD_EXECUTABLE(cmake_sample main.cc) >>>>>>> ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) >>>>>>> TARGET_LINK_LIBRARIES(cmake_sample crfpp) >>>>>>> In general , if I just build a build folder, compile like this : >>>>>>> >>>>>>> cmake . >>>>>>> . >>>>>>> < >>>>>>> /span> >>>>>>> make >>>>>>> It may works fine, compile the external project first , and copy the header file to desired place , and then continue compile main.cc in my project . But if I use compile command as multi-thread like this : >>>>>>> >>>>>>> cmake >>>>>>> . >>>>>>> . >>>>>>> make -j8 >>>>>>> It will not works because my main.cc and the external project are processed at same time, so it report a error like this : >>>>>>> >>>>>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>>>>>> #include "crfpp.h" // crfpp >>>>>>> ^ >>>>>>> 1 error generated. >>>>>>> This crfpp.h will generated after CRFPP_EX_PROJ , but in multi-thread environment , the sequence is quite different . >>>>>>> >>>>>>> My Question is : Is it possible that force let my project compile after these external projects all finished . BE CAREFUL , I'm not sure is this the problem of my use of ADD_DEPENDENCIES , I also wrote >>>>>>> >>>>>>> ADD_DEPENDENCIES( >>>>>>> < >>>>>>> span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">cmake_sample CRFPP_EX_PROJ) >>>>>>> but it seems not works ? >>>>>>> >>>>>>> Thanks for any help. >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> >>>>>>> Powered by www.kitware.com >>>>>>> >>>>>>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ >>>>>>> >>>>>>> Kitware offers various services to support the CMake community. For more information on each offering, please visit: >>>>>>> >>>>>>> CMake Support: http://cmake.org/cmake/help/support.html >>>>>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html >>>>>>> CMake Training Courses: http://cmake.org/cmake/help/training.html >>>>>>> >>>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>>>>>> >>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>> http://public.kitware.com/mailman/listinfo/cmake >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >>> >>> >> >> >> > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake -------------- next part -------------- An HTML attachment was scrubbed... URL: From micha.hergarden at gmail.com Tue Sep 16 07:57:54 2014 From: micha.hergarden at gmail.com (Micha Hergarden) Date: Tue, 16 Sep 2014 13:57:54 +0200 Subject: [CMake] how to force assign sequence in multi-thread in cmake In-Reply-To: References: <05FE4097-4F5A-4A7B-B302-98C62F75E6F4@gmail.com> <5417DEDC.1070205@gmail.com> <5417E645.2000603@gmail.com> <8B05041E-6ABA-411B-9854-9AA53BD51C07@gmail.com> <5417FD0E.4030106@astron.nl> <5418049A.8070403@gmail.com> Message-ID: <541825C2.6010809@gmail.com> Hello Yu, That is because of the following lines: AUX_SOURCE_DIRECTORY(. DIR_TARGET) ADD_LIBRARY (relfiles ${DIR_TARGET}) I think you may be misusing the aux_source_directory command. I have tested your setup on a linux machine with -j8 and it still builds. Did you take a look at the openchemistry setup? Regards, Micha On 09/16/2014 01:42 PM, Yu Jing wrote: > Hello Micha, > It seems still not work?. > > On Sep 16, 2014, at 17:36, Micha Hergarden > wrote: > >> Hello Yu, >> >> It seems I too needed another trick to make it work: >> set_property(TARGET CRFPP_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE) >> set_property(TARGET LEVELDB_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE) >> >> ADD_DEPENDENCIES(cmake_sample iniparser_static CRFPP_EX_PROJ >> LEVELDB_EX_PROJ) >> >> By default the ExternalProject_Add will add that target to the ALL >> target, and that confuses the Make dependency checker. I have removed >> those dependencies in my project. On the whole I agree with Marcel >> Loose and Petr Kmoch however. Combining their solution makes for a >> 'cleaner' project. To be honest, I am halfway of migrating my project >> to a superbuild as well. Take a look at the openchemistry project if >> you would like to see an example of that: >> https://github.com/OpenChemistry/openchemistry >> >> Regards, >> Micha Hergarden >> >> >> On 09/16/2014 11:04 AM, Marcel Loose wrote: >>> Hi Yu, >>> >>> I think you need to add an explicit dependency of main.cc >>> on the "generated" (well, not really generated, but >>> installed) header file crfpp.h. CMake has no clue as to what files >>> are being compiled/installed by your external project, so you have >>> to make this explicit. >>> >>> HTH, >>> Marcel Loose. >>> >>> >>> On 16/09/14 10:41, Yu Jing wrote: >>>> Hello Micha , >>>> >>>> It seems doesn?t work. >>>> I updated code , and move the external project to src , and it >>>> still not work. >>>> >>>> what should be noticed is : >>>> 1. If I just use >>>> $ make >>>> as make command ,all styles are work >>>> 2. If I use in multi jobs >>>> $ make -j8 >>>> It will run abnormal (not desired sequence) . >>>> >>>> >>>> On Sep 16, 2014, at 15:27, Micha Hergarden >>>> > wrote: >>>> >>>>> It may be that you have line 63 and 64 the wrong way around: >>>>> ADD_SUBDIRECTORY(src) >>>>> ADD_SUBDIRECTORY(lib) >>>>> >>>>> The externalproject is added in lib, but you add a dependency on >>>>> it in src. CMake will descend in the subdirectories in the order >>>>> you supply them. >>>>> Does reversing the directories help? >>>>> >>>>> Regards, >>>>> Micha >>>>> >>>>> On 09/16/2014 09:17 AM, Yu Jing wrote: >>>>>> I am in OSX 10.9.4 , a sample in github is >>>>>> : https://github.com/yujing5b5d/cmake_sample >>>>>> after git clone this project , a operation like this : >>>>>> ------------------------------------------------------------------------------------------------------------ >>>>>> >>>>>> *yu:cmake_sample yu$ mkdir build* >>>>>> *yu:cmake_sample yu$ cd build/* >>>>>> *yu:build yu$ cmake ..* >>>>>> ?. # skip some useless output >>>>>> -- Configuring done >>>>>> -- Generating done >>>>>> -- Build files have been written to: >>>>>> /Users/yu/Workspace/res/cmake_sample/build >>>>>> *yu:build yu$ make -j8 ### <<<<<<<<<<<<<<<* >>>>>> Scanning dependencies of target LEVELDB_EX_PROJ >>>>>> Scanning dependencies of target iniparser >>>>>> Scanning dependencies of target relfiles >>>>>> Scanning dependencies of target CRFPP_EX_PROJ >>>>>> Scanning dependencies of target iniparser_static >>>>>> [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object >>>>>> lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o >>>>>> Creating directories for 'CRFPP_EX_PROJ' >>>>>> Creating directories for 'LEVELDB_EX_PROJ' >>>>>> Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o >>>>>> Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o >>>>>> [ 30%] [ 35%] Performing download step (git clone) for >>>>>> 'LEVELDB_EX_PROJ' >>>>>> Performing download step (git clone) for 'CRFPP_EX_PROJ' >>>>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc >>>>>> :3:10: fatal error: 'crfpp.h' file not found >>>>>> #include "crfpp.h" // crfpp >>>>>> ^ >>>>>> Cloning into 'CRFPP_EX_PROJ'... >>>>>> Cloning into 'LEVELDB_EX_PROJ'... >>>>>> Linking C static library ../libiniparser.a >>>>>> Linking C shared library ../libiniparser.dylib >>>>>> [ 35%] [ 35%] Built target iniparser_static >>>>>> Built target iniparser >>>>>> Scanning dependencies of target cmake_sample >>>>>> [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o >>>>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc >>>>>> :3:10: fatal error: 'crfpp.h' file not found >>>>>> #include "crfpp.h" // crfpp >>>>>> ^ >>>>>> 1 error generated. >>>>>> 1 error generated. >>>>>> make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1 >>>>>> make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1 >>>>>> make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2 >>>>>> make[1]: *** Waiting for unfinished jobs.... >>>>>> make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2 >>>>>> ?. >>>>>> ------------------------------------------------------------------------------------------------------------ >>>>>> >>>>>> BE CAREFUL OF THIS LINE : >>>>>> *>> yu:build yu$ make -j8* >>>>>> * >>>>>> * >>>>>> the ExternalProject CRFPP_EX_PROJ?s result contains copy a >>>>>> crfpp.h header to a special path, after this process , we can >>>>>> use #include ?crfpp.h" ,and If I use >>>>>> make -j8 >>>>>> this means 8 jobs can be running at the same time, I can not >>>>>> constraints and let my compiler compile my main.cc >>>>>> after CRFPP_EX_PROJ finished. >>>>>> >>>>>> Of course , I?m not sure is this my misuse this project . >>>>>> >>>>>> >>>>>> >>>>>> On Sep 16, 2014, at 14:55, Micha Hergarden >>>>>> > wrote: >>>>>> >>>>>>> Hello all, >>>>>>> >>>>>>> I do use the ExternalProject to prebuild some binaries, without >>>>>>> the 'superproject' setup, and it does seem to work. Using the >>>>>>> add_dependencies, I can make sure some third party libs are >>>>>>> prebuild before I start to build my project. I have seen some >>>>>>> issues with ExternalProject (failing to extract, or build), but >>>>>>> they are too rare to pinpoint and create a bugreport. >>>>>>> >>>>>>> What exactly does not work? Is the external project not build at >>>>>>> all, or just not in time? >>>>>>> >>>>>>> Regards, >>>>>>> Micha >>>>>>> >>>>>>> On 09/16/2014 08:30 AM, Petr Kmoch wrote: >>>>>>>> Hi. >>>>>>>> >>>>>>>> I've never worked with ExternalProject myself, so I can't >>>>>>>> comment with certainty, but from what I understand, the correct >>>>>>>> way of using ExternalProject is to add your own project as an >>>>>>>> ExternalProject as well. Basically, the toplevel CMakeList >>>>>>>> becomes a superbuild which *only* does ExternalProject_Add() >>>>>>>> calls and does not add any libraries/executables directly. >>>>>>>> After you build the superbuild once to get all the dependencies >>>>>>>> correct, you switch to the "external" project of your own code >>>>>>>> and work with that normally. >>>>>>>> >>>>>>>> Petr >>>>>>>> >>>>>>>> On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing >>>>>>> > wrote: >>>>>>>> >>>>>>>> I had asked in http://stackoverflow.com/questions/25841602 >>>>>>>> , someone told me maybe here is a better place to ask. >>>>>>>> >>>>>>>> I am writing a project base on crfpp , a external project. >>>>>>>> I use cmake to integerate this project as follow . >>>>>>>> >>>>>>>> firstly , I add a extenal project like this: >>>>>>>> >>>>>>>> |EXTERNALPROJECT_ADD( >>>>>>>> CRFPP_EX_PROJ >>>>>>>> GIT_REPOSITORY git at github.com:yujing5b5d/crfpp.git >>>>>>>> PREFIX ${CMAKE_CURRENT_BINARY_DIR} >>>>>>>> CONFIGURE_COMMAND ./configure >>>>>>>> BUILD_COMMAND make -j8 >>>>>>>> BUILD_IN_SOURCE 1 >>>>>>>> INSTALL_COMMAND cp .libs/libcrfpp.a ${PROJECT_BINARY_DIR}/lib && cp crfpp.h ${PROJECT_BINARY_DIR}/include >>>>>>>> )| >>>>>>>> >>>>>>>> this will generate some .a file and copy a header >>>>>>>> file |crfpp.h| to folder |${PROJECT_BINARY_DIR}/include| , >>>>>>>> which is included in my project. >>>>>>>> >>>>>>>> and then , use the |${PROJECT_BINARY_DIR}/include| as >>>>>>>> include path as follow . >>>>>>>> >>>>>>>> |INCLUDE_DIRECTORIES( >>>>>>>> ${PROJECT_SOURCE_DIR}/include >>>>>>>> ${PROJECT_BINARY_DIR}/include >>>>>>>> )| >>>>>>>> >>>>>>>> finally , when I compile the main project , code like this : >>>>>>>> >>>>>>>> |ADD_EXECUTABLE(cmake_sample main.cc) >>>>>>>> ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) >>>>>>>> TARGET_LINK_LIBRARIES(cmake_sample crfpp)| >>>>>>>> >>>>>>>> In general , if I just build a build folder, compile like >>>>>>>> this : >>>>>>>> >>>>>>>> |cmake . >>>>>>>> . >>>>>>>> < >>>>>>>> /span> >>>>>>>> make| >>>>>>>> >>>>>>>> It may works fine, compile the external project first , and >>>>>>>> copy the header file to desired place , and then continue >>>>>>>> compile main.cc in my project . But if I >>>>>>>> use compile command as multi-thread like this : >>>>>>>> >>>>>>>> |cmake >>>>>>>> . >>>>>>>> . >>>>>>>> make -j8| >>>>>>>> >>>>>>>> It will not works because my main.cc and >>>>>>>> the external project are processed at same time, so it >>>>>>>> report a error like this : >>>>>>>> >>>>>>>> |/Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>>>>>>> #include "crfpp.h" // crfpp >>>>>>>> ^ >>>>>>>> 1 error generated.| >>>>>>>> >>>>>>>> This |crfpp.h| will generated after |CRFPP_EX_PROJ| , but >>>>>>>> in multi-thread environment , the sequence is quite different . >>>>>>>> >>>>>>>> My Question is : Is it possible that force let my project >>>>>>>> compile after these external projects all finished . BE >>>>>>>> CAREFUL , I'm not sure is this the problem of my use >>>>>>>> of |ADD_DEPENDENCIES| , I also wrote >>>>>>>> >>>>>>>> |ADD_DEPENDENCIES( >>>>>>>> < >>>>>>>> span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">cmake_sample CRFPP_EX_PROJ)| >>>>>>>> >>>>>>>> but it seems not works ? >>>>>>>> >>>>>>>> Thanks for any help. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> >>>>>>>> Powered by www.kitware.com >>>>>>>> >>>>>>>> Please keep messages on-topic and check the CMake FAQ at: >>>>>>>> http://www.cmake.org/Wiki/CMake_FAQ >>>>>>>> >>>>>>>> Kitware offers various services to support the CMake >>>>>>>> community. For more information on each offering, please visit: >>>>>>>> >>>>>>>> CMake Support: http://cmake.org/cmake/help/support.html >>>>>>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html >>>>>>>> CMake Training Courses: >>>>>>>> http://cmake.org/cmake/help/training.html >>>>>>>> >>>>>>>> Visit other Kitware open-source projects at >>>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>>> >>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>> http://public.kitware.com/mailman/listinfo/cmake >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>>> >>>> >>> >>> >>> >> >> -- >> >> Powered by www.kitware.com >> >> Please keep messages on-topic and check the CMake FAQ at: >> http://www.cmake.org/Wiki/CMake_FAQ >> >> Kitware offers various services to support the CMake community. For >> more information on each offering, please visit: >> >> CMake Support: http://cmake.org/cmake/help/support.html >> CMake Consulting: http://cmake.org/cmake/help/consulting.html >> CMake Training Courses: http://cmake.org/cmake/help/training.html >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From yujing5b5d at gmail.com Tue Sep 16 07:58:44 2014 From: yujing5b5d at gmail.com (Yu Jing) Date: Tue, 16 Sep 2014 19:58:44 +0800 Subject: [CMake] how to force assign sequence in multi-thread in cmake In-Reply-To: <541825C2.6010809@gmail.com> References: <05FE4097-4F5A-4A7B-B302-98C62F75E6F4@gmail.com> <5417DEDC.1070205@gmail.com> <5417E645.2000603@gmail.com> <8B05041E-6ABA-411B-9854-9AA53BD51C07@gmail.com> <5417FD0E.4030106@astron.nl> <5418049A.8070403@gmail.com> <541825C2.6010809@gmail.com> Message-ID: <64435DA1-EDA6-441C-AF4A-28604F00AEB8@gmail.com> I am trying ? That?s a very clear organization On Sep 16, 2014, at 19:57, Micha Hergarden wrote: > Hello Yu, > > That is because of the following lines: > > AUX_SOURCE_DIRECTORY(. DIR_TARGET) > ADD_LIBRARY (relfiles ${DIR_TARGET}) > > I think you may be misusing the aux_source_directory command. I have tested your setup on a linux machine with -j8 and it still builds. Did you take a look at the openchemistry setup? > > Regards, > Micha > > On 09/16/2014 01:42 PM, Yu Jing wrote: >> Hello Micha, >> It seems still not work?. >> >> On Sep 16, 2014, at 17:36, Micha Hergarden wrote: >> >>> Hello Yu, >>> >>> It seems I too needed another trick to make it work: >>> set_property(TARGET CRFPP_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE) >>> set_property(TARGET LEVELDB_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE) >>> >>> ADD_DEPENDENCIES(cmake_sample iniparser_static CRFPP_EX_PROJ LEVELDB_EX_PROJ) >>> >>> By default the ExternalProject_Add will add that target to the ALL target, and that confuses the Make dependency checker. I have removed those dependencies in my project. On the whole I agree with Marcel Loose and Petr Kmoch however. Combining their solution makes for a 'cleaner' project. To be honest, I am halfway of migrating my project to a superbuild as well. Take a look at the openchemistry project if you would like to see an example of that: https://github.com/OpenChemistry/openchemistry >>> >>> Regards, >>> Micha Hergarden >>> >>> >>> On 09/16/2014 11:04 AM, Marcel Loose wrote: >>>> Hi Yu, >>>> >>>> I think you need to add an explicit dependency of main.cc on the "generated" (well, not really generated, but installed) header file crfpp.h. CMake has no clue as to what files are being compiled/installed by your external project, so you have to make this explicit. >>>> >>>> HTH, >>>> Marcel Loose. >>>> >>>> >>>> On 16/09/14 10:41, Yu Jing wrote: >>>>> Hello Micha , >>>>> >>>>> It seems doesn?t work. >>>>> I updated code , and move the external project to src , and it still not work. >>>>> >>>>> what should be noticed is : >>>>> 1. If I just use >>>>> $ make >>>>> as make command ,all styles are work >>>>> 2. If I use in multi jobs >>>>> $ make -j8 >>>>> It will run abnormal (not desired sequence) . >>>>> >>>>> >>>>> On Sep 16, 2014, at 15:27, Micha Hergarden wrote: >>>>> >>>>>> It may be that you have line 63 and 64 the wrong way around: >>>>>> ADD_SUBDIRECTORY(src) >>>>>> ADD_SUBDIRECTORY(lib) >>>>>> >>>>>> The externalproject is added in lib, but you add a dependency on it in src. CMake will descend in the subdirectories in the order you supply them. >>>>>> Does reversing the directories help? >>>>>> >>>>>> Regards, >>>>>> Micha >>>>>> >>>>>> On 09/16/2014 09:17 AM, Yu Jing wrote: >>>>>>> I am in OSX 10.9.4 , a sample in github is : https://github.com/yujing5b5d/cmake_sample >>>>>>> after git clone this project , a operation like this : >>>>>>> ------------------------------------------------------------------------------------------------------------ >>>>>>> >>>>>>> yu:cmake_sample yu$ mkdir build >>>>>>> yu:cmake_sample yu$ cd build/ >>>>>>> yu:build yu$ cmake .. >>>>>>> ?. # skip some useless output >>>>>>> -- Configuring done >>>>>>> -- Generating done >>>>>>> -- Build files have been written to: /Users/yu/Workspace/res/cmake_sample/build >>>>>>> yu:build yu$ make -j8 ### <<<<<<<<<<<<<<< >>>>>>> Scanning dependencies of target LEVELDB_EX_PROJ >>>>>>> Scanning dependencies of target iniparser >>>>>>> Scanning dependencies of target relfiles >>>>>>> Scanning dependencies of target CRFPP_EX_PROJ >>>>>>> Scanning dependencies of target iniparser_static >>>>>>> [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o >>>>>>> Creating directories for 'CRFPP_EX_PROJ' >>>>>>> Creating directories for 'LEVELDB_EX_PROJ' >>>>>>> Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o >>>>>>> Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o >>>>>>> [ 30%] [ 35%] Performing download step (git clone) for 'LEVELDB_EX_PROJ' >>>>>>> Performing download step (git clone) for 'CRFPP_EX_PROJ' >>>>>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>>>>>> #include "crfpp.h" // crfpp >>>>>>> ^ >>>>>>> Cloning into 'CRFPP_EX_PROJ'... >>>>>>> Cloning into 'LEVELDB_EX_PROJ'... >>>>>>> Linking C static library ../libiniparser.a >>>>>>> Linking C shared library ../libiniparser.dylib >>>>>>> [ 35%] [ 35%] Built target iniparser_static >>>>>>> Built target iniparser >>>>>>> Scanning dependencies of target cmake_sample >>>>>>> [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o >>>>>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>>>>>> #include "crfpp.h" // crfpp >>>>>>> ^ >>>>>>> 1 error generated. >>>>>>> 1 error generated. >>>>>>> make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1 >>>>>>> make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1 >>>>>>> make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2 >>>>>>> make[1]: *** Waiting for unfinished jobs.... >>>>>>> make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2 >>>>>>> ?. >>>>>>> ------------------------------------------------------------------------------------------------------------ >>>>>>> >>>>>>> BE CAREFUL OF THIS LINE : >>>>>>> >> yu:build yu$ make -j8 >>>>>>> >>>>>>> the ExternalProject CRFPP_EX_PROJ?s result contains copy a crfpp.h header to a special path, after this process , we can use #include ?crfpp.h" ,and If I use >>>>>>> make -j8 >>>>>>> this means 8 jobs can be running at the same time, I can not constraints and let my compiler compile my main.cc after CRFPP_EX_PROJ finished. >>>>>>> >>>>>>> Of course , I?m not sure is this my misuse this project . >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Sep 16, 2014, at 14:55, Micha Hergarden wrote: >>>>>>> >>>>>>>> Hello all, >>>>>>>> >>>>>>>> I do use the ExternalProject to prebuild some binaries, without the 'superproject' setup, and it does seem to work. Using the add_dependencies, I can make sure some third party libs are prebuild before I start to build my project. I have seen some issues with ExternalProject (failing to extract, or build), but they are too rare to pinpoint and create a bugreport. >>>>>>>> >>>>>>>> What exactly does not work? Is the external project not build at all, or just not in time? >>>>>>>> >>>>>>>> Regards, >>>>>>>> Micha >>>>>>>> >>>>>>>> On 09/16/2014 08:30 AM, Petr Kmoch wrote: >>>>>>>>> Hi. >>>>>>>>> >>>>>>>>> I've never worked with ExternalProject myself, so I can't comment with certainty, but from what I understand, the correct way of using ExternalProject is to add your own project as an ExternalProject as well. Basically, the toplevel CMakeList becomes a superbuild which *only* does ExternalProject_Add() calls and does not add any libraries/executables directly. After you build the superbuild once to get all the dependencies correct, you switch to the "external" project of your own code and work with that normally. >>>>>>>>> >>>>>>>>> Petr >>>>>>>>> >>>>>>>>> On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing wrote: >>>>>>>>> I had asked in http://stackoverflow.com/questions/25841602 , someone told me maybe here is a better place to ask. >>>>>>>>> >>>>>>>>> I am writing a project base on crfpp , a external project. I use cmake to integerate this project as follow . >>>>>>>>> >>>>>>>>> firstly , I add a extenal project like this: >>>>>>>>> >>>>>>>>> EXTERNALPROJECT_ADD( >>>>>>>>> CRFPP_EX_PROJ >>>>>>>>> GIT_REPOSITORY git at github.com:yujing5b5d/crfpp.git >>>>>>>>> PREFIX ${CMAKE_CURRENT_BINARY_DIR} >>>>>>>>> CONFIGURE_COMMAND ./configure >>>>>>>>> BUILD_COMMAND make -j8 >>>>>>>>> BUILD_IN_SOURCE 1 >>>>>>>>> INSTALL_COMMAND cp .libs/libcrfpp.a ${PROJECT_BINARY_DIR}/lib && cp crfpp.h ${PROJECT_BINARY_DIR}/include >>>>>>>>> ) >>>>>>>>> this will generate some .a file and copy a header file crfpp.h to folder ${PROJECT_BINARY_DIR}/include , which is included in my project. >>>>>>>>> >>>>>>>>> and then , use the ${PROJECT_BINARY_DIR}/include as include path as follow . >>>>>>>>> >>>>>>>>> INCLUDE_DIRECTORIES( >>>>>>>>> ${PROJECT_SOURCE_DIR}/include >>>>>>>>> ${PROJECT_BINARY_DIR}/include >>>>>>>>> ) >>>>>>>>> finally , when I compile the main project , code like this : >>>>>>>>> >>>>>>>>> ADD_EXECUTABLE(cmake_sample main.cc) >>>>>>>>> ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) >>>>>>>>> TARGET_LINK_LIBRARIES(cmake_sample crfpp) >>>>>>>>> In general , if I just build a build folder, compile like this : >>>>>>>>> >>>>>>>>> cmake . >>>>>>>>> . >>>>>>>>> < >>>>>>>>> /span> >>>>>>>>> make >>>>>>>>> It may works fine, compile the external project first , and copy the header file to desired place , and then continue compile main.cc in my project . But if I use compile command as multi-thread like this : >>>>>>>>> >>>>>>>>> cmake >>>>>>>>> . >>>>>>>>> . >>>>>>>>> make -j8 >>>>>>>>> It will not works because my main.cc and the external project are processed at same time, so it report a error like this : >>>>>>>>> >>>>>>>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>>>>>>>> #include "crfpp.h" // crfpp >>>>>>>>> ^ >>>>>>>>> 1 error generated. >>>>>>>>> This crfpp.h will generated after CRFPP_EX_PROJ , but in multi-thread environment , the sequence is quite different . >>>>>>>>> >>>>>>>>> My Question is : Is it possible that force let my project compile after these external projects all finished . BE CAREFUL , I'm not sure is this the problem of my use of ADD_DEPENDENCIES , I also wrote >>>>>>>>> >>>>>>>>> ADD_DEPENDENCIES( >>>>>>>>> < >>>>>>>>> span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">cmake_sample CRFPP_EX_PROJ) >>>>>>>>> but it seems not works ? >>>>>>>>> >>>>>>>>> Thanks for any help. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> >>>>>>>>> Powered by www.kitware.com >>>>>>>>> >>>>>>>>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ >>>>>>>>> >>>>>>>>> Kitware offers various services to support the CMake community. For more information on each offering, please visit: >>>>>>>>> >>>>>>>>> CMake Support: http://cmake.org/cmake/help/support.html >>>>>>>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html >>>>>>>>> CMake Training Courses: http://cmake.org/cmake/help/training.html >>>>>>>>> >>>>>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>>>>>>>> >>>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>>> http://public.kitware.com/mailman/listinfo/cmake >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>> >>> -- >>> >>> Powered by www.kitware.com >>> >>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ >>> >>> Kitware offers various services to support the CMake community. For more information on each offering, please visit: >>> >>> CMake Support: http://cmake.org/cmake/help/support.html >>> CMake Consulting: http://cmake.org/cmake/help/consulting.html >>> CMake Training Courses: http://cmake.org/cmake/help/training.html >>> >>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/cmake >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yujing5b5d at gmail.com Tue Sep 16 08:20:19 2014 From: yujing5b5d at gmail.com (Yu Jing) Date: Tue, 16 Sep 2014 20:20:19 +0800 Subject: [CMake] how to force assign sequence in multi-thread in cmake In-Reply-To: <64435DA1-EDA6-441C-AF4A-28604F00AEB8@gmail.com> References: <05FE4097-4F5A-4A7B-B302-98C62F75E6F4@gmail.com> <5417DEDC.1070205@gmail.com> <5417E645.2000603@gmail.com> <8B05041E-6ABA-411B-9854-9AA53BD51C07@gmail.com> <5417FD0E.4030106@astron.nl> <5418049A.8070403@gmail.com> <541825C2.6010809@gmail.com> <64435DA1-EDA6-441C-AF4A-28604F00AEB8@gmail.com> Message-ID: <086FAE5A-B131-4C17-AC85-A3990CA6D514@gmail.com> Hello All, It is is because of # AUX_SOURCE_DIRECTORY(. DIR_TARGET) # ADD_LIBRARY (relfiles ${DIR_TARGET}) That?s really a stupid fault ,and thanks for your debug ?TAT I adjust the usage of External project , and it seems much better . Thanks for your help . Thanks for Micha Hergarden?s patience ? By the way , set_property(TARGET leveldb_proj PROPERTY EXCLUDE_FROM_ALL TRUE) I removed this property and it seems still works. On Sep 16, 2014, at 19:58, Yu Jing wrote: > I am trying ? That?s a very clear organization > > > On Sep 16, 2014, at 19:57, Micha Hergarden wrote: > >> Hello Yu, >> >> That is because of the following lines: >> >> AUX_SOURCE_DIRECTORY(. DIR_TARGET) >> ADD_LIBRARY (relfiles ${DIR_TARGET}) >> >> I think you may be misusing the aux_source_directory command. I have tested your setup on a linux machine with -j8 and it still builds. Did you take a look at the openchemistry setup? >> >> Regards, >> Micha >> >> On 09/16/2014 01:42 PM, Yu Jing wrote: >>> Hello Micha, >>> It seems still not work?. >>> >>> On Sep 16, 2014, at 17:36, Micha Hergarden wrote: >>> >>>> Hello Yu, >>>> >>>> It seems I too needed another trick to make it work: >>>> set_property(TARGET CRFPP_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE) >>>> set_property(TARGET LEVELDB_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE) >>>> >>>> ADD_DEPENDENCIES(cmake_sample iniparser_static CRFPP_EX_PROJ LEVELDB_EX_PROJ) >>>> >>>> By default the ExternalProject_Add will add that target to the ALL target, and that confuses the Make dependency checker. I have removed those dependencies in my project. On the whole I agree with Marcel Loose and Petr Kmoch however. Combining their solution makes for a 'cleaner' project. To be honest, I am halfway of migrating my project to a superbuild as well. Take a look at the openchemistry project if you would like to see an example of that: https://github.com/OpenChemistry/openchemistry >>>> >>>> Regards, >>>> Micha Hergarden >>>> >>>> >>>> On 09/16/2014 11:04 AM, Marcel Loose wrote: >>>>> Hi Yu, >>>>> >>>>> I think you need to add an explicit dependency of main.cc on the "generated" (well, not really generated, but installed) header file crfpp.h. CMake has no clue as to what files are being compiled/installed by your external project, so you have to make this explicit. >>>>> >>>>> HTH, >>>>> Marcel Loose. >>>>> >>>>> >>>>> On 16/09/14 10:41, Yu Jing wrote: >>>>>> Hello Micha , >>>>>> >>>>>> It seems doesn?t work. >>>>>> I updated code , and move the external project to src , and it still not work. >>>>>> >>>>>> what should be noticed is : >>>>>> 1. If I just use >>>>>> $ make >>>>>> as make command ,all styles are work >>>>>> 2. If I use in multi jobs >>>>>> $ make -j8 >>>>>> It will run abnormal (not desired sequence) . >>>>>> >>>>>> >>>>>> On Sep 16, 2014, at 15:27, Micha Hergarden wrote: >>>>>> >>>>>>> It may be that you have line 63 and 64 the wrong way around: >>>>>>> ADD_SUBDIRECTORY(src) >>>>>>> ADD_SUBDIRECTORY(lib) >>>>>>> >>>>>>> The externalproject is added in lib, but you add a dependency on it in src. CMake will descend in the subdirectories in the order you supply them. >>>>>>> Does reversing the directories help? >>>>>>> >>>>>>> Regards, >>>>>>> Micha >>>>>>> >>>>>>> On 09/16/2014 09:17 AM, Yu Jing wrote: >>>>>>>> I am in OSX 10.9.4 , a sample in github is : https://github.com/yujing5b5d/cmake_sample >>>>>>>> after git clone this project , a operation like this : >>>>>>>> ------------------------------------------------------------------------------------------------------------ >>>>>>>> >>>>>>>> yu:cmake_sample yu$ mkdir build >>>>>>>> yu:cmake_sample yu$ cd build/ >>>>>>>> yu:build yu$ cmake .. >>>>>>>> ?. # skip some useless output >>>>>>>> -- Configuring done >>>>>>>> -- Generating done >>>>>>>> -- Build files have been written to: /Users/yu/Workspace/res/cmake_sample/build >>>>>>>> yu:build yu$ make -j8 ### <<<<<<<<<<<<<<< >>>>>>>> Scanning dependencies of target LEVELDB_EX_PROJ >>>>>>>> Scanning dependencies of target iniparser >>>>>>>> Scanning dependencies of target relfiles >>>>>>>> Scanning dependencies of target CRFPP_EX_PROJ >>>>>>>> Scanning dependencies of target iniparser_static >>>>>>>> [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o >>>>>>>> Creating directories for 'CRFPP_EX_PROJ' >>>>>>>> Creating directories for 'LEVELDB_EX_PROJ' >>>>>>>> Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o >>>>>>>> Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o >>>>>>>> [ 30%] [ 35%] Performing download step (git clone) for 'LEVELDB_EX_PROJ' >>>>>>>> Performing download step (git clone) for 'CRFPP_EX_PROJ' >>>>>>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>>>>>>> #include "crfpp.h" // crfpp >>>>>>>> ^ >>>>>>>> Cloning into 'CRFPP_EX_PROJ'... >>>>>>>> Cloning into 'LEVELDB_EX_PROJ'... >>>>>>>> Linking C static library ../libiniparser.a >>>>>>>> Linking C shared library ../libiniparser.dylib >>>>>>>> [ 35%] [ 35%] Built target iniparser_static >>>>>>>> Built target iniparser >>>>>>>> Scanning dependencies of target cmake_sample >>>>>>>> [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o >>>>>>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>>>>>>> #include "crfpp.h" // crfpp >>>>>>>> ^ >>>>>>>> 1 error generated. >>>>>>>> 1 error generated. >>>>>>>> make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1 >>>>>>>> make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1 >>>>>>>> make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2 >>>>>>>> make[1]: *** Waiting for unfinished jobs.... >>>>>>>> make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2 >>>>>>>> ?. >>>>>>>> ------------------------------------------------------------------------------------------------------------ >>>>>>>> >>>>>>>> BE CAREFUL OF THIS LINE : >>>>>>>> >> yu:build yu$ make -j8 >>>>>>>> >>>>>>>> the ExternalProject CRFPP_EX_PROJ?s result contains copy a crfpp.h header to a special path, after this process , we can use #include ?crfpp.h" ,and If I use >>>>>>>> make -j8 >>>>>>>> this means 8 jobs can be running at the same time, I can not constraints and let my compiler compile my main.cc after CRFPP_EX_PROJ finished. >>>>>>>> >>>>>>>> Of course , I?m not sure is this my misuse this project . >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Sep 16, 2014, at 14:55, Micha Hergarden wrote: >>>>>>>> >>>>>>>>> Hello all, >>>>>>>>> >>>>>>>>> I do use the ExternalProject to prebuild some binaries, without the 'superproject' setup, and it does seem to work. Using the add_dependencies, I can make sure some third party libs are prebuild before I start to build my project. I have seen some issues with ExternalProject (failing to extract, or build), but they are too rare to pinpoint and create a bugreport. >>>>>>>>> >>>>>>>>> What exactly does not work? Is the external project not build at all, or just not in time? >>>>>>>>> >>>>>>>>> Regards, >>>>>>>>> Micha >>>>>>>>> >>>>>>>>> On 09/16/2014 08:30 AM, Petr Kmoch wrote: >>>>>>>>>> Hi. >>>>>>>>>> >>>>>>>>>> I've never worked with ExternalProject myself, so I can't comment with certainty, but from what I understand, the correct way of using ExternalProject is to add your own project as an ExternalProject as well. Basically, the toplevel CMakeList becomes a superbuild which *only* does ExternalProject_Add() calls and does not add any libraries/executables directly. After you build the superbuild once to get all the dependencies correct, you switch to the "external" project of your own code and work with that normally. >>>>>>>>>> >>>>>>>>>> Petr >>>>>>>>>> >>>>>>>>>> On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing wrote: >>>>>>>>>> I had asked in http://stackoverflow.com/questions/25841602 , someone told me maybe here is a better place to ask. >>>>>>>>>> >>>>>>>>>> I am writing a project base on crfpp , a external project. I use cmake to integerate this project as follow . >>>>>>>>>> >>>>>>>>>> firstly , I add a extenal project like this: >>>>>>>>>> >>>>>>>>>> EXTERNALPROJECT_ADD( >>>>>>>>>> CRFPP_EX_PROJ >>>>>>>>>> GIT_REPOSITORY git at github.com:yujing5b5d/crfpp.git >>>>>>>>>> PREFIX ${CMAKE_CURRENT_BINARY_DIR} >>>>>>>>>> CONFIGURE_COMMAND ./configure >>>>>>>>>> BUILD_COMMAND make -j8 >>>>>>>>>> BUILD_IN_SOURCE 1 >>>>>>>>>> INSTALL_COMMAND cp .libs/libcrfpp.a ${PROJECT_BINARY_DIR}/lib && cp crfpp.h ${PROJECT_BINARY_DIR}/include >>>>>>>>>> ) >>>>>>>>>> this will generate some .a file and copy a header file crfpp.h to folder ${PROJECT_BINARY_DIR}/include , which is included in my project. >>>>>>>>>> >>>>>>>>>> and then , use the ${PROJECT_BINARY_DIR}/include as include path as follow . >>>>>>>>>> >>>>>>>>>> INCLUDE_DIRECTORIES( >>>>>>>>>> ${PROJECT_SOURCE_DIR}/include >>>>>>>>>> ${PROJECT_BINARY_DIR}/include >>>>>>>>>> ) >>>>>>>>>> finally , when I compile the main project , code like this : >>>>>>>>>> >>>>>>>>>> ADD_EXECUTABLE(cmake_sample main.cc) >>>>>>>>>> ADD_DEPENDENCIES(cmake_sample CRFPP_EX_PROJ) >>>>>>>>>> TARGET_LINK_LIBRARIES(cmake_sample crfpp) >>>>>>>>>> In general , if I just build a build folder, compile like this : >>>>>>>>>> >>>>>>>>>> cmake . >>>>>>>>>> . >>>>>>>>>> < >>>>>>>>>> /span> >>>>>>>>>> make >>>>>>>>>> It may works fine, compile the external project first , and copy the header file to desired place , and then continue compile main.cc in my project . But if I use compile command as multi-thread like this : >>>>>>>>>> >>>>>>>>>> cmake >>>>>>>>>> . >>>>>>>>>> . >>>>>>>>>> make -j8 >>>>>>>>>> It will not works because my main.cc and the external project are processed at same time, so it report a error like this : >>>>>>>>>> >>>>>>>>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' file not found >>>>>>>>>> #include "crfpp.h" // crfpp >>>>>>>>>> ^ >>>>>>>>>> 1 error generated. >>>>>>>>>> This crfpp.h will generated after CRFPP_EX_PROJ , but in multi-thread environment , the sequence is quite different . >>>>>>>>>> >>>>>>>>>> My Question is : Is it possible that force let my project compile after these external projects all finished . BE CAREFUL , I'm not sure is this the problem of my use of ADD_DEPENDENCIES , I also wrote >>>>>>>>>> >>>>>>>>>> ADD_DEPENDENCIES( >>>>>>>>>> < >>>>>>>>>> span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;background-repeat:initial initial">cmake_sample CRFPP_EX_PROJ) >>>>>>>>>> but it seems not works ? >>>>>>>>>> >>>>>>>>>> Thanks for any help. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> >>>>>>>>>> Powered by www.kitware.com >>>>>>>>>> >>>>>>>>>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ >>>>>>>>>> >>>>>>>>>> Kitware offers various services to support the CMake community. For more information on each offering, please visit: >>>>>>>>>> >>>>>>>>>> CMake Support: http://cmake.org/cmake/help/support.html >>>>>>>>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html >>>>>>>>>> CMake Training Courses: http://cmake.org/cmake/help/training.html >>>>>>>>>> >>>>>>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>>>>>>>>> >>>>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>>>> http://public.kitware.com/mailman/listinfo/cmake >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>>> -- >>>> >>>> Powered by www.kitware.com >>>> >>>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ >>>> >>>> Kitware offers various services to support the CMake community. For more information on each offering, please visit: >>>> >>>> CMake Support: http://cmake.org/cmake/help/support.html >>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html >>>> CMake Training Courses: http://cmake.org/cmake/help/training.html >>>> >>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/cmake >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From biddisco at cscs.ch Tue Sep 16 11:38:35 2014 From: biddisco at cscs.ch (Biddiscombe, John A.) Date: Tue, 16 Sep 2014 15:38:35 +0000 Subject: [CMake] project not found despite being found Message-ID: I have a project which generates a project-config.cmake file and a project-config-version.cmake file in the relevant place, When another project tries to find_package it, I receive this message from cmake " Found package configuration file: /Users/biddisco/build/cmakesuper/xxx/xxx-config.cmake but it set xxx_FOUND to FALSE so package ?xxx" is considered to be NOT FOUND. ? Which is not expected. If I set xxx_FOUND in the config, it goes away, but I was under the impression that the cmake find_package command itself should set the xxx_FOUND internally and not be done by the user. Is the find_package command trying to tell me something by showing this message? Thanks JB From nilsgladitz at gmail.com Tue Sep 16 12:08:42 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Tue, 16 Sep 2014 18:08:42 +0200 Subject: [CMake] project not found despite being found In-Reply-To: References: Message-ID: <5418608A.9070506@gmail.com> On 16.09.2014 17:38, Biddiscombe, John A. wrote: > " > Found package configuration file: > > /Users/biddisco/build/cmakesuper/xxx/xxx-config.cmake > > but it set xxx_FOUND to FALSE so package ?xxx" is > considered to be NOT FOUND. > ? > > Which is not expected. If I set xxx_FOUND in the config, it goes away, but I was under the impression that the cmake find_package command itself should set the xxx_FOUND internally and not be done by the user. > > Is the find_package command trying to tell me something by showing this message? It think the message indicates that the config file was setting xxx_FOUND explicitly to FALSE itself. Nils From nicolamori at aol.com Tue Sep 16 13:35:02 2014 From: nicolamori at aol.com (Nicola Mori) Date: Tue, 16 Sep 2014 19:35:02 +0200 Subject: [CMake] QUIET option removes all output of find_package In-Reply-To: <541872B1.8090403@aol.com> References: <541872B1.8090403@aol.com> Message-ID: <541874C6.1070706@aol.com> According to the Cmake documentation for find_package: http://www.cmake.org/cmake/help/v3.0/command/find_package.html the QUIET option should suppress the output only when a package cannot be found: "The QUIET option disables messages if the package cannot be found." From my experience, QUIET removes all the output, even when the package has been found. For example in my custom module I print the result of find using this: include(FindPackageHandleStandardArgs) find_package_handle_standard_args(ROOT FOUND_VAR ROOT_FOUND REQUIRED_VARS ROOT_CONFIG_EXECUTABLE ROOTSYS ROOT_VERSION ROOT_INCLUDE_DIR ROOT_LIBRARIES ROOT_LIBRARY_DIR VERSION_VAR ROOT_VERSION) Without the QUIET option, on a successful search I get: -- Found ROOT: /home/mori/software/install/ROOT_5.34.20/bin/root-config (found version "5.34.20") while with QUIET I don't get any output, even when the package has been found. Is this the intended behaviour? Maybe I misinterpreted the documentation or maybe I'm doping something wrong with find_package_handle_standard_args? Thanks. From glhenni at sandia.gov Tue Sep 16 17:06:50 2014 From: glhenni at sandia.gov (Hennigan, Gary L) Date: Tue, 16 Sep 2014 21:06:50 +0000 Subject: [CMake] FW: Parallel GNU make issue Message-ID: <21f392e33d994c1dab88c3b2b04ce8ab@ES02AMSNLNT.srn.sandia.gov> Bill and David, Thanks for the replies. I had to shift to something else for a bit but I'm back to looking at this... Bill, I'm not sure what you mean by "external projects"? My software is built as part of a large suite of open-source software collectively named Trilinos that is owned, or at least managed, by my company. My own code project isn't directly part of the Trilinos project but they have a mechanism that allows for the build of my code to be incorporated into their build process. All of the software being built is either part of Trilinos or my own code. Nothing from "outside" is included in the build. All of it relies on cmake. David, memory usage was certainly a good thought, but from what I can tell there's no memory issue. While the build is huge it's on a system with 128GB of RAM and while it's a bit tricky getting memory usage of a process on Linux, use of "ps", "free", and "vmstat" didn't seem to indicate that memory usage was an issue. I did notice, by using "ps -ef" during the "ctest" build, there are lots of zombie cmake processes. I suspect these zombies are eating up the GNU-make parallel slots that are available. I have no idea why these are being created and why they're not being killed. Anyway, I believe we have a support contract with Kitware so I'm going to track down the proper local contacts to use that "official" channel. Thanks again, Gary -----Original Message----- Date: Thu, 11 Sep 2014 17:28:31 -0400 From: Bill Hoffman To: cmake at cmake.org Subject: Re: [CMake] FW: Parallel GNU make issue Message-ID: <541213FF.3020802 at kitware.com> Content-Type: text/plain; charset=windows-1252; format=flowed On 9/11/2014 4:09 PM, Hennigan, Gary L wrote: > Thanks for the reply Chuck. Do you have an external projects in this build? -Bill ------------------------------ Date: Thu, 11 Sep 2014 21:15:42 -0400 From: David Cole To: glhenni at sandia.gov, chuck.atkins at kitware.com Cc: cmake at cmake.org Subject: Re: [CMake] FW: Parallel GNU make issue Message-ID: <8D19C3E352A769F-2B64-432D5 at webmail-m253.sysops.aol.com> Content-Type: text/plain; charset="us-ascii"; format=flowed Is there a significant amount of output from make? What does make do if it's running low on RAM? ctest may be holding onto "too much" memory trying to process the output if it's very large... Just a thought -- worth a look, though. D ------------------------------ Subject: Digest Footer -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake ------------------------------ End of CMake Digest, Vol 125, Issue 23 ************************************** From Gilles.Khouzam at microsoft.com Tue Sep 16 19:35:15 2014 From: Gilles.Khouzam at microsoft.com (Gilles Khouzam) Date: Tue, 16 Sep 2014 23:35:15 +0000 Subject: [CMake] Get Visual Studio target Arch In-Reply-To: <8D19FB13DDCC886-18B4-9CAB@webmail-va018.sysops.aol.com> References: <8D19FB13DDCC886-18B4-9CAB@webmail-va018.sysops.aol.com> Message-ID: <99a389dbff044ec6b4b8454bdaa630cf@CY1PR0301MB0713.namprd03.prod.outlook.com> Hi David, Alexey I'm glad to hear your enthusiasm about our involvement with CMake. We're still trying to understand the issues that people are facing and how we can help improve those. The multi-platform support is something somewhat experimental that will have issues, but getting feedback will help address the issues that you might run into. Alexey, the issue with CMAKE_SYSTEM_PROCESSOR seems to come from the CMakeDetermineSystem.cmake (lines 110 and below) file which only sets it for WINCE based on the MSVC_C_ARCHITECTURE_ID and uses the HOST processor otherwise. That's probably why you're seeing AMD64 all the time. My initial thought is that using MSVC_C_ARCHITECTURE_ID should give you at least the right processor for the compile. BTW, I've only enabled the multiplatform support for cross-compiling for Windows Phone and Windows Store apps (to reduce the potential regressions) but if you would like to have it for native Windows apps, I should be able to easily enable it. Looking forward to being able to help more. Gilles Khouzam Senior Development Lead Microsoft OSG -----Original Message----- From: David Cole [mailto:dlrdave at aol.com] Sent: Tuesday, September 16, 2014 03:37 To: alexey.petruchik at gmail.com; Gilles Khouzam Cc: cmake at cmake.org Subject: Re: [CMake] Get Visual Studio target Arch > I still cant really make some arch specific ifdefs in my cmake scripts > using this approach. That's the point of a multi-configuration, multi-architecture Visual Studio solution: you defer choosing the configuration *and* the architecture until build time. No "CMake time" decisions are possible based on the configuration or the architecture with this approach because neither is known until compile time. It is inappropriate to "choose the configuration or architecture" in CMake code with this approach, and you should re-think about it and see if you can make compile time decisions instead, possibly with #ifdef sections in your C/C++ code... Rather than re-organize your libraries, you could easily just use "win32/libs/$(Platform)" as your value when using the VS generators, and this should work. By the way, Gilles, I echo the sentiment: nice work! I wish MS had gotten involved in CMake even earlier... but welcome! HTH, David C. From norulez at me.com Wed Sep 17 05:45:32 2014 From: norulez at me.com (NoRulez) Date: Wed, 17 Sep 2014 11:45:32 +0200 Subject: [CMake] [Cdash] Show results from the bullseye coverage in CDash In-Reply-To: <8D1970DAF9C6626-15CC-19901@webmail-m269.sysops.aol.com> References: <18BA988B-51F3-4733-9F2B-50FC1DDF151E@me.com> <8D1970DAF9C6626-15CC-19901@webmail-m269.sysops.aol.com> Message-ID: <6E789EB4-CF7E-45EE-8276-1B8CD906AC3E@me.com> Sorry for the long response time but we are currently in a release stage. No, the submit seems fine, but the value in the Coverage.xml looks like 0.00 0.00 Which can't be. However, the *-covbr.* and *-covsrc.* are generated with valid values. Currently CMake 3.0.1 and CDash 2.2.2 are used Best Regards > Am 05.09.2014 um 12:45 schrieb David Cole : > > When the coverage shows "0%" is there any indication that the ctest_submit for the coverage step failed? (i.e. do you log the output of ctest, and does it show anything about failing to submit?) > > That's another type of intermittent network blip that I see, where there's a successful local build, but the submit of a piece of the dashboard fails occasionally. > > > D > From dlrdave at aol.com Wed Sep 17 06:02:56 2014 From: dlrdave at aol.com (David Cole) Date: Wed, 17 Sep 2014 06:02:56 -0400 Subject: [CMake] [Cdash] Show results from the bullseye coverage in CDash Message-ID: <8D1A075B06931BD-884-67AF@webmail-va147.sysops.aol.com> > No, the submit seems fine, but the value in the Coverage.xml looks > like > > 0.00 > 0.00 > > Which can't be. > > However, the *-covbr.* and *-covsrc.* are generated with valid values. Sounds like a bug in ctest then. There must be something going wrong in the code that reads the coverage files and generates Coverage.xml. Can you reproduce the problem with a minimal test case? Or debug it yourself to analyze what's going wrong with ctest on the machine demonstrating the problem? Thanks, David C. From volker.pilipp at dectris.com Wed Sep 17 06:29:10 2014 From: volker.pilipp at dectris.com (Volker Pilipp) Date: Wed, 17 Sep 2014 12:29:10 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries Message-ID: I have encountered the following problem with cmake 3.0.1. Under certain circumstances TARGET_LINK_LIBRARIES replaces "/path/to/libXXX.so" by "-lXXX". The problem occurred when I used a non-standard compiler at /opt/XXX/bin/g++ and added the library /opt/XXX/lib/libXXX.so to TARGET_LINK_LIBRARIES. In particular CMakeLists.txt reads: "SET(CMAKE_CXX_COMPILER /opt/XXX/bin/g++) CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) PROJECT(XXX) add_executable(xxx xxx.cpp) target_link_libraries(xxx /opt/XXX/lib/libXXX.so)" When running make VERBOSE=1 produces output like /opt/XXX/bin/g++ (...) -lXXX which is not the same as /opt/XXX/bin/g++ (...) /opt/XXX/lib/libXXX.so I am wondering if this is a cmake bug and if there exists a workaround. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Wed Sep 17 06:58:07 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Wed, 17 Sep 2014 12:58:07 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: References: Message-ID: <5419693F.5060401@gmail.com> On 09/17/2014 12:29 PM, Volker Pilipp wrote: > I have encountered the following problem with cmake 3.0.1. > Under certain circumstances TARGET_LINK_LIBRARIES replaces > "/path/to/libXXX.so" by "-lXXX". The problem occurred when I used a > non-standard compiler at /opt/XXX/bin/g++ and added the library > /opt/XXX/lib/libXXX.so to TARGET_LINK_LIBRARIES. > In particular CMakeLists.txt reads: > > "SET(CMAKE_CXX_COMPILER /opt/XXX/bin/g++) > CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) > PROJECT(XXX) > add_executable(xxx xxx.cpp) > target_link_libraries(xxx /opt/XXX/lib/libXXX.so)" > > When running make VERBOSE=1 produces output like > > /opt/XXX/bin/g++ (...) -lXXX > > which is not the same as > /opt/XXX/bin/g++ (...) /opt/XXX/lib/libXXX.so I think CMake reverts to linking by name if either the library is in an implicit linker directory (e.g. a directory the linker searches by default) or if the shared library does not have an SONAME. Which library does -lXXX resolve to? e.g. why aren't the two command lines equivalent for you? Specifically which library does the linker (ld) pick up; not the runtime loader (ld.so). Nils From eike at sf-mail.de Wed Sep 17 07:07:32 2014 From: eike at sf-mail.de (Rolf Eike Beer) Date: Wed, 17 Sep 2014 13:07:32 +0200 Subject: [CMake] [Cdash] Show results from the bullseye coverage in CDash In-Reply-To: <8D1A075B06931BD-884-67AF@webmail-va147.sysops.aol.com> References: <8D1A075B06931BD-884-67AF@webmail-va147.sysops.aol.com> Message-ID: Am 17.09.2014 12:02, schrieb David Cole via CMake: >> No, the submit seems fine, but the value in the Coverage.xml looks >> like >> >> 0.00 >> 0.00 >> >> Which can't be. >> >> However, the *-covbr.* and *-covsrc.* are generated with valid values. > > > Sounds like a bug in ctest then. There must be something going wrong in > the code that reads the coverage files and generates Coverage.xml. > > Can you reproduce the problem with a minimal test case? Or debug it > yourself to analyze what's going wrong with ctest on the machine > demonstrating the problem? Excellent would be if you could provide an output file of Bullseye that shows that problem that could later be used in an automated test, the code parsing Bullseye data is currently not tested at all. Ideally you would use Bullseye to analyze either a dummy file or something from CMake itself so you do not need to show anything of your code (and CMake doesn't need to ship that). Greetings, Eike From volker.pilipp at dectris.com Wed Sep 17 07:30:10 2014 From: volker.pilipp at dectris.com (Volker Pilipp) Date: Wed, 17 Sep 2014 13:30:10 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: <5419693F.5060401@gmail.com> References: <5419693F.5060401@gmail.com> Message-ID: On Wed, Sep 17, 2014 at 12:58 PM, Nils Gladitz wrote: > On 09/17/2014 12:29 PM, Volker Pilipp wrote: > >> I have encountered the following problem with cmake 3.0.1. >> Under certain circumstances TARGET_LINK_LIBRARIES replaces >> "/path/to/libXXX.so" by "-lXXX". The problem occurred when I used a >> non-standard compiler at /opt/XXX/bin/g++ and added the library >> /opt/XXX/lib/libXXX.so to TARGET_LINK_LIBRARIES. >> In particular CMakeLists.txt reads: >> >> "SET(CMAKE_CXX_COMPILER /opt/XXX/bin/g++) >> CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) >> PROJECT(XXX) >> add_executable(xxx xxx.cpp) >> target_link_libraries(xxx /opt/XXX/lib/libXXX.so)" >> >> When running make VERBOSE=1 produces output like >> >> /opt/XXX/bin/g++ (...) -lXXX >> >> which is not the same as >> /opt/XXX/bin/g++ (...) /opt/XXX/lib/libXXX.so >> > > I think CMake reverts to linking by name if either the library is in an > implicit linker directory (e.g. a directory the linker searches by default) > or if the shared library does not have an SONAME. > > Which library does -lXXX resolve to? > e.g. why aren't the two command lines equivalent for you? > -lXXX stands in the actual case for libcurl.so. I have both /usr/lib4/libcurl.so.3 and /opt/XXX/llib/libcurl.so.4 installed and I want my program to be linked against the latter one. > > Specifically which library does the linker (ld) pick up; > not the runtime loader (ld.so). An ldd on the executable produces libcurl.so.3 => /usr/lib64/libcurl.so.3 Depending on LD_LIBRARY_PATH, (or rpath,...) I would have expected something like this libcurl.so.4 => NOT FOUND or libcurl.so.4 => /opt/XXX/lib/libcurl.so.4 Volker > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From d3ck0r at gmail.com Wed Sep 17 07:32:58 2014 From: d3ck0r at gmail.com (J Decker) Date: Wed, 17 Sep 2014 04:32:58 -0700 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: <5419693F.5060401@gmail.com> References: <5419693F.5060401@gmail.com> Message-ID: can't just add link_directories( /opt/XXX/lib ) ? On Wed, Sep 17, 2014 at 3:58 AM, Nils Gladitz wrote: > On 09/17/2014 12:29 PM, Volker Pilipp wrote: > >> I have encountered the following problem with cmake 3.0.1. >> Under certain circumstances TARGET_LINK_LIBRARIES replaces >> "/path/to/libXXX.so" by "-lXXX". The problem occurred when I used a >> non-standard compiler at /opt/XXX/bin/g++ and added the library >> /opt/XXX/lib/libXXX.so to TARGET_LINK_LIBRARIES. >> In particular CMakeLists.txt reads: >> >> "SET(CMAKE_CXX_COMPILER /opt/XXX/bin/g++) >> CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) >> PROJECT(XXX) >> add_executable(xxx xxx.cpp) >> target_link_libraries(xxx /opt/XXX/lib/libXXX.so)" >> >> When running make VERBOSE=1 produces output like >> >> /opt/XXX/bin/g++ (...) -lXXX >> >> which is not the same as >> /opt/XXX/bin/g++ (...) /opt/XXX/lib/libXXX.so >> > > I think CMake reverts to linking by name if either the library is in an > implicit linker directory (e.g. a directory the linker searches by default) > or if the shared library does not have an SONAME. > > Which library does -lXXX resolve to? > e.g. why aren't the two command lines equivalent for you? > > Specifically which library does the linker (ld) pick up; > not the runtime loader (ld.so). > > Nils > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From volker.pilipp at dectris.com Wed Sep 17 07:50:17 2014 From: volker.pilipp at dectris.com (Volker Pilipp) Date: Wed, 17 Sep 2014 13:50:17 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: References: <5419693F.5060401@gmail.com> Message-ID: I did so and found the following strange behaviour link_directories( /opt/XXX/lib ) -> no effect but link_directories( /opt/ ) -> -L/opt (?!) Volker On Wed, Sep 17, 2014 at 1:32 PM, J Decker wrote: > can't just add link_directories( /opt/XXX/lib ) ? > > On Wed, Sep 17, 2014 at 3:58 AM, Nils Gladitz > wrote: > >> On 09/17/2014 12:29 PM, Volker Pilipp wrote: >> >>> I have encountered the following problem with cmake 3.0.1. >>> Under certain circumstances TARGET_LINK_LIBRARIES replaces >>> "/path/to/libXXX.so" by "-lXXX". The problem occurred when I used a >>> non-standard compiler at /opt/XXX/bin/g++ and added the library >>> /opt/XXX/lib/libXXX.so to TARGET_LINK_LIBRARIES. >>> In particular CMakeLists.txt reads: >>> >>> "SET(CMAKE_CXX_COMPILER /opt/XXX/bin/g++) >>> CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) >>> PROJECT(XXX) >>> add_executable(xxx xxx.cpp) >>> target_link_libraries(xxx /opt/XXX/lib/libXXX.so)" >>> >>> When running make VERBOSE=1 produces output like >>> >>> /opt/XXX/bin/g++ (...) -lXXX >>> >>> which is not the same as >>> /opt/XXX/bin/g++ (...) /opt/XXX/lib/libXXX.so >>> >> >> I think CMake reverts to linking by name if either the library is in an >> implicit linker directory (e.g. a directory the linker searches by default) >> or if the shared library does not have an SONAME. >> >> Which library does -lXXX resolve to? >> e.g. why aren't the two command lines equivalent for you? >> >> Specifically which library does the linker (ld) pick up; >> not the runtime loader (ld.so). >> >> Nils >> >> >> -- >> >> Powered by www.kitware.com >> >> Please keep messages on-topic and check the CMake FAQ at: >> http://www.cmake.org/Wiki/CMake_FAQ >> >> Kitware offers various services to support the CMake community. For more >> information on each offering, please visit: >> >> CMake Support: http://cmake.org/cmake/help/support.html >> CMake Consulting: http://cmake.org/cmake/help/consulting.html >> CMake Training Courses: http://cmake.org/cmake/help/training.html >> >> Visit other Kitware open-source projects at http://www.kitware.com/ >> opensource/opensource.html >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/cmake >> > > -- ************************************************** Volker Pilipp Software & IT Technologies DECTRIS Ltd. Neuenhoferstr. 107 5400 Baden Switzerland +41 56 500 2100 general +41 56 500 2101 fax +41 56 500 2115 direct volker.pilipp at dectris.com www.dectris.com ************************************************** Confidentiality Note This message is intended only for the use of the named recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient, please contact the sender and delete the message. Any unauthorized use of the information contained in this message is prohibited. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Wed Sep 17 08:04:57 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Wed, 17 Sep 2014 14:04:57 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: References: <5419693F.5060401@gmail.com> Message-ID: <541978E9.5050809@gmail.com> On 09/17/2014 01:50 PM, Volker Pilipp wrote: > I did so and found the following strange behaviour > > link_directories( /opt/XXX/lib ) -> no effect > but > link_directories( /opt/ ) -> -L/opt (?!) Probably the same logic as for target_link_libraries(). E.g. implicit link directories aren't repeated as explicit link directories. Nils From volker.pilipp at dectris.com Wed Sep 17 08:17:06 2014 From: volker.pilipp at dectris.com (Volker Pilipp) Date: Wed, 17 Sep 2014 14:17:06 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: <541978E9.5050809@gmail.com> References: <5419693F.5060401@gmail.com> <541978E9.5050809@gmail.com> Message-ID: On Wed, Sep 17, 2014 at 2:04 PM, Nils Gladitz wrote: > On 09/17/2014 01:50 PM, Volker Pilipp wrote: > >> I did so and found the following strange behaviour >> >> link_directories( /opt/XXX/lib ) -> no effect >> but >> link_directories( /opt/ ) -> -L/opt (?!) >> > > Probably the same logic as for target_link_libraries(). > E.g. implicit link directories aren't repeated as explicit link > directories. But it is not an implicit link directory at least not according to the output of "/sbin/ldconfig -p" . What does cmake consider an implicit link directory? Volker > > > Nils > > -- ************************************************** Volker Pilipp Software & IT Technologies DECTRIS Ltd. Neuenhoferstr. 107 5400 Baden Switzerland +41 56 500 2100 general +41 56 500 2101 fax +41 56 500 2115 direct volker.pilipp at dectris.com www.dectris.com ************************************************** Confidentiality Note This message is intended only for the use of the named recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient, please contact the sender and delete the message. Any unauthorized use of the information contained in this message is prohibited. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Wed Sep 17 08:21:40 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Wed, 17 Sep 2014 14:21:40 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: References: <5419693F.5060401@gmail.com> <541978E9.5050809@gmail.com> Message-ID: <54197CD4.2000404@gmail.com> On 09/17/2014 02:17 PM, Volker Pilipp wrote: > > > On Wed, Sep 17, 2014 at 2:04 PM, Nils Gladitz > wrote: > > On 09/17/2014 01:50 PM, Volker Pilipp wrote: > > I did so and found the following strange behaviour > > link_directories( /opt/XXX/lib ) -> no effect > but > link_directories( /opt/ ) -> -L/opt (?!) > > > Probably the same logic as for target_link_libraries(). > E.g. implicit link directories aren't repeated as explicit link > directories. > > But it is not an implicit link directory at least not according to the > output of > "/sbin/ldconfig -p" . What does cmake consider an implicit link directory? I think a directory in which the linker looks by default (not the runtime loader; which is what ldconfig manages). Run e.g. echo "int main() {}"|/opt/XXX/bin/g++ -xc++ - -v And see the directories being passed to collect2 with -L. Nils From dlrdave at aol.com Wed Sep 17 08:22:52 2014 From: dlrdave at aol.com (David Cole) Date: Wed, 17 Sep 2014 08:22:52 -0400 Subject: [CMake] Code Coverage & Bullseye Message-ID: <8D1A0893C43F8AC-3064-E3A@webmail-m169.sysops.aol.com> > I am trying to configure the code coverage using the ctest script. I > took help from : http://www.cmake.org/Wiki/CTest/Coverage That wiki page was mostly written in 2007 and 2009. You may want to refer to something more recent than that, and something that's proven to work, like an existing dashboard script that does coverage, as a reference. One thing to note: there may not be a working example of somebody doing code coverage using the Xcode generator on a Mac. If there is, hopefully he will speak up here, and give you some additional hints. You might have better luck doing a coverage dashboard on Linux using gcc and gcov. See the scripts used for coverage dashboards on the CMake dashboard... for example, this one: http://open.cdash.org/viewNotes.php?buildid=3493343 Especially note the use of the -fprofile-arcs -ftest-coverage flags in the script. (Mentioned on that wiki page, I might add.) > Is Bullseye is mandatory for code coverage using ctest ??? > Is there any way to perform code coverage through ctest without using > bullseye ?? Bullseye is absolutely NOT mandatory for code coverage testing using ctest, it's simply one of the available options. If you do not have Bullseye, there is no need to set the COVFILE env variable. HTH, David C. From norulez at me.com Wed Sep 17 08:47:09 2014 From: norulez at me.com (NoRulez) Date: Wed, 17 Sep 2014 14:47:09 +0200 Subject: [CMake] Code Coverage & Bullseye In-Reply-To: <8D1A0893C43F8AC-3064-E3A@webmail-m169.sysops.aol.com> References: <8D1A0893C43F8AC-3064-E3A@webmail-m169.sysops.aol.com> Message-ID: <390B55B2-9F91-43A7-A3D4-127EE588FC39@me.com> Hello, since code coverage doesn't work very well with gcov and so on on Mac, our company decided to use bullseye for Mac OS too. I hope it helps Am 17.09.2014 um 14:22 schrieb David Cole via CMake : >> I am trying to configure the code coverage using the ctest script. I >> took help from : http://www.cmake.org/Wiki/CTest/Coverage > > That wiki page was mostly written in 2007 and 2009. You may want to > refer to something more recent than that, and something that's proven > to work, like an existing dashboard script that does coverage, as a > reference. > > One thing to note: there may not be a working example of somebody doing > code coverage using the Xcode generator on a Mac. If there is, > hopefully he will speak up here, and give you some additional hints. > > You might have better luck doing a coverage dashboard on Linux using > gcc and gcov. > > See the scripts used for coverage dashboards on the CMake dashboard... > for example, this one: > > http://open.cdash.org/viewNotes.php?buildid=3493343 > > Especially note the use of the -fprofile-arcs -ftest-coverage flags in > the script. (Mentioned on that wiki page, I might add.) > > >> Is Bullseye is mandatory for code coverage using ctest ??? >> Is there any way to perform code coverage through ctest without using >> bullseye ?? > > Bullseye is absolutely NOT mandatory for code coverage testing using > ctest, it's simply one of the available options. > > If you do not have Bullseye, there is no need to set the COVFILE env > variable. > > > HTH, > David C. > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From volker.pilipp at dectris.com Wed Sep 17 08:50:40 2014 From: volker.pilipp at dectris.com (Volker Pilipp) Date: Wed, 17 Sep 2014 14:50:40 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: <54197CD4.2000404@gmail.com> References: <5419693F.5060401@gmail.com> <541978E9.5050809@gmail.com> <54197CD4.2000404@gmail.com> Message-ID: > Run e.g. > echo "int main() {}"|/opt/XXX/bin/g++ -xc++ - -v > The output is Target: x86_64-unknown-linux-gnu Configured with: ../configure --prefix=/opt/XXX Thread model: posix gcc version 4.8.2 (GCC) COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /opt/XXX/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/cc1plus -quiet -v -D_GNU_SOURCE - -quiet -dumpbase - -mtune=generic -march=x86-64 -auxbase - -version -o /tmp/ccXHzSkQ.s GNU C++ (GCC) version 4.8.2 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.8.2, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2 /opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/x86_64-unknown-linux-gnu /opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/backward /opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include /usr/local/include /opt/XXX/include /opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include-fixed /usr/include End of search list. GNU C++ (GCC) version 4.8.2 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.8.2, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: d8088594c0e624acf8c1ee4300a343b6 COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' as -v --64 -o /tmp/ccytHs8u.o /tmp/ccXHzSkQ.s GNU assembler version 2.17.50.0.6-26.el5 (x86_64-redhat-linux) using BFD version 2.17.50.0.6-26.el5 20061020 COMPILER_PATH=/opt/XXX/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/:/opt/XXX/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/:/opt/XXX/libexec/gcc/x86_64-unknown-linux-gnu/:/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/:/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/ LIBRARY_PATH=/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/:/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /opt/XXX/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/crtbegin.o -L/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2 -L/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../.. /tmp/ccytHs8u.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/crtend.o /usr/lib/../lib64/crtn.o I suppose it is the line LIBRARY_PATH=/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/:/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../:/lib/:/usr/lib/ I see that /usr/lib64 (where libcurl.so.3 resides) is before /opt/XXX/lib (where libcurl.so.4 resides). That's why g++ links against the wrong library. However, this problem would not occur if I could stop cmake from replacing /opt/XXX/lib/libcurl.so by -lcurl :-( Volker -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.hoffman at kitware.com Wed Sep 17 08:56:59 2014 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Wed, 17 Sep 2014 08:56:59 -0400 Subject: [CMake] Code Coverage & Bullseye In-Reply-To: <390B55B2-9F91-43A7-A3D4-127EE588FC39@me.com> References: <8D1A0893C43F8AC-3064-E3A@webmail-m169.sysops.aol.com> <390B55B2-9F91-43A7-A3D4-127EE588FC39@me.com> Message-ID: <5419851B.4010305@kitware.com> On 9/17/2014 8:47 AM, NoRulez wrote: > Hello, > > since code coverage doesn't work very well with gcov and so on on Mac, our company decided to use bullseye for Mac OS too. If you could email the COVFILE to me I could take a look. Also it might help if you could run ctest with --debug and -VV and send those results to me as well. Sounds like and issue with ctest. -Bill From nilsgladitz at gmail.com Wed Sep 17 10:33:25 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Wed, 17 Sep 2014 16:33:25 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: References: <5419693F.5060401@gmail.com> <541978E9.5050809@gmail.com> <54197CD4.2000404@gmail.com> Message-ID: <54199BB5.3060708@gmail.com> On 09/17/2014 02:50 PM, Volker Pilipp wrote: > I see that /usr/lib64 (where libcurl.so.3 resides) is before > /opt/XXX/lib (where libcurl.so.4 resides). That's why g++ links against > the wrong library. However, this problem would not occur if I could stop > cmake from replacing /opt/XXX/lib/libcurl.so by -lcurl :-( Maybe you could bring this up on the issue tracker: http://public.kitware.com/Bug/my_view_page.php I am not entirely sure what the proper thing to do would be. Nils From alexey.petruchik at gmail.com Wed Sep 17 12:08:38 2014 From: alexey.petruchik at gmail.com (Alexey Petruchik) Date: Wed, 17 Sep 2014 19:08:38 +0300 Subject: [CMake] Get Visual Studio target Arch In-Reply-To: <99a389dbff044ec6b4b8454bdaa630cf@CY1PR0301MB0713.namprd03.prod.outlook.com> References: <8D19FB13DDCC886-18B4-9CAB@webmail-va018.sysops.aol.com> <99a389dbff044ec6b4b8454bdaa630cf@CY1PR0301MB0713.namprd03.prod.outlook.com> Message-ID: > No "CMake time" decisions are possible based on the configuration I have a project that uses some unix libraries. I use find_package() to locate them. On Windows platform find_package() obviously fails so I maintain folder with prebuilt binaries. So my CMakeLists.txt looks like: if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(CMAKE_LIBRARY_PATH "win32/x86/lib") endif() find_package(A REQUIRED) find_package(B REQUIRED) find_package(C REQUIRED) Now I want to add x64 build support. Obviously now it fails when tries to link x64 binary to x86 prebuilt libs. I cant use CMAKE_SYSTEM_PROCESSOR because its always defined to AMD64. Also I cant use VS $(Platform) variable because find_package() runs at "cmake time". So how I should handle it without "cmake time" decisions? Use internal undocumented MSVC_C_ARCHITECTURE_ID? Use CMAKE_CL_64\CMAKE_FORCE_WIN64\CMAKE_FORCE_IA64 vars that are x64-only hack that will fail for ARM build? Use CMAKE_GENERATOR var and find "Win64"\"ARM" substrings in it? I'm really running out of ideas and will appreciate any help in this question. Regards, Alexey On Wed, Sep 17, 2014 at 2:35 AM, Gilles Khouzam < Gilles.Khouzam at microsoft.com> wrote: > Hi David, Alexey > > I'm glad to hear your enthusiasm about our involvement with CMake. We're > still trying to understand the issues that people are facing and how we can > help improve those. The multi-platform support is something somewhat > experimental that will have issues, but getting feedback will help address > the issues that you might run into. > > Alexey, the issue with CMAKE_SYSTEM_PROCESSOR seems to come from the > CMakeDetermineSystem.cmake (lines 110 and below) file which only sets it > for WINCE based on the MSVC_C_ARCHITECTURE_ID and uses the HOST processor > otherwise. That's probably why you're seeing AMD64 all the time. My initial > thought is that using MSVC_C_ARCHITECTURE_ID should give you at least the > right processor for the compile. > > BTW, I've only enabled the multiplatform support for cross-compiling for > Windows Phone and Windows Store apps (to reduce the potential regressions) > but if you would like to have it for native Windows apps, I should be able > to easily enable it. > > Looking forward to being able to help more. > > Gilles Khouzam > Senior Development Lead > Microsoft OSG > > -----Original Message----- > From: David Cole [mailto:dlrdave at aol.com] > Sent: Tuesday, September 16, 2014 03:37 > To: alexey.petruchik at gmail.com; Gilles Khouzam > Cc: cmake at cmake.org > Subject: Re: [CMake] Get Visual Studio target Arch > > > I still cant really make some arch specific ifdefs in my cmake scripts > > using this approach. > > > That's the point of a multi-configuration, multi-architecture Visual > Studio solution: you defer choosing the configuration *and* the > architecture until build time. > > No "CMake time" decisions are possible based on the configuration or the > architecture with this approach because neither is known until compile time. > > It is inappropriate to "choose the configuration or architecture" in CMake > code with this approach, and you should re-think about it and see if you > can make compile time decisions instead, possibly with #ifdef sections in > your C/C++ code... > > Rather than re-organize your libraries, you could easily just use > "win32/libs/$(Platform)" as your value when using the VS generators, and > this should work. > > > By the way, Gilles, I echo the sentiment: nice work! I wish MS had gotten > involved in CMake even earlier... but welcome! > > > HTH, > David C. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.neundorf-work at gmx.net Wed Sep 17 16:00:51 2014 From: a.neundorf-work at gmx.net (Alexander Neundorf) Date: Wed, 17 Sep 2014 22:00:51 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: References: <54197CD4.2000404@gmail.com> Message-ID: <2528211.NPt9VMYoK7@tuxedo.neundorf.net> On Wednesday, September 17, 2014 14:50:40 Volker Pilipp wrote: ... > I suppose it is the line > LIBRARY_PATH=/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/:/opt/XXX/lib/g > cc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib64/:/lib/../lib64/:/usr/lib > /../lib64/:/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../:/lib/:/ > usr/lib/ yes, cmake checks $LIBRARY_PATH and uses -l for the libraries located in these directories. I stumbled about that behaviour last year or so, I guess it's a feature. Alex From j.s4403 at gmail.com Wed Sep 17 16:40:50 2014 From: j.s4403 at gmail.com (j s) Date: Wed, 17 Sep 2014 15:40:50 -0500 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: <54199BB5.3060708@gmail.com> References: <5419693F.5060401@gmail.com> <541978E9.5050809@gmail.com> <54197CD4.2000404@gmail.com> <54199BB5.3060708@gmail.com> Message-ID: Would it be possible to set something like: TARGET_LINK_LIBRARIES(myexe -L/opt/XXX/lib -lcurl) in the path? On Wed, Sep 17, 2014 at 9:33 AM, Nils Gladitz wrote: > On 09/17/2014 02:50 PM, Volker Pilipp wrote: >> >> I see that /usr/lib64 (where libcurl.so.3 resides) is before >> /opt/XXX/lib (where libcurl.so.4 resides). That's why g++ links against >> the wrong library. However, this problem would not occur if I could stop >> cmake from replacing /opt/XXX/lib/libcurl.so by -lcurl :-( > > > Maybe you could bring this up on the issue tracker: > http://public.kitware.com/Bug/my_view_page.php > > I am not entirely sure what the proper thing to do would be. > > Nils > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From volker.pilipp at dectris.com Thu Sep 18 01:52:44 2014 From: volker.pilipp at dectris.com (Volker Pilipp) Date: Thu, 18 Sep 2014 07:52:44 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: References: <5419693F.5060401@gmail.com> <541978E9.5050809@gmail.com> <54197CD4.2000404@gmail.com> <54199BB5.3060708@gmail.com> Message-ID: That actually does the trick. But it's not nice, because there are many targets in the project. Actually, I do not know about any use case, where cmake should replace a full path to a lib by its "-l" shortcut. Thank you very much for your help. Volker On Wed, Sep 17, 2014 at 10:40 PM, j s wrote: > Would it be possible to set something like: > TARGET_LINK_LIBRARIES(myexe -L/opt/XXX/lib -lcurl) > in the path? > > > On Wed, Sep 17, 2014 at 9:33 AM, Nils Gladitz > wrote: > > On 09/17/2014 02:50 PM, Volker Pilipp wrote: > >> > >> I see that /usr/lib64 (where libcurl.so.3 resides) is before > >> /opt/XXX/lib (where libcurl.so.4 resides). That's why g++ links against > >> the wrong library. However, this problem would not occur if I could stop > >> cmake from replacing /opt/XXX/lib/libcurl.so by -lcurl :-( > > > > > > Maybe you could bring this up on the issue tracker: > > http://public.kitware.com/Bug/my_view_page.php > > > > I am not entirely sure what the proper thing to do would be. > > > > Nils > > > > > > -- > > > > Powered by www.kitware.com > > > > Please keep messages on-topic and check the CMake FAQ at: > > http://www.cmake.org/Wiki/CMake_FAQ > > > > Kitware offers various services to support the CMake community. For more > > information on each offering, please visit: > > > > CMake Support: http://cmake.org/cmake/help/support.html > > CMake Consulting: http://cmake.org/cmake/help/consulting.html > > CMake Training Courses: http://cmake.org/cmake/help/training.html > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Andreas-Naumann at gmx.net Thu Sep 18 02:29:15 2014 From: Andreas-Naumann at gmx.net (Andreas Naumann) Date: Thu, 18 Sep 2014 08:29:15 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: <2528211.NPt9VMYoK7@tuxedo.neundorf.net> References: <54197CD4.2000404@gmail.com> <2528211.NPt9VMYoK7@tuxedo.neundorf.net> Message-ID: <541A7BBB.6000605@gmx.net> Am 17.09.2014 22:00, schrieb Alexander Neundorf: > On Wednesday, September 17, 2014 14:50:40 Volker Pilipp wrote: > ... >> I suppose it is the line >> LIBRARY_PATH=/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/:/opt/XXX/lib/g >> cc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib64/:/lib/../lib64/:/usr/lib >> /../lib64/:/opt/XXX/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../:/lib/:/ >> usr/lib/ > yes, cmake checks $LIBRARY_PATH and uses -l for the libraries located in these > directories. > I stumbled about that behaviour last year or so, I guess it's a feature. > > Alex > It less a feature of cmake, much more a feature of gcc. It interprets every directory in LIBRARY_PATH as system directory and reports this to cmake, so it assumes, that those directories are system directories. Andreas From nilsgladitz at gmail.com Thu Sep 18 02:59:02 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Thu, 18 Sep 2014 08:59:02 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: References: <5419693F.5060401@gmail.com> <541978E9.5050809@gmail.com> <54197CD4.2000404@gmail.com> <54199BB5.3060708@gmail.com> Message-ID: <541A82B6.20900@gmail.com> On 09/18/2014 07:52 AM, Volker Pilipp wrote: > That actually does the trick. But it's not nice, because there are many > targets in the project. > Actually, I do not know about any use case, where cmake should replace a > full path to a lib > by its "-l" shortcut. There are as far as I understand two use cases. - The library does not have a SONAME Linking to the library by path would embed the full path of the library in the target rather than just the name (which is what it does with -l or when the library does have a SONAME set) - The second use case I am not familiar with myself but the explanation in the code is: // Many system linkers support multiple architectures by // automatically selecting the implicit linker search path for the // current architecture. If the library appears in an implicit link // directory then just report the file name without the directory // portion. This will allow the system linker to locate the proper // library for the architecture at link time. Nils From d3ck0r at gmail.com Thu Sep 18 03:05:27 2014 From: d3ck0r at gmail.com (J Decker) Date: Thu, 18 Sep 2014 00:05:27 -0700 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: <541A82B6.20900@gmail.com> References: <5419693F.5060401@gmail.com> <541978E9.5050809@gmail.com> <54197CD4.2000404@gmail.com> <54199BB5.3060708@gmail.com> <541A82B6.20900@gmail.com> Message-ID: It shouldn't truncate paths if specified... cause of course if we want to test against a dev version then maybe the script knows better. But neither should it add the full path if it's not specified in the script. On Wed, Sep 17, 2014 at 11:59 PM, Nils Gladitz wrote: > On 09/18/2014 07:52 AM, Volker Pilipp wrote: > >> That actually does the trick. But it's not nice, because there are many >> targets in the project. >> Actually, I do not know about any use case, where cmake should replace a >> full path to a lib >> by its "-l" shortcut. >> > > There are as far as I understand two use cases. > > - The library does not have a SONAME > Linking to the library by path would embed the full path of the library > in the target rather than just the name (which is what it does with -l or > when the library does have a SONAME set) > > - The second use case I am not familiar with myself but the explanation in > the code is: > // Many system linkers support multiple architectures by > // automatically selecting the implicit linker search path for the > // current architecture. If the library appears in an implicit link > // directory then just report the file name without the directory > // portion. This will allow the system linker to locate the proper > // library for the architecture at link time. > > > Nils > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xavier.besseron at uni.lu Thu Sep 18 04:12:10 2014 From: xavier.besseron at uni.lu (Xavier Besseron) Date: Thu, 18 Sep 2014 10:12:10 +0200 Subject: [CMake] TARGET_LINK_LIBRARIES with full path libraries In-Reply-To: <16688e1860db4f71af0c1c2aaab91357@ARCHER.uni.lux> References: <5419693F.5060401@gmail.com> <541978E9.5050809@gmail.com> <54197CD4.2000404@gmail.com> <54199BB5.3060708@gmail.com> <541A82B6.20900@gmail.com> <16688e1860db4f71af0c1c2aaab91357@ARCHER.uni.lux> Message-ID: Dear all, I had the same issue some time ago with the Boost library. The solution for me was to declare this library as "imported". Here is an example: add_library( curl UNKNOWN IMPORTED) set_property(TARGET curl PROPERTY IMPORTED_LOCATION "/opt/XXX/lib/libcurl.so.4") add_executable(xxx xxx.cpp) target_link_libraries(xxx curl) Here are some relevant links: http://www.cmake.org/pipermail/cmake/2011-June/044790.html http://www.cmake.org/Wiki/CMake_2.6_Notes#Linking_to_System_Libraries Regards, Xavier 2014-09-18 9:05 GMT+02:00 J Decker : > It shouldn't truncate paths if specified... cause of course if we want to > test against a dev version then maybe the script knows better. But neither > should it add the full path if it's not specified in the script. > > On Wed, Sep 17, 2014 at 11:59 PM, Nils Gladitz > wrote: >> >> On 09/18/2014 07:52 AM, Volker Pilipp wrote: >>> >>> That actually does the trick. But it's not nice, because there are many >>> targets in the project. >>> Actually, I do not know about any use case, where cmake should replace a >>> full path to a lib >>> by its "-l" shortcut. >> >> >> There are as far as I understand two use cases. >> >> - The library does not have a SONAME >> Linking to the library by path would embed the full path of the library >> in the target rather than just the name (which is what it does with -l or >> when the library does have a SONAME set) >> >> - The second use case I am not familiar with myself but the explanation in >> the code is: >> // Many system linkers support multiple architectures by >> // automatically selecting the implicit linker search path for the >> // current architecture. If the library appears in an implicit link >> // directory then just report the file name without the directory >> // portion. This will allow the system linker to locate the proper >> // library for the architecture at link time. >> >> >> Nils >> -- >> >> Powered by www.kitware.com >> >> Please keep messages on-topic and check the CMake FAQ at: >> http://www.cmake.org/Wiki/CMake_FAQ >> >> Kitware offers various services to support the CMake community. For more >> information on each offering, please visit: >> >> CMake Support: http://cmake.org/cmake/help/support.html >> CMake Consulting: http://cmake.org/cmake/help/consulting.html >> CMake Training Courses: http://cmake.org/cmake/help/training.html >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/cmake > > -- Dr Xavier BESSERON Research associate FSTC, University of Luxembourg Campus Kirchberg, Office E-007 Phone: +352 46 66 44 5418 http://luxdem.uni.lu/ From rajeevkumar235813 at gmail.com Thu Sep 18 04:56:13 2014 From: rajeevkumar235813 at gmail.com (Rajeev Kumar) Date: Thu, 18 Sep 2014 14:26:13 +0530 Subject: [CMake] Code Coverage & Bullseye In-Reply-To: <5419851B.4010305@kitware.com> References: <8D1A0893C43F8AC-3064-E3A@webmail-m169.sysops.aol.com> <390B55B2-9F91-43A7-A3D4-127EE588FC39@me.com> <5419851B.4010305@kitware.com> Message-ID: Hi, Thanks for your responses. As David mentioned I don't have to set the COVFILE if I don't have the Bullseye. I am already using the -fprofile-arcs -ftest-coverage hence .gcna & .gcno files are getting generated. Here is my CMakeLists.txt : http://pastebin.com/hQt2htkK Here is my ctest script : http://pastebin.com/CFqHkPNZ I also enabled the --Debug flag for ctest script and I found out that ctest is looking the gcov files in following directories: 1. Performing coverage 2. COVFILE environment variable not found, not running bullseye 3. globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/CMakeFiles/ALL_BUILD.dir 4. globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/CMakeFiles/Continuous.dir 5. globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/CMakeFiles/Experimental.dir 6. globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/CMakeFiles/Nightly.dir 7. globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/CMakeFiles/NightlyMemoryCheck.dir 8. globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/CMakeFiles/ZERO_CHECK.dir 9. globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/intercepttest1/CMakeFiles/intercepttest1.dir 10. globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/intercepttest2/CMakeFiles/intercepttest2.dir 11. globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/sporttest1/CMakeFiles/sporttest1.dir 12. globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/sporttest2/CMakeFiles/sporttest2.dir 13. globbing for coverage in: /Users/rajekumar/work/test-codes/Test/out/test/CMakeFiles/Sample.dir 14. Cannot find any GCov coverage files. 15. Cannot find any Python Trace.py coverage files. 16. Cannot find coverage.py XML file: /Users/rajekumar/work/test-codes/Test/out/coverage.xml 17. Cannot find foobar GTM coverage file: /Users/rajekumar/work/test-codes/Test/out/gtm_coverage.mcov 18. Cannot find Cache coverage file: /Users/rajekumar/work/test-codes/Test/out/cache_coverage.cmcov 19. Cannot find any coverage files. Ignoring Coverage request. But simple grep shows that .gcda .gcno are located in different directory: gcno files: ./out/intercepttest1/Project.build/Debug/intercepttest1.build/Objects-normal/x86_64/intercepttest1.gcno ./out/intercepttest2/Project.build/Debug/intercepttest2.build/Objects-normal/x86_64/intercepttest2.gcno ./out/sporttest1/Project.build/Debug/sporttest1.build/Objects-normal/x86_64/sporttest1.gcno ./out/sporttest2/Project.build/Debug/sporttest2.build/Objects-normal/x86_64/sporttest2.gcno ./out/test/Project.build/Debug/Sample.build/Objects-normal/x86_64/main.gcno gcda files: ./out/intercepttest1/Project.build/Debug/intercepttest1.build/Objects-normal/x86_64/intercepttest1.gcda ./out/intercepttest2/Project.build/Debug/intercepttest2.build/Objects-normal/x86_64/intercepttest2.gcda ./out/sporttest1/Project.build/Debug/sporttest1.build/Objects-normal/x86_64/sporttest1.gcda ./out/sporttest2/Project.build/Debug/sporttest2.build/Objects-normal/x86_64/sporttest2.gcda ./out/test/Project.build/Debug/Sample.build/Objects-normal/x86_64/main.gcda Is this the problem ??? Here is the full debug logs : http://pastebin.com/cTXFZ3tS Thanks Rajeev On Wed, Sep 17, 2014 at 6:26 PM, Bill Hoffman wrote: > On 9/17/2014 8:47 AM, NoRulez wrote: > >> Hello, >> >> since code coverage doesn't work very well with gcov and so on on Mac, >> our company decided to use bullseye for Mac OS too. >> > If you could email the COVFILE to me I could take a look. Also it might > help if you could run ctest with --debug and -VV and send those results to > me as well. Sounds like and issue with ctest. > > > > -Bill > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlrdave at aol.com Thu Sep 18 06:06:40 2014 From: dlrdave at aol.com (David Cole) Date: Thu, 18 Sep 2014 06:06:40 -0400 Subject: [CMake] Code Coverage & Bullseye In-Reply-To: References: <8D1A0893C43F8AC-3064-E3A@webmail-m169.sysops.aol.com> <390B55B2-9F91-43A7-A3D4-127EE588FC39@me.com> <5419851B.4010305@kitware.com> Message-ID: <8D1A13F5FCE8B7E-1B24-23F@webmail-m169.sysops.aol.com> As I said in my previous response, I don't know anybody who is using Xcode on the Mac, and also successfully producing a gcov coverage build. If I were you, I would: (1) use gcov on a Linux build of your software for coverage measurement, using the "Unix Makefiles" generator and the right gcov flags or (2) buy Bullseye for the Mac, as NoRulez suggested his company did because they couldn't get a reliable coverage build using gcov on the Mac This is not a ctest problem. This is a "gcov doesn't work right on the Mac" problem. If somebody would like to claim gcov does work right on the Mac, I would love to see the proof. If anybody is doing it successfully, please do share your scripts and a link to the dashboard results you get using it. (And any hints we might need to replicate it ourselves...) Thanks, David C. From rajeevkumar235813 at gmail.com Thu Sep 18 08:00:33 2014 From: rajeevkumar235813 at gmail.com (Rajeev Kumar) Date: Thu, 18 Sep 2014 17:30:33 +0530 Subject: [CMake] Code Coverage & Bullseye In-Reply-To: <8D1A13F5FCE8B7E-1B24-23F@webmail-m169.sysops.aol.com> References: <8D1A0893C43F8AC-3064-E3A@webmail-m169.sysops.aol.com> <390B55B2-9F91-43A7-A3D4-127EE588FC39@me.com> <5419851B.4010305@kitware.com> <8D1A13F5FCE8B7E-1B24-23F@webmail-m169.sysops.aol.com> Message-ID: As David suggested I did following experiment. I created two Test projects. *Project1: * *set(CTEST_SOURCE_DIRECTORY /Users/rajekumar/work/test-codes/TestUnix)* *set(CTEST_BINARY_DIRECTORY /Users/rajekumar/work/test-codes/TestUnix/out)* *set(CTEST_CMAKE_GENERATOR "Unix Makefiles")* *set(CTEST_BUILD_COMMAND "make")* *Project2:* *set(CTEST_SOURCE_DIRECTORY /Users/rajekumar/work/test-codes/TestMac)* *set(CTEST_BINARY_DIRECTORY /Users/rajekumar/work/test-codes/TestMac/out)* *set(CTEST_CMAKE_GENERATOR "Xcode")* *set(CTEST_BUILD_COMMAND "xcodebuild")* Project1 is able to do the code coverage.Here is the log snippet. *SetCTestConfiguration:CoverageCommand:/usr/bin/gcov* * Add coverage exclude regular expressions.* * target directory list [/Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/TargetDirectories.txt]* *Performing coverage* * COVFILE environment variable not found, not running bullseye* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/Continuous.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ContinuousBuild.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ContinuousConfigure.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ContinuousCoverage.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ContinuousMemCheck.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ContinuousStart.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ContinuousSubmit.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ContinuousTest.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ContinuousUpdate.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/Experimental.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ExperimentalBuild.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ExperimentalConfigure.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ExperimentalCoverage.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ExperimentalMemCheck.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ExperimentalStart.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ExperimentalSubmit.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ExperimentalTest.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/ExperimentalUpdate.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/Nightly.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/NightlyBuild.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/NightlyConfigure.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/NightlyCoverage.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/NightlyMemCheck.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/NightlyMemoryCheck.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/NightlyStart.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/NightlySubmit.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/NightlyTest.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/CMakeFiles/NightlyUpdate.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestUnix/out/test/CMakeFiles/Sample.dir* * Processing coverage (each . represents one file):* * ."/usr/bin/gcov" -o "/Users/rajekumar/work/test-codes/TestUnix/out/test/CMakeFiles/Sample.dir" "/Users/rajekumar/work/test-codes/TestUnix/out/test/CMakeFiles/Sample.dir/main.c.gcda"* *File '/Users/rajekumar/work/test-codes/TestUnix/test/main.c'* *Lines executed:100.00% of 2* In Project 2 ctest was unable to find the .gcda. It was in /Users/rajekumar/work/test-codes/TestMac/out/test/Project.build/Debug/Sample.build/Objects-normal/x86_64/ and ctest was searching in following directories(from logs): *globbing for coverage in: /Users/rajekumar/work/test-codes/TestMac/out/CMakeFiles/ALL_BUILD.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestMac/out/CMakeFiles/Continuous.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestMac/out/CMakeFiles/Experimental.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestMac/out/CMakeFiles/Nightly.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestMac/out/CMakeFiles/NightlyMemoryCheck.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestMac/out/CMakeFiles/ZERO_CHECK.dir* * globbing for coverage in: /Users/rajekumar/work/test-codes/TestMac/out/test/CMakeFiles/Sample.dir* So when I gave the following command manually it worked. *RAJEKUMAR-MBP:TestMac rajekumar$ /usr/bin/gcov -o /Users/rajekumar/work/test-codes/TestMac/out/test/Project.build/Debug/Sample.build/Objects-normal/x86_64/ /Users/rajekumar/work/test-codes/TestMac/out/test/Project.build/Debug/Sample.build/Objects-normal/x86_64/main.gcda * *File '/Users/rajekumar/work/test-codes/TestMac/test/main.c'* *Lines executed:100.00% of 2* */Users/rajekumar/work/test-codes/TestMac/test/main.c:creating 'main.c.gcov'* So it seems that if generator is Xcode then the .gcda files are created in /Users/rajekumar/work/test-codes/TestMac/out/test/Project.build while the ctest try to find it in /Users/rajekumar/work/test-codes/TestMac/out/test/CMakeFiles Is there any way to make ctest to search in some additional directories ?? Rajeev On Thu, Sep 18, 2014 at 3:36 PM, David Cole wrote: > As I said in my previous response, I don't know anybody who is using Xcode > on the Mac, and also successfully producing a gcov coverage build. > > If I were you, I would: > > (1) use gcov on a Linux build of your software for coverage measurement, > using the "Unix Makefiles" generator and the right gcov flags > or > (2) buy Bullseye for the Mac, as NoRulez suggested his company did because > they couldn't get a reliable coverage build using gcov on the Mac > > This is not a ctest problem. This is a "gcov doesn't work right on the > Mac" problem. > > If somebody would like to claim gcov does work right on the Mac, I would > love to see the proof. If anybody is doing it successfully, please do share > your scripts and a link to the dashboard results you get using it. (And any > hints we might need to replicate it ourselves...) > > > Thanks, > David C. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlrdave at aol.com Thu Sep 18 08:26:18 2014 From: dlrdave at aol.com (David Cole) Date: Thu, 18 Sep 2014 08:26:18 -0400 Subject: [CMake] Code Coverage & Bullseye In-Reply-To: References: <8D1A0893C43F8AC-3064-E3A@webmail-m169.sysops.aol.com> <390B55B2-9F91-43A7-A3D4-127EE588FC39@me.com> <5419851B.4010305@kitware.com> <8D1A13F5FCE8B7E-1B24-23F@webmail-m169.sysops.aol.com> Message-ID: <8D1A152E162172B-1B24-BB1@webmail-m169.sysops.aol.com> My apologies. I take it back -- gcov apparently does work on the Mac nowadays. It is a ctest issue, then, and when using Xcode, ctest will need to look in some additional locations for the coverage data files. The source code is available -- patches welcome. :-) D From daniele.domenichelli at gmail.com Thu Sep 18 08:39:26 2014 From: daniele.domenichelli at gmail.com (Daniele E. Domenichelli) Date: Thu, 18 Sep 2014 14:39:26 +0200 Subject: [CMake] CMAKE_CFG_INTDIR In-Reply-To: <5416B8FF.4080209@gmail.com> References: <5416B8FF.4080209@gmail.com> Message-ID: <541AD27E.7060901@gmail.com> On 15/09/14 12:01, Daniele E. Domenichelli wrote: > Is there an alternative variable for CMAKE_CFG_INTDIR that can be used > in configure time, instead of build time? > > If there is not, is it safe to assume that the name of the directory is > equal to the name of the current configuration? Bump? What I would like to do is to be able to change CMAKE_RUNTIME_OUTPUT_DIRECTORY (and similar variables) with something that contains the current configuration directory, i.e. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY .../${CMAKE_CFG_INTDIR}/...) but unfortunately CMAKE_CFG_INTDIR causes an error when targets are installed. I was able to have something that works as I expect by doing this: foreach(config ${CMAKE_CONFIGURATION_TYPES}) string(TOUPPER ${config} CONFIG) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONFIG} .../${config}/...) endforeach() But I was wondering if it is safe to assume that the current directory is always "${config}" or if it might be different. Cheers, Daniele From norulez at me.com Thu Sep 18 09:17:36 2014 From: norulez at me.com (NoRulez) Date: Thu, 18 Sep 2014 15:17:36 +0200 Subject: [CMake] [Cdash] Show results from the bullseye coverage in CDash In-Reply-To: References: <8D1A075B06931BD-884-67AF@webmail-va147.sysops.aol.com> Message-ID: <33E1669D-91A2-4697-B8B6-D5FAA942E07A@me.com> When i start "ctest -V -V -S CTestScript.cmake" manually on the command line, I see the following messages: Performing coverage RegularExpression::compile(): ?+* follows nothing. RegularExpression::compile(): Error in compile. Best regards > Am 17.09.2014 um 13:07 schrieb Rolf Eike Beer : > > Am 17.09.2014 12:02, schrieb David Cole via CMake: >>> No, the submit seems fine, but the value in the Coverage.xml looks >>> like >>> 0.00 >>> 0.00 >>> Which can't be. >>> However, the *-covbr.* and *-covsrc.* are generated with valid values. >> Sounds like a bug in ctest then. There must be something going wrong in >> the code that reads the coverage files and generates Coverage.xml. >> Can you reproduce the problem with a minimal test case? Or debug it >> yourself to analyze what's going wrong with ctest on the machine >> demonstrating the problem? > > Excellent would be if you could provide an output file of Bullseye that shows that problem that could later be used in an automated test, the code parsing Bullseye data is currently not tested at all. Ideally you would use Bullseye to analyze either a dummy file or something from CMake itself so you do not need to show anything of your code (and CMake doesn't need to ship that). > > Greetings, > > Eike > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From clinton at elemtech.com Thu Sep 18 10:02:57 2014 From: clinton at elemtech.com (clinton at elemtech.com) Date: Thu, 18 Sep 2014 08:02:57 -0600 (MDT) Subject: [CMake] CMAKE_CFG_INTDIR In-Reply-To: <541AD27E.7060901@gmail.com> References: <5416B8FF.4080209@gmail.com> <541AD27E.7060901@gmail.com> Message-ID: <980771324.424882.1411048977795.JavaMail.zimbra@elemtech.com> ----- Original Message ----- > On 15/09/14 12:01, Daniele E. Domenichelli wrote: > > Is there an alternative variable for CMAKE_CFG_INTDIR that can be used > > in configure time, instead of build time? > > > > If there is not, is it safe to assume that the name of the directory is > > equal to the name of the current configuration? > > > Bump? > > What I would like to do is to be able to change > CMAKE_RUNTIME_OUTPUT_DIRECTORY (and similar variables) with something > that contains the current configuration directory, i.e. > > set(CMAKE_RUNTIME_OUTPUT_DIRECTORY .../${CMAKE_CFG_INTDIR}/...) > > but unfortunately CMAKE_CFG_INTDIR causes an error when targets are > installed. As expected, that will not work. CMAKE_CFG_INTDIR can give the build tool a variable, which is expanded by the build tool, and you've effectively added another configuration directory level. You could end up with a directory such as /path/to/Debug/Debug/ > > I was able to have something that works as I expect by doing this: > > foreach(config ${CMAKE_CONFIGURATION_TYPES}) > string(TOUPPER ${config} CONFIG) > set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONFIG} .../${config}/...) > endforeach() > > But I was wondering if it is safe to assume that the current directory > is always "${config}" or if it might be different. > That should work just fine. CMAKE_CONFIGURATION_TYPES gives you a list of all possible configuration that can be chosen at build time. Clint From gereon.kremer at cs.rwth-aachen.de Thu Sep 18 11:52:38 2014 From: gereon.kremer at cs.rwth-aachen.de (Gereon Kremer) Date: Thu, 18 Sep 2014 17:52:38 +0200 Subject: [CMake] Exporting a library shared and static Message-ID: <541AFFC6.4050109@cs.rwth-aachen.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I have a project that consists of a library and an application that are developed as two separated projects (different repos, separate cmake setups, etc.). Let's call them "lib" and "app". The app exports itself to ~/.cmake/ and creates a appTargets.cmake, the app simply does find_package(lib). For several reasons, we must be able to build the app dynamically and statically. Our current approach is based on a flag "STATICLIB_SWITCH" that exists in the lib and in the app. Based on it's value, we build the library as .a or .so and link the app statically or dynamically. However, there are a few drawbacks: The value of the switch has to be consistent for the lib and the app and we didn't quite manage to correctly search for all libs: The linker command line is cluttered with lots of -rdynamic etc, which also occasionally breaks down and is very hard to debug when it does. So I spent some time on this and it seems that this is meant to be done differently. My new setup looks like this: The lib has two targets, for a shared object and for a static object, that are always built and exported. The app includes whatever it needs. This would remove the switch from the lib, which would be very nice. However, it seems that the app always includes the "shared target", no matter what I do. Also, I have not been able to provide the target with the list of libraries necessary: I simply collect all libraries in a variable that are found by other find_package calls, but find_package will only find either the shared or the static versions... So basically my question is: How is this supposed to be done? (I somehow get the feeling, that both attempts are wrong :-) ) How can I use a library in another application and switch (fairly) easily between static and dynamic linking? Thanks for any hints on this! Gereon PS: I accidently posted this mail on cmake-developers a few days ago and realized today, that I got the wrong list. Sorry for that! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJUGv/GAAoJEIQ2nMX673Hfg+IIAKOZ9rpbAk4LKsgwwEmTdjLq Zy2LnsFcZqc/oRjaPVxLdJyWYDgtD4fi5SE3YGLn9VaHP9UM/KOWZGMGRew5358U yf8X1RTAW+0bH+RWqjjqry3FUl6YY+vlkAPvmEO2cnFgXLI3WONB5TZLm0M/EJR3 iDG3Dgk55BPlwOnEV06rMWauYr2iwK7HQv2lOBGKfoMFLb8lIYZKHROOBuvjE3gJ xbosZ7tZ+t62Db9BcxKsT716dgA6KWuZLnrLsuKChBA+RXPYlUph90IZN5pBg+L6 MU+bPePGtW3SWpY4XsEU8a9+7QQekCgT948NQUOTWK38kBPnJzSsmPLIybHQTik= =teCh -----END PGP SIGNATURE----- From Gilles.Khouzam at microsoft.com Thu Sep 18 19:58:42 2014 From: Gilles.Khouzam at microsoft.com (Gilles Khouzam) Date: Thu, 18 Sep 2014 23:58:42 +0000 Subject: [CMake] Get Visual Studio target Arch In-Reply-To: References: <540DFE18.3080809@googlemail.com> <5e1e26af926d4a4692beb5063ad29731@CY1PR0301MB0713.namprd03.prod.outlook.com> Message-ID: <0951888962a44c818d8791a70e7464ca@CY1PR0301MB0713.namprd03.prod.outlook.com> Hi Alexey I?ve updated our installers to get installed in CMakeMS instead of CMake, this allows you to run both side by side. If you want to rename the executable to be CMakeMS.exe, you can, I just felt that for people relying on scripts, this could be a hard change to take. ~Gilles -------------- next part -------------- An HTML attachment was scrubbed... URL: From rajeevkumar235813 at gmail.com Fri Sep 19 02:09:20 2014 From: rajeevkumar235813 at gmail.com (Rajeev Kumar) Date: Fri, 19 Sep 2014 11:39:20 +0530 Subject: [CMake] Code Coverage & Bullseye In-Reply-To: <8D1A152E162172B-1B24-BB1@webmail-m169.sysops.aol.com> References: <8D1A0893C43F8AC-3064-E3A@webmail-m169.sysops.aol.com> <390B55B2-9F91-43A7-A3D4-127EE588FC39@me.com> <5419851B.4010305@kitware.com> <8D1A13F5FCE8B7E-1B24-23F@webmail-m169.sysops.aol.com> <8D1A152E162172B-1B24-BB1@webmail-m169.sysops.aol.com> Message-ID: Thou shall receive the patch :) On Thu, Sep 18, 2014 at 5:56 PM, David Cole wrote: > My apologies. I take it back -- gcov apparently does work on the Mac > nowadays. > > It is a ctest issue, then, and when using Xcode, ctest will need to look > in some additional locations for the coverage data files. > > The source code is available -- patches welcome. :-) > > > D > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From guibufolo at gmail.com Fri Sep 19 04:55:45 2014 From: guibufolo at gmail.com (Guilherme) Date: Fri, 19 Sep 2014 10:55:45 +0200 Subject: [CMake] Problem compiling clang on cygwin, library prefix mismatch Message-ID: Hello, When generating the cmake file all goes well but during compilation it fails. One of the messages is: Linking CXX shared library ../../bin/cygLLVMSupport.dll Where you can see that it has added the cyg prefix to the generated lib. But all the other targets search for libLLVMSupport.dll, which does not exist. Is there any setting when invoking cmake to change the prefix from cyg to lib? How do i go about fixing this? Thank you Red From nilsgladitz at gmail.com Fri Sep 19 05:07:44 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Fri, 19 Sep 2014 11:07:44 +0200 Subject: [CMake] Problem compiling clang on cygwin, library prefix mismatch In-Reply-To: References: Message-ID: <541BF260.7060705@gmail.com> On 09/19/2014 10:55 AM, Guilherme wrote: > Hello, > > When generating the cmake file all goes well but during compilation it fails. > > One of the messages is: > Linking CXX shared library ../../bin/cygLLVMSupport.dll > > Where you can see that it has added the cyg prefix to the generated lib. > > But all the other targets search for libLLVMSupport.dll, which does not exist. The targets are looking how/when? As a link time dependency shouldn't they be looking for the import library rather than the DLL? Nils From guibufolo at gmail.com Fri Sep 19 05:17:15 2014 From: guibufolo at gmail.com (Guilherme) Date: Fri, 19 Sep 2014 11:17:15 +0200 Subject: [CMake] Problem compiling clang on cygwin, library prefix mismatch In-Reply-To: <541BF260.7060705@gmail.com> References: <541BF260.7060705@gmail.com> Message-ID: The output i see on the command line is: make[2]: *** No rule to make target 'lib/libLLVMSupport.dll.a', needed by 'bin/cygLLVMLineEditor.dll'. Stop. Well i'm trying to build all as shared. On Fri, Sep 19, 2014 at 11:07 AM, Nils Gladitz wrote: > On 09/19/2014 10:55 AM, Guilherme wrote: >> >> Hello, >> >> When generating the cmake file all goes well but during compilation it >> fails. >> >> One of the messages is: >> Linking CXX shared library ../../bin/cygLLVMSupport.dll >> >> Where you can see that it has added the cyg prefix to the generated lib. >> >> But all the other targets search for libLLVMSupport.dll, which does not >> exist. > > > The targets are looking how/when? > > As a link time dependency shouldn't they be looking for the import library > rather than the DLL? > > Nils > From nilsgladitz at gmail.com Fri Sep 19 05:24:16 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Fri, 19 Sep 2014 11:24:16 +0200 Subject: [CMake] Problem compiling clang on cygwin, library prefix mismatch In-Reply-To: References: <541BF260.7060705@gmail.com> Message-ID: <541BF640.4030003@gmail.com> On 09/19/2014 11:17 AM, Guilherme wrote: > The output i see on the command line is: > > make[2]: *** No rule to make target 'lib/libLLVMSupport.dll.a', needed > by 'bin/cygLLVMLineEditor.dll'. Stop. > > Well i'm trying to build all as shared. So it is correctly looking for the import library libLLVMSupport.dll.a rather than directly for cygLLVMSupport.dll. What does the add_library() call for LLVMSupport look like? How does LLVMLineEditor link to LLVMSupport? e.g. what does the target_link_libraries() call look like? Nils From marco.atzeri at gmail.com Fri Sep 19 05:25:38 2014 From: marco.atzeri at gmail.com (Marco Atzeri) Date: Fri, 19 Sep 2014 11:25:38 +0200 Subject: [CMake] Problem compiling clang on cygwin, library prefix mismatch In-Reply-To: References: <541BF260.7060705@gmail.com> Message-ID: <541BF692.9080409@gmail.com> On 19/09/2014 11:17, Guilherme wrote: > The output i see on the command line is: > > make[2]: *** No rule to make target 'lib/libLLVMSupport.dll.a', needed > by 'bin/cygLLVMLineEditor.dll'. Stop. > > Well i'm trying to build all as shared. on cygwin, the build system usually produce something like: $ find . -name "*dll*" ./cygqhull-6.dll ./cygqhull_p-6.dll ./libqhull.dll.a ./libqhull_p.dll.a the import library is called libXXXX.dll.a while the shared is cygXXXXX.dll Regards Marco From taylor at braun-jones.org Fri Sep 19 12:23:08 2014 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Fri, 19 Sep 2014 12:23:08 -0400 Subject: [CMake] Integrating ExternalData with Artifactory Message-ID: Hi all, I'm curious if anyone has attempted to integrate Artifactory with the ExternalData framework? Unfortunately the Artifactory REST API is a two step process where you first search for a file based on MD5 or SHA1 hash[1] which returns JSON results the file's URI. You then issue a second request to download the file from that URI. Any ideas for integrating this into CMake's ExternalData framework as cleanly as possible? Thanks! Taylor [1] http://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-ChecksumSearch -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.king at kitware.com Fri Sep 19 15:04:11 2014 From: brad.king at kitware.com (Brad King) Date: Fri, 19 Sep 2014 15:04:11 -0400 Subject: [CMake] Integrating ExternalData with Artifactory In-Reply-To: References: Message-ID: <541C7E2B.9080606@kitware.com> On 09/19/2014 12:23 PM, Taylor Braun-Jones wrote: > integrate Artifactory with the ExternalData framework? > > the Artifactory REST API is a two step process Currently ExternalData always uses the file(DOWNLOAD) command. Recently I was thinking about how to extend the ExternalData module to support custom download commands or scripts. I think it can be activated by a special format of an entry in ExternalData_URL_TEMPLATES that specifies a lookup key that maps to some kind of custom configuration of a .cmake script to include or command to launch with execute_process. If you are interested in design discussion and/or trying to develop the changes for this, please join the cmake-developers list: http://www.cmake.org/mailman/listinfo/cmake-developers and post this over there. Thanks, -Brad From hobbes1069 at gmail.com Sat Sep 20 12:45:41 2014 From: hobbes1069 at gmail.com (Richard Shaw) Date: Sat, 20 Sep 2014 11:45:41 -0500 Subject: [CMake] Modify nsis command? Message-ID: In my continued efforts to convert a project from autotools to CMake I've gotten to the point of creating an NSIS package. I'm trying not to modify any existing source files and the current method passes some defines to the nsis binary but I can't see any way to do that with the available CPACK variables. Anyone else run into this? Thanks, Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From iosif.neitzke+cmake at gmail.com Sat Sep 20 13:40:52 2014 From: iosif.neitzke+cmake at gmail.com (Iosif Neitzke) Date: Sat, 20 Sep 2014 12:40:52 -0500 Subject: [CMake] Modify nsis command? In-Reply-To: References: Message-ID: Which defines, for example? On Sat, Sep 20, 2014 at 11:45 AM, Richard Shaw wrote: > In my continued efforts to convert a project from autotools to CMake I've > gotten to the point of creating an NSIS package. > > I'm trying not to modify any existing source files and the current method > passes some defines to the nsis binary but I can't see any way to do that > with the available CPACK variables. > > Anyone else run into this? > > Thanks, > Richard > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From hobbes1069 at gmail.com Sat Sep 20 15:16:43 2014 From: hobbes1069 at gmail.com (Richard Shaw) Date: Sat, 20 Sep 2014 14:16:43 -0500 Subject: [CMake] Modify nsis command? In-Reply-To: References: Message-ID: On Sat, Sep 20, 2014 at 12:40 PM, Iosif Neitzke < iosif.neitzke+cmake at gmail.com> wrote: > Which defines, for example? I'm not sure why it matters but the projects maintains it's own nsis config file and in there is expects that the binaries which are being packaged (could be one, or the other, or both) to have defines specified on the nsis command line "-DHAVE_". Thanks, Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From post at hendrik-sattler.de Sat Sep 20 16:14:59 2014 From: post at hendrik-sattler.de (Hendrik Sattler) Date: Sat, 20 Sep 2014 22:14:59 +0200 Subject: [CMake] Modify nsis command? In-Reply-To: References: Message-ID: <80760601-fea1-47aa-8063-32ca05b5a974@email.android.com> Hi, this is a fairly simple task. You just need to generate (with configure_file) the Cpack nsis template from your own template (the template's template that is). As an alternative you can do a similar thing with the Cpackconfig file. HS On 20. September 2014 18:45:41 MESZ, Richard Shaw wrote: >In my continued efforts to convert a project from autotools to CMake >I've >gotten to the point of creating an NSIS package. > >I'm trying not to modify any existing source files and the current >method >passes some defines to the nsis binary but I can't see any way to do >that >with the available CPACK variables. > >Anyone else run into this? > >Thanks, >Richard > > >------------------------------------------------------------------------ From roland at utk.edu Sat Sep 20 17:31:05 2014 From: roland at utk.edu (Roland Schulz) Date: Sat, 20 Sep 2014 17:31:05 -0400 Subject: [CMake] Windows rpath emulation Message-ID: Hi, it would be nice if there were a way to emulate rpath under Windows. As far as I can see there are two possible approaches: - Generate a shell script which sets PATH - Generate a manifest for the application and a manifest for the dependencies. http://sourceforge.net/p/mingw-w64/mailman/message/30019971/ has an example of how to do it. To generate either the script or the manifest, all paths to the all required libraries need to be queried for an executable target. Then those paths could be put into the script/manifest with e.g. coonfigure_file. Those paths correspond to those used to set the rpath. This functionality has been suggested in this issue: http://www.cmake.org/Bug/bug_relationship_graph.php?bug_id=10449 The issue has been suspended with a comment that this idea, needs more discussion on the mailing list first. Of course it would be even nicer if cmake could generate the script or the manifest and not just provide the mechanism to query the path. Roland -- ORNL/UT Center for Molecular Biophysics cmb.ornl.gov 865-241-1537, ORNL PO BOX 2008 MS6309 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Sat Sep 20 17:53:38 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Sat, 20 Sep 2014 23:53:38 +0200 Subject: [CMake] Windows rpath emulation In-Reply-To: References: Message-ID: <541DF762.2000107@gmail.com> On 20.09.2014 23:31, Roland Schulz wrote: > Hi, > > it would be nice if there were a way to emulate rpath under Windows. > As far as I can see there are two possible approaches: > - Generate a shell script which sets PATH > - Generate a manifest for the application and a manifest for the > dependencies. > http://sourceforge.net/p/mingw-w64/mailman/message/30019971/ has an > example of how to do it. > > To generate either the script or the manifest, all paths to the all > required libraries need to be queried for an executable target. Then > those paths could be put into the script/manifest with e.g. > coonfigure_file. Those paths correspond to those used to set the rpath. I suppose it might be slightly more complex given that the import library that is being linked to and the DLL that corresponds to the import library might not be in the same location (and cmake might know the location of the one but not always the location of the the other). > This functionality has been suggested in this issue: > http://www.cmake.org/Bug/bug_relationship_graph.php?bug_id=10449 > The issue has been suspended with a comment that this idea, needs more > discussion on the mailing list first. Brad probably meant the developer's rather than the user's mailing list. (I am sending this reply to both) Nils From sircmpwn at gmail.com Sun Sep 21 16:16:03 2014 From: sircmpwn at gmail.com (Drew DeVault) Date: Sun, 21 Sep 2014 14:16:03 -0600 Subject: [CMake] CMake and user friendliness Message-ID: <541F3203.4010001@gmail.com> I've been using cmake for a few months now, and I wanted to provide some feedback compared to autotools. First of all, from a developer perspective, I love cmake. It's much, much better than autohell and I really appreciate it. However, from a user perspective (i.e. someone compiling and installing software), autotools is much, much better. Compare this: ./configure --enable-sdl --disable-readline To this: cmake -DENABLE_SDL=No -DENABLE_READLINE=No . And figuring out how the configuration works is a pain, too. Compare this: $ ./configure --help ... Optional Features: --enable-sdl enables the SDL frontend --disable-readline disables the readline frontend ... to this: $ cmake -LH // Enables the SDL frontend enable-sdl:BOOL=YES From sircmpwn at gmail.com Sun Sep 21 16:18:53 2014 From: sircmpwn at gmail.com (Drew DeVault) Date: Sun, 21 Sep 2014 14:18:53 -0600 Subject: [CMake] CMake and user friendliness Message-ID: <541F32AD.6010803@gmail.com> Apologies, this email got sent early after my fingers slipped on the keys. Here's the full text: I've been using cmake for a few months now, and I wanted to provide some feedback compared to autotools. First of all, from a developer perspective, I love cmake. It's much, much better than autohell and I really appreciate it. However, from a user perspective (i.e. someone compiling and installing software), autotools is much, much better. Compare this: ./configure --enable-sdl --disable-readline To this: cmake -DENABLE_SDL=No -DENABLE_READLINE=No . And figuring out how the configuration works is a pain, too. Compare this: $ ./configure --help ... Optional Features: --enable-sdl enables the SDL frontend --disable-readline disables the readline frontend ... to this: $ cmake -LH // Enables the SDL frontend enable-sdl:BOOL=NO // Enables the readline frontend enable-readline:BOOL=YES With the autotools version, you immediately know what to do if you want to enable the SDL frontend. With the cmake version, you have to read the man pages to figure out how to set variables (-D). Overall, autotools is a lot more intuitive for users, and cmake for developers. As a developer, I prefer cmake for that reason, but can we work on improving cmake for users? I don't understand why I couldn't be able to do this: cmake --enable-sdl . -- Drew DeVault From biddisco at cscs.ch Sun Sep 21 17:25:53 2014 From: biddisco at cscs.ch (Biddiscombe, John A.) Date: Sun, 21 Sep 2014 21:25:53 +0000 Subject: [CMake] project not found despite being found In-Reply-To: <5418608A.9070506@gmail.com> Message-ID: Nils I wasn?t setting xxx_FOUND at all - and I never resolved this problem, but it went away on its own after I made some changes to various config files etc. Thanks anyway. JB On 16/09/14 18:08, "Nils Gladitz" wrote: >On 16.09.2014 17:38, Biddiscombe, John A. wrote: >> " >> Found package configuration file: >> >> /Users/biddisco/build/cmakesuper/xxx/xxx-config.cmake >> >> but it set xxx_FOUND to FALSE so package ?xxx" is >> considered to be NOT FOUND. >> ? >> >> Which is not expected. If I set xxx_FOUND in the config, it goes away, >>but I was under the impression that the cmake find_package command >>itself should set the xxx_FOUND internally and not be done by the user. >> >> Is the find_package command trying to tell me something by showing this >>message? > >It think the message indicates that the config file was setting >xxx_FOUND explicitly to FALSE itself. > >Nils From biddisco at cscs.ch Sun Sep 21 17:34:08 2014 From: biddisco at cscs.ch (Biddiscombe, John A.) Date: Sun, 21 Sep 2014 21:34:08 +0000 Subject: [CMake] find_package and lib/cmake. Message-ID: If a projX is installed to ~/apps/projX And when installed it creates projXConfig.cmake projXConfigVersion.cmake projXTargets-debug.cmake projXTargets.cmake &etc. In ~/apps/projX/lib/cmake/projX It is necessary to say cmake ?Dprojx_DIR=~/apps/projX/lib/cmake/projX ?.. When configuring another project that uses find_package(projX) Is there a way of setting it up so that the user only has to say cmake ?Dprojx_DIR=~/apps/projX ?.. Without putting all the installed *.cmake files at the root of the install. It seems odd to me that CMake doesn?t search in lib/cmake/ Thanks JB From nilsgladitz at gmail.com Sun Sep 21 17:54:12 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Sun, 21 Sep 2014 23:54:12 +0200 Subject: [CMake] find_package and lib/cmake. In-Reply-To: References: Message-ID: <541F4904.6080503@gmail.com> On 21.09.2014 23:34, Biddiscombe, John A. wrote: > If a projX is installed to > > ~/apps/projX > > And when installed it creates > > projXConfig.cmake > projXConfigVersion.cmake > projXTargets-debug.cmake > projXTargets.cmake > &etc. > > In ~/apps/projX/lib/cmake/projX > > It is necessary to say > cmake ?Dprojx_DIR=~/apps/projX/lib/cmake/projX ?.. > > When configuring another project that uses find_package(projX) > > Is there a way of setting it up so that the user only has to say > cmake ?Dprojx_DIR=~/apps/projX ?.. > > Without putting all the installed *.cmake files at the root of the install. It seems odd to me that CMake doesn?t search in lib/cmake/ The cache variable projX_DIR points at the directory that contains the configuration file (e.g. is not an installation prefix) and will also be set by cmake itself if it finds a configuration file. The environment variables projX_DIR and CMAKE_PREFIX_PATH expect an installation prefix. e.g. setting the projX_DIR environment variable to ~/apps/projX should have it look in ~/apps/projX/lib/cmake/* as well. Nils From cristian.adam at gmail.com Mon Sep 22 01:45:58 2014 From: cristian.adam at gmail.com (Cristian Adam) Date: Mon, 22 Sep 2014 07:45:58 +0200 Subject: [CMake] Ninja generator fail for QNX on Windows Message-ID: Hi, I have a project which uses CMake (v 2.8.12.2) to (cross)compile on Windows using either Visual Studio 2008 or QNX 6.5.0. Using ninja (v1.5.1) as a CMake generator works as expected with Visual Studio 2008. First build takes time, second subsequent build says: "ninja: no work to do". On QNX side, thins are not as good. First, in order to compile the project I had to apply this patch [1], provided by Stephen Kelly. And now the "fail" part for QNX, the second subsequent build doesn't say "ninja: no work to do" instead it starts compiling, taking as much as 70% of the original clean build time :( Now I don't know who to blame cmake or ninja? Thank you, Cristian. [1] http://public.kitware.com/pipermail/cmake-developers/2014-January/009413.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From ono at java.pl Mon Sep 22 06:27:43 2014 From: ono at java.pl (Adam Strzelecki) Date: Mon, 22 Sep 2014 12:27:43 +0200 Subject: [CMake] CMake and user friendliness In-Reply-To: <541F32AD.6010803@gmail.com> References: <541F32AD.6010803@gmail.com> Message-ID: Please install cmake bash_completion and then it will be easy as typing: cmake -D --Adam From alexis.riksman at sogeti.nl Mon Sep 22 08:25:56 2014 From: alexis.riksman at sogeti.nl (Riksman, Alexis) Date: Mon, 22 Sep 2014 14:25:56 +0200 Subject: [CMake] VxWorks and CMake Message-ID: <000E83B3ED3D0742A7781DE413768461494975DE8A@SOGMB2.SGTI.NL> Has anyone used CMake for VxWorks environments? As far as I can see, there is no VxWorks support yet in the cmake distribution. The cleanest way seems to create a VxWorks.cmake in the Modules/Platform directory that specifies the OS specifics. Also a create a file VxWorks-toolchain.cmake that specifies the details of the compiler (gnu) and other tools. A copy of a working platform file and toolchain file would be great, but any useful hint is appreciated. Kind regards, Alexis Disclaimer: This message contains information that may be privileged or confidential and is the property of Sogeti Nederland B.V. or its Group members. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zbeekman at gmail.com Mon Sep 22 08:53:06 2014 From: zbeekman at gmail.com (Zaak Beekman) Date: Mon, 22 Sep 2014 08:53:06 -0400 Subject: [CMake] CMake and user friendliness (Drew DeVault) Message-ID: Well, it depends on who you are expecting the "user" to be and what their background is. I always configure new cmake buiulds with cmake-gui or ccmake, which I find to be much easier than auto tools, because the documentation and ability to set options is in the same place--one stop shopping. No need to read about a number of options, then try to remember which ones to set, and to what. Just read the doc string of each option one at a time and then change its value from the default if desired. my $0.02 -Zaak Izaak Beekman =================================== (301)244-9367 Princeton University Doctoral Candidate Mechanical and Aerospace Engineering ibeekman at princeton.edu UMD-CP Visiting Graduate Student Aerospace Engineering ibeekman at umiacs.umd.edu ibeekman at umd.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.hoffman at kitware.com Mon Sep 22 10:27:05 2014 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Mon, 22 Sep 2014 10:27:05 -0400 Subject: [CMake] CMake course in Carrboro, NC October 20, 2014. Message-ID: <542031B9.6070005@kitware.com> Kitware is hosting a CMake training course, titled ?Project Lifecycle Management with the CMake Family of Tools,? in Carrboro, NC. The course will be held on October 20, 2014. Through the course, you will learn how to create a build system for your C/C++/Fortran project using CMake, CPack, CTest, and CDash. This course covers in-depth how CMake works and how you can efficiently write CMake scripts for small to large projects. The course also covers unit testing with CTest, packaging with CPack and continuous integration with CDash. Additional details and registration information are available on the Kitware website. The price of the course via early registration is $650. Early registration is available through October 8, 2014. The price of the course via regular registration is $815. In addition, Kitware will be hosting a ?Scalable Visualization using VTK, ParaView, & Python? training course on October 21, 2014. This course will also be hosted on Carrboro. For more information, please visit http://www.kitware.com/products/protraining.php. -Bill From yue.nicholas at gmail.com Mon Sep 22 10:59:54 2014 From: yue.nicholas at gmail.com (Nicholas Yue) Date: Mon, 22 Sep 2014 07:59:54 -0700 Subject: [CMake] ExternalProject_Add dependency graph (dot/graphviz?) ? Message-ID: <5420396A.4060308@gmail.com> Hi, CMake has graphviz output capability for dependency within a project. Is there a way to graph dependency at the ExternalProject_Add() level ? Cheers -- Nicholas Yue Graphics - RenderMan, Visualization, OpenGL, HDF5 Custom Dev - C++ porting, OSX, Linux, Windows http://au.linkedin.com/in/nicholasyue https://vimeo.com/channels/naiadtools From bill.hoffman at kitware.com Mon Sep 22 11:40:48 2014 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Mon, 22 Sep 2014 11:40:48 -0400 Subject: [CMake] Ninja generator fail for QNX on Windows In-Reply-To: References: Message-ID: <54204300.8090809@kitware.com> On 9/22/2014 1:45 AM, Cristian Adam wrote: > > On QNX side, thins are not as good. First, in order to compile > the project I had to apply this patch [1], provided by Stephen Kelly. > > And now the "fail" part for QNX, the second subsequent build > doesn't say "ninja: no work to do" instead it starts compiling, > taking as much as 70% of the original clean build time :( > > Now I don't know who to blame cmake or ninja? There is no way to really tell what is going on from what you have posted. What about the third time you run ninja does it have nothing todo? You can run: ninja -d explain to see why ninja wants to run things. Sounds like some input files are getting changed during your build for QNX for some reason. -Bill From cristian.adam at gmail.com Mon Sep 22 11:53:25 2014 From: cristian.adam at gmail.com (Cristian Adam) Date: Mon, 22 Sep 2014 17:53:25 +0200 Subject: [CMake] Ninja generator fail for QNX on Windows In-Reply-To: <54204300.8090809@kitware.com> References: <54204300.8090809@kitware.com> Message-ID: On Mon, Sep 22, 2014 at 5:40 PM, Bill Hoffman wrote: > On 9/22/2014 1:45 AM, Cristian Adam wrote: > >> >> On QNX side, thins are not as good. First, in order to compile >> the project I had to apply this patch [1], provided by Stephen Kelly. >> >> And now the "fail" part for QNX, the second subsequent build >> doesn't say "ninja: no work to do" instead it starts compiling, >> taking as much as 70% of the original clean build time :( >> >> Now I don't know who to blame cmake or ninja? >> > There is no way to really tell what is going on from what you have > posted. What about the third time you run ninja does it have nothing todo? > For the 3rd time, 4th time etc. same thing happens. > > You can run: > ninja -d explain > to see why ninja wants to run things. Sounds like some input files are > getting changed during your build for QNX for some reason. > > -Bill > > "-d explain" parameter gives for lots of files (probably all) in the project (headers, source files, object files, static libraries, executables) "is dirty" This means that ninja's method of detecting if a file has been changed doesn't quite work for QNX. Or is this being set by cmake? Some compiler flag which needs a -Wc, or -Wp prefix? Cheers, Cristian. -------------- next part -------------- An HTML attachment was scrubbed... URL: From elfring at users.sourceforge.net Mon Sep 22 11:50:52 2014 From: elfring at users.sourceforge.net (SF Markus Elfring) Date: Mon, 22 Sep 2014 17:50:52 +0200 Subject: [CMake] How to make the construction and reuse of CMake lists safer? Message-ID: <5420455C.8070606@users.sourceforge.net> Hello, The build tool "CMake" supports also the data processing for lists to some degree. http://www.cmake.org/cmake/help/v3.0/manual/cmake-language.7.html#lists I notice that CMake scripts are also provided by some software libraries so that corresponding settings can be automatically determined by the command "find_package". http://www.cmake.org/cmake/help/v3.0/command/find_package.html I have also noticed that a lot of libraries provide only a single file for source file inclusion and linking. It seems that appropriate quoting of variables is often forgotten for this use case, isn't it? How many library build scripts construct variables with suffixes like "_INCLUDE_DIRS" and "_LIBRARIES" which contain two list elements at least? Can any special build function help to make the required data processing safer here? How can it be achieved that contents are properly escaped? Regards, Markus From object.rexx at gmail.com Mon Sep 22 12:06:40 2014 From: object.rexx at gmail.com (Rick McGuire) Date: Mon, 22 Sep 2014 12:06:40 -0400 Subject: [CMake] Problems resolving PTHREAD_* symbols. Message-ID: We have some semaphore code that has conditional compilation based on #defines in config.h. We're having problems with resolving the various PTHREAD_* symbols to get the correct values in config.h. Our first attempt at this (done on Linux) used check_symbol_exists(PTHREAD_MUTEX_RECURSIVE "pthread.h" HAVE_PTHREAD_MUTEX_RECURSIVE) This did not pick the symbol up correctly. Eventually, we got things to work by using check_c_source_compiles("#include int main(int arg, char **argv) { int tryme; tryme = PTHREAD_MUTEX_RECURSIVE; return 0;}" HAVE_PTHREAD_MUTEX_RECURSIVE) and got everything to build cleanly. Over the weekend, we tried building on OSX for the first time, and once again, we were not resolving that these symbols existed. What are we missing here? Is there some technique we should be using that will work across the various platforms? Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From ehh.patrick at gmail.com Mon Sep 22 12:12:12 2014 From: ehh.patrick at gmail.com (Patrick Sauter) Date: Mon, 22 Sep 2014 11:12:12 -0500 Subject: [CMake] Building CTestDashboardTargets Experimental, etc From Xcode Fails Message-ID: <252FEBFE-7DC8-4B33-AA71-8DE7E62C9BE1@gmail.com> Hello! I am trying to build my Dashboard targets from inside Xcode, and it keeps failing! Here is the build log... echo "" /usr/local/Cellar/cmake/3.0.2/bin/ctest -C Debug -D Experimental Site: macpat Build name: Darwin-clang++ Create new tag: 20140922-1554 - Experimental Configure project Each . represents 1024 bytes of output .... Size of output: 3K Build project Each symbol represents 1024 bytes of output. '!' represents an error and '*' a warning. .....make: *** [/Volumes/Users/patrick/Projects/skeleton/xcode_build/CMakeFiles/Experimental] Interrupt: 2 Building these targets with Unix Makefiles works just fine. Running "/usr/local/Cellar/cmake/3.0.2/bin/ctest -C Debug -D Experimental? manually in the Xcode build directory works just fine. Any ideas?! Thanks, Patrick From bill.hoffman at kitware.com Mon Sep 22 12:32:47 2014 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Mon, 22 Sep 2014 12:32:47 -0400 Subject: [CMake] Ninja generator fail for QNX on Windows In-Reply-To: References: <54204300.8090809@kitware.com> Message-ID: <54204F2F.3090109@kitware.com> On 9/22/2014 11:53 AM, Cristian Adam wrote: > > "-d explain" parameter gives for lots of files (probably all) in the > project (headers, source files, object files, static libraries, > executables) > "is dirty" > > This means that ninja's method of detecting if a file has been changed > doesn't quite work for QNX. Or is this being set by cmake? > Some compiler flag which needs a -Wc, or -Wp prefix? I would look close at the output of explain: For example, in building cmake: If I start with an up to date build, and do this: touch ../cmake/Source/cmake.cxx ninja -d explain I get something like this: Creating library bin\ctest.lib and object bin\ctest.exp ninja explain: output Source\CMakeFiles\CMakeLib.dir\cmake.cxx.obj older than most recent input C:\Users\hoffman\Work\My Builds\cmake\Source\cmake.cxx (433106324 vs 433106443) ninja explain: Source\CMakeFiles\CMakeLib.dir\cmake.cxx.obj is dirty ninja explain: Source\CMakeLib.lib is dirty ninja explain: Source\CMakeLib.lib is dirty ninja explain: bin\cmake.exe is dirty ninja explain: Source\CMakeLib.lib is dirty ninja explain: bin\cmcldeps.exe is dirty ninja explain: Source\CMakeLib.lib is dirty ninja explain: bin\cpack.exe is dirty ninja explain: Source\CMakeLib.lib is dirty ninja explain: bin\ctest.exe is dirty ninja explain: Source\CMakeLib.lib is dirty ninja explain: Tests\CMakeLib\CMakeLibTests.exe is dirty ninja explain: Source\CMakeLib.lib is dirty ninja explain: Tests\CTestTestMemcheck\memcheck_fail.exe is dirty ninja explain: Source\CMakeLib.lib is dirty ninja explain: Tests\CTestTestMemcheck\BC.exe is dirty ninja explain: Source\CMakeLib.lib is dirty ninja explain: Tests\CTestTestMemcheck\purify.exe is dirty ninja explain: Source\CMakeLib.lib is dirty ninja explain: Tests\CTestTestMemcheck\valgrind.exe is dirty Maybe if you looked at the very first older than in your output instead of the dirty ones it might tell you what ninja thinks is out of date. Could be some sort of path issue that has something to do with the way the paths are constructed. Again, without seeing the details I can only guess. Do makefiles work for you? What if you try the "Unix Makefiles" generator on the same machine does it have the same problem? -Bill From cristian.adam at gmail.com Tue Sep 23 09:05:58 2014 From: cristian.adam at gmail.com (Cristian Adam) Date: Tue, 23 Sep 2014 15:05:58 +0200 Subject: [CMake] Ninja generator fail for QNX on Windows In-Reply-To: <54204F2F.3090109@kitware.com> References: <54204300.8090809@kitware.com> <54204F2F.3090109@kitware.com> Message-ID: On Mon, Sep 22, 2014 at 6:32 PM, Bill Hoffman wrote: > Maybe if you looked at the very first older than in your output instead of > the dirty ones it might tell you what ninja thinks is out of date. Could be > some sort of path issue that has something to do with the way the paths are > constructed. Again, without seeing the details I can only guess. > > Do makefiles work for you? What if you try the "Unix Makefiles" generator > on the same machine does it have the same problem? > > -Bill > Unix Makefiles work, but on the make provided by QNX doesn't support the parallel -j flag. Found the problem though. QCC compiler generates for this project dependency files which look like: c:\projects\my_proj\include\/a.h \ c:\projects\my_proj\src\/a.cpp \ c:\projects\my_proj\other\..\/include/b.h \ c:\projects\my_proj\other\..\/src/b.cpp \ The "\/" combination does not agree with ninja. I've tried to hack disk_interface.cc:RealDiskInterface::Stat by removing the "/" prefix. string dir = DirName(path); > string base(path.substr(dir.size() ? dir.size() + 1 : 0)); > > if (base[0] == '/' || base[0] == '\\') > { > base.erase(0, 1); > } > > But this fixes only the a.h and a.cpp case. The other case with doesn't work though, since the path is no longer present, Stat received only "include/b.h" and "src/b.cpp". A workaround would be to search and replace all "\/" occurrences in all dependency files. This looks like a ninja bug, I'll report it there. Thank you for the support. Cheers, Cristian. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.hoffman at kitware.com Tue Sep 23 09:26:57 2014 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Tue, 23 Sep 2014 09:26:57 -0400 Subject: [CMake] Ninja generator fail for QNX on Windows In-Reply-To: References: <54204300.8090809@kitware.com> <54204F2F.3090109@kitware.com> Message-ID: <54217521.6000203@kitware.com> On 9/23/2014 9:05 AM, Cristian Adam wrote: > On Mon, Sep 22, 2014 at 6:32 PM, Bill Hoffman > wrote: > > > Maybe if you looked at the very first older than in your output > instead of the dirty ones it might tell you what ninja thinks is out > of date. Could be some sort of path issue that has something to do > with the way the paths are constructed. Again, without seeing the > details I can only guess. > > Do makefiles work for you? What if you try the "Unix Makefiles" > generator on the same machine does it have the same problem? > > -Bill > > > Unix Makefiles work, but on the make provided by QNX doesn't support the > parallel -j flag. Seems that gmake supports that: http://www.qnx.com/developers/docs/6.4.1/neutrino/prog/make_convent.html#Parallel > > Found the problem though. > > QCC compiler generates for this project dependency files which look like: > > c:\projects\my_proj\include\/a.h \ > c:\projects\my_proj\src\/a.cpp \ > c:\projects\my_proj\other\..\/include/b.h \ > c:\projects\my_proj\other\..\/src/b.cpp \ > > The "\/" combination does not agree with ninja. > That would do it. How are the depends being created? Is it ninja or CMake that is creating them on QNX? > This looks like a ninja bug, I'll report it there. > Might be. -Bill From cristian.adam at gmail.com Tue Sep 23 10:22:40 2014 From: cristian.adam at gmail.com (Cristian Adam) Date: Tue, 23 Sep 2014 16:22:40 +0200 Subject: [CMake] Ninja generator fail for QNX on Windows In-Reply-To: <54217521.6000203@kitware.com> References: <54204300.8090809@kitware.com> <54204F2F.3090109@kitware.com> <54217521.6000203@kitware.com> Message-ID: On 23 Sep 2014 15:27, "Bill Hoffman" wrote: > > > Seems that gmake supports that: > http://www.qnx.com/developers/docs/6.4.1/neutrino/prog/make_convent.html#Parallel > In theory it should work, but the mingw version they ship doesn't work. I've upgraded to a version of make which does (one needs to pass SHELL=cmd.exe as an additional parameter), but when you haven't changed anything it still takes some time. This is where ninja comes into place. >> >> Found the problem though. >> >> QCC compiler generates for this project dependency files which look like: >> >> c:\projects\my_proj\include\/a.h \ >> c:\projects\my_proj\src\/a.cpp \ >> c:\projects\my_proj\other\..\/include/b.h \ >> c:\projects\my_proj\other\..\/src/b.cpp \ >> >> The "\/" combination does not agree with ninja. >> > That would do it. How are the depends being created? Is it ninja or CMake that is creating them on QNX? CMake sets the right flags for qcc and qcc creates the dependency files. Cheers, Cristian. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmerkow at gmail.com Tue Sep 23 10:34:18 2014 From: jmerkow at gmail.com (jmerkow) Date: Tue, 23 Sep 2014 07:34:18 -0700 (PDT) Subject: [CMake] CPack WIX examples Message-ID: <1411482858958-7588561.post@n2.nabble.com> Hello I am working on creating an msi installer using cpack with the WIX installer (converting from old system). Im having some trouble finding some good resources to do this. My project needs to set a number of registry entries. We have a few components, and licenses that are installed along with our software. I also don't completely understand the example for CPACK_WIX_PATCH_FILE in the documentation for adding components, etc. I thought it would be helpful to see some of this in action and I was hoping someone could point me to an example or two of a project that uses CPack WIX generators to get me going. I searched github and around the CMake website, and couldn't find any projects that use WIX. -Jameson -- View this message in context: http://cmake.3232098.n2.nabble.com/CPack-WIX-examples-tp7588561.html Sent from the CMake mailing list archive at Nabble.com. From nilsgladitz at gmail.com Tue Sep 23 10:40:39 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Tue, 23 Sep 2014 16:40:39 +0200 Subject: [CMake] CPack WIX examples In-Reply-To: <1411482858958-7588561.post@n2.nabble.com> References: <1411482858958-7588561.post@n2.nabble.com> Message-ID: <54218667.7040009@gmail.com> On 09/23/2014 04:34 PM, jmerkow wrote: > Hello > > I am working on creating an msi installer using cpack with the WIX installer > (converting from old system). Im having some trouble finding some good > resources to do this. > My project needs to set a number of registry entries. We have a few > components, and licenses that are installed along with our software. I also > don't completely understand the example for CPACK_WIX_PATCH_FILE in the > documentation for adding components, etc. > I thought it would be helpful to see some of this in action and I was hoping > someone could point me to an example or two of a project that uses CPack WIX > generators to get me going. I searched github and around the CMake website, > and couldn't find any projects that use WIX. I've got some tiny example projects (actually manual test cases): https://github.com/ngladitz/cmake-wix-testsuite Each sub directory should contain a self contained project usually exercising one specific feature of the WIX generator. Nils From object.rexx at gmail.com Tue Sep 23 10:50:06 2014 From: object.rexx at gmail.com (Rick McGuire) Date: Tue, 23 Sep 2014 10:50:06 -0400 Subject: [CMake] Problems resolving PTHREAD_* symbols. In-Reply-To: References: Message-ID: This is still driving us crazy. Digging a little deeper into this, the symbols we need are defined as enums on Linux, which explains why check_symbol_exists() does not work there. The OSX pthread.h header uses defines, but for some reason, the check_c_source_compiles method is still failing. We've updated our script to use check_c_source_compiles("#include int main(int arg, char **argv) { int tryme; tryme = PTHREAD_MUTEX_ERRORCHECK; return 0;}" HAVE_PTHREAD_MUTEX_ERRORCHECK) if (NOT DEFINED HAVE_PTHREAD_MUTEX_ERRORCHECK) check_symbol_exists(PTHREAD_MUTEX_ERRORCHECK "pthread.h" HAVE_PTHREAD_MUTEX_ERRORCHECK) endif () to try both methods, but this is still failing on the Mac and a couple of the Linux versions we build for. This is driving us nuts, since we don't understand why the check_c_source_compiler check is not working. Is there some way we can get debug information about why the compile fails? That might give us some clues. Rick On Mon, Sep 22, 2014 at 12:06 PM, Rick McGuire wrote: > We have some semaphore code that has conditional compilation based on > #defines in config.h. We're having problems with resolving the various > PTHREAD_* symbols to get the correct values in config.h. Our first attempt > at this (done on Linux) used > > check_symbol_exists(PTHREAD_MUTEX_RECURSIVE "pthread.h" HAVE_PTHREAD_MUTEX_RECURSIVE) > > > This did not pick the symbol up correctly. Eventually, we got things to work by using > > > check_c_source_compiles("#include > int main(int arg, char **argv) { > int tryme; > tryme = PTHREAD_MUTEX_RECURSIVE; > return 0;}" > HAVE_PTHREAD_MUTEX_RECURSIVE) > > and got everything to build cleanly. Over the weekend, we tried building on OSX for the first time, and once again, we were not resolving that these symbols existed. What are we missing here? Is there some technique we should be using that will work across the various platforms? > > > Rick > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From glenn.coombs at gmail.com Tue Sep 23 11:05:56 2014 From: glenn.coombs at gmail.com (Glenn Coombs) Date: Tue, 23 Sep 2014 16:05:56 +0100 Subject: [CMake] How to get custom commands to build in parallel ? Message-ID: I have the following code in one of my CMakeLists.txt files: set(feature_files_h) set(feature_files_cpp) macro(create_feature_files NAME) add_custom_command( OUTPUT ${FEATURES_OUTPUT_DIR}/${NAME}.cpp ${FEATURES_OUTPUT_DIR}/${NAME}.h DEPENDS ${FEATURES_INPUT_DIR}/${NAME}.txt WORKING_DIRECTORY ${SIM_ROOT}/tools/features COMMAND perl ${FEATURES_PERL_PATH} "-s${FEATURES_INPUT_DIR}" "-d${FEATURES_OUTPUT_DIR}" "-f${NAME}" ) list(APPEND feature_files_h ${FEATURES_OUTPUT_DIR}/${NAME}.h) list(APPEND feature_files_cpp ${FEATURES_OUTPUT_DIR}/${NAME}.cpp) endmacro() create_feature_files(example_features) create_feature_files(fme_core_features) create_feature_files(fme_features) create_feature_files(front_end_features) create_feature_files(inloop_filter_features) add_library(${PROJECT_NAME} STATIC ${feature_files_cpp} ${feature_files_h} ${SIM_ROOT}/tools/features/cpp-code/cfeatures.cpp) which creates a library from an existing source file called cfeatures.cpp and from a bunch of auto-generated .cpp and .h files. The whole thing works fine and runs the perl script to create each of the auto-generated files before creating the library. The only problem I have with it is that it is quite slow and I would like to speed it up by having it run the perl commands to create the auto-generated files in parallel. Currently, each of the auto-generated cpp files is generated sequentially, then they are all compiled in parallel and the library created in the final step. I'm using cmake 3.0.0 with Visual Studio 2013 Express Edition. And I've added the /MP option so that Visual Studio will do parallel builds. I've also set the "Projects and Solutions=>Build and Run=>maximum number of parallel project builds" option to 4. This works well with all the normal cpp files in other projects and I easily see all 4 cpu cores maxxed out. But when building this project only 1 cpu core is used. Can anybody tell me how to change it so that the auto-geneated files are created in parallel as well ? -- Glenn -------------- next part -------------- An HTML attachment was scrubbed... URL: From post at hendrik-sattler.de Tue Sep 23 11:10:47 2014 From: post at hendrik-sattler.de (Hendrik Sattler) Date: Tue, 23 Sep 2014 17:10:47 +0200 Subject: [CMake] Ninja generator fail for QNX on Windows In-Reply-To: References: <54204300.8090809@kitware.com> <54204F2F.3090109@kitware.com> <54217521.6000203@kitware.com> Message-ID: On 23. September 2014 16:22:40 MESZ, Cristian Adam >>> QCC compiler generates for this project dependency files which look >like: >>> >>> c:\projects\my_proj\include\/a.h \ >>> c:\projects\my_proj\src\/a.cpp \ >>> c:\projects\my_proj\other\..\/include/b.h \ >>> c:\projects\my_proj\other\..\/src/b.cpp \ To me it looks more like a bug in qcc. Does qcc generates the same broken files when not used in context of CMake or ninja? It should only use one kind of separator for directories. HS From robert.maynard at kitware.com Tue Sep 23 11:20:23 2014 From: robert.maynard at kitware.com (Robert Maynard) Date: Tue, 23 Sep 2014 11:20:23 -0400 Subject: [CMake] How to get custom commands to build in parallel ? In-Reply-To: References: Message-ID: If you are using VS2013 you should look at the /maxcpucount flag which allows msbuild to build multiple projects at the same time. You will have to manually balance /MP and /maxcpucount as they cause a P*C number of processes to execute. On Tue, Sep 23, 2014 at 11:05 AM, Glenn Coombs wrote: > I have the following code in one of my CMakeLists.txt files: > > set(feature_files_h) > set(feature_files_cpp) > > macro(create_feature_files NAME) > add_custom_command( > OUTPUT ${FEATURES_OUTPUT_DIR}/${NAME}.cpp > ${FEATURES_OUTPUT_DIR}/${NAME}.h > DEPENDS ${FEATURES_INPUT_DIR}/${NAME}.txt > WORKING_DIRECTORY ${SIM_ROOT}/tools/features > COMMAND perl ${FEATURES_PERL_PATH} "-s${FEATURES_INPUT_DIR}" > "-d${FEATURES_OUTPUT_DIR}" "-f${NAME}" > ) > list(APPEND feature_files_h ${FEATURES_OUTPUT_DIR}/${NAME}.h) > list(APPEND feature_files_cpp ${FEATURES_OUTPUT_DIR}/${NAME}.cpp) > endmacro() > > create_feature_files(example_features) > create_feature_files(fme_core_features) > create_feature_files(fme_features) > create_feature_files(front_end_features) > create_feature_files(inloop_filter_features) > > add_library(${PROJECT_NAME} STATIC ${feature_files_cpp} ${feature_files_h} > ${SIM_ROOT}/tools/features/cpp-code/cfeatures.cpp) > > which creates a library from an existing source file called cfeatures.cpp > and from a bunch of auto-generated .cpp and .h files. The whole thing works > fine and runs the perl script to create each of the auto-generated files > before creating the library. The only problem I have with it is that it is > quite slow and I would like to speed it up by having it run the perl > commands to create the auto-generated files in parallel. Currently, each of > the auto-generated cpp files is generated sequentially, then they are all > compiled in parallel and the library created in the final step. > > I'm using cmake 3.0.0 with Visual Studio 2013 Express Edition. And I've > added the /MP option so that Visual Studio will do parallel builds. I've > also set the "Projects and Solutions=>Build and Run=>maximum number of > parallel project builds" option to 4. This works well with all the normal > cpp files in other projects and I easily see all 4 cpu cores maxxed out. > But when building this project only 1 cpu core is used. > > Can anybody tell me how to change it so that the auto-geneated files are > created in parallel as well ? > > -- > Glenn > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From robert.maynard at kitware.com Tue Sep 23 11:31:58 2014 From: robert.maynard at kitware.com (Robert Maynard) Date: Tue, 23 Sep 2014 11:31:58 -0400 Subject: [CMake] Problems resolving PTHREAD_* symbols. In-Reply-To: References: Message-ID: To get information on why a try_compile is failing you can use the --debug-trycompile option which will stop CMake from deleting the try_compile build tree code. Now this flag is only useful on a single try_compile at a time. On Tue, Sep 23, 2014 at 10:50 AM, Rick McGuire wrote: > This is still driving us crazy. Digging a little deeper into this, the > symbols we need are defined as enums on Linux, which explains why > check_symbol_exists() does not work there. The OSX pthread.h header uses > defines, but for some reason, the check_c_source_compiles method is still > failing. We've updated our script to use > > check_c_source_compiles("#include > int main(int arg, char **argv) { > int tryme; > tryme = PTHREAD_MUTEX_ERRORCHECK; > return 0;}" > HAVE_PTHREAD_MUTEX_ERRORCHECK) > if (NOT DEFINED HAVE_PTHREAD_MUTEX_ERRORCHECK) > check_symbol_exists(PTHREAD_MUTEX_ERRORCHECK "pthread.h" > HAVE_PTHREAD_MUTEX_ERRORCHECK) > endif () > > > to try both methods, but this is still failing on the Mac and a couple of > the Linux versions we build for. > > > This is driving us nuts, since we don't understand why the > check_c_source_compiler check is not working. Is there some way we can get > debug information about why the compile fails? That might give us some > clues. > > > Rick > > > On Mon, Sep 22, 2014 at 12:06 PM, Rick McGuire > wrote: >> >> We have some semaphore code that has conditional compilation based on >> #defines in config.h. We're having problems with resolving the various >> PTHREAD_* symbols to get the correct values in config.h. Our first attempt >> at this (done on Linux) used >> >> check_symbol_exists(PTHREAD_MUTEX_RECURSIVE "pthread.h" >> HAVE_PTHREAD_MUTEX_RECURSIVE) >> >> >> This did not pick the symbol up correctly. Eventually, we got things to >> work by using >> >> >> check_c_source_compiles("#include >> int main(int arg, char **argv) { >> int tryme; >> tryme = PTHREAD_MUTEX_RECURSIVE; >> return 0;}" >> HAVE_PTHREAD_MUTEX_RECURSIVE) >> >> and got everything to build cleanly. Over the weekend, we tried building >> on OSX for the first time, and once again, we were not resolving that these >> symbols existed. What are we missing here? Is there some technique we >> should be using that will work across the various platforms? >> >> >> Rick >> >> > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From hobbes1069 at gmail.com Tue Sep 23 12:27:48 2014 From: hobbes1069 at gmail.com (Richard Shaw) Date: Tue, 23 Sep 2014 11:27:48 -0500 Subject: [CMake] Abuse try_compile to get DLL dependencies for win32 NSIS packaging? Message-ID: Ok, this may or may not work but I figured it was worth a try. I'm running out of motivation to get a good method to determine which DLL's I need to package with the install(SCRIPT...) / GetPrerequisites mess. My current approach is to attempt to use try_compile to build a minimal program I can link against and use GetPrerequisites with it. I crated an minimal do nothing c++ program and used the full linker flags for the main program but it appears that the "-Wl,--no-whole-archive" is "helping" me by not linking with things I don't need: $ objdump -x getdeps.exe | grep "DLL Name:" DLL Name: KERNEL32.dll DLL Name: msvcrt.dll Any ideas? Thanks, Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From h1lan at ucsd.edu Tue Sep 23 13:08:20 2014 From: h1lan at ucsd.edu (lanhz) Date: Tue, 23 Sep 2014 10:08:20 -0700 (PDT) Subject: [CMake] VTK compiling problem with CMake Message-ID: <1411492100475-7588569.post@n2.nabble.com> Hi, I'm trying use CMake to build VTK, but got error as below. I searched the internet and tried many ways suggested, but they didn't work. The OS is Windows 7 with Visual Studio 2010 Pro (up to date). I don't know how to solve. I'll appreciate your help. Error info from CMake-gui --------------------------------------------------------------------- The C compiler identification is MSVC 16.0.30319.1 The CXX compiler identification is MSVC 16.0.30319.1 Check for working C compiler using: Visual Studio 10 Win64 Check for working C compiler using: Visual Studio 10 Win64 -- broken CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/cl.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: C:/Code/VTK-bin/CMakeFiles/CMakeTmp Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec696148031 Microsoft (R) Visual Studio Version 10.0.30319.1. Copyright (C) Microsoft Corp. All rights reserved. 1>------ Build started: Project: cmTryCompileExec696148031, Configuration: Debug x64 ------ 1>Build started 9/10/2014 1:31:13 PM. 1>PrepareForBuild: 1> Creating directory "C:\Code\VTK-bin\CMakeFiles\CMakeTmp\Debug\". 1>InitializeBuildStatus: 1> Creating "cmTryCompileExec696148031.dir\Debug\cmTryCompileExec696148031.unsuccessfulbuild" because "AlwaysCreate" was specified. 1>ClCompile: 1> Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64 1> Copyright (C) Microsoft Corporation. All rights reserved. 1> 1> cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec696148031.dir\Debug\\" /Fd"cmTryCompileExec696148031.dir\Debug\vc100.pdb" /Gd /TC /errorReport:prompt testCCompiler.c 1> 1> testCCompiler.c 1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt 1> 1>Build FAILED. 1> 1>Time Elapsed 00:00:00.26 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:28 (project) Configuring incomplete, errors occurred! See also "C:/Code/VTK-bin/CMakeFiles/CMakeOutput.log". See also "C:/Code/VTK-bin/CMakeFiles/CMakeError.log". Best Lan -- View this message in context: http://cmake.3232098.n2.nabble.com/VTK-compiling-problem-with-CMake-tp7588569.html Sent from the CMake mailing list archive at Nabble.com. From drescherjm at gmail.com Tue Sep 23 13:16:21 2014 From: drescherjm at gmail.com (John Drescher) Date: Tue, 23 Sep 2014 13:16:21 -0400 Subject: [CMake] VTK compiling problem with CMake In-Reply-To: <1411492100475-7588569.post@n2.nabble.com> References: <1411492100475-7588569.post@n2.nabble.com> Message-ID: Did you try runing cmake-gui from a VisualStudio 2010 x64 command prompt? John On Tue, Sep 23, 2014 at 1:08 PM, lanhz wrote: > Hi, > > I'm trying use CMake to build VTK, but got error as below. I searched the > internet and tried many ways suggested, but they didn't work. The OS is > Windows 7 with Visual Studio 2010 Pro (up to date). I don't know how to > solve. I'll appreciate your help. > > Error info from CMake-gui > --------------------------------------------------------------------- > The C compiler identification is MSVC 16.0.30319.1 > The CXX compiler identification is MSVC 16.0.30319.1 > Check for working C compiler using: Visual Studio 10 Win64 > Check for working C compiler using: Visual Studio 10 Win64 -- broken > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message): > The C compiler "C:/Program Files (x86)/Microsoft Visual Studio > 10.0/VC/bin/x86_amd64/cl.exe" is not able to compile a simple test program. > > It fails with the following output: > > Change Dir: C:/Code/VTK-bin/CMakeFiles/CMakeTmp > > Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\devenv.com > CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec696148031 > > > Microsoft (R) Visual Studio Version 10.0.30319.1. > > > Copyright (C) Microsoft Corp. All rights reserved. > > > 1>------ Build started: Project: cmTryCompileExec696148031, Configuration: > Debug x64 ------ > > > 1>Build started 9/10/2014 1:31:13 PM. > > > 1>PrepareForBuild: > > > 1> Creating directory "C:\Code\VTK-bin\CMakeFiles\CMakeTmp\Debug\". > > > 1>InitializeBuildStatus: > > > 1> Creating > "cmTryCompileExec696148031.dir\Debug\cmTryCompileExec696148031.unsuccessfulbuild" > because "AlwaysCreate" was specified. > > > 1>ClCompile: > > > 1> Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64 > > > 1> Copyright (C) Microsoft Corporation. All rights reserved. > > > 1> > > > 1> cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D > "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise > /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec696148031.dir\Debug\\" > /Fd"cmTryCompileExec696148031.dir\Debug\vc100.pdb" /Gd /TC > /errorReport:prompt testCCompiler.c > > > 1> > > > 1> testCCompiler.c > > > 1>LINK : fatal error LNK1123: failure during conversion to COFF: file > invalid or corrupt > > > 1> > > > 1>Build FAILED. > > > 1> > > > 1>Time Elapsed 00:00:00.26 > > > ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped > ========== > > > CMake will not be able to correctly generate this project. > Call Stack (most recent call first): > CMakeLists.txt:28 (project) > Configuring incomplete, errors occurred! > See also "C:/Code/VTK-bin/CMakeFiles/CMakeOutput.log". > See also "C:/Code/VTK-bin/CMakeFiles/CMakeError.log". > > > Best > Lan > > > > -- > View this message in context: http://cmake.3232098.n2.nabble.com/VTK-compiling-problem-with-CMake-tp7588569.html > Sent from the CMake mailing list archive at Nabble.com. > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake -- John M. Drescher From bill.hoffman at kitware.com Tue Sep 23 13:39:10 2014 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Tue, 23 Sep 2014 13:39:10 -0400 Subject: [CMake] VTK compiling problem with CMake In-Reply-To: References: <1411492100475-7588569.post@n2.nabble.com> Message-ID: <5421B03E.10000@kitware.com> On 9/23/2014 1:16 PM, John Drescher wrote: > Did you try runing cmake-gui from a VisualStudio 2010 x64 command prompt? > > John This has to do with the version of cvtres.exe that you have installed on the machine: http://stackoverflow.com/questions/10888391/error-link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-inval Thing to google for: " 1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt" -Bill From dschepler at scalable-networks.com Tue Sep 23 13:35:42 2014 From: dschepler at scalable-networks.com (Daniel Schepler) Date: Tue, 23 Sep 2014 17:35:42 +0000 Subject: [CMake] VTK compiling problem with CMake In-Reply-To: <1411492100475-7588569.post@n2.nabble.com> References: <1411492100475-7588569.post@n2.nabble.com> Message-ID: 1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt When we've seen this, it's usually been due to .NET being upgraded to 4.5, which is incompatible with the tools in the original version of Visual Studio 2010. Upgrading Visual Studio 2010 to SP1 usually resolves the issue. -- Daniel Schepler From micha.hergarden at gmail.com Tue Sep 23 14:58:01 2014 From: micha.hergarden at gmail.com (Micha Hergarden) Date: Tue, 23 Sep 2014 20:58:01 +0200 Subject: [CMake] ExternalProject_Add dependency graph (dot/graphviz?) ? In-Reply-To: <5420396A.4060308@gmail.com> References: <5420396A.4060308@gmail.com> Message-ID: <5421C2B9.4090500@gmail.com> On 09/22/2014 04:59 PM, Nicholas Yue wrote: > Hi, > > CMake has graphviz output capability for dependency within a project. > > Is there a way to graph dependency at the ExternalProject_Add() > level ? > > Cheers > Hello Nicholas, Can you clarify your question a bit more? Do you mean 'show me the external projects a target in my project depends on' or do you mean 'show me the dependencies the external project depens on', or something different altogether? With kind regards, Micha Hergarden -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From yue.nicholas at gmail.com Tue Sep 23 15:09:06 2014 From: yue.nicholas at gmail.com (Nicholas Yue) Date: Tue, 23 Sep 2014 12:09:06 -0700 Subject: [CMake] ExternalProject_Add dependency graph (dot/graphviz?) ? In-Reply-To: <5421C2B9.4090500@gmail.com> References: <5420396A.4060308@gmail.com> <5421C2B9.4090500@gmail.com> Message-ID: Hi Micha, My interest is in "show me the dependencies the external project depends on" I am considering migrating an in-house build system to build opensource projects to using CMake. As there are many external packages and versions (close to 100), I'd like to be able to visualize their dependency. Once the new system based on CMake is working, I need to build them for different target OS to assist in migration from current OS to future OS version. e.g. ExternalProject_Add ( python264_static .... ) ExternalProject_Add ( python264 DEPENDS python264_static .... ) ExternalProject_Add ( boost_1_47_0 DEPENDS python264 .... ) ExternalProject_Add ( alembic_1_5_5 DEPENDS python264 boost_1_47_0 .... ) Cheers On 23 September 2014 11:58, Micha Hergarden wrote: > On 09/22/2014 04:59 PM, Nicholas Yue wrote: > > Hi, > > > > CMake has graphviz output capability for dependency within a project. > > > > Is there a way to graph dependency at the ExternalProject_Add() > > level ? > > > > Cheers > > > Hello Nicholas, > > Can you clarify your question a bit more? Do you mean 'show me the > external projects a target in my project depends on' or do you mean > 'show me the dependencies the external project depens on', or something > different altogether? > > With kind regards, > Micha Hergarden > > -- Nicholas Yue Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5 Custom Dev - C++ porting, OSX, Linux, Windows http://au.linkedin.com/in/nicholasyue https://vimeo.com/channels/naiadtools -------------- next part -------------- An HTML attachment was scrubbed... URL: From micha.hergarden at gmail.com Tue Sep 23 16:05:05 2014 From: micha.hergarden at gmail.com (Micha Hergarden) Date: Tue, 23 Sep 2014 22:05:05 +0200 Subject: [CMake] Fwd: Re: ExternalProject_Add dependency graph (dot/graphviz?) ? In-Reply-To: <5421D223.2060300@gmail.com> References: <5421D223.2060300@gmail.com> Message-ID: <5421D271.8050204@gmail.com> Hello Nicholas, I see what you mean. I have generated a build.ninja for an external project depeding on an external project, and the dotfile does show the dependency. The problem seems to be that the view is somewhat cluttered by the intermediate dependencies on custom_target etc. I guess it depends on the level of detail you need: you only want to see high level dependencies, but a developer that wants to know exactly what dependencies are generated will want to see the custom_target dependencies as well. I don't see a quick solution to this. I guess not generating the intermediates (if this is possible at all) would mean adapt the ninja generator; not showing the intermediates would mean adapt ninja? I'm not familiar enough with either to help you I'm afraid. Maybe one of the ninja generator maintainers can help you? With kind regards, Micha Hergarden On 09/23/2014 09:09 PM, Nicholas Yue wrote: > Hi Micha, > > My interest is in "show me the dependencies the external project > depends on" > > I am considering migrating an in-house build system to build > opensource projects to using CMake. > As there are many external packages and versions (close to 100), I'd > like to be able to visualize their dependency. > Once the new system based on CMake is working, I need to build them > for different target OS to assist in migration from current OS to > future OS version. > > e.g. > > ExternalProject_Add ( python264_static > .... > ) > > ExternalProject_Add ( python264 > DEPENDS > python264_static > .... > ) > > ExternalProject_Add ( boost_1_47_0 > DEPENDS > python264 > .... > ) > > ExternalProject_Add ( alembic_1_5_5 > DEPENDS > python264 boost_1_47_0 > .... > ) > > Cheers > > > On 23 September 2014 11:58, Micha Hergarden > wrote: > > On 09/22/2014 04:59 PM, Nicholas Yue wrote: > > Hi, > > > > CMake has graphviz output capability for dependency within a > project. > > > > Is there a way to graph dependency at the ExternalProject_Add() > > level ? > > > > Cheers > > > Hello Nicholas, > > Can you clarify your question a bit more? Do you mean 'show me the > external projects a target in my project depends on' or do you mean > 'show me the dependencies the external project depens on', or > something > different altogether? > > With kind regards, > Micha Hergarden > > > > > -- > Nicholas Yue > Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5 > Custom Dev - C++ porting, OSX, Linux, Windows > http://au.linkedin.com/in/nicholasyue > https://vimeo.com/channels/naiadtools -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From jmerkow at gmail.com Tue Sep 23 20:40:33 2014 From: jmerkow at gmail.com (jmerkow) Date: Tue, 23 Sep 2014 17:40:33 -0700 (PDT) Subject: [CMake] CPack WIX examples In-Reply-To: <54218667.7040009@gmail.com> References: <1411482858958-7588561.post@n2.nabble.com> <54218667.7040009@gmail.com> Message-ID: <1411519233024-7588576.post@n2.nabble.com> Thanks a lot for your help! Those examples are excellent. I have a follow up questions for creating the installer, though. We have a number of registry entries that need to be created for the software to run in 'release mode'. In our current system we add registry entries into the wxs, but I don't see a way to do that with cmake/cpack easily. We add a few lines, such as: We use these registry entries as anchors for the locations for software assets. It seems the best way to do this would be to override the template with a number of configurable entries? So I could add something like (there's about 15 of em): I wanted to check to see if there was a way to handle this directly from CMake. -Jameson -- View this message in context: http://cmake.3232098.n2.nabble.com/CPack-WIX-examples-tp7588561p7588576.html Sent from the CMake mailing list archive at Nabble.com. From h1lan at ucsd.edu Tue Sep 23 22:01:06 2014 From: h1lan at ucsd.edu (lanhz) Date: Tue, 23 Sep 2014 19:01:06 -0700 (PDT) Subject: [CMake] VTK compiling problem with CMake In-Reply-To: <5421B03E.10000@kitware.com> References: <1411492100475-7588569.post@n2.nabble.com> <5421B03E.10000@kitware.com> Message-ID: <1411524066183-7588577.post@n2.nabble.com> Thank everyone! I installed VS SP1 and it work! ! -- View this message in context: http://cmake.3232098.n2.nabble.com/VTK-compiling-problem-with-CMake-tp7588569p7588577.html Sent from the CMake mailing list archive at Nabble.com. From j.s4403 at gmail.com Wed Sep 24 00:04:23 2014 From: j.s4403 at gmail.com (j s) Date: Tue, 23 Sep 2014 23:04:23 -0500 Subject: [CMake] Object Library into Shared library Message-ID: <542242C7.1060006@gmail.com> Hello, According to: http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library it is possible to compile OBJECT libraries for use in other targets, as of CMake 2.8.8. Unfortunately it doesn't document how to make the OBJECT position independent. Is the proper cross platform method to set the POSITION_INDEPENDENT_CODE property ON on the OBJECT library? What is the minimum version required to set the POSITION_INDEPENDENT_CODE property on an OBJECT library. Thanks, From j.s4403 at gmail.com Wed Sep 24 00:14:31 2014 From: j.s4403 at gmail.com (j s) Date: Tue, 23 Sep 2014 23:14:31 -0500 Subject: [CMake] get windows import lib location Message-ID: <54224527.1010401@gmail.com> What is the proper way to get the import lib location for a windows dll? I've used GET_TARGET_PROPERTY(FOOPATH foo LOCATION) to get the location of the foo.dll, but I also need the path to foo.lib. Thanks, From jeremy.ardley at gmail.com Wed Sep 24 01:58:02 2014 From: jeremy.ardley at gmail.com (Jeremy Ardley) Date: Wed, 24 Sep 2014 13:58:02 +0800 Subject: [CMake] CMAKE_INSTALL_PREFIX problem Message-ID: <54225D6A.5090409@gmail.com> I am using cmake 2.8.9 on debian wheezy. I'm fairly new to using cmake. My CMakelists.txt file starts with cmake_minimum_required(VERSION 2.6) SET(CMAKE_INSTALL_PREFIX /home/jeremy/Projects/local/) project(myproject) .... Finishing with INSTALL ( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/@APPLICATION_NAME@ DESTINATION @${BUILD_BIN} ) which installs in my target directory, but under a tree prefixed by the '@' character. i.e. /home/jeremy/Projects/local/@/sbin and equivalent. I'm guessing that this is a result of the fragment @${BUILD_BIN} The problem is that if I remove the '@' the INSTALL ignores the CMAKE_INSTALL_PREFIX I've experimented with different variations on the INSTALL lines to no success. Any advice on how to get my INSTALLS ending up in /home/jeremy/Projects/local/sbin and equivalent? Thanks -- Jeremy Ardley -------------- next part -------------- An HTML attachment was scrubbed... URL: From petr.kmoch at gmail.com Wed Sep 24 02:39:49 2014 From: petr.kmoch at gmail.com (Petr Kmoch) Date: Wed, 24 Sep 2014 08:39:49 +0200 Subject: [CMake] CMAKE_INSTALL_PREFIX problem In-Reply-To: <54225D6A.5090409@gmail.com> References: <54225D6A.5090409@gmail.com> Message-ID: Hi Jeremy. Does ${BUILD_BIN} perhaps start with a slash? If so, it would be interpreted as an absolute path, which of course ignores CMAKE_INSTALL_PREFIX. Petr On Wed, Sep 24, 2014 at 7:58 AM, Jeremy Ardley wrote: > I am using cmake 2.8.9 on debian wheezy. I'm fairly new to using cmake. > > My CMakelists.txt file starts with > > cmake_minimum_required(VERSION 2.6) > SET(CMAKE_INSTALL_PREFIX /home/jeremy/Projects/local/) > project(myproject) > > .... > > Finishing with > > INSTALL ( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/@APPLICATION_NAME@ DESTINATION @${BUILD_BIN} ) > > which installs in my target directory, but under a tree prefixed by the > '@' character. i.e. /home/jeremy/Projects/local/@/sbin and equivalent. > > I'm guessing that this is a result of the fragment > > @${BUILD_BIN} > > The problem is that if I remove the '@' the INSTALL ignores the > CMAKE_INSTALL_PREFIX > > I've experimented with different variations on the INSTALL lines to no > success. > > Any advice on how to get my INSTALLS ending up in > /home/jeremy/Projects/local/sbin and equivalent? > > Thanks > > -- > Jeremy Ardley > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From petr.kmoch at gmail.com Wed Sep 24 02:58:49 2014 From: petr.kmoch at gmail.com (Petr Kmoch) Date: Wed, 24 Sep 2014 08:58:49 +0200 Subject: [CMake] CMAKE_INSTALL_PREFIX problem In-Reply-To: <54226874.3010506@gmail.com> References: <54225D6A.5090409@gmail.com> <54226874.3010506@gmail.com> Message-ID: I don't know why @ was inserted, but here's why it overrides the absolute path: because it has no special meaning. The path then becomes "@/sbin", which is not an absolute path (doesn't start with '/'), so the install prefix is prepended normally. Bear in mind that Unix directory and file names can contain any characters except '/' and NUL. About variable substitution: ${var} is the normal way to expand variables. @var@ is primarily intended for use with configure_file(). I believe it works during normal CMake runs as well, but don't use it like that, it will only add confusion. Petr P.S. Please keep the list in copy when replying. On Wed, Sep 24, 2014 at 8:45 AM, Jeremy Ardley wrote: > It was > > set (BUILD_BIN /sbin) > > Removing that fixed the problem. Thanks! > > Curious why my IDE inserted the '@' (kdevelop 3) And more so why it > overrides the absolute path? > > I need to discover more about value substitution :=( > > @somekey@ vs ${somekey} > > > On 24/09/14 14:39, Petr Kmoch wrote: > > Hi Jeremy. > > Does ${BUILD_BIN} perhaps start with a slash? If so, it would be > interpreted as an absolute path, which of course ignores > CMAKE_INSTALL_PREFIX. > > Petr > > On Wed, Sep 24, 2014 at 7:58 AM, Jeremy Ardley > wrote: > >> I am using cmake 2.8.9 on debian wheezy. I'm fairly new to using cmake. >> >> My CMakelists.txt file starts with >> >> cmake_minimum_required(VERSION 2.6) >> SET(CMAKE_INSTALL_PREFIX /home/jeremy/Projects/local/) >> project(myproject) >> >> .... >> >> Finishing with >> >> INSTALL ( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/@APPLICATION_NAME@ DESTINATION @${BUILD_BIN} ) >> >> which installs in my target directory, but under a tree prefixed by the >> '@' character. i.e. /home/jeremy/Projects/local/@/sbin and equivalent. >> >> I'm guessing that this is a result of the fragment >> >> @${BUILD_BIN} >> >> The problem is that if I remove the '@' the INSTALL ignores the >> CMAKE_INSTALL_PREFIX >> >> I've experimented with different variations on the INSTALL lines to no >> success. >> >> Any advice on how to get my INSTALLS ending up in >> /home/jeremy/Projects/local/sbin and equivalent? >> >> Thanks >> >> -- >> Jeremy Ardley >> >> -- >> >> Powered by www.kitware.com >> >> Please keep messages on-topic and check the CMake FAQ at: >> http://www.cmake.org/Wiki/CMake_FAQ >> >> Kitware offers various services to support the CMake community. For more >> information on each offering, please visit: >> >> CMake Support: http://cmake.org/cmake/help/support.html >> CMake Consulting: http://cmake.org/cmake/help/consulting.html >> CMake Training Courses: http://cmake.org/cmake/help/training.html >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/cmake >> > > > > -- > Jeremy Ardley > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeremy.ardley at gmail.com Wed Sep 24 03:02:07 2014 From: jeremy.ardley at gmail.com (Jeremy Ardley) Date: Wed, 24 Sep 2014 15:02:07 +0800 Subject: [CMake] CMAKE_INSTALL_PREFIX problem In-Reply-To: References: <54225D6A.5090409@gmail.com> <54226874.3010506@gmail.com> Message-ID: <54226C6F.60008@gmail.com> Thanks for assistance. I forgot 'reply all'. Will be better next time :-) On 24/09/14 14:58, Petr Kmoch wrote: > I don't know why @ was inserted, but here's why it overrides the > absolute path: because it has no special meaning. The path then > becomes "@/sbin", which is not an absolute path (doesn't start with > '/'), so the install prefix is prepended normally. Bear in mind that > Unix directory and file names can contain any characters except '/' > and NUL. > > About variable substitution: > > ${var} is the normal way to expand variables. > > @var@ is primarily intended for use with configure_file(). I believe > it works during normal CMake runs as well, but don't use it like that, > it will only add confusion. > > Petr > > P.S. Please keep the list in copy when replying. > > On Wed, Sep 24, 2014 at 8:45 AM, Jeremy Ardley > > wrote: > > It was > > set (BUILD_BIN /sbin) > > Removing that fixed the problem. Thanks! > > Curious why my IDE inserted the '@' (kdevelop 3) And more so why > it overrides the absolute path? > > I need to discover more about value substitution :=( > > @somekey@ vs ${somekey} > > > On 24/09/14 14:39, Petr Kmoch wrote: >> Hi Jeremy. >> >> Does ${BUILD_BIN} perhaps start with a slash? If so, it would be >> interpreted as an absolute path, which of course ignores >> CMAKE_INSTALL_PREFIX. >> >> Petr >> >> On Wed, Sep 24, 2014 at 7:58 AM, Jeremy Ardley >> > wrote: >> >> I am using cmake 2.8.9 on debian wheezy. I'm fairly new to >> using cmake. >> >> My CMakelists.txt file starts with >> >> cmake_minimum_required(VERSION 2.6) >> SET(CMAKE_INSTALL_PREFIX /home/jeremy/Projects/local/) >> project(myproject) >> >> .... >> >> Finishing with >> >> INSTALL ( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/@APPLICATION_NAME@ DESTINATION @${BUILD_BIN} ) >> >> which installs in my target directory, but under a tree >> prefixed by the '@' character. i.e. >> /home/jeremy/Projects/local/@/sbin and equivalent. >> >> I'm guessing that this is a result of the fragment >> >> @${BUILD_BIN} >> >> The problem is that if I remove the '@' the INSTALL ignores >> the CMAKE_INSTALL_PREFIX >> >> I've experimented with different variations on the INSTALL >> lines to no success. >> >> Any advice on how to get my INSTALLS ending up in >> /home/jeremy/Projects/local/sbin and equivalent? >> >> Thanks >> >> -- >> Jeremy Ardley >> >> -- >> >> Powered by www.kitware.com >> >> Please keep messages on-topic and check the CMake FAQ at: >> http://www.cmake.org/Wiki/CMake_FAQ >> >> Kitware offers various services to support the CMake >> community. For more information on each offering, please visit: >> >> CMake Support: http://cmake.org/cmake/help/support.html >> CMake Consulting: http://cmake.org/cmake/help/consulting.html >> CMake Training Courses: http://cmake.org/cmake/help/training.html >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/cmake >> >> > > > -- > Jeremy Ardley > > -- Jeremy Ardley -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Wed Sep 24 03:17:33 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Wed, 24 Sep 2014 09:17:33 +0200 Subject: [CMake] CPack WIX examples In-Reply-To: <1411519233024-7588576.post@n2.nabble.com> References: <1411482858958-7588561.post@n2.nabble.com> <54218667.7040009@gmail.com> <1411519233024-7588576.post@n2.nabble.com> Message-ID: <5422700D.3090101@gmail.com> On 24.09.2014 02:40, jmerkow wrote: > It seems the best way to do this would be to override the template with a > number of configurable entries? > So I could add something like (there's about 15 of em): > Value='[INSTALL_ROOT]@home_path@' /> > > I wanted to check to see if there was a way to handle this directly from > CMake. > The elements will require a parent and that component needs to be referenced by an existing feature. I've used CPACK_WIX_PATCH_FILE (e.g. the fragment_injection example) to insert similar content into existing components. The patch file could also be configured by configure_file(). If you need this to be an independent I suppose you could use your own template, add the (and its childen) to the element and add a reference to it from within the existing element. Nils From glenn.coombs at gmail.com Wed Sep 24 03:27:05 2014 From: glenn.coombs at gmail.com (Glenn Coombs) Date: Wed, 24 Sep 2014 08:27:05 +0100 Subject: [CMake] How to get custom commands to build in parallel ? In-Reply-To: References: Message-ID: I am already using /MP and the equivalent to the /maxcpucount. It is the /MP one that is important in this context as I am only concerned with improving the speed of a single project out of the many in my solution. I believe the problem is with cmake rather than with Visual Studio as I can select any of the other projects in the same solution and build them in isolation and they will build their object files in parallel. For some reason cmake isn't seeing the custom commands as something it can run in parallel. -- Glenn On 23 September 2014 16:20, Robert Maynard wrote: > If you are using VS2013 you should look at the /maxcpucount flag which > allows msbuild to build multiple projects at the same time. You will > have to manually balance /MP and /maxcpucount as they cause a P*C > number of processes to execute. > > On Tue, Sep 23, 2014 at 11:05 AM, Glenn Coombs > wrote: > > I have the following code in one of my CMakeLists.txt files: > > > > set(feature_files_h) > > set(feature_files_cpp) > > > > macro(create_feature_files NAME) > > add_custom_command( > > OUTPUT ${FEATURES_OUTPUT_DIR}/${NAME}.cpp > > ${FEATURES_OUTPUT_DIR}/${NAME}.h > > DEPENDS ${FEATURES_INPUT_DIR}/${NAME}.txt > > WORKING_DIRECTORY ${SIM_ROOT}/tools/features > > COMMAND perl ${FEATURES_PERL_PATH} "-s${FEATURES_INPUT_DIR}" > > "-d${FEATURES_OUTPUT_DIR}" "-f${NAME}" > > ) > > list(APPEND feature_files_h ${FEATURES_OUTPUT_DIR}/${NAME}.h) > > list(APPEND feature_files_cpp ${FEATURES_OUTPUT_DIR}/${NAME}.cpp) > > endmacro() > > > > create_feature_files(example_features) > > create_feature_files(fme_core_features) > > create_feature_files(fme_features) > > create_feature_files(front_end_features) > > create_feature_files(inloop_filter_features) > > > > add_library(${PROJECT_NAME} STATIC ${feature_files_cpp} > ${feature_files_h} > > ${SIM_ROOT}/tools/features/cpp-code/cfeatures.cpp) > > > > which creates a library from an existing source file called cfeatures.cpp > > and from a bunch of auto-generated .cpp and .h files. The whole thing > works > > fine and runs the perl script to create each of the auto-generated files > > before creating the library. The only problem I have with it is that it > is > > quite slow and I would like to speed it up by having it run the perl > > commands to create the auto-generated files in parallel. Currently, > each of > > the auto-generated cpp files is generated sequentially, then they are all > > compiled in parallel and the library created in the final step. > > > > I'm using cmake 3.0.0 with Visual Studio 2013 Express Edition. And I've > > added the /MP option so that Visual Studio will do parallel builds. I've > > also set the "Projects and Solutions=>Build and Run=>maximum number of > > parallel project builds" option to 4. This works well with all the > normal > > cpp files in other projects and I easily see all 4 cpu cores maxxed out. > > But when building this project only 1 cpu core is used. > > > > Can anybody tell me how to change it so that the auto-geneated files are > > created in parallel as well ? > > > > -- > > Glenn > > > > > > -- > > > > Powered by www.kitware.com > > > > Please keep messages on-topic and check the CMake FAQ at: > > http://www.cmake.org/Wiki/CMake_FAQ > > > > Kitware offers various services to support the CMake community. For more > > information on each offering, please visit: > > > > CMake Support: http://cmake.org/cmake/help/support.html > > CMake Consulting: http://cmake.org/cmake/help/consulting.html > > CMake Training Courses: http://cmake.org/cmake/help/training.html > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/cmake > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cristian.adam at gmail.com Wed Sep 24 07:04:48 2014 From: cristian.adam at gmail.com (Cristian Adam) Date: Wed, 24 Sep 2014 11:04:48 +0000 (UTC) Subject: [CMake] Ninja generator fail for QNX on Windows References: <54204300.8090809@kitware.com> <54204F2F.3090109@kitware.com> <54217521.6000203@kitware.com> Message-ID: Hendrik Sattler writes: > On 23. September 2014 16:22:40 MESZ, Cristian Adam > >>> QCC compiler generates for this project dependency files which look > >like: > >>> > >>> c:\projects\my_proj\include\/a.h \ > >>> c:\projects\my_proj\src\/a.cpp \ > >>> c:\projects\my_proj\other\..\/include/b.h \ > >>> c:\projects\my_proj\other\..\/src/b.cpp \ > > To me it looks more like a bug in qcc. > Does qcc generates the same broken files when not used in context of > CMake or ninja? > > It should only use one kind of separator for directories. > > HS > It might be a bug in qcc. I've tried to compile CMake with ninja and here are a few dependency files: [c:\Projects\cmake-2.8.12.2-build\Source\kwsys\CMakeFiles\cmsys.dir\ Base64.c.o.d] Source\kwsys\CMakeFiles\cmsys.dir\Base64.c.o: \ C:\Projects\cmake-2.8.12.2\Source\kwsys\Base64.c \ C:\Projects\cmake-2.8.12.2\Source\kwsys\/kwsysPrivate.h \ Source/cmsys/Base64.h Source/cmsys/Configure.h [c:\Projects\cmake-2.8.12.2-build\Utilities\KWIML\test\CMakeFiles\ cmIML_test.dir\test_ABI_C.c.o.d] Utilities\KWIML\test\CMakeFiles\cmIML_test.dir\test_ABI_C.c.o: \ C:\Projects\cmake-2.8.12.2\Utilities\KWIML\test\test_ABI_C.c \ C:\Projects\cmake-2.8.12.2\Utilities\KWIML\test\/test.h \ Utilities/cmIML/ABI.h Utilities\KWIML\test/test_ABI_endian.h The following patch to ninja fixed my problem with the "\/" pair: diff -Naur ninja-master-orig/src/depfile_parser.in.cc ninja-master/src/depfile_parser.in.cc --- ninja-master-orig/src/depfile_parser.in.cc 2014-09-17 22:00:32.000000000 +0200 +++ ninja-master/src/depfile_parser.in.cc 2014-09-24 08:29:03.869714200 +0200 @@ -67,6 +67,11 @@ *out++ = '$'; continue; } + '\\/' { + // QCC case on Windows where in some cases "\/" were generated. + *out++ = '\\'; + continue; + } '\\' [^\000\r\n] { // Let backslash before other characters through verbatim. *out++ = '\\'; Everything is fine now! ^_^ Cheers, Cristian. From robert.maynard at kitware.com Wed Sep 24 09:43:01 2014 From: robert.maynard at kitware.com (Robert Maynard) Date: Wed, 24 Sep 2014 09:43:01 -0400 Subject: [CMake] How to get custom commands to build in parallel ? In-Reply-To: References: Message-ID: /MP flag is specifically for compiling object files in parallel so it won't cause multiple custom commands to be run in parallel as each one is a msbuild custom build item task. I don't know exactly how msbuild treats custom tasks such as these, but they might be implicitly serial. On Wed, Sep 24, 2014 at 3:27 AM, Glenn Coombs wrote: > I am already using /MP and the equivalent to the /maxcpucount. It is the > /MP one that is important in this context as I am only concerned with > improving the speed of a single project out of the many in my solution. I > believe the problem is with cmake rather than with Visual Studio as I can > select any of the other projects in the same solution and build them in > isolation and they will build their object files in parallel. For some > reason cmake isn't seeing the custom commands as something it can run in > parallel. > > -- > Glenn > > On 23 September 2014 16:20, Robert Maynard > wrote: >> >> If you are using VS2013 you should look at the /maxcpucount flag which >> allows msbuild to build multiple projects at the same time. You will >> have to manually balance /MP and /maxcpucount as they cause a P*C >> number of processes to execute. >> >> On Tue, Sep 23, 2014 at 11:05 AM, Glenn Coombs >> wrote: >> > I have the following code in one of my CMakeLists.txt files: >> > >> > set(feature_files_h) >> > set(feature_files_cpp) >> > >> > macro(create_feature_files NAME) >> > add_custom_command( >> > OUTPUT ${FEATURES_OUTPUT_DIR}/${NAME}.cpp >> > ${FEATURES_OUTPUT_DIR}/${NAME}.h >> > DEPENDS ${FEATURES_INPUT_DIR}/${NAME}.txt >> > WORKING_DIRECTORY ${SIM_ROOT}/tools/features >> > COMMAND perl ${FEATURES_PERL_PATH} "-s${FEATURES_INPUT_DIR}" >> > "-d${FEATURES_OUTPUT_DIR}" "-f${NAME}" >> > ) >> > list(APPEND feature_files_h ${FEATURES_OUTPUT_DIR}/${NAME}.h) >> > list(APPEND feature_files_cpp ${FEATURES_OUTPUT_DIR}/${NAME}.cpp) >> > endmacro() >> > >> > create_feature_files(example_features) >> > create_feature_files(fme_core_features) >> > create_feature_files(fme_features) >> > create_feature_files(front_end_features) >> > create_feature_files(inloop_filter_features) >> > >> > add_library(${PROJECT_NAME} STATIC ${feature_files_cpp} >> > ${feature_files_h} >> > ${SIM_ROOT}/tools/features/cpp-code/cfeatures.cpp) >> > >> > which creates a library from an existing source file called >> > cfeatures.cpp >> > and from a bunch of auto-generated .cpp and .h files. The whole thing >> > works >> > fine and runs the perl script to create each of the auto-generated files >> > before creating the library. The only problem I have with it is that it >> > is >> > quite slow and I would like to speed it up by having it run the perl >> > commands to create the auto-generated files in parallel. Currently, >> > each of >> > the auto-generated cpp files is generated sequentially, then they are >> > all >> > compiled in parallel and the library created in the final step. >> > >> > I'm using cmake 3.0.0 with Visual Studio 2013 Express Edition. And I've >> > added the /MP option so that Visual Studio will do parallel builds. >> > I've >> > also set the "Projects and Solutions=>Build and Run=>maximum number of >> > parallel project builds" option to 4. This works well with all the >> > normal >> > cpp files in other projects and I easily see all 4 cpu cores maxxed out. >> > But when building this project only 1 cpu core is used. >> > >> > Can anybody tell me how to change it so that the auto-geneated files are >> > created in parallel as well ? >> > >> > -- >> > Glenn >> > >> > >> > -- >> > >> > Powered by www.kitware.com >> > >> > Please keep messages on-topic and check the CMake FAQ at: >> > http://www.cmake.org/Wiki/CMake_FAQ >> > >> > Kitware offers various services to support the CMake community. For more >> > information on each offering, please visit: >> > >> > CMake Support: http://cmake.org/cmake/help/support.html >> > CMake Consulting: http://cmake.org/cmake/help/consulting.html >> > CMake Training Courses: http://cmake.org/cmake/help/training.html >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/cmake > > From hobbes1069 at gmail.com Wed Sep 24 09:57:47 2014 From: hobbes1069 at gmail.com (Richard Shaw) Date: Wed, 24 Sep 2014 08:57:47 -0500 Subject: [CMake] I broke get_preresiquites Message-ID: Ok, I have no idea what's going on. I'm using configure_file to put the get_preresiquites cmake script in the binary dir... It's running... It's not show any errors... It's also not finding any dependencies... I've double and triple checked that the variable I'm using in the message command is the same as what I'm using in get_preresiquites. But manually running objdump gives the correct output: $ objdump -p src/fldigi.exe | grep "DLL Name:" DLL Name: ADVAPI32.dll DLL Name: libfltk.dll DLL Name: libfltk_images.dll DLL Name: libgcc_s_sjlj-1.dll DLL Name: libintl-8.dll DLL Name: KERNEL32.dll DLL Name: msvcrt.dll DLL Name: libpng16-16.dll DLL Name: libportaudio-2.dll DLL Name: libwinpthread-1.dll DLL Name: libsamplerate-0.dll DLL Name: SHELL32.DLL DLL Name: libsndfile-1.dll DLL Name: libstdc++-6.dll DLL Name: USER32.dll DLL Name: WS2_32.dll DLL Name: WSOCK32.DLL Thanks, Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Wed Sep 24 11:48:16 2014 From: DLRdave at aol.com (David Cole) Date: Wed, 24 Sep 2014 11:48:16 -0400 Subject: [CMake] I broke get_preresiquites In-Reply-To: References: Message-ID: If you send some code, maybe somebody can spot something wrong with the code... On Wed, Sep 24, 2014 at 9:57 AM, Richard Shaw wrote: > Ok, I have no idea what's going on. > > I'm using configure_file to put the get_preresiquites cmake script in the > binary dir... > It's running... > It's not show any errors... > > It's also not finding any dependencies... > > I've double and triple checked that the variable I'm using in the message > command is the same as what I'm using in get_preresiquites. > > But manually running objdump gives the correct output: > > $ objdump -p src/fldigi.exe | grep "DLL Name:" > DLL Name: ADVAPI32.dll > DLL Name: libfltk.dll > DLL Name: libfltk_images.dll > DLL Name: libgcc_s_sjlj-1.dll > DLL Name: libintl-8.dll > DLL Name: KERNEL32.dll > DLL Name: msvcrt.dll > DLL Name: libpng16-16.dll > DLL Name: libportaudio-2.dll > DLL Name: libwinpthread-1.dll > DLL Name: libsamplerate-0.dll > DLL Name: SHELL32.DLL > DLL Name: libsndfile-1.dll > DLL Name: libstdc++-6.dll > DLL Name: USER32.dll > DLL Name: WS2_32.dll > DLL Name: WSOCK32.DLL > > Thanks, > Richard > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From simon.m.su.ctr at mail.mil Wed Sep 24 12:16:07 2014 From: simon.m.su.ctr at mail.mil (Su, Simon M CTR USARMY ARL (US)) Date: Wed, 24 Sep 2014 16:16:07 +0000 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) Message-ID: Classification: UNCLASSIFIED Caveats: NONE Hello, I am using https://github.com/rpavlik/cppdom/blob/master/CMakeLists.txt to generate sln file for cppdom to be compiled on windows x64. I ran cmake and compile form VS2013 (express) x64 Cross Tools Command Prompt. How can I change the CMakeLists.txt file so that it will automatically generate target machine of type x64 and not x86? Or is there like a flag that I can pass to cmake to have cmake generate sln files with x64 default target machine? Any help is much appreciated. Thanks -simon Classification: UNCLASSIFIED Caveats: NONE -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 9990 bytes Desc: not available URL: From jmerkow at gmail.com Wed Sep 24 15:26:05 2014 From: jmerkow at gmail.com (jmerkow) Date: Wed, 24 Sep 2014 12:26:05 -0700 (PDT) Subject: [CMake] CPack WIX examples In-Reply-To: <5422700D.3090101@gmail.com> References: <1411482858958-7588561.post@n2.nabble.com> <54218667.7040009@gmail.com> <1411519233024-7588576.post@n2.nabble.com> <5422700D.3090101@gmail.com> Message-ID: <1411586765646-7588591.post@n2.nabble.com> Ok I'm going the fragment injection route, but having some issues. So I found the component id for the target that these registry values will be needed by in files.wxs: In this case its 'CMP_ID_1', using the first cmp id seemed like a safe bet in general to have it referenced by a feature. So a configurable patch.xml.in looks something like: ... There are just a few in there to test the process. In CMake, i configure and add it the file to CPACK_WIX_PATCH_FILE: configure_file(${CMAKE_CURRENT_SOURCE_DIR}/windows/registry-patch.xml.in "${TEMP_DIR}/registry-patch.xml" @ONLY) set(CPACK_WIX_PATCH_FILE "${TEMP_DIR}/registry-patch.xml") Then I generate the msi using cpack. However the resulting msi doesn't set any registry entries, I also don't see any of the entries anywhere in the resulting xml. I did notice that in the documentations [1] and in your example your component id is more complex.. It looks to be something like (and I'm abusing cmake generator expressions for brevity) Id='CM_CP_ at cmake_component@. at TARGET_FILE_DIR:tgt at .@TARGET_FILE_DIR:tgt@'. I tried an Id of this nature as well (i.e. ) but this also did not work. Am I obtaining the id wrong? The documentation is a little confusing compared to whats being generated. so I'm not sure exactly sure if I have the proper id. Is there a way to get the Id from the in cmake to configure the file directly? Maybe there is another issue entirely? -Jameson [1] http://www.cmake.org/cmake/help/v3.0/module/CPackWIX.html?highlight=cpack_wix_patch [2] https://github.com/ngladitz/cmake-wix-testsuite/tree/master/fragment_injection -- View this message in context: http://cmake.3232098.n2.nabble.com/CPack-WIX-examples-tp7588561p7588591.html Sent from the CMake mailing list archive at Nabble.com. From nilsgladitz at gmail.com Wed Sep 24 16:07:40 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Wed, 24 Sep 2014 22:07:40 +0200 Subject: [CMake] CPack WIX examples In-Reply-To: <1411586765646-7588591.post@n2.nabble.com> References: <1411482858958-7588561.post@n2.nabble.com> <54218667.7040009@gmail.com> <1411519233024-7588576.post@n2.nabble.com> <5422700D.3090101@gmail.com> <1411586765646-7588591.post@n2.nabble.com> Message-ID: <5423248C.4000909@gmail.com> On 24.09.2014 21:26, jmerkow wrote: > Am I obtaining the id wrong? The documentation is a little confusing > compared to whats being generated. so I'm not sure exactly sure if I have > the proper id. Is there a way to get the Id from the in cmake to configure > the file directly? Maybe there is another issue entirely? After running CPack with the WIX generator you will have a "_CPack_Packages\\WIX" directory. Within are all the WIX sources and everything else used to build the installer. In "files.wxs" you can find all the component definitions and their IDs. Here you can also find your patch fragments (if they are being successfully applied). Using a non existent ID in a patch file should generate an error at CPack time. If you are currently successfully generating an installer with an invalid ID that might indicate that the patch file isn't being used at all. Is it possible that you are using an older CMake release or that you are setting CPACK_WIX_PATCH_FILE after or outside the context of your include(CPack)? CPack only sees the options that make it to CPackConfig.cmake which is generated by include(CPack). Nils From hobbes1069 at gmail.com Wed Sep 24 16:31:04 2014 From: hobbes1069 at gmail.com (Richard Shaw) Date: Wed, 24 Sep 2014 15:31:04 -0500 Subject: [CMake] I broke get_preresiquites In-Reply-To: References: Message-ID: I figured it out... I'm cross-compiling MinGW on Fedora linux and it just dawned on me that the cmake instance run by CPack probably isn't using the correct environment. I think it would be best if this was handled automatically but for the time being I pushed the required variables into the install script to make GetPreresiquites work correctly, at least for the most part. The function, get_preresiquites, has an option to exclude system libraries but it doesn't seem to be doing that for me right now. Thanks Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmerkow at gmail.com Wed Sep 24 17:20:16 2014 From: jmerkow at gmail.com (jmerkow) Date: Wed, 24 Sep 2014 14:20:16 -0700 (PDT) Subject: [CMake] CPack WIX examples In-Reply-To: <5423248C.4000909@gmail.com> References: <1411482858958-7588561.post@n2.nabble.com> <54218667.7040009@gmail.com> <1411519233024-7588576.post@n2.nabble.com> <5422700D.3090101@gmail.com> <1411586765646-7588591.post@n2.nabble.com> <5423248C.4000909@gmail.com> Message-ID: <1411593616783-7588594.post@n2.nabble.com> Ok, I've double checked everything and I'm not sure whats going on. I was looking in files.wxs (in _CPack_Packages/win64/WIX) for the component ID, and i've tried a few different ones. I also dropped the config file step and used your example patch.xml: Still nothing added when I search file.wxs for FOOBAR or anything else that should be added with the fragment injection. I am still curious as to why the component id's look so different between your tests and whats being generated in my file.wxs. That seems to leave the older version question.... Is this feature new with 3+? I am using CMake 2.8.12.2 -Jameson -- View this message in context: http://cmake.3232098.n2.nabble.com/CPack-WIX-examples-tp7588561p7588594.html Sent from the CMake mailing list archive at Nabble.com. From jmerkow at gmail.com Wed Sep 24 17:25:35 2014 From: jmerkow at gmail.com (jmerkow) Date: Wed, 24 Sep 2014 14:25:35 -0700 (PDT) Subject: [CMake] CPack WIX examples In-Reply-To: <1411593616783-7588594.post@n2.nabble.com> References: <1411482858958-7588561.post@n2.nabble.com> <54218667.7040009@gmail.com> <1411519233024-7588576.post@n2.nabble.com> <5422700D.3090101@gmail.com> <1411586765646-7588591.post@n2.nabble.com> <5423248C.4000909@gmail.com> <1411593616783-7588594.post@n2.nabble.com> Message-ID: <1411593935791-7588595.post@n2.nabble.com> I forgot to mention that I double checked that this particular code was being executed. I started changing the name (and adding a time stamp) to the msi in the same section of code to double check. Here is it is (its at send of my code for cpack): ... if(WIN32) if(MSVC) set(CPACK_GENERATOR "WIX") set(CPACK_WIX_PRODUCT_GUID "---") set(CPACK_WIX_UPGRADE_GUID "---") SET(CPACK_PACKAGE_FILE_NAME "myproj-${myproj_FULL_VERSION}-Win-x64_${TIMESTAMP}_NewTest") set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/patch.xml") endif() endif() include(CPack) -- View this message in context: http://cmake.3232098.n2.nabble.com/CPack-WIX-examples-tp7588561p7588595.html Sent from the CMake mailing list archive at Nabble.com. From nilsgladitz at gmail.com Wed Sep 24 17:39:36 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Wed, 24 Sep 2014 23:39:36 +0200 Subject: [CMake] CPack WIX examples In-Reply-To: <1411593616783-7588594.post@n2.nabble.com> References: <1411482858958-7588561.post@n2.nabble.com> <54218667.7040009@gmail.com> <1411519233024-7588576.post@n2.nabble.com> <5422700D.3090101@gmail.com> <1411586765646-7588591.post@n2.nabble.com> <5423248C.4000909@gmail.com> <1411593616783-7588594.post@n2.nabble.com> Message-ID: <54233A18.2000302@gmail.com> On 24.09.2014 23:20, jmerkow wrote: > Ok, I've double checked everything and I'm not sure whats going on. > > I was looking in files.wxs (in _CPack_Packages/win64/WIX) for the component > ID, and i've tried a few different ones. I also dropped the config file > step and used your example patch.xml: > > > > > > > Still nothing added when I search file.wxs for FOOBAR or anything else that > should be added with the fragment injection. I am still curious as to why > the component id's look so different between your tests and whats being > generated in my file.wxs. > > That seems to leave the older version question.... > Is this feature new with 3+? I am using CMake 2.8.12.2 Yes, 2.8.12 does not have CPACK_WIX_PATCH_FILE yet: http://www.cmake.org/cmake/help/v2.8.12/cmake.html#module:CPackWIX You would need 3.0: www.cmake.org/cmake/help/v3.0/module/CPackWIX.html The WIX generator is still relatively new and hasn't had as much time as the other generators to settle yet. I am still in progress of adding features as requests come in which means that many of the more recent additions will require a more current CMake version. Nils From nico.schloemer at gmail.com Wed Sep 24 19:09:42 2014 From: nico.schloemer at gmail.com (=?UTF-8?Q?Nico_Schl=C3=B6mer?=) Date: Thu, 25 Sep 2014 01:09:42 +0200 Subject: [CMake] @ONLY and nested variables Message-ID: Hi all, I would like to use CONFIGURE_PACKAGE_CONFIG_FILE() [1] instead of CONFIGURE_FILE() for my export configurations. Unfortunately, it seems that CONFIGURE_PACKAGE_CONFIG_FILE() only supports the @ONLY syntax. I do use nested variables names in the export configuration, though, e.g., ``` SET(${PACKAGE}_LIBS ${${PACKAGE}_LIBRARIES}) ``` Any idea how to translate this line into @ONLY syntax? Any other ideas? Cheers, Nico [1] http://www.cmake.org/cmake/help/v3.0/module/CMakePackageConfigHelpers.html From jzakrzewski at e2e.ch Thu Sep 25 03:34:24 2014 From: jzakrzewski at e2e.ch (Jakub Zakrzewski) Date: Thu, 25 Sep 2014 07:34:24 +0000 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) In-Reply-To: References: Message-ID: > to generate sln file for cppdom to be compiled on windows x64. I ran cmake and compile form VS2013 (express) x64 > Cross Tools Command Prompt. How can I change the CMakeLists.txt file so that it will automatically generate target > machine of type x64 and not x86? Or is there like a flag that I can pass to cmake to have cmake generate sln files > with x64 default target machine? Don't the Visual Studio XX Win64 generators do that? From simon.m.su.ctr at mail.mil Thu Sep 25 09:55:56 2014 From: simon.m.su.ctr at mail.mil (Su, Simon M CTR USARMY ARL (US)) Date: Thu, 25 Sep 2014 13:55:56 +0000 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) In-Reply-To: References: Message-ID: Classification: UNCLASSIFIED Caveats: NONE I thought so too. What I did in the past was to load the sln file generated in the IDE GUI and manually added x64 projects by copying from the x86 project. I was hoping to get the x64 projects also generated automatically that now I have lost access to the GUI - the network I am attached to is blocking the registration traffic for some reason and vs2013 Express is not allowing me to run the IDE after the trial period. I can only compile from msbuild command line now. And since I have been using ninja generator to compile ParaView, I just tried it with ninja generator and it is creating a x64 project/library using the same CMakeLists.txt file. Not sure why it is doing x64 project for ninja generator and not VS2013Express generator. Thoughts? Thanks -simon -----Original Message----- From: Jakub Zakrzewski [mailto:jzakrzewski at e2e.ch] Sent: Thursday, September 25, 2014 3:34 AM To: Su, Simon M CTR USARMY ARL (US) Cc: cmake at cmake.org Subject: RE: cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) > to generate sln file for cppdom to be compiled on windows x64. I ran > cmake and compile form VS2013 (express) x64 Cross Tools Command > Prompt. How can I change the CMakeLists.txt file so that it will > automatically generate target machine of type x64 and not x86? Or is there > like a flag that I can pass to cmake to have cmake generate sln files > with > x64 default target machine? Don't the Visual Studio XX Win64 generators do that? Classification: UNCLASSIFIED Caveats: NONE -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 9990 bytes Desc: not available URL: From jmerkow at gmail.com Thu Sep 25 11:34:05 2014 From: jmerkow at gmail.com (jmerkow) Date: Thu, 25 Sep 2014 08:34:05 -0700 (PDT) Subject: [CMake] CPack WIX examples In-Reply-To: <54233A18.2000302@gmail.com> References: <1411482858958-7588561.post@n2.nabble.com> <54218667.7040009@gmail.com> <1411519233024-7588576.post@n2.nabble.com> <5422700D.3090101@gmail.com> <1411586765646-7588591.post@n2.nabble.com> <5423248C.4000909@gmail.com> <1411593616783-7588594.post@n2.nabble.com> <54233A18.2000302@gmail.com> Message-ID: <1411659245633-7588600.post@n2.nabble.com> Thanks a lot this worked! Are there any plans to add the functionality for adding registry entries into the WIX xml directly? Looking at the source code, it looks like it would be somewhat painless. If no one is already working on this, I'll work on contributing the code myself, in the near future. -Jameson -- View this message in context: http://cmake.3232098.n2.nabble.com/CPack-WIX-examples-tp7588561p7588600.html Sent from the CMake mailing list archive at Nabble.com. From jmerkow at gmail.com Thu Sep 25 11:36:18 2014 From: jmerkow at gmail.com (jmerkow) Date: Thu, 25 Sep 2014 08:36:18 -0700 (PDT) Subject: [CMake] CPack DragNDrop, adding an additional file to DMG Message-ID: <1411659378507-7588601.post@n2.nabble.com> Using CPack is it possible to add an additional file to the DMG? Many DMGs accompany their bundles with readme's or other files. I haven't found anything in the documentation to accomplish this. -Jameson -- View this message in context: http://cmake.3232098.n2.nabble.com/CPack-DragNDrop-adding-an-additional-file-to-DMG-tp7588601.html Sent from the CMake mailing list archive at Nabble.com. From tom.kacvinsky at vectorcast.com Thu Sep 25 11:37:31 2014 From: tom.kacvinsky at vectorcast.com (Tom Kacvinsky) Date: Thu, 25 Sep 2014 11:37:31 -0400 Subject: [CMake] Forcing order of link libraries Message-ID: Hi, Is there any way of forcing cmake to use the order of libraries I specify instead of the order cmake calculates? Thanks, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Thu Sep 25 11:49:37 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Thu, 25 Sep 2014 17:49:37 +0200 Subject: [CMake] CPack WIX examples In-Reply-To: <1411659245633-7588600.post@n2.nabble.com> References: <1411482858958-7588561.post@n2.nabble.com> <54218667.7040009@gmail.com> <1411519233024-7588576.post@n2.nabble.com> <5422700D.3090101@gmail.com> <1411586765646-7588591.post@n2.nabble.com> <5423248C.4000909@gmail.com> <1411593616783-7588594.post@n2.nabble.com> <54233A18.2000302@gmail.com> <1411659245633-7588600.post@n2.nabble.com> Message-ID: <54243991.5020300@gmail.com> On 2014-09-25 17:34, jmerkow wrote: > Thanks a lot this worked! Are there any plans to add the functionality for > adding registry entries into the WIX xml directly? Looking at the source > code, it looks like it would be somewhat painless. If no one is already > working on this, I'll work on contributing the code myself, in the near > future. I was planning on extending the patch mechanism for the Product element following up on a request that was part of a different issue: http://public.kitware.com/Bug/view.php?id=15165#c36863 Which I think would also match this use case? Unless you were thinking about adding these somewhere else or in an entirely different way? Nils From clinton at elemtech.com Thu Sep 25 11:57:28 2014 From: clinton at elemtech.com (Clinton Stimpson) Date: Thu, 25 Sep 2014 09:57:28 -0600 Subject: [CMake] CPack DragNDrop, adding an additional file to DMG In-Reply-To: <1411659378507-7588601.post@n2.nabble.com> References: <1411659378507-7588601.post@n2.nabble.com> Message-ID: <1888839.ouEV63zTkR@stryke> On Thursday, September 25, 2014 08:36:18 AM jmerkow wrote: > Using CPack is it possible to add an additional file to the DMG? Many DMGs > accompany their bundles with readme's or other files. I haven't found > anything in the documentation to accomplish this. > > -Jameson Have you tried this? install(FILES readme.txt DESTINATION ".") -Clint From jmerkow at gmail.com Thu Sep 25 13:19:23 2014 From: jmerkow at gmail.com (jmerkow) Date: Thu, 25 Sep 2014 10:19:23 -0700 (PDT) Subject: [CMake] CPack DragNDrop, adding an additional file to DMG In-Reply-To: <1888839.ouEV63zTkR@stryke> References: <1411659378507-7588601.post@n2.nabble.com> <1888839.ouEV63zTkR@stryke> Message-ID: <1411665563133-7588605.post@n2.nabble.com> Yes. Im actually using the Bundle generator. We don't use bundle when compiling. We only use bundles to launch for the binaries. DESTINATION "." points to Contents/Resources/ in this case. -Jameson -- View this message in context: http://cmake.3232098.n2.nabble.com/CPack-DragNDrop-adding-an-additional-file-to-DMG-tp7588601p7588605.html Sent from the CMake mailing list archive at Nabble.com. From clinton at elemtech.com Thu Sep 25 13:45:48 2014 From: clinton at elemtech.com (Clinton Stimpson) Date: Thu, 25 Sep 2014 11:45:48 -0600 Subject: [CMake] CPack DragNDrop, adding an additional file to DMG In-Reply-To: <1411665563133-7588605.post@n2.nabble.com> References: <1411659378507-7588601.post@n2.nabble.com> <1888839.ouEV63zTkR@stryke> <1411665563133-7588605.post@n2.nabble.com> Message-ID: <1430405.2GdAzKZCyP@stryke> On Thursday, September 25, 2014 10:19:23 AM jmerkow wrote: > Yes. > > Im actually using the Bundle generator. We don't use bundle when compiling. > We only use bundles to launch for the binaries. DESTINATION "." points to > Contents/Resources/ in this case. > > -Jameson > Sorry, the Bundle generator doesn't let you do that. This is one of the reasons we have the DragNDrop generator, so you should use that instead. To do that, you'll also need to change your application to be a bundle in the build directory. You can also use variables for the DESTINATION parameter in your install() commands. Clint From Dominique.Ledit at PDGM.com Thu Sep 25 12:55:55 2014 From: Dominique.Ledit at PDGM.com (Dominique Ledit) Date: Thu, 25 Sep 2014 16:55:55 +0000 Subject: [CMake] Using the "Visual Studio 10 Win64" CMake generator of CMake 2.8.12.2, is there a way to get .vcxproj including the TrackFileAccess property set to false. Message-ID: <31e29a82bc4340bfa948fc31a0959e17@DM2PR0701MB1344.namprd07.prod.outlook.com> Hi I use CMake 2.8.12.2 and the "Visual Studio 10 Win64" generator to generate the solution/projects I use to build my application. My Windows development platform is a Win 7 machine with Visual Studio 10 installed on it. I'm currently trying to address an issue that makes many .dll/.exe being linked on Windows platform, using msbuild, even if they should not do. I've read a lot of articles and done a lot of tests on small projects and it seems that, using msbuild, the dependencies are managed by the build system itself through the use of Tracker.exe that parses the link command lines to retrieve the dependencies. 1. The library dependencies in the VS solution generated by CMake are correct. At least they are consistent with what Microsoft thinks is the right way to build a product on their platform. The .dll/.exe depend on the .lib (import lib) of their direct dependencies. 2. In debug builds I perform incremental links. This means that the build of a library doesn't necessary result in a change of the .lib: Assuming there were no changes in the symbol table (no changes in the library API) the .lib is left unchanged. So, typically, as far as we don't change the API (.h) the .dll is changed but the .lib is left unchanged. So theoretically a change that doesn't affect the API will result in the library being rebuilt, but the .lib is left unchanged, and the products that depend on this library (through the .lib) are not re-built. This is close to the behavior on Linux, where there is no dependencies between .so, but the builds are triggered if the API changes because basically some .h changed, which triggers some .o builds in the dependent libraries, hence the libs rebuild. 3. So basically everything looks consistent and neat. Now here is the issue as far as I understand: whenever a library has to rebuild because one of the .lib it depends on changed, the incremental link is disabled, a full link is performed and, as a consequence, the .lib (import lib) is changed, even if there is no reason for it to change (the API has not changed). And then all the libraries that depend on it are rebuilt, with incremental link disabled, which cascades again and results in all the dependent libs (direct and indirect) rebuilding. The trick I've found is to disable the tracker, by setting the TrackFileAccess property to "false" (I add false) in each .vcxproj generated at configuration time. Of course this has to be done after each CMake configure. So my question is: is there a way to make the "Visual Studio 10 Win64" generator set this property to false, in all .vcxproj at generation time? Thank you very much Dominique ------------------- This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwebb at compunetix.com Thu Sep 25 16:14:45 2014 From: jwebb at compunetix.com (Jon Webb) Date: Thu, 25 Sep 2014 20:14:45 +0000 Subject: [CMake] Compiling Firebreak plugin on OSX Message-ID: I'm having a heck of a time compiling a Firebreath plugin using OSX 10.8. (Firebreath uses CMake). I installed Xcode 5.1 and the command-line tools, and ran xcode-select to set the Xcode path. I also installed Qt 4.8.2 (which Firebreath uses) and CMake, of course. When I run prepmac.sh I get an error that CMAKE_C_COMPILER and CMAKE_CXX_COMPILER are not found. I also found this error in the CMakeError log: In file included from /Volumes/osPresenter/PresenterPlugin/CtxPresenterPlugin/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:2: /Library/Frameworks/QtCore.framework/Headers/qglobal.h:328:6: warning: "This version of Mac OS X is unsupported" [-W#warnings] # warning "This version of Mac OS X is unsupported" ^ /Volumes/osPresenter/PresenterPlugin/CtxPresenterPlugin/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:8:19: error: use of undeclared identifier 'Q_WS_QWS' return ((int*)(&Q_WS_QWS))[argc]; ^ 1 warning and 1 error generated. It looks to me like CMake is trying to verify whether symbol processing works in the way it expects and this fails. Clearly I'm missing some important step. Can anyone point out to me what it might be? -------------- next part -------------- An HTML attachment was scrubbed... URL: From scott.bloom at onshorecs.com Thu Sep 25 16:54:37 2014 From: scott.bloom at onshorecs.com (Scott Aron Bloom) Date: Thu, 25 Sep 2014 20:54:37 +0000 Subject: [CMake] Problem (questions) with OSX Package/BUNDLE install Message-ID: <6FD2E165340D9A429CF831C7A2D4F42E4E385ED0@WIN-R92V03RFJ85.onshorecs.local> Im using a package installation, and its working fine.. Except 1 minor issue. When the user installs an updated version, it doesn't uninstall the previous version. Im not an OSX expert by any means, is it possible to have in uninstall the previous version? Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: From yue.nicholas at gmail.com Thu Sep 25 17:40:28 2014 From: yue.nicholas at gmail.com (Nicholas Yue) Date: Thu, 25 Sep 2014 14:40:28 -0700 Subject: [CMake] ExternalProject_Add with custom build/make command for Boost Message-ID: Hi, I am trying to build Boost (1.47.0) using CMake's ExternalProject_Add() I got it to build and install via it's bjam "./b2 install" However, there is an implicit "make install" generated by CMake which will fail because there is no Makefile so to speak with an install target. ExternalProject_Add() has many configuration parameter and I am wondering if there is one which I can use to tell it not to attempt to "make install" Cheers -- Nicholas Yue Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5 Custom Dev - C++ porting, OSX, Linux, Windows http://au.linkedin.com/in/nicholasyue https://vimeo.com/channels/naiadtools -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Thu Sep 25 20:03:40 2014 From: DLRdave at aol.com (David Cole) Date: Thu, 25 Sep 2014 20:03:40 -0400 Subject: [CMake] ExternalProject_Add with custom build/make command for Boost In-Reply-To: References: Message-ID: INSTALL_COMMAND "" should work. (Assuming you're doing "./b2 install" as the BUILD_COMMAND...?) Check out how the open chemistry project builds boost as an ExternalProject as a reference point: https://github.com/OpenChemistry/openchemistry/blob/master/cmake/External_boost.cmake HTH, David C. On Thu, Sep 25, 2014 at 5:40 PM, Nicholas Yue wrote: > Hi, > > I am trying to build Boost (1.47.0) using CMake's ExternalProject_Add() > > I got it to build and install via it's bjam "./b2 install" > > However, there is an implicit "make install" generated by CMake which will > fail because there is no Makefile so to speak with an install target. > > ExternalProject_Add() has many configuration parameter and I am wondering > if there is one which I can use to tell it not to attempt to "make install" > > Cheers > -- > Nicholas Yue > Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5 > Custom Dev - C++ porting, OSX, Linux, Windows > http://au.linkedin.com/in/nicholasyue > https://vimeo.com/channels/naiadtools > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From simon.m.su.ctr at mail.mil Fri Sep 26 10:28:59 2014 From: simon.m.su.ctr at mail.mil (Su, Simon M CTR USARMY ARL (US)) Date: Fri, 26 Sep 2014 14:28:59 +0000 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) In-Reply-To: References: Message-ID: Classification: UNCLASSIFIED Caveats: NONE For some reason, when running cmake in VS2013 (express) x64 Cross Tools Command Prompt is not picking up the Visual Studio 12 2013 Win64 generator by default for this project. But when I added -G "Visual Studio 12 2013 Win64" To cmake, it generated x64 project files and I am able to generate 64bit library from command line with msbuild command. Thanks -simon -----Original Message----- From: Jakub Zakrzewski [mailto:jzakrzewski at e2e.ch] Sent: Thursday, September 25, 2014 3:34 AM To: Su, Simon M CTR USARMY ARL (US) Cc: cmake at cmake.org Subject: RE: cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) > to generate sln file for cppdom to be compiled on windows x64. I ran > cmake and compile form VS2013 (express) x64 Cross Tools Command > Prompt. How can I change the CMakeLists.txt file so that it will > automatically generate target machine of type x64 and not x86? Or is there > like a flag that I can pass to cmake to have cmake generate sln files > with > x64 default target machine? Don't the Visual Studio XX Win64 generators do that? Classification: UNCLASSIFIED Caveats: NONE -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 9990 bytes Desc: not available URL: From nilsgladitz at gmail.com Fri Sep 26 10:41:25 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Fri, 26 Sep 2014 16:41:25 +0200 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) In-Reply-To: References: Message-ID: <54257B15.1000107@gmail.com> On 09/26/2014 04:28 PM, Su, Simon M CTR USARMY ARL (US) wrote: > Classification: UNCLASSIFIED > Caveats: NONE > > For some reason, when running cmake in VS2013 (express) x64 Cross Tools > Command Prompt is not picking up the Visual Studio 12 2013 Win64 generator by > default for this project. But when I added > > -G "Visual Studio 12 2013 Win64" > > To cmake, it generated x64 project files and I am able to generate 64bit > library from command line with msbuild command. CMake defaults to the newest known and available visual studio generator. The current visual studio command line environment is neither required for the visual studio generators nor does it influence which generator CMake picks. The environment matters when you are using one of the makefile or ninja generators though since CMake will then use it to locate the compilers. Nils From simon.m.su.ctr at mail.mil Fri Sep 26 10:59:05 2014 From: simon.m.su.ctr at mail.mil (Su, Simon M CTR USARMY ARL (US)) Date: Fri, 26 Sep 2014 14:59:05 +0000 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) In-Reply-To: <54257B15.1000107@gmail.com> References: <54257B15.1000107@gmail.com> Message-ID: Classification: UNCLASSIFIED Caveats: NONE Thanks Nils. I will double check my environment. -simon -----Original Message----- From: Nils Gladitz [mailto:nilsgladitz at gmail.com] Sent: Friday, September 26, 2014 10:41 AM To: Su, Simon M CTR USARMY ARL (US); Jakub Zakrzewski Cc: cmake at cmake.org Subject: Re: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) On 09/26/2014 04:28 PM, Su, Simon M CTR USARMY ARL (US) wrote: > Classification: UNCLASSIFIED > Caveats: NONE > > For some reason, when running cmake in VS2013 (express) x64 Cross > Tools Command Prompt is not picking up the Visual Studio 12 2013 Win64 > generator by default for this project. But when I added > > -G "Visual Studio 12 2013 Win64" > > To cmake, it generated x64 project files and I am able to generate > 64bit library from command line with msbuild command. CMake defaults to the newest known and available visual studio generator. The current visual studio command line environment is neither required for the visual studio generators nor does it influence which generator CMake picks. The environment matters when you are using one of the makefile or ninja generators though since CMake will then use it to locate the compilers. Nils Classification: UNCLASSIFIED Caveats: NONE -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 9990 bytes Desc: not available URL: From ewmailing at gmail.com Sat Sep 27 00:57:03 2014 From: ewmailing at gmail.com (Eric Wing) Date: Fri, 26 Sep 2014 21:57:03 -0700 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) In-Reply-To: References: Message-ID: On 9/26/14, Su, Simon M CTR USARMY ARL (US) wrote: > Classification: UNCLASSIFIED > Caveats: NONE > > For some reason, when running cmake in VS2013 (express) x64 Cross Tools > Command Prompt is not picking up the Visual Studio 12 2013 Win64 generator > by > default for this project. But when I added > > -G "Visual Studio 12 2013 Win64" > > To cmake, it generated x64 project files and I am able to generate 64bit > library from command line with msbuild command. > > Thanks > -simon > In my experience, CMake always generates the 32-bit version by default (and the generator doesn't let you switch in the project). I consider this extremely annoying. I only have 1 Visual Studio version installed so it can't be picking up other versions. > -G "Visual Studio 12 2013 Win64" I always have to use that switch. Aside from picking 64-bit by default or getting a project generator that correctly allows switching within the project, I wish there was a way I could just request 64-bit with a command line switch independently of the Visual Studio version. In the case where I am working with people with different versions of Visual Studio and we share build scripts, I have no easy way of controlling 64-bit without knowing exactly which Visual Studio version is installed. Thanks, Eric -- Beginning iPhone Games Development http://playcontrol.net/iphonegamebook/ From bscmake at outlook.com Sun Sep 28 10:31:32 2014 From: bscmake at outlook.com (Benjamin Staubli) Date: Sun, 28 Sep 2014 16:31:32 +0200 Subject: [CMake] error using find_package Message-ID: Hello everyone, I encountered some problems when I tried to setup a CUDA project in CMake. My first line of code in the CMakeLists.txt file is find_package(CUDA). when I run the CMake with this file, I get the following error in the command line: CMake Error at /Applications/CMake.app/Contents/share/cmake-3.0/Modules/FindCUDA.cmake:605 (if): if given arguments: "CUDA_VERSION" "VERSION_GREATER" "5.0" "AND" "CMAKE_CROSSCOMPILING" "AND" "MATCHES" "arm" "AND" "EXISTS" "/usr/local/cuda/targets/armv7-linux-gnueabihf" Unknown arguments specified Call Stack (most recent call first): CMakeLists.txt:5 (find_package) -- Configuring incomplete, errors occurred! At the location "/usr/local/cuda" are aliases the folders of my cuda installation. The folder targets is not present there. I running OSX Mavericks on a MacBook Pro mid 2009 with the latest cuda driver and toolkit. I am guessing that one of the arguments passed in line 605 of the find cuda files is not set prior to this line. But I don't know which one. Help is appreciated! Best, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Sun Sep 28 10:48:21 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Sun, 28 Sep 2014 16:48:21 +0200 Subject: [CMake] error using find_package In-Reply-To: References: Message-ID: <54281FB5.8030002@gmail.com> On 09/28/2014 04:31 PM, Benjamin Staubli wrote: > Hello everyone, > > I encountered some problems when I tried to setup a CUDA project in > CMake. > > My first line of code in the CMakeLists.txt file is find_package(CUDA). That may be the problem if you do have an explicit project() call it has to come before find_package(). project() runs compiler detection and queries compiler information which is used by the module. Nils -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruslan_baratov at yahoo.com Mon Sep 29 06:41:10 2014 From: ruslan_baratov at yahoo.com (Ruslan Baratov) Date: Mon, 29 Sep 2014 14:41:10 +0400 Subject: [CMake] @ONLY and nested variables In-Reply-To: References: Message-ID: <54293746.5000405@yahoo.com> You can run configure_package_config_file twice with code: SET(@PACKAGE at _LIBS @@PACKAGE at _LIBRARIES@) Also you can use configure_file command to create one file and include it with config file that was made by configure_package_config_file: # CMakeLists.txt configure_file(FooVars.cmake.in FooVars.cmake) configure_package_config_file(FooConfig.cmake.in FooConfig.cmake ...) install(FILES FooVars.cmake FooConfig.cmake ...) # FooConfig.cmake.in include(relative/path/to/FooVars.cmake) On 25-Sep-14 03:09, Nico Schl?mer wrote: > Hi all, > > I would like to use CONFIGURE_PACKAGE_CONFIG_FILE() [1] instead of > CONFIGURE_FILE() for my export configurations. Unfortunately, it seems > that CONFIGURE_PACKAGE_CONFIG_FILE() only supports the @ONLY syntax. I > do use nested variables names in the export configuration, though, > e.g., > ``` > SET(${PACKAGE}_LIBS ${${PACKAGE}_LIBRARIES}) > ``` > Any idea how to translate this line into @ONLY syntax? Any other ideas? > > Cheers, > Nico > > > [1] http://www.cmake.org/cmake/help/v3.0/module/CMakePackageConfigHelpers.html From simon.m.su.ctr at mail.mil Mon Sep 29 09:46:01 2014 From: simon.m.su.ctr at mail.mil (Su, Simon M CTR USARMY ARL (US)) Date: Mon, 29 Sep 2014 13:46:01 +0000 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) In-Reply-To: References: Message-ID: Classification: UNCLASSIFIED Caveats: NONE Thanks for sharing. I guess I originally wanted to ask if there is a switch to cmake that will allow picking 64-bit by default if 64-bit version is available. My understanding is that (for VS2013 Express), if you run things from a VS2013 x64 Cross Tools Command Prompt, you will get environment setup for doing all things 64-bit and you will get "Visual Studio 12 2013 Win64" as default generator when you run cmake from that command prompt. And if you run from within "Developer Command Prompt for VS2013" command prompt, you will get all the 32-bit environment setup and get "Visual Studio 12 2013" as default generator. However, for CMakeLists.txt in the openmpi-1.4.4 project, it is not picking up "Visual Studio 12 2013 Win64" generator by default even if you run cmake from a VS2013 x64 Cross Tools Command Prompt. Most of my other cmakefied projects will pick "Visual Studio 12 2013 Win64" as default generator when ran from within VS2013 x64 Cross Tools Command Prompt. But if I have to specifically include the switch -G "Visual Studio 12 2013 Win64" to get the 64-bit project, I am also ok with it. Thanks -simon -----Original Message----- From: Eric Wing [mailto:ewmailing at gmail.com] Sent: Saturday, September 27, 2014 12:57 AM To: Su, Simon M CTR USARMY ARL (US) Cc: Jakub Zakrzewski; cmake at cmake.org Subject: Re: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) On 9/26/14, Su, Simon M CTR USARMY ARL (US) wrote: > Classification: UNCLASSIFIED > Caveats: NONE > > For some reason, when running cmake in VS2013 (express) x64 Cross > Tools Command Prompt is not picking up the Visual Studio 12 2013 Win64 > generator by default for this project. But when I added > > -G "Visual Studio 12 2013 Win64" > > To cmake, it generated x64 project files and I am able to generate > 64bit library from command line with msbuild command. > > Thanks > -simon > In my experience, CMake always generates the 32-bit version by default (and the generator doesn't let you switch in the project). I consider this extremely annoying. I only have 1 Visual Studio version installed so it can't be picking up other versions. > -G "Visual Studio 12 2013 Win64" I always have to use that switch. Aside from picking 64-bit by default or getting a project generator that correctly allows switching within the project, I wish there was a way I could just request 64-bit with a command line switch independently of the Visual Studio version. In the case where I am working with people with different versions of Visual Studio and we share build scripts, I have no easy way of controlling 64-bit without knowing exactly which Visual Studio version is installed. Thanks, Eric -- Beginning iPhone Games Development http://playcontrol.net/iphonegamebook/ Classification: UNCLASSIFIED Caveats: NONE -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 9990 bytes Desc: not available URL: From nilsgladitz at gmail.com Mon Sep 29 09:54:11 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Mon, 29 Sep 2014 15:54:11 +0200 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) In-Reply-To: References: Message-ID: <54296483.1000003@gmail.com> On 09/29/2014 03:46 PM, Su, Simon M CTR USARMY ARL (US) wrote: > Classification: UNCLASSIFIED > Caveats: NONE > > Thanks for sharing. I guess I originally wanted to ask if there is a switch > to cmake that will allow picking 64-bit by default if 64-bit version is > available. > > My understanding is that (for VS2013 Express), if you run things from a > VS2013 x64 Cross Tools Command Prompt, you will get environment setup for > doing all things 64-bit and you will get "Visual Studio 12 2013 Win64" as > default generator when you run cmake from that command prompt. And if you > run from within "Developer Command Prompt for VS2013" command prompt, you > will get all the 32-bit environment setup and get "Visual Studio 12 2013" as > default generator. Like I tried to explain this is not the case. The command line environment doesn't have any effect on which generator CMake will pick. When you run CMake from a plain "cmd" or a "Visual Studio 8 2005" command prompt you will still end up with the "Visual Studio 12 2013" generator by default (assuming 2013 is the newest available and known visual studio installation). Nils From simon.m.su.ctr at mail.mil Mon Sep 29 10:02:34 2014 From: simon.m.su.ctr at mail.mil (Su, Simon M CTR USARMY ARL (US)) Date: Mon, 29 Sep 2014 14:02:34 +0000 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) In-Reply-To: <54296483.1000003@gmail.com> References: <54296483.1000003@gmail.com> Message-ID: Classification: UNCLASSIFIED Caveats: NONE You are right Nils. I just tried cmake vtk projects with VS2013 x64 Cross Tools Command Prompt and it is not picking the "Visual Studio 12 2013 Win64" generator. But why some of them do? Actually out of 10 cmake projects I build, 8 of them actually picked "Visual Studio 12 2013 Win64" generator by default. Or have I just been lucky so far. I guess using the switch -G "Visual Studio 12 2013 Win64" won't hurt. Thanks -simon -----Original Message----- From: Nils Gladitz [mailto:nilsgladitz at gmail.com] Sent: Monday, September 29, 2014 9:54 AM To: Su, Simon M CTR USARMY ARL (US); Eric Wing Cc: cmake at cmake.org Subject: Re: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) On 09/29/2014 03:46 PM, Su, Simon M CTR USARMY ARL (US) wrote: > Classification: UNCLASSIFIED > Caveats: NONE > > Thanks for sharing. I guess I originally wanted to ask if there is a > switch to cmake that will allow picking 64-bit by default if 64-bit > version is available. > > My understanding is that (for VS2013 Express), if you run things from > a > VS2013 x64 Cross Tools Command Prompt, you will get environment setup > for doing all things 64-bit and you will get "Visual Studio 12 2013 > Win64" as default generator when you run cmake from that command > prompt. And if you run from within "Developer Command Prompt for > VS2013" command prompt, you will get all the 32-bit environment setup > and get "Visual Studio 12 2013" as default generator. Like I tried to explain this is not the case. The command line environment doesn't have any effect on which generator CMake will pick. When you run CMake from a plain "cmd" or a "Visual Studio 8 2005" command prompt you will still end up with the "Visual Studio 12 2013" generator by default (assuming 2013 is the newest available and known visual studio installation). Nils Classification: UNCLASSIFIED Caveats: NONE -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 9990 bytes Desc: not available URL: From nilsgladitz at gmail.com Mon Sep 29 10:10:19 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Mon, 29 Sep 2014 16:10:19 +0200 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) In-Reply-To: References: <54296483.1000003@gmail.com> Message-ID: <5429684B.7020802@gmail.com> On 09/29/2014 04:02 PM, Su, Simon M CTR USARMY ARL (US) wrote: > Classification: UNCLASSIFIED > Caveats: NONE > > You are right Nils. I just tried cmake vtk projects with VS2013 x64 Cross > Tools Command Prompt and it is not picking the "Visual Studio 12 2013 > Win64" generator. But why some of them do? Actually out of 10 cmake projects > I build, 8 of them actually picked "Visual Studio 12 2013 Win64" generator > by default. Or have I just been lucky so far. I guess using the switch -G > "Visual Studio 12 2013 Win64" won't hurt. The only thing I can think of is that you either are looking at build directories which are already configured (you can not change the generator of an existing build directory and rerunning cmake without -G will not change the generator currently in use) or You aren't invoking CMake yourself and whatever invokes CMake is picking the generator for you (might also be the case when you've got CMake invoking another CMake instance e.g. in context of an ExternalProject). Nils From simon.m.su.ctr at mail.mil Mon Sep 29 10:19:44 2014 From: simon.m.su.ctr at mail.mil (Su, Simon M CTR USARMY ARL (US)) Date: Mon, 29 Sep 2014 14:19:44 +0000 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) In-Reply-To: <5429684B.7020802@gmail.com> References: <54296483.1000003@gmail.com> <5429684B.7020802@gmail.com> Message-ID: Classification: UNCLASSIFIED Caveats: NONE Thanks -simon -----Original Message----- From: Nils Gladitz [mailto:nilsgladitz at gmail.com] Sent: Monday, September 29, 2014 10:10 AM To: Su, Simon M CTR USARMY ARL (US); Eric Wing Cc: cmake at cmake.org Subject: Re: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) On 09/29/2014 04:02 PM, Su, Simon M CTR USARMY ARL (US) wrote: > Classification: UNCLASSIFIED > Caveats: NONE > > You are right Nils. I just tried cmake vtk projects with VS2013 x64 > Cross Tools Command Prompt and it is not picking the "Visual Studio > 12 2013 Win64" generator. But why some of them do? Actually out of 10 > cmake projects I build, 8 of them actually picked "Visual Studio 12 > 2013 Win64" generator by default. Or have I just been lucky so far. I > guess using the switch -G "Visual Studio 12 2013 Win64" won't hurt. The only thing I can think of is that you either are looking at build directories which are already configured (you can not change the generator of an existing build directory and rerunning cmake without -G will not change the generator currently in use) or You aren't invoking CMake yourself and whatever invokes CMake is picking the generator for you (might also be the case when you've got CMake invoking another CMake instance e.g. in context of an ExternalProject). Nils Classification: UNCLASSIFIED Caveats: NONE -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 9990 bytes Desc: not available URL: From DLRdave at aol.com Mon Sep 29 10:22:38 2014 From: DLRdave at aol.com (David Cole) Date: Mon, 29 Sep 2014 10:22:38 -0400 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) In-Reply-To: <5429684B.7020802@gmail.com> References: <54296483.1000003@gmail.com> <5429684B.7020802@gmail.com> Message-ID: Also, the default in cmake-gui is to prompt the user with "the same generator you used last time" as the default value for 2nd and subsequent runs of cmake-gui on any given machine by a given user... So if you choose Win64 once in cmake-gui, and you always use cmake-gui... you'll get it as the default combo-box choice for any new build trees after that. On Mon, Sep 29, 2014 at 10:10 AM, Nils Gladitz wrote: > On 09/29/2014 04:02 PM, Su, Simon M CTR USARMY ARL (US) wrote: >> >> Classification: UNCLASSIFIED >> Caveats: NONE >> >> You are right Nils. I just tried cmake vtk projects with VS2013 x64 Cross >> Tools Command Prompt and it is not picking the "Visual Studio 12 2013 >> Win64" generator. But why some of them do? Actually out of 10 cmake >> projects >> I build, 8 of them actually picked "Visual Studio 12 2013 Win64" generator >> by default. Or have I just been lucky so far. I guess using the switch -G >> "Visual Studio 12 2013 Win64" won't hurt. > > > The only thing I can think of is that you either are looking at build > directories which are already configured (you can not change the generator > of an existing build directory and rerunning cmake without -G will not > change the generator currently in use) > > or > > You aren't invoking CMake yourself and whatever invokes CMake is picking the > generator for you (might also be the case when you've got CMake invoking > another CMake instance e.g. in context of an ExternalProject). > > > Nils > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake From d3ck0r at gmail.com Mon Sep 29 10:43:03 2014 From: d3ck0r at gmail.com (J Decker) Date: Mon, 29 Sep 2014 07:43:03 -0700 Subject: [CMake] cmake 3.0.0 generating VS sln file default target machine type x86 (UNCLASSIFIED) In-Reply-To: References: <54296483.1000003@gmail.com> <5429684B.7020802@gmail.com> Message-ID: automatic selection 1) use a batch file and test things like %PROCESSOR_ARCHITECTURE% and generate a cmake -g "" 2) write a cmake script that does the test. and runs an appropraite cmake command specifying the generator instead of using msbuild, you can use 'cmake --build . --config Debug --target INSTALL -- /m:4 /v:m' (for instance) while I find it annoying that VS tests come from the registry, and therefore are always available, pre-empting that you have gcc in the path and not devenv... it has to default to something. -------------- next part -------------- An HTML attachment was scrubbed... URL: From iss at nesono.com Mon Sep 29 10:43:04 2014 From: iss at nesono.com (Jochen Issing) Date: Mon, 29 Sep 2014 16:43:04 +0200 Subject: [CMake] EFFECTIVE_PLATFORM_NAME for iOS not in $ Message-ID: <1068AADF-EA42-4750-A135-820FE35419D6@nesono.com> Hi all, I am currently working on a project for iOS and run into a problem when linking/running custom commands. My setup is xcode 5.1.1 with cmake 2.8.12.2 (but I also tried with xcode 6 and cmake 3.0.1 - same issue). On iOS the EFFECTIVE_PLATFORM_NAME happens to be appended to the target path (i.e. it?s not called Debug but Debug-iphonesimulator). However, the generator $ does NOT seem to append the EFFECTIVE_PLATFORM_NAME. I patched it locally (by using a hard coded variable), but it seems brittle and hackish to have it solved like that. Is there something I am missing? Thanks, jochen -------------- next part -------------- An HTML attachment was scrubbed... URL: From nico.schloemer at gmail.com Mon Sep 29 11:16:37 2014 From: nico.schloemer at gmail.com (=?UTF-8?Q?Nico_Schl=C3=B6mer?=) Date: Mon, 29 Sep 2014 17:16:37 +0200 Subject: [CMake] @ONLY and nested variables In-Reply-To: <54293746.5000405@yahoo.com> References: <54293746.5000405@yahoo.com> Message-ID: All good suggestions; thanks! ?Nico On Mon, Sep 29, 2014 at 12:41 PM, Ruslan Baratov wrote: > You can run configure_package_config_file twice with code: > > SET(@PACKAGE at _LIBS @@PACKAGE at _LIBRARIES@) > > Also you can use configure_file command to create one file and include it > with config file that was made by configure_package_config_file: > > # CMakeLists.txt > configure_file(FooVars.cmake.in FooVars.cmake) > configure_package_config_file(FooConfig.cmake.in FooConfig.cmake ...) > > install(FILES FooVars.cmake FooConfig.cmake ...) > > # FooConfig.cmake.in > include(relative/path/to/FooVars.cmake) > > > > On 25-Sep-14 03:09, Nico Schl?mer wrote: >> >> Hi all, >> >> I would like to use CONFIGURE_PACKAGE_CONFIG_FILE() [1] instead of >> CONFIGURE_FILE() for my export configurations. Unfortunately, it seems >> that CONFIGURE_PACKAGE_CONFIG_FILE() only supports the @ONLY syntax. I >> do use nested variables names in the export configuration, though, >> e.g., >> ``` >> SET(${PACKAGE}_LIBS ${${PACKAGE}_LIBRARIES}) >> ``` >> Any idea how to translate this line into @ONLY syntax? Any other ideas? >> >> Cheers, >> Nico >> >> >> [1] >> http://www.cmake.org/cmake/help/v3.0/module/CMakePackageConfigHelpers.html > > From gahanse at sandia.gov Mon Sep 29 13:24:42 2014 From: gahanse at sandia.gov (Hansen, Glen A) Date: Mon, 29 Sep 2014 17:24:42 +0000 Subject: [CMake] CMake 3.0.1 missing CMakeLists.txt error Message-ID: Dear List: I recently upgraded to CMake 3.0.1, and I am now getting the error: CMake Error at packages/stratimikos/CMakeLists.txt:15 (ADD_SUBDIRECTORY): The source directory /lore/ghansen/nightly/repos/publicTrilinos/packages/stratimikos/doc does not contain a CMakeLists.txt file. This used to be a warning in earlier versions of CMake. Does anyone know of a way to turn it back to a warning instead of an error? Thanks, Glen Hansen -------------- next part -------------- An HTML attachment was scrubbed... URL: From gr at componic.co.nz Mon Sep 29 17:28:43 2014 From: gr at componic.co.nz (Glenn Ramsey) Date: Tue, 30 Sep 2014 10:28:43 +1300 Subject: [CMake] How to install the command line tools on OSX with 3.0.2 Message-ID: <5429CF0B.8000807@componic.co.nz> Hi, With CMake 3.0.2 on OSX when I try to install the command line tools I get the following message: "Failed create symlink installation may be incomplete: /usr/bin/" With the 2.8.* versions I was able to workaround this by manually deleting the symlinks in /usr/bin as recommended here: http://public.kitware.com/Bug/print_bug_page.php?bug_id=10056 However that doesn't seem to work now, even if I run CMake.app as root. Aside from manually creating the symlinks is there a workaround for this? Glenn From sean at rogue-research.com Mon Sep 29 18:20:28 2014 From: sean at rogue-research.com (Sean McBride) Date: Mon, 29 Sep 2014 18:20:28 -0400 Subject: [CMake] How to install the command line tools on OSX with 3.0.2 In-Reply-To: <5429CF0B.8000807@componic.co.nz> References: <5429CF0B.8000807@componic.co.nz> Message-ID: <20140929222028.60280619@mail.rogue-research.com> On Tue, 30 Sep 2014 10:28:43 +1300, Glenn Ramsey said: >With CMake 3.0.2 on OSX when I try to install the command line tools I get the >following message: > >"Failed create symlink installation may be incomplete: /usr/bin/" > >With the 2.8.* versions I was able to workaround this by manually deleting the >symlinks in /usr/bin as recommended here: > >http://public.kitware.com/Bug/print_bug_page.php?bug_id=10056 > >However that doesn't seem to work now, even if I run CMake.app as root. > >Aside from manually creating the symlinks is there a workaround for this? Now that CMake 3 finally excludes its version from its filename, I suggest you just add /Applications/CMake.app/Contents/bin to you $PATH. Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From object.rexx at gmail.com Mon Sep 29 19:36:31 2014 From: object.rexx at gmail.com (Rick McGuire) Date: Mon, 29 Sep 2014 19:36:31 -0400 Subject: [CMake] Dealing with .def and .rc files needed on Windows. Message-ID: We have a project that gets built on a variety of platforms, but it mostly boils down to "windows" and "not windows". For our libraries to build on Windows, we need to also specify a .def and a .rc file in the library source files list. We have a strategy for adding these in using an extra platform specific variable that's working fine. However, cmake seems to be so good at sorting out differences like this that I was wondering if I might be missing an easier strategy of dealing with these extra requirements. I tried adding those files to the list unconditionally in the hope that cmake would figure out that these files were a Windows-only thing and ignore them, but that didn't really work. Is there some easier way to do this? What we have is working well, but I'm always looking for ways to reduce the number of conditional tests we require in the build script. Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From d3ck0r at gmail.com Tue Sep 30 03:02:50 2014 From: d3ck0r at gmail.com (J Decker) Date: Tue, 30 Sep 2014 00:02:50 -0700 Subject: [CMake] Issues setting CMAKE_VS_PLATFORM_TOOLSET Message-ID: I was recently trying to package some apps I was building, but ran into an issue that they weren't compatible on XP. ... I was setting CMAKE_VS_PLATFORM_TOOLSET on the base SDK but that wasn't being relayed to subsequent projects... so I fixed that, and the toolset still isn't being set. This is a clip from "cmake --trace ...." I added a message() to log what the toolset was set to in cmakedeterminecompilerid.cmake... Even though it's set earlier to v110_xp, when it uses the value later it is only 'v110' I don't understand where it is getting reset... in the '....cut....' section there are no references to that variable... I'm using a nightly build 3.0.20140924-g8abd5 from about a week ago ----------------------------------- Running with trace output on. /General/Build/sack/debug_out/core/CMakePackage(7): message(SET CMAKE_VS_PLATFORM_TOOLSET ) SET CMAKE_VS_PLATFORM_TOOLSET /General/Build/sack/debug_out/core/CMakePackage(8): set(CMAKE_VS_PLATFORM_TOOLSET v110_xp ) /General/Build/sack/debug_out/core/CMakePackage(9): add_definitions(-wd4996 ) /General/Build/sack/debug_out/core/CMakePackage(11): enable_language(C ) .... cut.... c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(142): set(id_platform ${CMAKE_VS_PLATFORM_NAME} ) c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(143): set(id_lang ${lang} ) c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(144): set(id_cl cl.exe ) c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(145): if(CMAKE_VS_PLATFORM_NAME STREQUAL Tegra-Android ) c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(155): elseif(lang STREQUAL Fortran ) c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(159): elseif(NOT ${vs_version} VERSION_LESS 10 ) c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(160): set(v 10 ) c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(161): set(ext vcxproj ) c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(170): if(${id_platform} STREQUAL Itanium ) c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(173): message(CMAKE_VS_PLATFORM_TOOLSET ${CMAKE_VS_PLATFORM_TOOLSET} ) CMAKE_VS_PLATFORM_TOOLSET v110 c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(174): if(CMAKE_VS_PLATFORM_TOOLSET ) c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(175): if(CMAKE_VS_PLATFORM_NAME STREQUAL Tegra-Android ) c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(177): else() c:/tools/unix/cmake/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake(178): set(id_toolset ${CMAKE_VS_PLATFORM_TOOLSET} ) -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Tue Sep 30 03:15:44 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Tue, 30 Sep 2014 09:15:44 +0200 Subject: [CMake] Issues setting CMAKE_VS_PLATFORM_TOOLSET In-Reply-To: References: Message-ID: <542A58A0.3010906@gmail.com> On 09/30/2014 09:02 AM, J Decker wrote: > I was recently trying to package some apps I was building, but ran into > an issue that they weren't compatible on XP. ... I was setting > CMAKE_VS_PLATFORM_TOOLSET on the base SDK but that wasn't being relayed > to subsequent projects... so I fixed that, and the toolset still isn't > being set. To set the platform toolset try -T from the cmake command line. From what I can tell CMAKE_VS_PLATFORM_TOOLSET isn't meant to be set by the user but should reflect what you set with -T. Nils From d3ck0r at gmail.com Tue Sep 30 03:29:26 2014 From: d3ck0r at gmail.com (J Decker) Date: Tue, 30 Sep 2014 00:29:26 -0700 Subject: [CMake] Issues setting CMAKE_VS_PLATFORM_TOOLSET In-Reply-To: <542A58A0.3010906@gmail.com> References: <542A58A0.3010906@gmail.com> Message-ID: On Tue, Sep 30, 2014 at 12:15 AM, Nils Gladitz wrote: > On 09/30/2014 09:02 AM, J Decker wrote: > >> I was recently trying to package some apps I was building, but ran into >> an issue that they weren't compatible on XP. ... I was setting >> CMAKE_VS_PLATFORM_TOOLSET on the base SDK but that wasn't being relayed >> to subsequent projects... so I fixed that, and the toolset still isn't >> being set. >> > > To set the platform toolset try -T from the cmake command line. > > From what I can tell CMAKE_VS_PLATFORM_TOOLSET isn't meant to be set by > the user but should reflect what you set with -T. > > okay... -T works; that complicates the chained-build though.... would be nice if I can just pick up and use the variable that was used for core projects. *shrug* > Nils > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de Tue Sep 30 03:58:04 2014 From: Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de (Mueller-Roemer, Johannes Sebastian) Date: Tue, 30 Sep 2014 07:58:04 +0000 Subject: [CMake] INTERFACE_LINK_LIBRARIES and CMP0028 Message-ID: <8D981219EEA621479C112DA9BDC39A8E2584CD61@EXMBS1.ad.igd.fraunhofer.de> The behavior of the transitive INTERFACE_LINK_LIBRARIES combined with CMP0028 seems very broken to me. For libraries using a module (such as ZLIB), I can simply do a find_package in one of my libraries' CMakeLists.txt and link to it in a different CMakeLists.txt without issues. If I do the same with libraries using configs and IMPORTED targets (such as Qt5), I cannot have my find_package at the place of use but am forced to move it to the root CMakeLists.txt as I otherwise get CMP0028 warnings. Is this actually intended behavior? Am I doing something wrong? Shouldn't INTERFACE_LINK_LIBRARIES just include the actual libraries (and INTERFACE_INCLUDE_DIRECTORIES the actual include directories) when linking to an imported target. These extra dependencies between CMakeLists.txt are very ugly :/ -- Johannes S. Mueller-Roemer, MSc Wiss. Mitarbeiter - Interactive Engineering Technologies (IET) Fraunhofer-Institut f?r Graphische Datenverarbeitung IGD Fraunhoferstr. 5 | 64283 Darmstadt | Germany Tel +49 6151 155-606 | Fax +49 6151 155-139 johannes.mueller-roemer at igd.fraunhofer.de | www.igd.fraunhofer.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From nilsgladitz at gmail.com Tue Sep 30 04:21:35 2014 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Tue, 30 Sep 2014 10:21:35 +0200 Subject: [CMake] INTERFACE_LINK_LIBRARIES and CMP0028 In-Reply-To: <8D981219EEA621479C112DA9BDC39A8E2584CD61@EXMBS1.ad.igd.fraunhofer.de> References: <8D981219EEA621479C112DA9BDC39A8E2584CD61@EXMBS1.ad.igd.fraunhofer.de> Message-ID: <542A680F.4020308@gmail.com> On 09/30/2014 09:58 AM, Mueller-Roemer, Johannes Sebastian wrote: > The behavior of the transitive INTERFACE_LINK_LIBRARIES combined with > CMP0028 seems very broken to me. For libraries using a module (such as > ZLIB), I can simply do a find_package in one of my libraries? > CMakeLists.txt and link to it in a different CMakeLists.txt without > issues. If I do the same with libraries using configs and IMPORTED > targets (such as Qt5), I cannot have my find_package at the place of use > but am forced to move it to the root CMakeLists.txt as I otherwise get > CMP0028 warnings. Is this actually intended behavior? Am I doing > something wrong? Shouldn?t INTERFACE_LINK_LIBRARIES just include the > actual libraries (and INTERFACE_INCLUDE_DIRECTORIES the actual include > directories) when linking to an imported target. These extra > dependencies between CMakeLists.txt are very ugly :/ If I understand correctly then this was fixed here: http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a272344228174958a8b2346793d3272eb432dad8 Which should be in 3.1 when it is released. Nils From norman-k-williams at uiowa.edu Tue Sep 30 10:14:15 2014 From: norman-k-williams at uiowa.edu (Williams, Norman K) Date: Tue, 30 Sep 2014 14:14:15 +0000 Subject: [CMake] find_package issues with ITK and VTK (and SlicerExecution Model) Message-ID: This is a problem that has been cropping up in our projects that use ITK, VTK and SlicerExecutionModel. You won?t see it UNLESS you turn on the ITKVTK/ITKVtkGlue modules. The problem is this: if you find packages in this order: find_package(VTK REQUIRED) find_package(ITK REQUIRED) You can?t real compile anything that needs VTK, because down in the ITK deployment stuff, it calls find_package(VTK) like this: find_package(VTK COMPONENTS vtkCommonCore vtkRenderingCore vtkRenderingOpenGL vtkRenderingFreeType vtkInteractionStyle vtkIOImage vtkImagingSources REQUIRED) Which blows away the larger list of include directories and libraries that the first find_package(VTK REQUIRED) built. Even better ? or worse ? Modules/Segmentation/LevelSetsv4Visualization/CMakeLists.txt also include find_package(VTK) ? so ITK tries to import VTK twice, with different module lists. It doesn?t even help to reverse the order: find_package(ITK REQUIRED) find_package(VTK REQUIRED) because apparently there?s some hangover from the find_package(VTK) inside the ITK CMake deployment files. The only thing that works is to use COMPONENTS, i.e. find_package(ITK REQUIRED) find_package(VTK COMPONENTS vtkCommonCore vtkRenderingAnnotation ? REQUIRED) Which seems to trigger a proper re-scan and build of the library/include lists. It gets even worse if you use find_package(SlicerExecutionModel) after find_package(ITK), for the same reason ? SlicerExecutionModel depends on ITK, so it clobbers the include/library lists from the first find_package(ITK). ________________________________ Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. ________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Sep 30 10:23:36 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 30 Sep 2014 10:23:36 -0400 Subject: [CMake] [ITK-dev] find_package issues with ITK and VTK (and SlicerExecution Model) In-Reply-To: References: Message-ID: Here is what I do for the WikiExamples remote module: find_package(VTK REQUIRED) include(${VTK_USE_FILE}) set(VTK_COMPONENTS ${VTK_LIBRARIES}) find_package(ITK REQUIRED) include(${ITK_USE_FILE}) set(ITK_LIBRARIES ${ITK_LIBRARIES} ${VTK_COMPONENTS}) On Tue, Sep 30, 2014 at 10:14 AM, Williams, Norman K wrote: > This is a problem that has been cropping up in our projects that use ITK, > VTK and SlicerExecutionModel. > > You won?t see it UNLESS you turn on the ITKVTK/ITKVtkGlue modules. > > The problem is this: if you find packages in this order: > > find_package(VTK REQUIRED) > find_package(ITK REQUIRED) > > You can?t real compile anything that needs VTK, because down in the ITK > deployment stuff, it calls find_package(VTK) like this: > find_package(VTK COMPONENTS > vtkCommonCore > vtkRenderingCore > vtkRenderingOpenGL > vtkRenderingFreeType > vtkInteractionStyle > vtkIOImage > vtkImagingSources > REQUIRED) > > Which blows away the larger list of include directories and libraries that > the first find_package(VTK REQUIRED) built. > > Even better ? or worse ? > Modules/Segmentation/LevelSetsv4Visualization/CMakeLists.txt also include > find_package(VTK) ? so ITK tries to import VTK twice, with different module > lists. > > It doesn?t even help to reverse the order: > find_package(ITK REQUIRED) > find_package(VTK REQUIRED) > > because apparently there?s some hangover from the find_package(VTK) inside > the ITK CMake deployment files. The only thing that works is to use > COMPONENTS, i.e. > > find_package(ITK REQUIRED) > find_package(VTK COMPONENTS vtkCommonCore vtkRenderingAnnotation ? REQUIRED) > > Which seems to trigger a proper re-scan and build of the library/include > lists. > > It gets even worse if you use find_package(SlicerExecutionModel) after > find_package(ITK), for the same reason ? SlicerExecutionModel depends on > ITK, so it clobbers the include/library lists from the first > find_package(ITK). > > > > > ________________________________ > Notice: This UI Health Care e-mail (including attachments) is covered by the > Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential > and may be legally privileged. If you are not the intended recipient, you > are hereby notified that any retention, dissemination, distribution, or > copying of this communication is strictly prohibited. Please reply to the > sender that you have received the message in error, then delete it. Thank > you. > ________________________________ > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers > -- Unpaid intern in BillsBasement at noware dot com From brad.king at kitware.com Tue Sep 30 10:48:47 2014 From: brad.king at kitware.com (Brad King) Date: Tue, 30 Sep 2014 10:48:47 -0400 Subject: [CMake] [ITK-dev] find_package issues with ITK and VTK (and SlicerExecution Model) In-Reply-To: References: Message-ID: <542AC2CF.7030008@kitware.com> On 09/30/2014 10:14 AM, Williams, Norman K wrote: > find_package(VTK REQUIRED) > find_package(ITK REQUIRED) > > You can?t real compile anything that needs VTK, because down in > the ITK deployment stuff, it calls find_package(VTK) like this: [snip] > Which blows away the larger list of include directories and libraries One may use the itk_module_config and vtk_module_config macros from the *ModuleAPI.cmake modules that come with the respective packages to compute the list of libraries and include dirs for a given list of components. All ITKConfig and VTKConfig do with the list of components is: itk_module_config(ITK ${ITK_MODULES_REQUESTED}) # sets ITK_LIBRARIES, ITK_INCLUDE_DIRS, etc. and vtk_module_config(VTK ${VTK_MODULES_REQUESTED}) # sets VTK_LIBRARIES, VTK_INCLUDE_DIRS, etc. One can invoke these directly: itk_module_config(ITK ${MY_LIST_OF_ITK_COMPONENTS}) vtk_module_config(VTK ${MY_LIST_OF_VTK_COMPONENTS}) at any time after the find_package calls. One could even use a different prefix: itk_module_config(MyITK ${MY_LIST_OF_ITK_COMPONENTS}) # sets MyITK_LIBRARIES, MyITK_INCLUDE_DIRS, etc. In the long run the plan is to stop recommending use of component lists at find_package time and instead use imported targets and usage requirements: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html#build-specification-and-usage-requirements but that will have to wait until we can require CMake 3.0. -Brad From blowekamp at mail.nih.gov Tue Sep 30 11:13:22 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Tue, 30 Sep 2014 11:13:22 -0400 Subject: [CMake] [ITK-dev] find_package issues with ITK and VTK (and SlicerExecution Model) In-Reply-To: <542AC2CF.7030008@kitware.com> References: <542AC2CF.7030008@kitware.com> Message-ID: Brad, Do you have a suggestion on how to conditionally include a module if it's available? e.g. Use ITKDeprecated if ITK was configure with it? Thanks, Brad On Sep 30, 2014, at 10:48 AM, Brad King wrote: > On 09/30/2014 10:14 AM, Williams, Norman K wrote: >> find_package(VTK REQUIRED) >> find_package(ITK REQUIRED) >> >> You can?t real compile anything that needs VTK, because down in >> the ITK deployment stuff, it calls find_package(VTK) like this: > [snip] >> Which blows away the larger list of include directories and libraries > > One may use the itk_module_config and vtk_module_config macros > from the *ModuleAPI.cmake modules that come with the respective > packages to compute the list of libraries and include dirs for > a given list of components. All ITKConfig and VTKConfig do with > the list of components is: > > itk_module_config(ITK ${ITK_MODULES_REQUESTED}) > # sets ITK_LIBRARIES, ITK_INCLUDE_DIRS, etc. > > and > > vtk_module_config(VTK ${VTK_MODULES_REQUESTED}) > # sets VTK_LIBRARIES, VTK_INCLUDE_DIRS, etc. > > One can invoke these directly: > > itk_module_config(ITK ${MY_LIST_OF_ITK_COMPONENTS}) > vtk_module_config(VTK ${MY_LIST_OF_VTK_COMPONENTS}) > > at any time after the find_package calls. One could even use > a different prefix: > > itk_module_config(MyITK ${MY_LIST_OF_ITK_COMPONENTS}) > # sets MyITK_LIBRARIES, MyITK_INCLUDE_DIRS, etc. > > In the long run the plan is to stop recommending use of component > lists at find_package time and instead use imported targets and > usage requirements: > > http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html#build-specification-and-usage-requirements > > but that will have to wait until we can require CMake 3.0. > > -Brad > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers From brad.king at kitware.com Tue Sep 30 11:22:57 2014 From: brad.king at kitware.com (Brad King) Date: Tue, 30 Sep 2014 11:22:57 -0400 Subject: [CMake] [ITK-dev] find_package issues with ITK and VTK (and SlicerExecution Model) In-Reply-To: References: <542AC2CF.7030008@kitware.com> Message-ID: <542ACAD1.2040805@kitware.com> On 09/30/2014 11:13 AM, Bradley Lowekamp wrote: > Do you have a suggestion on how to conditionally include a > module if it's available? e.g. Use ITKDeprecated if ITK was > configure with it? find_package(ITK REQUIRED) set(MY_ITK_COMPONENTS ...) # list required mods here if(";${ITK_MODULES_ENABLED};" MATCHES ";ITKDeprecated;") list(APPEND MY_ITK_COMPONENTS ITKDeprecated) endif() itk_module_config(ITK ${MY_ITK_COMPONENTS}) I think the if() line could also be written if(TARGET ITKDeprecated) but I don't remember off the top of my head whether the library names and module names always match exactly. -Brad From nico.schloemer at gmail.com Tue Sep 30 18:26:40 2014 From: nico.schloemer at gmail.com (=?UTF-8?Q?Nico_Schl=C3=B6mer?=) Date: Wed, 1 Oct 2014 00:26:40 +0200 Subject: [CMake] GNUInstallDir for CMake export files Message-ID: Hi all, into which of the directories listed in [1] are the CMake export files (*Config.cmake, *Target.cmake,...) supposed to go? Cheers, Nico [1] http://www.cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html