[cmake-developers] [CMake 0012620]: FindPkgConfig does not fail when pkg-config is not installed
The following issue has been SUBMITTED. == http://public.kitware.com/Bug/view.php?id=12620 == Reported By:Aurélien Gâteau Assigned To: == Project:CMake Issue ID: 12620 Category: Modules Reproducibility:always Severity: minor Priority: normal Status: new == Date Submitted: 2011-12-12 11:28 EST Last Modified: 2011-12-12 11:28 EST == Summary:FindPkgConfig does not fail when pkg-config is not installed Description: If pkg-config is not installed and one calls find_package(PkgConfig REQUIRED) in a CMakeLists.txt, cmake does not fail. Steps to Reproduce: - Make sure pkg-config is not installed - Create a CMakeLists.txt with the line find_package(PkgConfig REQUIRED) - Run cmake = no failure == Issue History Date ModifiedUsername FieldChange == 2011-12-12 11:28 Aurélien GâteauNew Issue == -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
[cmake-developers] [CMake 0012621]: Compatibility with Xcode 4.2
The following issue has been SUBMITTED. == http://public.kitware.com/Bug/view.php?id=12621 == Reported By:davidrogers Assigned To: == Project:CMake Issue ID: 12621 Category: CMake Reproducibility:always Severity: major Priority: urgent Status: new == Date Submitted: 2011-12-12 22:44 EST Last Modified: 2011-12-12 22:44 EST == Summary:Compatibility with Xcode 4.2 Description: As of the latest 4.2 beta, Apple is choosing to no longer install Xcode in /Developer. Instead packaging it as a single application bundle to be distributed via the App Store. Defaulting to /Applications but can be moved anywhere. As of 2.8.7rc1, CMake cannot detect the location of compilers or tools that are installed in this bundle. As a result, projects cannot be generated. Steps to Reproduce: Uninstall dev tools from /Developer, Install Xcode 4.2 beta, Attempt to configure a project. == Issue History Date ModifiedUsername FieldChange == 2011-12-12 22:44 davidrogersNew Issue == -- 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] hear hear
On Tuesday, 6. December 2011, 17:27:47, Daniel Dekkers wrote: On Dec 4, 2011, at 11:59 AM, Michael Jackson wrote: I think if the CMake community took a vote we could probably come up with an Exemplar Find*.cmake file that is good for someone trying to develop a new one. Yes please. And I think in general that is true. Of course it is more interesting and often more urgent to spend time on exotic problems. But there are these basics that are missing in the documentation. Like,.. this works in 99% of the cases, we, CMake, advise you to do this. If you don't, you are making life hard on yourself and you are more or less on your own. Something like: 1) a single executable 2) a single executable linked to a lib built from source 3) different executables using the same lib built from source 4) a single executable linked to a binary lib (with the aid of a find module) ... n) multiple executables linked to multiple libraries (linked to third-party libraries), some static, some dynamic, some with their own CMake builds, some without, on different platforms. Auch. n+1) making anything work with Xcode I would like that, too. Also, it would be nice if the example would include a *Config.cmake (and *Version.cmake) file. What I notice with several projects is that the *config.cmake mechanism for finding out about a package is still largely ignored and each projects rolls out its own Find*.cmake file instead, which dependent projects than copy into their source tree. Raising the awareness for the *Config.cmake style of making your package easy to find would certainly be a good thing. Cheers, Johannes -- 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] print content of linking script ?
Dear Eric, I tried the file(READ... cmake command, but it does not work during CMake buildup - the link.txt file is ready for reading only after ending the buildup what is not my case. Why I need it ? Some time ago I reported problem about missing static library: http://www.cmake.org/pipermail/cmake/2011-November/047444.html Though it is not solved, I would like - for the CDash buildup - print out the complete (or partial?) link.txt command in the Configure Output, to extend CDash output as this, http://repo.ctcc.no/CDash/buildSummary.php?buildid=6251 to see all linked libraries and flags. For the linking step I reported above the CMake is assigning couple of libraries, and there is no possibility of removing some of them. So at least, leat us see on-line which ones are linked. Yours, Miro From: Eric Noulard [eric.noul...@gmail.com] Sent: Sunday, December 11, 2011 6:24 PM To: Ilias Miroslav Cc: cmake@cmake.org Subject: Re: [CMake] print content of linking script ? 2011/12/11 Ilias Miroslav miroslav.il...@umb.sk: Dear all, is there an easy way of printing out content of the linking file CMakeFiles/TARGET.dir/link.txt as a simple command in the CMakeLists.txt file ? Usually we do cat .../link.txt after the cmake-configuration but we would prefer some more elegant form within the message(...) commad. You can read the content of any file using file(READ your-file YOURVAR) cmake command then use message(Your-file=${YOURVAR}) to display it, that said I don't **when** the link.txt file is getting generated so that I don't if it'll work from within CMakeLists.txt. Why do you want to do that? if you are using Makefile generator then may be make VERBOSE=1 target would be enough? -- 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] Top level target depending on a file
Hi, Can anyone help me with this? I haven't found a proper solution myself yet.. 2011/12/8 Alexander Broekhuis a.broekh...@gmail.com Hi all, In my project, some top level targets depend on simple text files. These targets produce a zip file as output, this is done using a custom command with a post-build to a library target. Part of the zip file are some simple text files, which are included using some custom CPack handling inside the custom command. How can I let the top level target depend on these text files as well? In other words, if a text files changes, the zip file has to be regenerated. These text files are not generated or copied etc. So a simple DEPENDS would suffice. I know add_custom_command(OUTPUT has support for this, but am wondering how to do this with add_custom_command(TARGET. TiA! -- Met vriendelijke groet, Alexander Broekhuis -- Met vriendelijke groet, Alexander Broekhuis -- 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] print content of linking script ?
2011/12/12 Ilias Miroslav miroslav.il...@umb.sk: Dear Eric, I tried the file(READ... cmake command, but it does not work during CMake buildup - the link.txt file is ready for reading only after ending the buildup what is not my case. Why I need it ? Some time ago I reported problem about missing static library: http://www.cmake.org/pipermail/cmake/2011-November/047444.html Though it is not solved, I would like - for the CDash buildup - print out the complete (or partial?) link.txt command in the Configure Output, to extend CDash output as this, http://repo.ctcc.no/CDash/buildSummary.php?buildid=6251 If you use ctest to submit your CDash submission then may be you can file(READ ..) at CTest time inside you ctest script after you did ctest_configure and add some ExtraFiles to you submission. -- 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] Top level target depending on a file
2011/12/12 Alexander Broekhuis a.broekh...@gmail.com: Hi, Can anyone help me with this? I haven't found a proper solution myself yet.. The fact is there is no builtin support for what you ask see: http://public.kitware.com/Bug/view.php?id=8438 But the thing is. Why don't you create a top level target using add_custom_target instead of a post-build event? this custom target would depend on both the text file and the library target your are building. The only issue would be that you have to call (i.e. build) the new custom target explicitely instead of relying on POST BUILD. Note that may be I didn't catch your usage so may be you can send us the concerned bits of your CMakeLists.txt -- 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] Java support - install with components
andreas, Yes I agree the COMPONENT should be optional, but handled in the same manner as the install command - in fact if the function is to incorporate the INSTALL command then we must have a way to pass the same options to the INSTALL command that the INSTALL command supports. Maybe, we need to disect the INSTALL command? I like the; set(CMAKE_JAVA_MANIFEST mymanifest.mf) option for manifests since they are more specific to java jar files. On Thursday 20 October 2011 11:59:05 Allen D Byrne wrote: I've upgraded my Java project to the latest 2.8.6 release. The only thing missing for me is to allow components on the install commands. I just did the following: Hi Allen, function(INSTALL_JAR _TARGET_NAME _DESTINATION _COMPONENT) get_property(__FILES TARGET ${_TARGET_NAME} PROPERTY INSTALL_FILES ) if (__FILES) install( FILES ${__FILES} DESTINATION ${_DESTINATION} COMPONENT ${_COMPONENT} ) else (__FILES) message(SEND_ERROR The target ${_TARGET_NAME} is not known in this scope.) endif (__FILES) endfunction(INSTALL_JAR _TARGET_NAME _DESTINATION _COMPONENT) Sorry, this is not acceptable. If component should be added, it should be optional. Patches are welcome :) -- andreas Hi, Hi, I am happy about the recently improved Java support within cmake. Thanks! Anyhow, I have a small point which should be easy to improve and which would deliver quite some usability, in my opinion. The current syntax for building and packaging Java files is: add_jar(${TARGETNAME} ${SOURCE_FILES} ${RESOURCE_FILES}) This has some drawbacks: 1) No executable jar can be created with that method. It seems there is already some effort on that issue as: https://github.com/viandfraich/CMake/commit/36b223e34f5d48339da39e833a2f5e7d f2866e87 I don't like the way how it has been added here. I think it should be an optional vairable you set before like the others. Please open a feature request in the bug tracker. Patches are welcome. 2) A jar file can be annotated with a lot of more important information, e.g., version information, scope, main-class (would also catch the first issue), etc. This information is normally passed as a property/manifest file when calling the jar packager. Currently, the UseJava.cmake module creates the following command within 'add_jar': jar cf ${TARGETNAME} ${CLASS_FILES} ${RESOURCE_FILES} The following would solve my (and I guess many others') use cases: jar cmf ${TARGETNAME} MyManifest.mf ${CLASS_FILES} ${RESOURCE_FILES} Should be an optional option and should be done like the other options. set(CMAKE_JAVA_MANIFEST mymanifest.mf) add_jar(foo foo.java) An optional command to add_jar would be desirable which allows to provide an optional manifest file. If provided, the later syntax should be used for calling the 'jar' tool. Will there be progress towards supporting manifest information anytime soon within cmake? Open a feature request in the bugtracker. -- andreas I needed to change the UseJava.cmake script to allow INSTALL components and to have more flexible locations for JAR resource files. In addition I needed to change the java_copy_file function to use the execute_process command. Attached is the diff for my changes, hoping the correct folks will review. Hi Allen, sorry this patch is not acceptable. It needs to be optional or we break existing scripts. See find_jar() or create_javadoc(). -- andreas -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Problem Compiling on Solaris 10 x86
I already had the output for VERBOSE=1 :-) Here is the output of CMakeCache.txt: # cat ./cmake-2.8.6/CMakeCache.txt|grep -i curse //Build the CMake Curses Dialog ccmake BUILD_CursesDialog:BOOL=ON CMAKE_FORM_BINARY_DIR:STATIC=/build/packages/cmake/cmake-2.8.6/Source/CursesDialog/form CMAKE_FORM_SOURCE_DIR:STATIC=/build/packages/cmake/cmake-2.8.6/Source/CursesDialog/form CURSES_CURSES_H_PATH:PATH=/usr/include CURSES_CURSES_LIBRARY:FILEPATH=/usr/lib/libcurses.so CURSES_EXTRA_LIBRARY:FILEPATH=CURSES_EXTRA_LIBRARY-NOTFOUND CURSES_FORM_LIBRARY:FILEPATH=/usr/lib/libform.so CURSES_HAVE_CURSES_H:FILEPATH=/usr/include/curses.h //The curses include path CURSES_INCLUDE_PATH:FILEPATH=/usr/include //The curses library CURSES_LIBRARY:FILEPATH=/usr/lib/libcurses.so CURSES_NCURSES_LIBRARY:FILEPATH=CURSES_NCURSES_LIBRARY-NOTFOUND //The curses form library cmForm_LIB_DEPENDS:STATIC=general;/usr/lib/libcurses.so; //ADVANCED property for variable: CURSES_CURSES_HAS_WSYNCUP CURSES_CURSES_HAS_WSYNCUP-ADVANCED:INTERNAL=1 //Have library /usr/lib/libcurses.so CURSES_CURSES_HAS_WSYNCUP:INTERNAL=1 //ADVANCED property for variable: CURSES_CURSES_LIBRARY CURSES_CURSES_LIBRARY-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CURSES_EXTRA_LIBRARY CURSES_EXTRA_LIBRARY-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CURSES_INCLUDE_PATH CURSES_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CURSES_LIBRARY CURSES_LIBRARY-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CURSES_NCURSES_LIBRARY CURSES_NCURSES_LIBRARY-ADVANCED:INTERNAL=1 Christopher Hylarides Systems Administrator OANDA Corporation +1.416.593.6767x327 http://www.oanda.com/ On 11-12-09 5:38 PM, Bill Hoffman wrote: On 12/9/2011 3:43 PM, Christopher Hylarides wrote: Hey guys, I'm trying to build cmake on Solaris 10 x86 and am getting the following error: [ 94%] Building CXX object Source/CMakeFiles/ccmake.dir/CursesDialog/cmCursesLongMessageForm.cxx.o [ 95%] Building CXX object Source/CMakeFiles/ccmake.dir/CursesDialog/cmCursesMainForm.cxx.o [ 95%] Building CXX object Source/CMakeFiles/ccmake.dir/CursesDialog/cmCursesPathWidget.cxx.o [ 95%] Building CXX object Source/CMakeFiles/ccmake.dir/CursesDialog/cmCursesStringWidget.cxx.o [ 95%] Building CXX object Source/CMakeFiles/ccmake.dir/CursesDialog/cmCursesWidget.cxx.o [ 96%] Building CXX object Source/CMakeFiles/ccmake.dir/CursesDialog/ccmake.cxx.o Linking CXX executable ../bin/ccmake Undefined first referenced symbol in file wattr_on CMakeFiles/ccmake.dir/CursesDialog/cmCursesLongMessageForm.cxx.o wattr_off CMakeFiles/ccmake.dir/CursesDialog/cmCursesLongMessageForm.cxx.o ld: fatal: Symbol referencing errors. No output written to ../bin/ccmake collect2: ld returned 1 exit status make[2]: *** [bin/ccmake] Error 1 make[1]: *** [Source/CMakeFiles/ccmake.dir/all] Error 2 make: *** [all] Error 2 Below is with VERBOSE=1 [ 95%] Building CXX object Source/CMakeFiles/ccmake.dir/CursesDialog/cmCursesWidget.cxx.o cd /build/packages/cmake/cmake-2.8.6/Source /build/system/bin/g++ -DCURL_STATICLIB -DLIBARCHIVE_STATIC -DCMAKE_BUILD_WITH_CMAKE -I/build/packages/cmake/cmake-2.8.6/Utilities -I/build/packages/cmake/cmake-2.8.6/Source -I/build/packages/cmake/cmake-2.8.6/Utilities/cmcompress -I/build/packages/cmake/cmake-2.8.6/Source/CTest -I/build/packages/cmake/cmake-2.8.6/Source/CursesDialog/form -o CMakeFiles/ccmake.dir/CursesDialog/cmCursesWidget.cxx.o -c /build/packages/cmake/cmake-2.8.6/Source/CursesDialog/cmCursesWidget.cxx /build/packages/cmake/cmake-2.8.6/Bootstrap.cmk/cmake -E cmake_progress_report /build/packages/cmake/cmake-2.8.6/CMakeFiles 41 [ 96%] Building CXX object Source/CMakeFiles/ccmake.dir/CursesDialog/ccmake.cxx.o cd /build/packages/cmake/cmake-2.8.6/Source /build/system/bin/g++ -DCURL_STATICLIB -DLIBARCHIVE_STATIC -DCMAKE_BUILD_WITH_CMAKE -I/build/packages/cmake/cmake-2.8.6/Utilities -I/build/packages/cmake/cmake-2.8.6/Source -I/build/packages/cmake/cmake-2.8.6/Utilities/cmcompress -I/build/packages/cmake/cmake-2.8.6/Source/CTest -I/build/packages/cmake/cmake-2.8.6/Source/CursesDialog/form -o CMakeFiles/ccmake.dir/CursesDialog/ccmake.cxx.o -c /build/packages/cmake/cmake-2.8.6/Source/CursesDialog/ccmake.cxx Linking CXX executable ../bin/ccmake cd /build/packages/cmake/cmake-2.8.6/Source /build/packages/cmake/cmake-2.8.6/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/ccmake.dir/link.txt --verbose=1 /build/system/bin/g++ CMakeFiles/ccmake.dir/CursesDialog/cmCursesBoolWidget.cxx.o CMakeFiles/ccmake.dir/CursesDialog/cmCursesCacheEntryComposite.cxx.o CMakeFiles/ccmake.dir/CursesDialog/cmCursesDummyWidget.cxx.o CMakeFiles/ccmake.dir/CursesDialog/cmCursesFilePathWidget.cxx.o CMakeFiles/ccmake.dir/CursesDialog/cmCursesForm.cxx.o CMakeFiles/ccmake.dir/CursesDialog/cmCursesLabelWidget.cxx.o CMakeFiles/ccmake.dir/CursesDialog/cmCursesLongMessageForm.cxx.o CMakeFiles/ccmake.dir/CursesDialog/cmCursesMainForm.cxx.o CMakeFiles/ccmake.dir/CursesDialog/cmCursesPathWidget.cxx.o
[CMake] Visual Studio 2010 default property sheets
Sorry if this a re-post had mail issue. I'm not sure if this has been discussed much within the CMake developer community but I wanted to give some thoughts on the use of Visual Sudio property sheets and some suggestion for CMake. As far as I know this is only relevant to Visual Studio 10 and hence MSBuild. I am not familiar with older versions of VS. Sorry if this a bit long winded or it falls into the bleeding obvious category. I did look around and couldn't find any discussion like this online. So first an overview of property sheets in VS10/MSBuild skip this if you are in the know. For those not to familiar with property sheets you can consider them to be collections of compiler/linker flags and other build related information. Physically property sheets are just MSBuild XML files which get included into the main Visaul Studio project file, the .vcxproj file, which is also an MSBuild XML file. To a certain degree you can consider one of Visual Studio functions to be a glorified editor of MSBuild XML files. When you create a project in Visual Studio you have to select what type of project it is, for instance a standard DLL, aka shared library, project. When you do this the project file that VS produces will automatically includes certain property sheets that Microsoft supplies with MSBuild. These files can be found in something like C:\Program Files (x86)\MSBuild\Microsoft.Cpp/v4.0 and have names like Microsoft.Cl.Common.props. The is also a sub directory called Platforms which contains directories like Win32 and x64. These correspond directly to the Platform you see in VS. These directories contain further MSBuild predefined platform specific property sheets like Microsoft.Cpp.Win32.props Property sheets can be inherited what this means is that a property sheet can inherit a set of compiler flags from a parent sheet and can override or extend them if it wants to. This is the key to the usefulness of property sheets. If you look in the Property Manager screen in VS of a standard DLL project you should see something like the following property sheets being inherited for a 32 bit windows build Microsoft.Cpp.Win32.user Windows Dynamic Link Library Multi-byte Character Support Core Windows Libraries Sheets higher up inherit and can override sheets lower down the list. The bottom three correspond to MSBuild supplied property sheets in the MSBuild install directories mentioned earlier. Sadly I haven't found a way in the VS GUI of finding out the actual file name and path of the property sheet but you can normally guess it. The Microsoft.Cpp.Win32.user property sheet which is normally somewhere like AppData\Local\Microsoft\MSBuild\v4.0 in your user id allows you to store user specific build overrides which is generally a bad idea. When you right click on a project in VS solution explorer ( or other equivalent method ) you can look at the properties of that project, including all the compiler/linker flags. Items that are in bold font are defined directly in the property sheet you are looking at while non bold indicates a value that has been inherited. For some compiler flags like the include path it makes sense to inherit the value from your parent property sheet and extend it. In this case you'll see something like %(AdditionIncludeDirectories) in the value which is a macro value representing the value of this field inherited from the parent sheet. A very key portion of the property sheet you can see in VS GUI is the General page under Configuration Properties. At the bottom of this screen is a section called Project Defaults which looks something like Configuration Type Dynamic Library (.dll) Use of MFC Use Standard Windows Libraries Use of ATL Not using ATL Character Set Use Multi Byte Character Set Common Language Runtime Support No Common Language Runtime Support Whole Program Optimization No Whole Program Optimization The above are not really compiler flags directly but define which MSBuild supplied property sheets to inherit. In other words they effect compiler flags used in your build by changing what property sheets you inherit from. So if you change the Character set from multi byte to Unicode you will see in the property manager that you now inherit from a sheet called Unicode Support rather than Multi-byte Character set. This may change many compiler/linker flags/defines etc... Note the situation is a little more complicated as you can define certain MSBuild XML elements before you inherit the MSBuild supplied property sheets which influence what flags they set. A good exmple of this is the UseDebugLibrariestrueUseDebugLibraries which amongst many other things makes the build process link to the debug versions MDd of the MS runtime libraries rather than the optimized/release ones. End of overview So what was the point of this ramble
Re: [CMake] Copy a input file from src folder to EXECUTABLE_OUTPUT_PATH
At build time: ADD_CUSTOM_COMMAND(TARGET OneOfYourExecutables COMMAND ${CMAKE_COMMAND} -E copy_if_different path/to/input.txt $TARGET_FILE_DIR:OneOfYourExecutables) ADD_CUSTOM_COMMAND(TARGET AnotherExecutable COMMAND ${CMAKE_COMMAND} -E copy_if_different path/to/input.txt $TARGET_FILE_DIR:AnotherExecutable) Personally, I'd prefer the latter as it's clean and quite flexible. I decided to use ADD_CUSTOM_COMMAND( TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different P:/mtkLib/Examples/${PROJECT_NAME}/ball.mtk $TARGET_FILE_DIR:${PROJECT_NAME} ) It works fine. But I have a few more questions: 1) How can I get rid of the absolute path in the expression for the source file? 2) when doing make clean, the file in the target file dir is not deleted. How to add it to 'clean'? Thanks, Totte -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Copy a input file from src folder to EXECUTABLE_OUTPUT_PATH
On 12/12/2011 04:29 PM, Totte Karlsson wrote: At build time: ADD_CUSTOM_COMMAND(TARGET OneOfYourExecutables COMMAND ${CMAKE_COMMAND} -E copy_if_different path/to/input.txt $TARGET_FILE_DIR:OneOfYourExecutables) ADD_CUSTOM_COMMAND(TARGET AnotherExecutable COMMAND ${CMAKE_COMMAND} -E copy_if_different path/to/input.txt $TARGET_FILE_DIR:AnotherExecutable) Personally, I'd prefer the latter as it's clean and quite flexible. I decided to use ADD_CUSTOM_COMMAND( TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different P:/mtkLib/Examples/${PROJECT_NAME}/ball.mtk $TARGET_FILE_DIR:${PROJECT_NAME} ) It works fine. But I have a few more questions: 1) How can I get rid of the absolute path in the expression for the source file? Use the ${PROJECT_SOURCE_DIR} variable. It points to the directory containing the CMakeLists.txt file with the last project() call. 2) when doing make clean, the file in the target file dir is not deleted. How to add it to 'clean'? See the ADDITIONAL_MAKE_CLEAN_FILES directory property. However, this is going to be somewhat tricky since you are using $TARGET_FILE_DIR:... in your custom command, and AFAIK the set_directory_property command is not aware of this notation. Do you really need ball.mtk to be in the same directory as your output file? 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
[CMake] Changing Package Top level directory name
hi, how can I change the name of top level directory of cpack. Without changing CPACK_PACKAGE_FILE_NAME ? I want package name to be in format of cmake-2.5.0-Linux-i686 only. But I want to change the root (top directory ) name inside package. regards Vivek Goel -- 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] Setting environment variables in custom command
Hi, I'm creating a custom target in CMake 2.8.7 RC1 and running it in Visual Studio 2008. I set an environment variable called BUILDBIN in the custom command but for some reason my scripts that I invoke are not picking up that environment variable. Am I doing something wrong? These custom commands are starting to get pretty complex and I'm wondering if I should pull out the logic into a batch file. What do you guys think? set( server ${CMAKE_SOURCE_DIR}/${DIRECTORY_SERVER} ) set( common ${CMAKE_SOURCE_DIR}/common ) set( symlinks ${SYMLINK_DIR} ) set( tess ${CMAKE_CURRENT_SOURCE_DIR}/TessInstall ) foreach( incdir ${INSTALLSHIELD_INCLUDE_DIRS} ) list( APPEND include_dirs -i${incdir} ) endforeach() set( command_compile ${INSTALLSHIELD_COMPILER} ${tess}/Script Files/setup.rul ${INSTALLSHIELD_LIBRARIES} -i${tess}/Script Files ${include_dirs} -i${server}/gmmserver/installer -i${common}/exchange/gdexchsrvcommon -i${symlinks}/gtgisde -dBUILDBIN=${BUILD_DIRECTORY}/$CONFIGURATION ) set( command_env COMMAND set BUILDBIN=\${BUILD_DIRECTORY}/$CONFIGURATION\ ) set( command_isbuild ${INSTALLSHIELD_ISBUILD} -p\${tess}/tess install.ipr\ -m\CD\ ) add_custom_target( domino_installer COMMAND ${command_compile} ${command_env} COMMAND ${command_isbuild} DEPENDS gtgisde COMMENT Building GMM Domino Installer through Install Shield... #VERBATIM ) -- 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] Setting environment variables in custom command
On 12/12/2011 08:28 PM, Robert Dailey wrote: Hi, I'm creating a custom target in CMake 2.8.7 RC1 and running it in Visual Studio 2008. I set an environment variable called BUILDBIN in the custom command but for some reason my scripts that I invoke are not picking up that environment variable. Am I doing something wrong? These custom commands are starting to get pretty complex and I'm wondering if I should pull out the logic into a batch file. What do you guys think? [snip long code] Definitely batch file or, preferably CMake script. In CMake scripts, just assign to the ENV{VAR} variable and use execute_process(). Michael -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Setting environment variables in custom command
On Mon, Dec 12, 2011 at 1:31 PM, Michael Wild them...@gmail.com wrote: On 12/12/2011 08:28 PM, Robert Dailey wrote: Hi, I'm creating a custom target in CMake 2.8.7 RC1 and running it in Visual Studio 2008. I set an environment variable called BUILDBIN in the custom command but for some reason my scripts that I invoke are not picking up that environment variable. Am I doing something wrong? These custom commands are starting to get pretty complex and I'm wondering if I should pull out the logic into a batch file. What do you guys think? [snip long code] Definitely batch file or, preferably CMake script. In CMake scripts, just assign to the ENV{VAR} variable and use execute_process(). CMake script would imply that it runs as part of the configuration process. I can't build an installer until all binaries are compiled and linked, so it needs to be a target in visual studio. Problem with pushing this out to a batch file is that I only have 9 parameters maximum that I can use to pass CMake variables. I need more than 9, as you can see from the number of variables I use in the script I sent you. I can't think of a good design for this. Not to mention I hate batch files. But moving it out to a batch file will guarantee that I can setup the environment properly (set environment variables) and also when users change the way the installer works, CMake won't need to be reconfigured, which is a huge plus. Any advice here on how I could setup my batch file to accept more than 9 parameters from CMake? -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] target dependency in subdirectory not found
I'm trying to get get CMake to do the equivalent from this Makefile. I'm using cp in this simple example, but want to use different commands in my project. ==Makefile== srcdir=.. hij: a/efg cp a/efg hij a/efg: $(srcdir)/a/abc -mkdir a cp $(srcdir)/a/abc a/efg == For this I am using two CMakeLists.txt files. ==CMakeLists.txt== cmake_minimum_required(VERSION 2.8) add_subdirectory(a) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hij COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/a/efg ${CMAKE_CURRENT_BINARY_DIR}/hij DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/a/efg VERBATIM ) add_custom_target(hij_target ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/hij) == ==a/CMakeLists.txt== add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/efg COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/abc ${CMAKE_CURRENT_BINARY_DIR}/efg DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/abc VERBATIM ) This gives me the error: make[2]: *** No rule to make target `a/efg', needed by `hij'. Stop. make[1]: *** [CMakeFiles/hij_target.dir/all] Error 2 make: *** [all] Error 2 How can cmake be made to understand this simple dependency? Cheers, Jos -- Jos van den Oever, software architect +49 391 25 19 15 53 074 3491911 http://kogmbh.com/legal/ -- 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] Setting environment variables in custom command
On 12/12/2011 08:46 PM, Robert Dailey wrote: On Mon, Dec 12, 2011 at 1:31 PM, Michael Wild them...@gmail.com mailto:them...@gmail.com wrote: On 12/12/2011 08:28 PM, Robert Dailey wrote: Hi, I'm creating a custom target in CMake 2.8.7 RC1 and running it in Visual Studio 2008. I set an environment variable called BUILDBIN in the custom command but for some reason my scripts that I invoke are not picking up that environment variable. Am I doing something wrong? These custom commands are starting to get pretty complex and I'm wondering if I should pull out the logic into a batch file. What do you guys think? [snip long code] Definitely batch file or, preferably CMake script. In CMake scripts, just assign to the ENV{VAR} variable and use execute_process(). CMake script would imply that it runs as part of the configuration process. I can't build an installer until all binaries are compiled and linked, so it needs to be a target in visual studio. Wrong. add_custom_command( COMMAND ${CMAKE_EXECUTABLE} -DVAR=VAL -P ${PROJECT_BINARY_DIR}/script.cmake DEPENDS ${PROJECT_BINARY_DIR}/script.cmake WORKING_DIRECTORY ${PROJECT_BINARY_DIR} COMMENT Running script.cmake VERBATIM) Problem with pushing this out to a batch file is that I only have 9 parameters maximum that I can use to pass CMake variables. I need more than 9, as you can see from the number of variables I use in the script I sent you. I can't think of a good design for this. Not to mention I hate batch files. Configured CMake file, it is. set(VAR1 VAL1) set(VAR2 VAL2) set(VAR3 VAL3) configure_file(script.cmake.in ${PROJECT_BINARY_DIR}/script.cmake @ONLY) Where script.cmake.in could look like this: set(ENV{VAR1} @VAR1@) set(ENV{VAR2} @VAR2@) set(ENV{VAR3} @VAR3@) message(STATUS DEBUG: VAR1=$ENV{VAR1}, VAR2=$ENV{VAR2}, VAR3=$ENV{VAR3}) But moving it out to a batch file will guarantee that I can setup the environment properly (set environment variables) and also when users change the way the installer works, CMake won't need to be reconfigured, which is a huge plus. Any advice here on how I could setup my batch file to accept more than 9 parameters from CMake? Make it a configured file. Either batch or CMake script, as shown above. 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
[CMake] CMAKE_EXE_LINKER_FLAGS for shared libraries?
I need a version of CMAKE_EXE_LINKER_FLAGS for shared libraries. I need to specify /NODEFAULTLIB for a shared library (DLL) that I'm building, but it doesn't seem that CMAKE_EXE_LINKER_FLAGS is used by shared library projects generated by CMake for visual studio. Any suggestions? - Robert Dailey -- 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_EXE_LINKER_FLAGS for shared libraries?
On 12/12/2011 09:00 PM, Robert Dailey wrote: I need a version of CMAKE_EXE_LINKER_FLAGS for shared libraries. I need to specify /NODEFAULTLIB for a shared library (DLL) that I'm building, but it doesn't seem that CMAKE_EXE_LINKER_FLAGS is used by shared library projects generated by CMake for visual studio. Any suggestions? Use CMAKE_SHARED_LINKER_FLAGS. Strangely, this family of variables is missing from the docs... Michael -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Setting environment variables in custom command
On Mon, Dec 12, 2011 at 1:53 PM, Michael Wild them...@gmail.com wrote: CMake script would imply that it runs as part of the configuration process. I can't build an installer until all binaries are compiled and linked, so it needs to be a target in visual studio. Wrong. add_custom_command( COMMAND ${CMAKE_EXECUTABLE} -DVAR=VAL -P ${PROJECT_BINARY_DIR}/script.cmake DEPENDS ${PROJECT_BINARY_DIR}/script.cmake WORKING_DIRECTORY ${PROJECT_BINARY_DIR} COMMENT Running script.cmake VERBATIM) Interesting, I didn't even think about doing this. Good job :) I will do this. I can use add_custom_target instead though, right? Why do you use add_custom_command here? I don't know how that translates in Visual Studio. Problem with pushing this out to a batch file is that I only have 9 parameters maximum that I can use to pass CMake variables. I need more than 9, as you can see from the number of variables I use in the script I sent you. I can't think of a good design for this. Not to mention I hate batch files. Configured CMake file, it is. set(VAR1 VAL1) set(VAR2 VAL2) set(VAR3 VAL3) configure_file(script.cmake.in ${PROJECT_BINARY_DIR}/script.cmake @ONLY) Where script.cmake.in could look like this: set(ENV{VAR1} @VAR1@) set(ENV{VAR2} @VAR2@) set(ENV{VAR3} @VAR3@) message(STATUS DEBUG: VAR1=$ENV{VAR1}, VAR2=$ENV{VAR2}, VAR3=$ENV{VAR3}) But moving it out to a batch file will guarantee that I can setup the environment properly (set environment variables) and also when users change the way the installer works, CMake won't need to be reconfigured, which is a huge plus. Any advice here on how I could setup my batch file to accept more than 9 parameters from CMake? Make it a configured file. Either batch or CMake script, as shown above. If I use a CMake script, I won't need it to be configured, right? As I can pass in as many -D arguments as I want it seems. I definitely like CMake scripts better than batch files, so I will go with CMake scripts. Thanks for the insight. -- 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_EXE_LINKER_FLAGS for shared libraries?
Apparently, they are undocumented, but there are also: CMAKE_SHARED_LINKER_FLAGS and CMAKE_MODULE_LINKER_FLAGS (and their per-config variants) for SHARED and MODULE library targets as well. Use CMAKE_SHARED_LINKER_FLAGS instead. HTH, David On Mon, Dec 12, 2011 at 3:00 PM, Robert Dailey rcdai...@gmail.com wrote: I need a version of CMAKE_EXE_LINKER_FLAGS for shared libraries. I need to specify /NODEFAULTLIB for a shared library (DLL) that I'm building, but it doesn't seem that CMAKE_EXE_LINKER_FLAGS is used by shared library projects generated by CMake for visual studio. Any suggestions? - Robert Dailey -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMAKE_EXE_LINKER_FLAGS for shared libraries?
On Mon, Dec 12, 2011 at 2:10 PM, David Cole david.c...@kitware.com wrote: Apparently, they are undocumented, but there are also: CMAKE_SHARED_LINKER_FLAGS and CMAKE_MODULE_LINKER_FLAGS (and their per-config variants) for SHARED and MODULE library targets as well. Use CMAKE_SHARED_LINKER_FLAGS instead. Thanks for the information guys. I'm having a minor problem with these variables though. Here is how I use it: set( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:\${lib}\ ) Prior to calling the set above, the shared linker flags look like this: /STACK:1000 /machine:X86 After calling the set above, it looks like this: /STACK:1000 /machine:X86 ;/NODEFAULTLIB:LIBC For some reason a semi-colon is being inserted prior to the /NODEFAULTLIB part. I don't know why this is happening but visual studio is complaining about it. Any reason why this is happening? Thanks. -- 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_EXE_LINKER_FLAGS for shared libraries?
On Mon, Dec 12, 2011 at 2:13 PM, Robert Dailey rcdai...@gmail.com wrote: On Mon, Dec 12, 2011 at 2:10 PM, David Cole david.c...@kitware.comwrote: Apparently, they are undocumented, but there are also: CMAKE_SHARED_LINKER_FLAGS and CMAKE_MODULE_LINKER_FLAGS (and their per-config variants) for SHARED and MODULE library targets as well. Use CMAKE_SHARED_LINKER_FLAGS instead. Thanks for the information guys. I'm having a minor problem with these variables though. Here is how I use it: set( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:\${lib}\ ) Prior to calling the set above, the shared linker flags look like this: /STACK:1000 /machine:X86 After calling the set above, it looks like this: /STACK:1000 /machine:X86 ;/NODEFAULTLIB:LIBC For some reason a semi-colon is being inserted prior to the /NODEFAULTLIB part. I don't know why this is happening but visual studio is complaining about it. Any reason why this is happening? Thanks. Actually I just realized it is probably putting the semi-colon there because it thinks I'm trying to create a list. I guess I need to create a temp variable and call list(APPEND) on it first, then set CMAKE_SHARED_LINKER_FLAGS to the temp list variable? Kind of messy... -- 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] Setting environment variables in custom command
On 12/12/2011 09:05 PM, Robert Dailey wrote: On Mon, Dec 12, 2011 at 1:53 PM, Michael Wild them...@gmail.com mailto:them...@gmail.com wrote: CMake script would imply that it runs as part of the configuration process. I can't build an installer until all binaries are compiled and linked, so it needs to be a target in visual studio. Wrong. add_custom_command( COMMAND ${CMAKE_EXECUTABLE} -DVAR=VAL -P ${PROJECT_BINARY_DIR}/script.cmake DEPENDS ${PROJECT_BINARY_DIR}/script.cmake WORKING_DIRECTORY ${PROJECT_BINARY_DIR} COMMENT Running script.cmake VERBATIM) Interesting, I didn't even think about doing this. Good job :) I will do this. I can use add_custom_target instead though, right? Why do you use add_custom_command here? I don't know how that translates in Visual Studio. A custom target is considered to be always out of date. I.e. it always runs its COMMAND. A custom command produces one or multiple output files that CMake (or in your case, also VisualStudio) knows about. The command is only executed if one of its dependencies is newer than any of the outputs. Often it is customary to have pairs of custom commands and targets. Problem with pushing this out to a batch file is that I only have 9 parameters maximum that I can use to pass CMake variables. I need more than 9, as you can see from the number of variables I use in the script I sent you. I can't think of a good design for this. Not to mention I hate batch files. Configured CMake file, it is. set(VAR1 VAL1) set(VAR2 VAL2) set(VAR3 VAL3) configure_file(script.cmake.in http://script.cmake.in ${PROJECT_BINARY_DIR}/script.cmake @ONLY) Where script.cmake.in http://script.cmake.in could look like this: set(ENV{VAR1} @VAR1@) set(ENV{VAR2} @VAR2@) set(ENV{VAR3} @VAR3@) message(STATUS DEBUG: VAR1=$ENV{VAR1}, VAR2=$ENV{VAR2}, VAR3=$ENV{VAR3}) But moving it out to a batch file will guarantee that I can setup the environment properly (set environment variables) and also when users change the way the installer works, CMake won't need to be reconfigured, which is a huge plus. Any advice here on how I could setup my batch file to accept more than 9 parameters from CMake? Make it a configured file. Either batch or CMake script, as shown above. If I use a CMake script, I won't need it to be configured, right? As I can pass in as many -D arguments as I want it seems. It will probably still run through the Windows command interpreter, so the number of arguments is very limited. I'm not experienced enough to tell for sure, though... I definitely like CMake scripts better than batch files, so I will go with CMake scripts. Thanks for the insight. You're welcome. Michael -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Changing Package Top level directory name
2011/12/12 vivek goel goelvivek2...@gmail.com: hi, how can I change the name of top level directory of cpack. Without changing CPACK_PACKAGE_FILE_NAME ? I want package name to be in format of cmake-2.5.0-Linux-i686 only. But I want to change the root (top directory ) name inside package. There is a bug related to this issue: http://public.kitware.com/Bug/view.php?id=12606 -- 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_EXE_LINKER_FLAGS for shared libraries?
On Mon, Dec 12, 2011 at 3:15 PM, Robert Dailey rcdai...@gmail.com wrote: On Mon, Dec 12, 2011 at 2:13 PM, Robert Dailey rcdai...@gmail.com wrote: On Mon, Dec 12, 2011 at 2:10 PM, David Cole david.c...@kitware.com wrote: Apparently, they are undocumented, but there are also: CMAKE_SHARED_LINKER_FLAGS and CMAKE_MODULE_LINKER_FLAGS (and their per-config variants) for SHARED and MODULE library targets as well. Use CMAKE_SHARED_LINKER_FLAGS instead. Thanks for the information guys. I'm having a minor problem with these variables though. Here is how I use it: set( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:\${lib}\ ) Prior to calling the set above, the shared linker flags look like this: /STACK:1000 /machine:X86 After calling the set above, it looks like this: /STACK:1000 /machine:X86 ;/NODEFAULTLIB:LIBC For some reason a semi-colon is being inserted prior to the /NODEFAULTLIB part. I don't know why this is happening but visual studio is complaining about it. Any reason why this is happening? Thanks. Actually I just realized it is probably putting the semi-colon there because it thinks I'm trying to create a list. I guess I need to create a temp variable and call list(APPEND) on it first, then set CMAKE_SHARED_LINKER_FLAGS to the temp list variable? Kind of messy... These are space separated in the final value, and passed to the linker as is, so you should set it like this: set( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:\${lib}\ ) (Double-quote the whole thing, so the space is embedded in the string, rather than used by cmake as an argument separator for the set command.) HTH, David -- 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_EXE_LINKER_FLAGS for shared libraries?
On 12/12/2011 09:13 PM, Robert Dailey wrote: On Mon, Dec 12, 2011 at 2:10 PM, David Cole david.c...@kitware.com mailto:david.c...@kitware.com wrote: Apparently, they are undocumented, but there are also: CMAKE_SHARED_LINKER_FLAGS and CMAKE_MODULE_LINKER_FLAGS (and their per-config variants) for SHARED and MODULE library targets as well. Use CMAKE_SHARED_LINKER_FLAGS instead. Thanks for the information guys. I'm having a minor problem with these variables though. Here is how I use it: set( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:\${lib}\ ) Prior to calling the set above, the shared linker flags look like this: /STACK:1000 /machine:X86 After calling the set above, it looks like this: /STACK:1000 /machine:X86 ;/NODEFAULTLIB:LIBC For some reason a semi-colon is being inserted prior to the /NODEFAULTLIB part. I don't know why this is happening but visual studio is complaining about it. Any reason why this is happening? Thanks. That's how CMake works. set(VAR val1 val2 val3) defines a *list* where the elements are separated by a semi-colon (;). To prevent that, quote the assignment: set(VAR val1 val2 val3) Michael -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] hear hear
On Monday 12 December 2011, Johannes Zarl wrote: On Tuesday, 6. December 2011, 17:27:47, Daniel Dekkers wrote: On Dec 4, 2011, at 11:59 AM, Michael Jackson wrote: I think if the CMake community took a vote we could probably come up with an Exemplar Find*.cmake file that is good for someone trying to develop a new one. Yes please. And I think in general that is true. Of course it is more interesting and often more urgent to spend time on exotic problems. But there are these basics that are missing in the documentation. Like,.. this works in 99% of the cases, we, CMake, advise you to do this. If you don't, you are making life hard on yourself and you are more or less on your own. Something like: 1) a single executable 2) a single executable linked to a lib built from source 3) different executables using the same lib built from source 4) a single executable linked to a binary lib (with the aid of a find module) ... n) multiple executables linked to multiple libraries (linked to third-party libraries), some static, some dynamic, some with their own CMake builds, some without, on different platforms. Auch. n+1) making anything work with Xcode I would like that, too. Also, it would be nice if the example would include a *Config.cmake (and *Version.cmake) file. Here is an example which shows just that: https://projects.kde.org/projects/kde/kdeexamples/repository/revisions/master/show/buildsystem/HowToInstallALibrary It's not final yet, i.e. I'll work on improving it in the next weeks. Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMAKE_EXE_LINKER_FLAGS for shared libraries?
Another issue... At what point is it most important for the values of CMAKE_SHARED_LINK_FLAGS to exist? I set the value of this variable before my call to add_library(), however after that at some point the flags will get reverted because I'm stepping out of function scope. Does it need to exist up to the end of the current cmake script? My flow is basically this (pseudo call stack): Enter CMakeLists.txt - Call define_project() function (in a separate cmake module) - - Call ignore_libs() function - - - Set CMAKE_SHARED_LINK_FLAGS with PARENT_SCOPE - - Call create_target() function - - - Call add_library() command Leave CMakeLists.txt I've done some testing and I find that before the call to add_library(), my flags are setup properly in the CMAKE_SHARED_LINK_FLAGS variable. - Robert Dailey On Mon, Dec 12, 2011 at 2:20 PM, Michael Wild them...@gmail.com wrote: On 12/12/2011 09:13 PM, Robert Dailey wrote: On Mon, Dec 12, 2011 at 2:10 PM, David Cole david.c...@kitware.com mailto:david.c...@kitware.com wrote: Apparently, they are undocumented, but there are also: CMAKE_SHARED_LINKER_FLAGS and CMAKE_MODULE_LINKER_FLAGS (and their per-config variants) for SHARED and MODULE library targets as well. Use CMAKE_SHARED_LINKER_FLAGS instead. Thanks for the information guys. I'm having a minor problem with these variables though. Here is how I use it: set( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:\${lib}\ ) Prior to calling the set above, the shared linker flags look like this: /STACK:1000 /machine:X86 After calling the set above, it looks like this: /STACK:1000 /machine:X86 ;/NODEFAULTLIB:LIBC For some reason a semi-colon is being inserted prior to the /NODEFAULTLIB part. I don't know why this is happening but visual studio is complaining about it. Any reason why this is happening? Thanks. That's how CMake works. set(VAR val1 val2 val3) defines a *list* where the elements are separated by a semi-colon (;). To prevent that, quote the assignment: set(VAR val1 val2 val3) Michael -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMAKE_EXE_LINKER_FLAGS for shared libraries?
I forgot to say that the main issue is that my /NODEFAULTLIB link flag isn't showing up in visual studio. - Robert Dailey On Mon, Dec 12, 2011 at 4:10 PM, Robert Dailey rcdai...@gmail.com wrote: Another issue... At what point is it most important for the values of CMAKE_SHARED_LINK_FLAGS to exist? I set the value of this variable before my call to add_library(), however after that at some point the flags will get reverted because I'm stepping out of function scope. Does it need to exist up to the end of the current cmake script? My flow is basically this (pseudo call stack): Enter CMakeLists.txt - Call define_project() function (in a separate cmake module) - - Call ignore_libs() function - - - Set CMAKE_SHARED_LINK_FLAGS with PARENT_SCOPE - - Call create_target() function - - - Call add_library() command Leave CMakeLists.txt I've done some testing and I find that before the call to add_library(), my flags are setup properly in the CMAKE_SHARED_LINK_FLAGS variable. - Robert Dailey On Mon, Dec 12, 2011 at 2:20 PM, Michael Wild them...@gmail.com wrote: On 12/12/2011 09:13 PM, Robert Dailey wrote: On Mon, Dec 12, 2011 at 2:10 PM, David Cole david.c...@kitware.com mailto:david.c...@kitware.com wrote: Apparently, they are undocumented, but there are also: CMAKE_SHARED_LINKER_FLAGS and CMAKE_MODULE_LINKER_FLAGS (and their per-config variants) for SHARED and MODULE library targets as well. Use CMAKE_SHARED_LINKER_FLAGS instead. Thanks for the information guys. I'm having a minor problem with these variables though. Here is how I use it: set( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:\${lib}\ ) Prior to calling the set above, the shared linker flags look like this: /STACK:1000 /machine:X86 After calling the set above, it looks like this: /STACK:1000 /machine:X86 ;/NODEFAULTLIB:LIBC For some reason a semi-colon is being inserted prior to the /NODEFAULTLIB part. I don't know why this is happening but visual studio is complaining about it. Any reason why this is happening? Thanks. That's how CMake works. set(VAR val1 val2 val3) defines a *list* where the elements are separated by a semi-colon (;). To prevent that, quote the assignment: set(VAR val1 val2 val3) Michael -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] FindLAPACK problem
Hi, I sent this out awhile ago, saying it couldn't find the MKL LAPACK. But I think the problem may be bigger than that because it can't find non-MKL lapack for me either. I get: -- A library with BLAS API found. -- A library with BLAS API found. CMake Error at /usr/share/cmake/Modules/FindLAPACK.cmake:295 (message): A required library with LAPACK API not found. Please specify library location. Call Stack (most recent call first): but |21:52||tgallagher@harpy:leslie| ls /usr/lib64/libblas* /usr/lib64/libblas.a /usr/lib64/libblas_pic.a /usr/lib64/libblas.so /usr/lib64/libblas.so.3 /usr/lib64/libblas.so.3.3.1 |21:52||tgallagher@harpy:leslie| ls /usr/lib64/liblapack* /usr/lib64/liblapack.a /usr/lib64/liblapack.so /usr/lib64/liblapack.so.3.3.1 /usr/lib64/liblapack_pic.a /usr/lib64/liblapack.so.3 So I have BLAS and LAPACK installed from OpenSuSE and CMake 2.8.6. This is sort of a show stopper if we can't get FindLAPACK working. Tim -- 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_EXE_LINKER_FLAGS for shared libraries?
It needs to exist **at the end** of the CMakeLists.txt file containing the target. If you don't want to do that (or can't, as in your case), you can use the LINK_FLAGS target property instead. HTH Michael On 12/12/2011 11:39 PM, Robert Dailey wrote: I have attached a small CMake project that reproduces the issue I'm referring to. Please take a look :) - Robert Dailey On Mon, Dec 12, 2011 at 4:11 PM, Robert Dailey rcdai...@gmail.com mailto:rcdai...@gmail.com wrote: I forgot to say that the main issue is that my /NODEFAULTLIB link flag isn't showing up in visual studio. - Robert Dailey On Mon, Dec 12, 2011 at 4:10 PM, Robert Dailey rcdai...@gmail.com mailto:rcdai...@gmail.com wrote: Another issue... At what point is it most important for the values of CMAKE_SHARED_LINK_FLAGS to exist? I set the value of this variable before my call to add_library(), however after that at some point the flags will get reverted because I'm stepping out of function scope. Does it need to exist up to the end of the current cmake script? My flow is basically this (pseudo call stack): Enter CMakeLists.txt - Call define_project() function (in a separate cmake module) - - Call ignore_libs() function - - - Set CMAKE_SHARED_LINK_FLAGS with PARENT_SCOPE - - Call create_target() function - - - Call add_library() command Leave CMakeLists.txt I've done some testing and I find that before the call to add_library(), my flags are setup properly in the CMAKE_SHARED_LINK_FLAGS variable. - Robert Dailey On Mon, Dec 12, 2011 at 2:20 PM, Michael Wild them...@gmail.com mailto:them...@gmail.com wrote: On 12/12/2011 09:13 PM, Robert Dailey wrote: On Mon, Dec 12, 2011 at 2:10 PM, David Cole david.c...@kitware.com mailto:david.c...@kitware.com mailto:david.c...@kitware.com mailto:david.c...@kitware.com wrote: Apparently, they are undocumented, but there are also: CMAKE_SHARED_LINKER_FLAGS and CMAKE_MODULE_LINKER_FLAGS (and their per-config variants) for SHARED and MODULE library targets as well. Use CMAKE_SHARED_LINKER_FLAGS instead. Thanks for the information guys. I'm having a minor problem with these variables though. Here is how I use it: set( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:\${lib}\ ) Prior to calling the set above, the shared linker flags look like this: /STACK:1000 /machine:X86 After calling the set above, it looks like this: /STACK:1000 /machine:X86 ;/NODEFAULTLIB:LIBC For some reason a semi-colon is being inserted prior to the /NODEFAULTLIB part. I don't know why this is happening but visual studio is complaining about it. Any reason why this is happening? Thanks. That's how CMake works. set(VAR val1 val2 val3) defines a *list* where the elements are separated by a semi-colon (;). To prevent that, quote the assignment: set(VAR val1 val2 val3) Michael -- Powered by www.kitware.com http://www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] [CTest] CTest -S script cannot be found on Windows network drive (solved)
On 12/09/2011 04:47 PM, m.hergarden wrote: On 12/09/2011 04:30 PM, David Cole wrote: On Fri, Dec 9, 2011 at 9:30 AM, m.hergardenm.hergar...@euphoria-it.nl wrote: I have two buildservers: a Linux box and a Windows box. I now have a buildscript that does a svn checkout in the homedir of the Linux build user. This directory is shared read/write using Samba. The Windows builduser (same credentials, same uid) is able to reach the files through a mingw mount. On the Windows box there is a ssh server, so I can run commands from the Linux box. When running ssh windowsbuilduser@windowsip 'ctest -S /path/to/scriptfile' I get the following error: CMake Error: Cannot find file: /path/to/scriptfile (actual pathnames are used of course) When running ssh windowsbuilduser@windowsip 'ls /path/to/scriptfile' I do see that the scriptfile is there. My guess is that ctest starts a new shell, which cannot find the script. Is that a correct assumption? Does anybody know how to resolve this? Any help or pointers would be very much appreciated. With kind regards, Micha Hergarden -- Powered bywww.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 What sshd are you running on the Windows box? Can you map the network path to a Windows drive letter (say N: for network), and use the N:/path/to/script file form instead? Thank you for the quick reply. I am using FreeSSHd. Using the 'net use' command I can map the network drive to n: When calling ctest using your suggested path locally on the windows box it does seem to work OK. Running it through the ssh session still yields the same error. I'm now successfully using the form you suggested. Thank you for the advice. With kind regards, Micha Hergarden -- 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.6-2187-gf4d10ce
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 f4d10ce77d76df8275e105632d1e7aff84d23b59 (commit) via 121c29553fc66575f231bebda6682b21216c1e03 (commit) from 46eba8bd6a5161a62900c42532b8473633481de1 (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=f4d10ce77d76df8275e105632d1e7aff84d23b59 commit f4d10ce77d76df8275e105632d1e7aff84d23b59 Merge: 46eba8b 121c295 Author: Eric Noulard eric.noul...@gmail.com AuthorDate: Mon Dec 12 17:13:16 2011 -0500 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Mon Dec 12 17:13:16 2011 -0500 Merge topic 'CPackRPM-0012608-UserSpecificFileControl' into next 121c295 CPackRPM fix #0012608 and unoticed related bug http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=121c29553fc66575f231bebda6682b21216c1e03 commit 121c29553fc66575f231bebda6682b21216c1e03 Author: Eric NOULARD eric.noul...@gmail.com AuthorDate: Mon Dec 12 23:11:02 2011 +0100 Commit: Eric NOULARD eric.noul...@gmail.com CommitDate: Mon Dec 12 23:11:02 2011 +0100 CPackRPM fix #0012608 and unoticed related bug The User may now specific a list of file that shouldn't be automatically handled by CPack but specified by the user. Like %config(noreplace) or specific %attr. The concerned files/dir lines will be removed from the set automatically handled by CPack. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index bb1021b..bf476ad 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -161,6 +161,15 @@ # CPACK_RPM_COMPONENT_POST_UNINSTALL_SCRIPT_FILE # One may verify which scriptlet has been included with # rpm -qp --scripts package.rpm +# CPACK_RPM_USER_FILELIST +# CPACK_RPM_COMPONENT_USER_FILELIST +# Mandatory : NO +# Default : - +# May be used to explicitely specify %(directive) file line +# in the spec file. Like %config(noreplace) or any other directive +# that be found in the %files section. Since CPackRPM is generating +# the list of files (and directories) the user specified files of +# the CPACK_RPM_COMPONENT_USER_FILELIST list will be removed from the generated list. # CPACK_RPM_CHANGELOG_FILE # Mandatory : NO # Default : - @@ -594,23 +603,89 @@ EXECUTE_PROCESS(COMMAND find . -type f -o -type l -o (-type d -a -not -name .) WORKING_DIRECTORY ${WDIR} OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES) -# In component case, replace CPACK_ABSOLUTE_DESTINATION_FILES -#with the content of CPACK_ABSOLUTE_DESTINATION_FILES_COMPONENT -# This must be done BEFORE the CPACK_ABSOLUTE_DESTINATION_FILES handling +# In component case, put CPACK_ABSOLUTE_DESTINATION_FILES_COMPONENT +# into CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL +# otherwise, put CPACK_ABSOLUTE_DESTINATION_FILES +# This must be done BEFORE the CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL handling if(CPACK_RPM_PACKAGE_COMPONENT) if(CPACK_ABSOLUTE_DESTINATION_FILES) set(COMPONENT_FILES_TAG CPACK_ABSOLUTE_DESTINATION_FILES_${CPACK_RPM_PACKAGE_COMPONENT}) - set(CPACK_ABSOLUTE_DESTINATION_FILES ${${COMPONENT_FILES_TAG}}) + set(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL ${${COMPONENT_FILES_TAG}}) if(CPACK_RPM_PACKAGE_DEBUG) - message(CPackRPM:Debug: Handling Absolute Destination Files ${CPACK_ABSOLUTE_DESTINATION_FILES}) + message(CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}) message(CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}) endif(CPACK_RPM_PACKAGE_DEBUG) endif() +else() + if(CPACK_ABSOLUTE_DESTINATION_FILES) +set(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL ${CPACK_ABSOLUTE_DESTINATION_FILES}) + endif() +endif() + +# In component case, set CPACK_RPM_USER_FILELIST_INTERNAL with CPACK_RPM_COMPONENT_USER_FILELIST. +if(CPACK_RPM_PACKAGE_COMPONENT) + if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_USER_FILELIST) +set(CPACK_RPM_USER_FILELIST_INTERNAL ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_USER_FILELIST}) +if(CPACK_RPM_PACKAGE_DEBUG) + message(CPackRPM:Debug: Handling User Filelist: ${CPACK_RPM_USER_FILELIST_INTERNAL}) + message(CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}) +endif(CPACK_RPM_PACKAGE_DEBUG) + else() +set(CPACK_RPM_USER_FILELIST_INTERNAL ) + endif() +else() + if(CPACK_RPM_USER_FILELIST) +set(CPACK_RPM_USER_FILELIST_INTERNAL ${CPACK_RPM_USER_FILELIST}) + else() +set(CPACK_RPM_USER_FILELIST_INTERNAL ) + endif() +endif() + +# Handle user specified file line list in