Re: [cmake-developers] Support for imported targets in CMAKE_REQUIRED_LIBRARIES
On Friday 20 January 2012, Brad King wrote: On 1/19/2012 11:49 AM, Alexander Neundorf wrote: On Thursday 19 January 2012, Brad King wrote: I think a full solution to this will end up duplicating a lot of the logic that CMake already has in its C++ code for link dependency analysis. I wonder if instead you could modify the signature of try_compile to accept the LINK_LIBRARIES as a formal argument. Then teach the C++ code to resolve the imported targets and take care of the link interfaces. I'll have a look at that too. What things exactly do you have in mind additionally ? Rather than jumping to an implementation of my proposal let's think through the interface. The src-file signature of try_compile is currently: try_compile(RESULT_VAR bindir srcfile [CMAKE_FLAGS flags...] [COMPILE_DEFINITIONS flags...] [OUTPUT_VARIABLE var] [COPY_FILE fileName]) The CMakeLists.txt it generates includes the line TARGET_LINK_LIBRARIES(cmTryCompileExec ${LINK_LIBRARIES}) so right now one uses the CMAKE_FLAGS option to pass -DLINK_LIBRARIES=... to specify link libraries. The try_compile command has no chance to recognize which options are libraries. Instead, let's add a LINK_LIBRARIES option to try_compile: try_compile(RESULT_VAR bindir srcfile ... [LINK_LIBRARIES libs...] ...) Then the implementation of the command can evaluate the libs... arguments in a context where imported targets are known. Loop over each library. For those that this-Makefile-FindTargetToUse() returns a target, verify that it is IMPORTED, and then call target-GetLinkInformation(config), where config is the try-compile's configuration. The return value of that will be a cmComputeLinkInformation object from which you can query the link line. I'm getting there. To get the link line I moved code from cmLocalGenerator::OutputLinkLibraries() into a separate function GetLinkLine(cmTarget, cmComputeLinkInformation). But before I get there I get a segfault: #0 0x0821f1d7 in std::vectorstd::basic_stringchar, std::char_traitschar, std::allocatorchar , std::allocatorstd::basic_stringchar, std::char_traitschar, std::allocatorchar ::begin() const () #1 0x0827f733 in cmTarget::ComputeLinkClosure(char const*, cmTarget::LinkClosure) () #2 0x0827f594 in cmTarget::GetLinkClosure(char const*) () #3 0x0827f44a in cmTarget::GetLinkerLanguage(char const*) () #4 0x0832a29a in cmComputeLinkInformation::cmComputeLinkInformation(cmTarget*, char const*) () #5 0x08286f1b in cmTarget::GetLinkInformation(char const*) () #6 0x082bf5ab in cmCoreTryCompile::CreateProject(std::basic_stringchar, std::char_traitschar Still figuring out what's going wrong there... It crashes in cmTarget::ComputeLinkClosure() because mTarget::GetLinkImplementation() returns 0 for imported targets. It probably should not get there at all, since calling GetLinkerLanguage() always leads to that path. Well, enough for today... Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [CMake] execute a script before and after configuration
2012/1/21 David Cole david.c...@kitware.com: On Friday, January 20, 2012, Michael Hertling mhertl...@online.de wrote: On 01/20/2012 01:57 PM, Dominik Szczerba wrote: Hi, I am building a big software framework on a cray system whereby during cmake configuration phase I need to unload certain system modules (so that some small test programs are allowed to run without scheduler) and afterwards, before the actual build phase starts, I need to load them back. Doing it manually is troublesome, because sometimes typing make triggers cmake to re-run, and then re-build, so there is no chance to load/unload the modules. So, how would I force one script to run when cmake is started and one other script before build starts? Many thanks for any directions. Dominik You might use an EXECUTE_PROCESS() command at the beginning of your CMakeLists.txt to unload the modules, and another EXECUTE_PROCESS() at the end to reload them. Regards, Michael -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake Doesn't the module switching involve setting environment variables? You're going to have to do that before invoking CMake aren't you? As far as I remember (not used cray modules for ages) yes, there are env var modification. There is (at least) one similar tool not dedicated to Cray machine, which works the same way. http://modules.sourceforge.net/ Usually the main goal is to be able to install several version of softwares on the very same machine which is shared by many users and then offer each user a way to select the version of each installed tool. May be Dominik can explain this so that some small test programs are allowed to run without scheduler a little more? Does it mean you have to unload some module in order to run without using PBS (http://en.wikipedia.org/wiki/Portable_Batch_System) or something similar? Does this impact try_run or can't you use something like execute_process(module unload whatever testme this ) normally inside the exexcute_process you don't need module load again because the executed process has been forked. This should be verified though. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] execute a script before and after configuration
You might use an EXECUTE_PROCESS() command at the beginning of your CMakeLists.txt to unload the modules, and another EXECUTE_PROCESS() at the end to reload them. Will try, thanks for the hint! Doesn't the module switching involve setting environment variables? You're going to have to do that before invoking CMake aren't you? No, it means calling something like module un/load from command line. May be Dominik can explain this so that some small test programs are allowed to run without scheduler a little more? Simplest example, suppose I need to compute epsilon and save it in myconfig.h. To this end I need to run a small program and I use TRY_RUN for that. But by default you are not allowed to run any programs on the login node, all compiled execs must go through a scheduler. This is not what I want for a test program. To allow it to run on a login node during cmake configuration I must first unload a certain module, so it is compiled differently to run directly on the calling machine. But right before the actual build of my application starts it must be loaded again, else I would not be able to submit my job with the scheduler because it would be compiled in run-locally node, which is not what I want for my application. Regards Dominik -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] execute a script before and after configuration
On Sat, Jan 21, 2012 at 10:50 AM, Dominik Szczerba domi...@itis.ethz.ch wrote: You might use an EXECUTE_PROCESS() command at the beginning of your CMakeLists.txt to unload the modules, and another EXECUTE_PROCESS() at the end to reload them. Will try, thanks for the hint! Unfortunately, it does not work. Unloading the module via a call to a bash script only unloads it for this script's process - the test run is not affected. Instead of calling the script I tried sourcing it (like 'source script', so the whole current session is affected) but this in turn seems to somehow silently do nothing, it does not even seem to be called. Still dead end, any more ideas? It would be nice to have a general elegant solution for cases where user is not allowed to directly run their programs on the current node. Similar scenario will arise for executing tests - currently make test fails because the tests are built for the scheduler so will not run locally. Regards, Dominik -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] execute a script before and after configuration
2012/1/21 Dominik Szczerba domi...@itis.ethz.ch: You might use an EXECUTE_PROCESS() command at the beginning of your CMakeLists.txt to unload the modules, and another EXECUTE_PROCESS() at the end to reload them. Will try, thanks for the hint! Doesn't the module switching involve setting environment variables? You're going to have to do that before invoking CMake aren't you? No, it means calling something like module un/load from command line. Dominik, Running something from the command line does not mean it doesn't change the environment. Would you try $ env env1.txt $ module unload sysmodule_you_dont_want $ env env2.txt $ cmake -E compare_files env1.txt env2.txt I'd be surprise if nothing changed but I may be wrong. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] execute a script before and after configuration
2012/1/21 Dominik Szczerba domi...@itis.ethz.ch: May be Dominik can explain this so that some small test programs are allowed to run without scheduler a little more? Simplest example, suppose I need to compute epsilon and save it in myconfig.h. To this end I need to run a small program and I use TRY_RUN for that. But by default you are not allowed to run any programs on the login node, all compiled execs must go through a scheduler. This is not what I want for a test program. To allow it to run on a login node during cmake configuration I must first unload a certain module, so it is compiled differently to run directly on the calling machine. But right before the actual build of my application starts it must be loaded again, else I would not be able to submit my job with the scheduler because it would be compiled in run-locally node, which is not what I want for my application. This looks like kind of cross-compiling problem. see cmake --help-command try_run. In your case, the host being the login/frontend node while the target is the parallel nodes. The only difference here is that the compiler switch is probably hidden by the module call. May be that if you can wrap all your small tests to be tried-run on the login node in a separate project you can execute_process(COMMAND your-shell-script.sh ${CMAKE_SOURCE_DIR}/path/you/want OUTPUT_VARIABLE TO_BE_PROCESSED) the your-shell-script.sh would do something like: module unload systemmod cmake --build $1 cmake -P /path/to/your/separate/project/collect_result.cmake after that you get the result oif the test done with the systemmod unloaded in TO_BE_PROCESSED. Others may correct me if I'm wrong but each command is processed by a forked child so that any modification (w.r.t. the environment) in the child is lost in the parent process and the following other COMMAND if any. Thus you should really do it by hand or wrap-up a separate project which will do the testing. Note that this helper project may enable you install some helper executable (compiled for the login-node execution) inside the build tree of the to-be-configured project such that you can actually run those executable during the configure process of the main project. You may be able to achieve that [more] easily using ExternalProject_Add see cmake --help-module ExternalProject By the way you may not be the only person to use CMake on Cray machine how do the others do? Do they use some try_run as well? -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] how to link mysql++ in a lib with cmake
2012/1/21 paspa...@noos.fr: Hello I am trying to link mysql++ in a lib, with the following cmakelist.txt file: I get a fatal error: mysql_version.h no such a file or directory this file is located in usr/include/mysql so I don't understand thanks in advance if someone can help May be you simply miss the leading / include_directories(usr/include/mysql) -- include_directories(/usr/include/mysql) project(plibb) include_directories(usr/include) include_directories(usr/include/mysql) include_directories(usr/include/mysql++) add_library(plibb STATIC exec_msg2.cpp cTest2.cpp cDB.cpp) target_link_libraries(plibb usr/lib/libmysqlpp.a) target_link_libraries(plibb usr/lib/libmysqlclient.a) You have a look at find_path and find_library commands. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] execute a script before and after configuration
Running something from the command line does not mean it doesn't change the environment. Would you try $ env env1.txt $ module unload sysmodule_you_dont_want $ env env2.txt $ cmake -E compare_files env1.txt env2.txt I'd be surprise if nothing changed but I may be wrong. You are of course right, but this is not the scenario here. If you put module un/load XXX into a bash script, and call it from command line, it will only modify the env for this script/process. On the return your original env will not be changed. To change it, you need to source your script, but that is what seems to do nothing with cmake. Thanks Dominik -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake still broken post-2.8.1
Ah HAH -- you're right, sort of, though I don't understand why it's this way. With the code added that you suggested: GOOD C:/Program Files/Regina/regina.exe cc.rex dcc.exe CMakeCCompilerId.c -- arg=[COMMAND] -- arg=[C:/Program Files/Regina/regina.exe] -- arg=[cc.rex dcc.exe] -- arg=[CMakeCCompilerId.c] -- arg=[WORKING_DIRECTORY] -- arg=[C:/SVN/zFPE/CMakeFiles/CompilerIdC] -- arg=[OUTPUT_VARIABLE] -- arg=[CMAKE_C_COMPILER_ID_OUTPUT] -- arg=[ERROR_VARIABLE] -- arg=[CMAKE_C_COMPILER_ID_OUTPUT] -- arg=[RESULT_VARIABLE] -- arg=[CMAKE_C_COMPILER_ID_RESULT] BAD c:/Program Files/Regina/regina.exe cc.rex;dcc.exe CMakeCCompilerId.c -- arg=[COMMAND] -- arg=[c:/Program Files/Regina/regina.exe] -- arg=[cc.rex] -- arg=[dcc.exe] -- arg=[CMakeCCompilerId.c] -- arg=[WORKING_DIRECTORY] -- arg=[C:/SVN/zFPE/CMakeFiles/CompilerIdC] -- arg=[OUTPUT_VARIABLE] -- arg=[CMAKE_C_COMPILER_ID_OUTPUT] -- arg=[ERROR_VARIABLE] -- arg=[CMAKE_C_COMPILER_ID_OUTPUT] -- arg=[RESULT_VARIABLE] -- arg=[CMAKE_C_COMPILER_ID_RESULT] But confusion continues. I changed cc.rex to echo its arguments on entry and its return code on exit to a log, and: GOOD: dcc.exe -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c C:/SVN/zFPE/CMakeFiles/CMakeTmp/testCCompiler.c Exiting cc.rex, rc=0 dcc.exe -o CMakeFiles/cmTryCompileExec.dir/CMakeCCompilerABI.c.o -c C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCCompilerABI.c Exiting cc.rex, rc=1 dcxx.exe -o CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.o -c C:/SVN/zFPE/CMakeFiles/CMakeTmp/testCXXCompiler.cxx Exiting cc.rex, rc=0 dcxx.exe -o CMakeFiles/cmTryCompileExec.dir/CMakeCXXCompilerABI.cpp.o -c C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCXXCompilerABI.cpp Exiting cc.rex, rc=1 dcc.exe -o CMakeFiles/cmTryCompileExec.dir/CheckIncludeFile.c.o -c C:/SVN/zFPE/CMakeFiles/CMakeTmp/CheckIncludeFile.c Exiting cc.rex, rc=0 dcc.exe -o CMakeFiles/cmTryCompileExec.dir/CheckIncludeFile.c.o -c C:/SVN/zFPE/CMakeFiles/CMakeTmp/CheckIncludeFile.c Exiting cc.rex, rc=0 dcc.exe -o CMakeFiles/cmTryCompileExec.dir/CheckIncludeFile.c.o -c C:/SVN/zFPE/CMakeFiles/CMakeTmp/CheckIncludeFile.c Exiting cc.rex, rc=0 dcc.exe -o CMakeFiles/cmTryCompileExec.dir/SIZEOF_UNSIGNED_LONG_LONG.c.o -c C:/SVN/zFPE/CMakeFiles/CheckTypeSize/SIZEOF_UNSIGNED_LONG_LONG.c Exiting cc.rex, rc=0 dcc.exe -o CMakeFiles/cmTryCompileExec.dir/SIZEOF_UNSIGNED_LONG.c.o -c C:/SVN/zFPE/CMakeFiles/CheckTypeSize/SIZEOF_UNSIGNED_LONG.c Exiting cc.rex, rc=0 dcc.exe -o CMakeFiles/cmTryCompileExec.dir/SIZEOF_UNSIGNED_INT.c.o -c C:/SVN/zFPE/CMakeFiles/CheckTypeSize/SIZEOF_UNSIGNED_INT.c Exiting cc.rex, rc=0 BAD: dcc.exe CMakeCCompilerId.c So arguably this is a bug in my cc.rex, in that it's not noticing the missing arguments. But of course, it worked before. Also note that cc.rex *never gets invoked against CMakeCCompilerId* in the GOOD case. The more I look at this, the less I understand it... -Original Message- From: Phil Smith Sent: Friday, January 20, 2012 4:37 PM To: 'Brad King' Cc: Bill Hoffman; cmake@cmake.org Subject: RE: [CMake] CMake still broken post-2.8.1 I'm confused because neither of your examples has the semicolon, but what we need is: regina.exe cc.rex dcc.exe CMakeCCompilerId.c But it sounds like you're saying that we're not actually getting invoked as: cc.rex;dcc.exe CMakeCCompilerId.c The problem is, I can't tell what we ARE getting invoked as. The symptoms match regina being invoked with no operands, but I can't seem to prove that. If I run with --trace and --debug-output, the last of the output is: C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake(97): EXECUTE_PROCESS(COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_ COMPILER_ID_ARG1} ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} ${testflags} ${src} WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR} OUTPUT_VARIABLE CMAKE_${lang}_C OMPILER_ID_OUTPUT ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT ) Called from: [2] C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake [1] C:/SVN/zFPE/CMakeLists.txt Does that tell us anything? -Original Message- From: Brad King [mailto:brad.k...@kitware.com] Sent: Friday, January 20, 2012 3:50 PM To: Phil Smith Cc: Bill Hoffman; cmake@cmake.org Subject: Re: [CMake] CMake still broken post-2.8.1 On October 24, 2011 6:08 PM Bill Hoffman wrote: So, right at the end it is doing this: C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake(96): EXECUTE_PROCESS(COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_ARG1} ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} ${testflags} ${src} WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR} OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT RESULT_VARIABLE
Re: [CMake] execute a script before and after configuration
2012/1/21 Dominik Szczerba domi...@itis.ethz.ch: Running something from the command line does not mean it doesn't change the environment. Would you try $ env env1.txt $ module unload sysmodule_you_dont_want $ env env2.txt $ cmake -E compare_files env1.txt env2.txt I'd be surprise if nothing changed but I may be wrong. You are of course right, but this is not the scenario here. If you put module un/load XXX into a bash script, and call it from command line, it will only modify the env for this script/process. On the return your original env will not be changed. The very same scenario is happening with CMake. To change it, you need to source your script, but that is what seems to do nothing with cmake. Yes that's precisely the point CMake is not behaving like a shell at ALL with respect to env var. Re-read my other message. When cmake executes a command (using e.g. execute_process) it forks that is a NEW process which is a child of current cmake process is created, then the command/executable is run within the child (or replace the child http://en.wikipedia.org/wiki/Fork-exec) then the child terminates and CMake continue with other command with may be other child process. So when you COMMAND module unload blah this only affect the current child. That's the same difference between sourcing a script and running it with CMake you have no way to source a shell script because CMake is not the shell. From within CMake you source a cmake script (just include it) but not a shell script (which seems to be the machinery behind the 'module' command). What you can do however is to identify which environment change did the module unload do and then do the same with cmake. You may be able to monitor the change from cmake using a shell script which does: env file1 module unload env file2 diff file1 file2 -- then process the diff ouput with some cmake script en reproduce the environnement change using set(ENV{EnvVarName} newValue) -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake still broken post-2.8.1
On 1/21/2012 12:24 PM, Phil Smith wrote: GOOD C:/Program Files/Regina/regina.exe cc.rex dcc.exe CMakeCCompilerId.c -- arg=[C:/Program Files/Regina/regina.exe] -- arg=[cc.rex dcc.exe] -- arg=[CMakeCCompilerId.c] [snip] BAD c:/Program Files/Regina/regina.exe cc.rex;dcc.exe CMakeCCompilerId.c -- arg=[c:/Program Files/Regina/regina.exe] -- arg=[cc.rex] -- arg=[dcc.exe] -- arg=[CMakeCCompilerId.c] [snip] GOOD: dcc.exe -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c C:/SVN/zFPE/CMakeFiles/CMakeTmp/testCCompiler.c Exiting cc.rex, rc=0 [snip] BAD: dcc.exe CMakeCCompilerId.c Can you reproduce these two results by running the two different command lines on a dummy .c file by hand at a command prompt? -Brad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake still broken post-2.8.1
Well, the hang occurs when I do so. The good line doesn't work due to paths, the temporary C file not having been created, etc., but it doesn't hang. -Original Message- From: Brad King [mailto:brad.k...@kitware.com] Sent: Saturday, January 21, 2012 3:45 PM To: Phil Smith Cc: Bill Hoffman; cmake@cmake.org Subject: Re: [CMake] CMake still broken post-2.8.1 On 1/21/2012 12:24 PM, Phil Smith wrote: GOOD C:/Program Files/Regina/regina.exe cc.rex dcc.exe CMakeCCompilerId.c -- arg=[C:/Program Files/Regina/regina.exe] -- arg=[cc.rex dcc.exe] -- arg=[CMakeCCompilerId.c] [snip] BAD c:/Program Files/Regina/regina.exe cc.rex;dcc.exe CMakeCCompilerId.c -- arg=[c:/Program Files/Regina/regina.exe] -- arg=[cc.rex] -- arg=[dcc.exe] -- arg=[CMakeCCompilerId.c] [snip] GOOD: dcc.exe -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c C:/SVN/zFPE/CMakeFiles/CMakeTmp/testCCompiler.c Exiting cc.rex, rc=0 [snip] BAD: dcc.exe CMakeCCompilerId.c Can you reproduce these two results by running the two different command lines on a dummy .c file by hand at a command prompt? -Brad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake still broken post-2.8.1
Argh, premature send syndrome: the hang is definitely because cc.rex is missing arguments and thus invokes the actual, two-stage C compiler without a source file. -Original Message- From: Brad King [mailto:brad.k...@kitware.com] Sent: Saturday, January 21, 2012 3:45 PM To: Phil Smith Cc: Bill Hoffman; cmake@cmake.org Subject: Re: [CMake] CMake still broken post-2.8.1 On 1/21/2012 12:24 PM, Phil Smith wrote: GOOD C:/Program Files/Regina/regina.exe cc.rex dcc.exe CMakeCCompilerId.c -- arg=[C:/Program Files/Regina/regina.exe] -- arg=[cc.rex dcc.exe] -- arg=[CMakeCCompilerId.c] [snip] BAD c:/Program Files/Regina/regina.exe cc.rex;dcc.exe CMakeCCompilerId.c -- arg=[c:/Program Files/Regina/regina.exe] -- arg=[cc.rex] -- arg=[dcc.exe] -- arg=[CMakeCCompilerId.c] [snip] GOOD: dcc.exe -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c C:/SVN/zFPE/CMakeFiles/CMakeTmp/testCCompiler.c Exiting cc.rex, rc=0 [snip] BAD: dcc.exe CMakeCCompilerId.c Can you reproduce these two results by running the two different command lines on a dummy .c file by hand at a command prompt? -Brad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Revision header
I have a script that generates a revision.h file, I've spent the morning trying to figure out how to make it so that ... any time CMake rebuilds any of the other targets, it starts by running the make-new-revision script. The idea is, I use the script manually to upversion, but anytime I type make and /anything/ has to be done (even just a relink), it will do the upversion first. I've only managed to make it either source dependent or always build, which forces the versionNo file to recompile and forces all executables to relink, so if you type: make ; make ... it will have to relink the executables the second time because of an pointless upversion :) - Oliver -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[Cmake-commits] CMake branch, next, updated. v2.8.7-2179-g0e3ad86
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via 0e3ad866235cf1d12766fcc5a0f68d248599880d (commit) via 8892c8d00bc62bac2ebc5b089e16dc730350f75f (commit) from aababf9947a4e35ee708c40f2b9146bbf8f887a2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0e3ad866235cf1d12766fcc5a0f68d248599880d commit 0e3ad866235cf1d12766fcc5a0f68d248599880d Merge: aababf9 8892c8d Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Sat Jan 21 06:10:09 2012 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Sat Jan 21 06:10:09 2012 -0500 Merge topic 'uninitialized-var-in-if' into next 8892c8d If() test: fix match expression for in-place builds http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8892c8d00bc62bac2ebc5b089e16dc730350f75f commit 8892c8d00bc62bac2ebc5b089e16dc730350f75f Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Sat Jan 21 10:34:11 2012 +0100 Commit: Rolf Eike Beer e...@sf-mail.de CommitDate: Sat Jan 21 10:34:11 2012 +0100 If() test: fix match expression for in-place builds diff --git a/Tests/CMakeTests/IfTest.cmake.in b/Tests/CMakeTests/IfTest.cmake.in index 43a15d4..639e226 100644 --- a/Tests/CMakeTests/IfTest.cmake.in +++ b/Tests/CMakeTests/IfTest.cmake.in @@ -158,7 +158,7 @@ endforeach() test_vars() set(Invalid-Argument-RESULT 1) -set(Invalid-Argument-STDERR .*CMake Error at @CMAKE_CURRENT_SOURCE_DIR@/If-Invalid-Argument.cmake:1 \\(if\\):.*Unknown arguments specified.*) +set(Invalid-Argument-STDERR .*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?If-Invalid-Argument.cmake:1 \\(if\\):.*Unknown arguments specified.*) include(@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake) check_cmake_test(If --- Summary of changes: Tests/CMakeTests/IfTest.cmake.in |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits
[Cmake-commits] CMake branch, next, updated. v2.8.7-2182-g2bcb720
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via 2bcb720d9825e5f7f2ff51f3751cabf68f251172 (commit) via 3dc6f2bfb34ff90a905b10872e98c163940f456a (commit) via a668c9f059cebad61138511f7e91fbe49a414666 (commit) from 0e3ad866235cf1d12766fcc5a0f68d248599880d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2bcb720d9825e5f7f2ff51f3751cabf68f251172 commit 2bcb720d9825e5f7f2ff51f3751cabf68f251172 Merge: 0e3ad86 3dc6f2b Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Sat Jan 21 16:25:51 2012 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Sat Jan 21 16:25:51 2012 -0500 Merge topic 'find-threads-11333' into next 3dc6f2b FindThreads: Try pthreads with no special option first (#11333) a668c9f KWSys Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3dc6f2bfb34ff90a905b10872e98c163940f456a commit 3dc6f2bfb34ff90a905b10872e98c163940f456a Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Mon Apr 25 11:33:15 2011 -0400 Commit: Rolf Eike Beer e...@sf-mail.de CommitDate: Sat Jan 21 22:24:19 2012 +0100 FindThreads: Try pthreads with no special option first (#11333) QNX has the phtread stuff in the standard library. The best way would IMHO be to check if a program that uses pthread_* can be successfully linked without specifying any linker option before trying out the different flags. diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index a6c2df8..21614fb 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -23,6 +23,7 @@ INCLUDE (CheckIncludeFiles) INCLUDE (CheckLibraryExists) +INCLUDE (CheckSymbolExists) SET(Threads_FOUND FALSE) # Do we have sproc? @@ -44,33 +45,41 @@ ELSE() # SET(CMAKE_HAVE_THREADS_LIBRARY) IF(NOT THREADS_HAVE_PTHREAD_ARG) - - # Do we have -lpthreads - CHECK_LIBRARY_EXISTS(pthreads pthread_create CMAKE_HAVE_PTHREADS_CREATE) - IF(CMAKE_HAVE_PTHREADS_CREATE) -SET(CMAKE_THREAD_LIBS_INIT -lpthreads) + # Check if pthread functions are in normal C library + CHECK_SYMBOL_EXISTS(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE) + IF(CMAKE_HAVE_LIBC_CREATE) +SET(CMAKE_THREAD_LIBS_INIT ) SET(CMAKE_HAVE_THREADS_LIBRARY 1) SET(Threads_FOUND TRUE) ENDIF() - # Ok, how about -lpthread - CHECK_LIBRARY_EXISTS(pthread pthread_create CMAKE_HAVE_PTHREAD_CREATE) - IF(CMAKE_HAVE_PTHREAD_CREATE) -SET(CMAKE_THREAD_LIBS_INIT -lpthread) -SET(Threads_FOUND TRUE) -SET(CMAKE_HAVE_THREADS_LIBRARY 1) - ENDIF() + IF(NOT CMAKE_HAVE_THREADS_LIBRARY) +# Do we have -lpthreads +CHECK_LIBRARY_EXISTS(pthreads pthread_create CMAKE_HAVE_PTHREADS_CREATE) +IF(CMAKE_HAVE_PTHREADS_CREATE) + SET(CMAKE_THREAD_LIBS_INIT -lpthreads) + SET(CMAKE_HAVE_THREADS_LIBRARY 1) + SET(Threads_FOUND TRUE) +ENDIF() - IF(CMAKE_SYSTEM MATCHES SunOS.*) -# On sun also check for -lthread -CHECK_LIBRARY_EXISTS(thread thr_create CMAKE_HAVE_THR_CREATE) -IF(CMAKE_HAVE_THR_CREATE) - SET(CMAKE_THREAD_LIBS_INIT -lthread) +# Ok, how about -lpthread +CHECK_LIBRARY_EXISTS(pthread pthread_create CMAKE_HAVE_PTHREAD_CREATE) +IF(CMAKE_HAVE_PTHREAD_CREATE) + SET(CMAKE_THREAD_LIBS_INIT -lpthread) SET(CMAKE_HAVE_THREADS_LIBRARY 1) SET(Threads_FOUND TRUE) ENDIF() - ENDIF(CMAKE_SYSTEM MATCHES SunOS.*) +IF(CMAKE_SYSTEM MATCHES SunOS.*) + # On sun also check for -lthread + CHECK_LIBRARY_EXISTS(thread thr_create CMAKE_HAVE_THR_CREATE) + IF(CMAKE_HAVE_THR_CREATE) +SET(CMAKE_THREAD_LIBS_INIT -lthread) +SET(CMAKE_HAVE_THREADS_LIBRARY 1) +SET(Threads_FOUND TRUE) + ENDIF() +ENDIF(CMAKE_SYSTEM MATCHES SunOS.*) + ENDIF(NOT CMAKE_HAVE_THREADS_LIBRARY) ENDIF(NOT THREADS_HAVE_PTHREAD_ARG) IF(NOT CMAKE_HAVE_THREADS_LIBRARY) @@ -111,7 +120,7 @@ ELSE() ENDIF(CMAKE_HAVE_PTHREAD_H) ENDIF() -IF(CMAKE_THREAD_LIBS_INIT) +IF(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE) SET(CMAKE_USE_PTHREADS_INIT 1) SET(Threads_FOUND TRUE) ENDIF() --- Summary of changes: Modules/FindThreads.cmake | 47 ++--- Source/kwsys/kwsysDateStamp.cmake |2 +- 2 files changed, 29 insertions(+), 20 deletions(-) hooks/post-receive
[Cmake-commits] CMake branch, master, updated. v2.8.7-144-g3be1282
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, master has been updated via 3be1282fd31e7f663b4fdd6a271781cceccbdbda (commit) from a668c9f059cebad61138511f7e91fbe49a414666 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3be1282fd31e7f663b4fdd6a271781cceccbdbda commit 3be1282fd31e7f663b4fdd6a271781cceccbdbda Author: KWSys Robot kwro...@kitware.com AuthorDate: Sun Jan 22 00:05:05 2012 -0500 Commit: KWSys Robot kwro...@kitware.com CommitDate: Sun Jan 22 00:05:05 2012 -0500 KWSys Nightly Date Stamp diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 998ecb8..d378136 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2012) SET(KWSYS_DATE_STAMP_MONTH 01) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 21) +SET(KWSYS_DATE_STAMP_DAY 22) --- Summary of changes: Source/kwsys/kwsysDateStamp.cmake |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits