[CMake] Looking for Cmake / CPACK documentation
Hello, I am not absolutely sure if this is the right place to ask, so excuse me if I am totally wrong here and show me the right way :) For my software I am looking to create a NSIS installer via CMake (3.2.2) on Windows. Creating an installer with things like components and required parts wasn't that hard, but now I am having two problems: 1. I need a custom page with 2 mutual exclusive options. Depending on the selection I need to copy either file A or file B in "Component 1" while I would need to copy file C or D in "component 2". Is this possible with cmake / cpack or a problem to be tackled within the NSIS system? 2. When starting the created installer itself the GUI is very small, basically having three columns in the window: - A column describing what to do (Left). - A tree view of the available components (Middle) - A description of the selected component (right). The users complained that the window was too small and the texts were near impossible to read. The window itself can't not be resized at all. I tried to switch the GUI by changing to !include "MUI2.nsh" in NSIS.template.in (I was led to believe that this would change the layout to 2 horizontal blocks: Component tree and description of selected component). Compiled, got errors that some variables and macros have changed, corrected that but still the installer shows me the 3 column window layout. As I am currently lost, I am looking for some pointers on where to look for documentation regarding those problems. Thank you in advance Bettina -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[Cmake-commits] CMake branch, master, updated. v3.4.1-850-g03c0303
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 03c0303d2e4bc07b9c5df1ecdbf89da6e36259d9 (commit) from 27410a9c62f883f3bada885b0ef6cdb343ea40b5 (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 - https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=03c0303d2e4bc07b9c5df1ecdbf89da6e36259d9 commit 03c0303d2e4bc07b9c5df1ecdbf89da6e36259d9 Author: Kitware Robot <kwro...@kitware.com> AuthorDate: Mon Jan 18 00:01:06 2016 -0500 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Mon Jan 18 00:01:06 2016 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7e895f3..cb13018 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 4) -set(CMake_VERSION_PATCH 20160117) +set(CMake_VERSION_PATCH 20160118) #set(CMake_VERSION_RC 1) --- Summary of changes: Source/CMakeVersion.cmake |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits
[cmake-developers] [PATCH] Now prints line number of cache parse error
To fix issue 11109, this patch implements the printing of the line number of the CMakeCache.txt file that causes a parse error when an error occurs. --- Source/cmCacheManager.cxx | 10 -- Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 5 + Tests/RunCMake/CommandLine/cache-bad-entry-result.txt | 1 + Tests/RunCMake/CommandLine/cache-bad-entry-stderr.txt | 1 + Tests/RunCMake/CommandLine/cache-bad-entry/CMakeCache.txt | 10 ++ Tests/RunCMake/CommandLine/cache-empty-entry-result.txt | 1 + Tests/RunCMake/CommandLine/cache-empty-entry-stderr.txt | 1 + Tests/RunCMake/CommandLine/cache-empty-entry/CMakeCache.txt | 7 +++ 8 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 Tests/RunCMake/CommandLine/cache-bad-entry-result.txt create mode 100644 Tests/RunCMake/CommandLine/cache-bad-entry-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/cache-bad-entry/CMakeCache.txt create mode 100644 Tests/RunCMake/CommandLine/cache-empty-entry-result.txt create mode 100644 Tests/RunCMake/CommandLine/cache-empty-entry-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/cache-empty-entry/CMakeCache.txt diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index ce8af55..7466c29 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -64,12 +64,14 @@ bool cmCacheManager::LoadCache(const std::string& path, const char *realbuffer; std::string buffer; std::string entryKey; + unsigned int lineno = 0; while(fin) { // Format is key:type=value std::string helpString; CacheEntry e; cmSystemTools::GetLineFromStream(fin, buffer); +lineno++; realbuffer = buffer.c_str(); while(*realbuffer != '0' && (*realbuffer == ' ' || @@ -77,6 +79,7 @@ bool cmCacheManager::LoadCache(const std::string& path, *realbuffer == '\r' || *realbuffer == '\n')) { + if (*realbuffer == '\n') lineno++; realbuffer++; } // skip blank lines and comment lines @@ -96,6 +99,7 @@ bool cmCacheManager::LoadCache(const std::string& path, helpString += [2]; } cmSystemTools::GetLineFromStream(fin, buffer); + lineno++; realbuffer = buffer.c_str(); if(!fin) { @@ -138,8 +142,10 @@ bool cmCacheManager::LoadCache(const std::string& path, } else { - cmSystemTools::Error("Parse error in cache file ", cacheFile.c_str(), - ". Offending entry: ", realbuffer); + std::ostringstream error; + error << "Parse error in cache file " << cacheFile; + error << " on line " << lineno << ". Offending entry: " << realbuffer; + cmSystemTools::Error(error.str().c_str()); } } this->CacheMajorVersion = 0; diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index e77ba1f..8068973 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -33,6 +33,11 @@ run_cmake_command(build-bad-dir run_cmake_command(build-bad-generator ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-bad-generator) +run_cmake_command(cache-bad-entry + ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-bad-entry/) +run_cmake_command(cache-empty-entry + ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-empty-entry/) + function(run_BuildDir) # Use a single build tree for a few tests without cleaning. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/BuildDir-build) diff --git a/Tests/RunCMake/CommandLine/cache-bad-entry-result.txt b/Tests/RunCMake/CommandLine/cache-bad-entry-result.txt new file mode 100644 index 000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/cache-bad-entry-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/cache-bad-entry-stderr.txt b/Tests/RunCMake/CommandLine/cache-bad-entry-stderr.txt new file mode 100644 index 000..35e8be2 --- /dev/null +++ b/Tests/RunCMake/CommandLine/cache-bad-entry-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Parse error in cache file /home/ashley/workspace/cmake/Tests/RunCMake/CommandLine/cache-bad-entry/CMakeCache.txt on line 7. Offending entry: BAD ENTRY.* diff --git a/Tests/RunCMake/CommandLine/cache-bad-entry/CMakeCache.txt b/Tests/RunCMake/CommandLine/cache-bad-entry/CMakeCache.txt new file mode 100644 index 000..75cd7c2 --- /dev/null +++ b/Tests/RunCMake/CommandLine/cache-bad-entry/CMakeCache.txt @@ -0,0 +1,10 @@ +# This is a comment + +// That was an empty line. This isn't. +EMPTY_LINE:BOOL=FALSE + +// Uhoh! Here it comes +BAD ENTRY + +// This is fine +GOOD_ENTRY:BOOL=TRUE diff --git a/Tests/RunCMake/CommandLine/cache-empty-entry-result.txt b/Tests/RunCMake/CommandLine/cache-empty-entry-result.txt new file mode 100644 index 000..d00491f --- /dev/null +++
[CMake] Interpackage dependencies - find_package() from package
Hi, I have problems understanding how the cmake-buildsystem is supposed to resolve inter-package dependencies (imported targets form installed packages). Let say I have a project with an executable target (e.g. someApp) that depends on a library (libfoo). While libfoo is built in a separate project and depends on libbar which is built in another project. Libbar and libfoo export cmake packages (fooConfig.cmake, fooVersion.cmake fooTargets.cmake etc.) according to [1] and [3] I.e.: someApp->libfoo->libbar In libfoo: - find_package(bar CONFIG REQUIRED) - target_link_libraries(bar::bar) The packages are installed and found - no problem here. In FooTargets.cmake the dependency on bar::bar is added to INTERFACE_LINK_LIBRARIES. If in someApp I find foo find_package(foo CONFIG REQUIRED) I get an error: "The following imported targets are referenced, but are missing: bar::bar" The current workaround is to manually add in someApp find_package(bar CONFIG REQUIRED) before find_package(foo CONFIG REQUIRED) But in my understanding this find_package(bar) should somehow be resolved from the package foo - am I wrong? The client should not have to resolve the entire dependency tree manually bay adding find_package() in the correct order. How can this be done? Do I miss something or does CMake (3.4) just not do what I want it to do out of the box? Thanks in advance! Thomas I am using the wiki + reference: [1] https://cmake.org/Wiki/CMake/Tutorials/Packaging [2] https://cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html and this example: [3] https://github.com/forexample/package-example -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Interpackage dependencies - find_package() from package
> If in someApp I find foo find_package(foo CONFIG REQUIRED) > I get an error: "The following imported targets are referenced, but are > missing: bar::bar" > > The current workaround is to manually add in someApp > find_package(bar CONFIG REQUIRED) before > find_package(foo CONFIG REQUIRED) > > > But in my understanding this find_package(bar) should somehow be > resolved from the package foo - am I wrong? > The client should not have to resolve the entire dependency tree > manually bay adding find_package() in the correct order. > How can this be done? As far as I know find_package(foo) will not search for its dependencies (e.g. bar) except if you put another find_package inside Findfoo.cmake script that finds it for you. On the other hand I doubt that this is a CMake issue/shortcoming. I imagine that your dependency tree looks something like this: your_program <- foo <- bar <- bar so both your program and foo library depend on bar library and there are three cases that I see: 1) your application has direct dependency on bar library (is using bar api) 2a) your application depends on foo that exposes bar api because it uses bar api as public foo api 2b) you application depends on foo that exposes bar api but foo doesn't use it as public foo api In all cases you will have to search for bar library yourself and link it to your application but: In case 1 it is logical that you have to search for bar lib yourself since it is just a coincidence that foo is using bar internally. In case 2a dependency to bar is by design and it's questionable why bar is used in public foo api (maybe performance reasons?) so it might be a flaw in library design (or is your own library in which case it would probably be better to create an object library and do all the linking and searching for libraries in you applications cmake list - in this case you could also set a variable with PARENT_SCOPE that gets propagated to root cmake list to automate you dependency detection). In case 2b dependency to bar is accidental and is just poor/old library design - library is not linked with everything being a private symbol and only public api being marked as public either by using an attribute (https://gcc.gnu.org/wiki/Visibility - supported in one way or the other in gcc, Visual C++, xlC from version 13.1 and probably clang and others) or some other form like export lists or static keywords (http://www.ibm.com/developerworks/aix/library/au-aix-symbol-visibility/). If this is an external library and you are using it for production application I would suggest that if possible you write a wrapper library that only exposes its public api and link your application only to your wrapper - or if library is open sourced ask if they are interested in such patches and contribute them there. In any case if this is not supporter directly by CMake (could be that it is and I only don't know about it) I doubt that it should be since libraries leaking their internal implementation probably have API and ABI compatibility issues between versions and can cause interesting compile and runtime errors when linked twice as in your case but with different shared library versions (e.g. you get an already compiled library and just want to link to it but don't know with which version of internally dependent library it was built). Issues with this can be easily seen in cases such as: your_program <- foo <- bar (v 1.0) <- bas <- bar (v 2.1) <- bar (v 1.3) If your application, foo, bar and bas are not built as the same super project or expect different (not API compatible) versions of bar and they all leak their internal use to the world (and let's also say that bar 1 and 2 were not tested for combined use in the same application) then have fun building such an application without causing interesting runtime errors (e.g. constructor from being called version 1.0 and destructor from version 2.1). Hope this helps. Regards, Domen -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Code::blocks: parallel build from IDE
On Sunday, January 17, 2016 13:45:34 Dimitri Kaparis wrote: > On Sat, Jan 9, 2016 at 9:16 PM, Alexander Neundorf> wrote: > > On Saturday, January 09, 2016 12:27:48 Dimitri Kaparis wrote: > > > Greetings, > > > > > > I'm using the "CodeBlocks - Unix Makefiles" generator under linux to > > > > create > > > > > a build tree for my project consisting of multiple executables and > > > libraries. > > > From the command line, I could use make -jN switch from the root of the > > > build tree to invoke a full build in parallel, but I see no way of doing > > > that from the Code Blocks IDE. > > > > Oops, sorry, that's not implemented for C::B. > > > > Alex > > Any plans on it, yes, but not commited yet. Alex -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Code::blocks: parallel build from IDE
On Sat, Jan 9, 2016 at 9:16 PM, Alexander Neundorfwrote: > On Saturday, January 09, 2016 12:27:48 Dimitri Kaparis wrote: > > Greetings, > > > > I'm using the "CodeBlocks - Unix Makefiles" generator under linux to > create > > a build tree for my project consisting of multiple executables and > > libraries. > > From the command line, I could use make -jN switch from the root of the > > build tree to invoke a full build in parallel, but I see no way of doing > > that from the Code Blocks IDE. > > Oops, sorry, that's not implemented for C::B. > > Alex > > Any plans on it, or an idea for a workaround? Thanks, Dimitri -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Code::blocks: parallel build from IDE
On 17.01.2016 12:45, Dimitri Kaparis wrote: On Sat, Jan 9, 2016 at 9:16 PM, Alexander Neundorf> wrote: Oops, sorry, that's not implemented for C::B. Alex Any plans on it, or an idea for a workaround? As a workaround perhaps "CodeBlocks - Ninja" would be an option? ninja builds parallel by default. Nils -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Interpackage dependencies - find_package() from package
Thank you Domen for your detailed answer! > If your application, foo, bar and bas are not built as the same super > project [...] In fact this is where I started, for now all are build in the same super-project and foo and bar have tight coupling. In fact foo and bar end up in the same Cpack package and are installed together. (BTW. foo and bar are static libraries and bar exports compile_flags to let its clients know how it was compiled.) I started playing around trying if I can use the packages installed and found the problem that while bar can be used in the client program foo couldn't and I wondered wether this is possible. Your arguments make total sense... althought it would be cool if it worked... Thanks again! Thomas -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[cmake-developers] [PATCH] Now prints warning when --build is not honored
As per issue 12641, this patch means that a warning is given when the "--build" option is ignored. I'm not sure if you'd want a different error message here. I feel like it might be better to print something about the fact that "--build" should be used after the binary tree has been generated, but I can't think of a good way to word it. Also this doesn't print a warning when "--build" is used in command mode. It felt unnecessary. --- Source/cmake.cxx | 5 + 1 file changed, 5 insertions(+) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 8f6b952..27378c9 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -798,6 +798,11 @@ void cmake::SetArgs(const std::vector& args, this->SetGlobalGenerator(gen); } } +else if (arg.find("--build", 0) == 0) + { + cmSystemTools::Message("--build is not a valid option when " + "generating a project binary tree. Ignoring.", "Warning"); + } // no option assume it is the path to the source else { -- 2.6.4 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers