[CMake] How do I allow an ExternalProject to fail?

2015-11-13 Thread Nicholas Braden
to use this with ExternalProject_Add - I want CMake to automatically download and update the git repository and try to rebuild it again when there are changes, if possible. What would be the best way to go about doing this? I am using CMake 3.4.0 Thanks, Nicholas Braden -- Powered by www.kitware.com

Re: [CMake] How to build cmake to have http support?

2015-11-15 Thread Nicholas Braden
Have you tried installing the required parts locally (e.g. in your home directory) and just telling CMake to look there instead of the default system locations? On Sun, Nov 15, 2015 at 9:52 AM, Cedric Doucet wrote: > > Thank you Gregor! > > As I feared, this solution does

Re: [CMake] Creating relocatable export files

2015-11-14 Thread Nicholas Braden
Instead of using FOO_INCLUDE_DIR, I believe you should use target_include_directories() with the INTERFACE or PUBLIC options - this will export the include directories properly and they will be used when someone target_link_library()s your exported target.

Re: [CMake] adding external project

2015-12-15 Thread Nicholas Braden
What's the word "clone" doing in there? That should be a URL, not command parameters. On Tue, Dec 15, 2015 at 2:01 AM, Owen Hogarth II wrote: > I have been reading this: > https://cmake.org/cmake/help/v3.0/module/ExternalProject.html > > trying to add sdl external project

Re: [CMake] adding external project

2015-12-15 Thread Nicholas Braden
gt; the end of the cmakelists.txt files > > TARGET_INCLUDE_DIRECTORIES(mylib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/headers) > > so that I can just #include "mylib" instead of the path to the file. With > this setup, I can't do target_include_directories from the > external_pro

Re: [CMake] Calling find_package(self) for in-project builds

2016-06-02 Thread Nicholas Braden
Although not ideal, you could alias the targets to the names they would have when imported with find_package() by using add_library(ALIAS), and then use if(TARGET) to conditionally call find_package(). This also is a step toward supporting using the library via add_subdirectory(), if that ever

Re: [CMake] Policy CMP0063 is not set: Honor visibility properties for all target

2016-06-18 Thread Nicholas Braden
CMP0063 was not added until CMake 3.3, so requesting 3.1 as the minimum does not make sense. https://cmake.org/cmake/help/latest/policy/CMP0063.html On Sat, Jun 18, 2016 at 6:03 AM, Alexander Shukaev wrote: > On 06/18/2016 12:18 PM, Nils Gladitz wrote: >> >> On

Re: [CMake] Compiling binaries with cmake -- help

2016-06-22 Thread Nicholas Braden
Are you trying to use an existing CMakeLists.txt, or are you trying to create your own? CMake doesn't just work on source files alone. On Wed, Jun 22, 2016 at 7:30 PM, Crest Christopher wrote: > Hi, I'm hoping I can get some help on how to compile a repository from >

Re: [CMake] Compiling binaries with cmake -- help

2016-06-22 Thread Nicholas Braden
> which file you have downloaded or project you want to compile? > > I think this would make it much easier for readers to help. > > Best regards, > > Martin > > Nicholas Braden > Wednesday, June 22, 2016 8:50 PM > Are you trying to use an existing CMakeLists.txt,

Re: [CMake] Compiling binaries with cmake -- help

2016-06-22 Thread Nicholas Braden
s missing dependencies ? > > Nicholas Braden > Thursday, June 23, 2016 1:08 AM > It looks like the instructions are there in the README. I tried > building on my system but I'm missing some dependencies (e.g. at some > point it finds my Python 3 installation and tries to run some code b

Re: [CMake] Dependency on imported target with ninja-generator

2016-06-22 Thread Nicholas Braden
If Project B depends on Project A, you should probably be using the ExternalProject module with a superproject structure that builds both projects in the proper order. https://cmake.org/cmake/help/latest/module/ExternalProject.html Trying to manually call CMake is not really a good idea IMO -

Re: [CMake] Compiling binaries with cmake -- help

2016-06-23 Thread Nicholas Braden
it compiled ? > > Nicholas Braden > Thursday, June 23, 2016 1:15 AM > Yes, many projects do not include their dependencies and require you > to obtain them yourself. In this case it looks like you need the > Python sipconfig module installed. > > On Thu, Jun 23, 2016 at 12:10 AM,

Re: [CMake] CXX_STANDARD and -std=c++14

2016-06-23 Thread Nicholas Braden
This was asked recently - have a look at the CXX_EXTENSIONS property: https://cmake.org/cmake/help/latest/prop_tgt/CXX_EXTENSIONS.html Previous discussion: http://public.kitware.com/pipermail/cmake/2016-June/063691.html On Thu, Jun 23, 2016 at 7:27 AM, James Swift wrote: >

Re: [CMake] CMake based package manager

2016-01-11 Thread Nicholas Braden
Doesn't biicode already fill this role? Biicode seems to work well enough for me, anyway. On Mon, Jan 11, 2016 at 5:42 AM, Cristian Adam wrote: > Ruslan Baratov via CMake writes: > >> >> Hi, >> >> I'm developing a project that is a kind of wrapper of >>

Re: [CMake] CMake based package manager

2016-01-11 Thread Nicholas Braden
com> wrote: > On Mon, Jan 11, 2016 at 2:33 PM, Nicholas Braden > <nicholas11bra...@gmail.com> wrote: >> >> Doesn't biicode already fill this role? Biicode seems to work well >> enough for me, anyway. >> > > Biicode is dead. > > There is a compariso

Re: [CMake] ExternalProject_Add support for git clone -o option

2016-01-15 Thread Nicholas Braden
Why would you like to have names other than origin? I am struggling to think of a use case for this, seeing as you never directly interact with the cloned repository. I don't even think it's safe to assume that a git repository is involved at all, for all you know it could be changed to just

[CMake] How do I create targets first and add sources later?

2016-01-14 Thread Nicholas Braden
I often find it more convenient to call add_library() and add_executable() first, apply properties to them etc., and then later add the sources to them with target_sources() (usually in other CMake files via add_subdirectory). Obviously, all my targets will eventually have sources added. However,

Re: [CMake] ExternalProject question

2016-02-07 Thread Nicholas Braden
You will need to look at their building documentation to find how to set those preferences when building with CMake. On Sat, Feb 6, 2016 at 11:47 PM, vadtec wrote: > I'm using ExternalProject to build external dependencies. curl provides a > cmake build process, but I cannot

Re: [CMake] Is there any way to use clang-cl with MSBuild on Windows?

2016-01-29 Thread Nicholas Braden
Have you tried setting the toolset? The -T parameter can set the toolset. This sets the platform toolset property that you would normally set in Visual Studio. if Visual Studio lets you select the llvm platform toolset, so will CMake. On Fri, Jan 29, 2016 at 12:04 PM, Yi-Hong Lyu

Re: [CMake] cmake documentation incomplete

2016-02-25 Thread Nicholas Braden
Yes, an existing build saves all the information it needs in the build cache. Once you have created a build, you never need to specify the source directory again. On Thu, Feb 25, 2016 at 9:13 AM, Vania Joloboff wrote: > Hi, > > The cmake documentation says there are two

Re: [CMake] Install from a source directory with ExternalProject

2016-02-26 Thread Nicholas Braden
I'm not sure how you would download a directory without it being in some sort of archive. If you just want to use an existing directory, use the SOURCE_DIR option instead. On Fri, Feb 26, 2016 at 8:37 AM, Cedric Doucet wrote: > > Hello, > > I would like to know if it's

Re: [CMake] Install from a source directory with ExternalProject

2016-02-26 Thread Nicholas Braden
ers, > > Cédric > > > > > - Mail original - >> De: "Nicholas Braden" <nicholas11bra...@gmail.com> >> À: "Cedric Doucet" <cedric.dou...@inria.fr> >> Cc: cmake@cmake.org >> Envoyé: Vendredi 26 Février 2016 15:56:02 >

Re: [CMake] Install from a source directory with ExternalProject

2016-02-26 Thread Nicholas Braden
http://www.iro.umontreal.ca/~lecuyer/myftp/streams00/c++/ > I know how to do it with FILE(DOWNLOAD ...) but I would like to know if there > is a way to do it with ExternalProject_Add. > > Cédric > > > > - Mail original - >> De: "Nicholas Braden&q

Re: [CMake] cmake documentation incomplete

2016-02-25 Thread Nicholas Braden
here is an undocumented option -B to do this ? > > Vania > > > On 02/25/2016 04:16 PM, Nicholas Braden wrote: >> >> Yes, an existing build saves all the information it needs in the build >> cache. Once you have created a build, you never need to specify the >>

Re: [CMake] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-21 Thread Nicholas Braden
piler ABI info > -- Detecting CXX compiler ABI info - done > -- Detecting CXX compile features > -- Detecting CXX compile features - done > External - CMAKE_COMPILER_IS_GNUCXX: 1 > External - CMAKE_CXX_COMPILER_ID: GNU > External - CMAKE_CXX_FLAGS: -march=native > -- Configuring done >

Re: [CMake] Library target names and the ExternalProject_Add command

2016-01-25 Thread Nicholas Braden
ExternalProject makes no assumptions about what is being built. It could just be a collection of executables, or maybe nothing is built at all. It is up to the project being built to provide facilities for accessing its targets in a platform-independent way. For example, the external project can

Re: [CMake] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-20 Thread Nicholas Braden
Where/how is that variable normally set? External projects have no awareness of the project they are in, they just run CMake as usual the same way you would. If the variable is normally set by CMake itself, make sure that your containing project and the external project both find the same

Re: [CMake] exclude a dependency from export

2016-01-22 Thread Nicholas Braden
Have you tried using the PRIVATE keyword when linking to A? https://cmake.org/cmake/help/latest/command/target_link_libraries.html#libraries-for-a-target-and-or-its-dependents On Fri, Jan 22, 2016 at 9:14 AM, Jack Stalnaker wrote: > Is there any way to exclude a dependency

Re: [CMake] Create main and sub-projects; be able to compile them together and individually.

2016-03-08 Thread Nicholas Braden
Thank you for your suggestion Nicholas, I have never used > ExternalProject_Add before and can't find a related example to my project. > Would you know an example that uses it? > > On Tue, Mar 8, 2016 at 10:38 AM, Nicholas Braden < > nicholas11bra...@gmail.com&g

Re: [CMake] Create main and sub-projects; be able to compile them together and individually.

2016-03-08 Thread Nicholas Braden
hich I really want to be "independent" if the user > wants. > > On Tue, Mar 8, 2016 at 5:13 PM, Nicholas Braden < > nicholas11bra...@gmail.com> wrote: > >> Example simple usages from my personal projects: >> >> https://github.com/LB--/events/blob/499ba78b923b4

Re: [CMake] ExternalProject and libraries again

2016-03-09 Thread Nicholas Braden
I'm not sure which discussion you're referring to, so forgive me if this was already mentioned - but are you using a superproject to ensure that dependencies are built and installed before your own project? That is, all dependencies as well as your own project are built via ExternalProject_Add and

Re: [CMake] Firefox and chrome warnings when dowloading cmake windows installers

2016-04-11 Thread Nicholas Braden
Previously there was a discussion about only Chrome: http://public.kitware.com/pipermail/cmake/2016-April/063192.html Good to know Firefox is affected too. For now I don't think anyone actually knows whether the file in question is truly dangerous or not, so use at your own risk. From what I've

[CMake] find_package: request/proposal for better version matching support

2016-04-12 Thread Nicholas Braden
I've run into a bit of an issue with the find_package interface. Let's say I want to use a library libsemver: find_package(semver REQUIRED) Now, I want my code to work even when libsemver releases new versions with breaking API changes, and I happen to know they follow the semantic versioning

Re: [CMake] How to deal with generated source files (w/ dependency tracking) for globs

2016-04-06 Thread Nicholas Braden
Projects - maybe you could get it to work that way, but it'd be ugly) On Wed, Apr 6, 2016 at 6:28 AM, Eric Wing <ewmail...@gmail.com> wrote: > On 4/4/16, Nicholas Braden <nicholas11bra...@gmail.com> wrote: >> I haven't tested this myself, but instead of using a glob, you could

Re: [CMake] Include XYZ.cmake from external project

2016-04-08 Thread Nicholas Braden
To solve the dependency order problem, generally you would make a superbuild which builds your dependencies and also your own project via ExternalProject, using the DEPENDS option to guarantee build order. This way all your dependencies are fully built and installed before it even gets to

Re: [CMake] why no cumulative variable operations via the commandline?

2016-03-19 Thread Nicholas Braden
The command line is the first point where variables can be defined (all code runs after this), so I am not sure where you expect pre-existing values to come from in order for a += or -= to make sense. Could you give an example of when you would find them useful? I think maybe I am not

Re: [CMake] why no cumulative variable operations via the commandline?

2016-03-19 Thread Nicholas Braden
Ah, I understand now - I have a habit of forgetting that you can configure existing CMake builds by repeatedly invoking cmake. I don't know if such a feature exists but it definitely sounds useful. On Sat, Mar 19, 2016 at 12:03 PM, René J. V. <rjvber...@gmail.com> wrote: > Nicholas Bra

Re: [CMake] Two phase install?

2016-03-23 Thread Nicholas Braden
Aron Bloom <sc...@towel42.com> wrote: > Ok.. Do you have an example somewhere ? > > -Original Message- > From: Nicholas Braden [mailto:nicholas11bra...@gmail.com] > Sent: Wednesday, March 23, 2016 6:11 PM > To: Scott Aron Bloom > Cc: Alan W. Irwin; cmake@cmake.org

Re: [CMake] Two phase install?

2016-03-23 Thread Nicholas Braden
Both projects should be built via ExternalProject within a superproject, this way you can use the DEPENDS arguments to guarantee build order. On Wed, Mar 23, 2016 at 8:08 PM, Scott Aron Bloom wrote: > Do you have apointer to an example of using the external_project. > > I have

Re: [CMake] find_package REQUIRED ignores OPTIONAL_COMPONENTS

2016-03-08 Thread Nicholas Braden
Jakob, I don't think there is any confusion about what REQUIRED means. Whether or not REQUIRED is provided, the list of OPTIONAL_COMPONENTS should not be required under any circumstances. The example error message seems pretty clear to me that the expected behavior and actual behavior are

Re: [CMake] Some Visual Studio/CMake questions

2016-03-08 Thread Nicholas Braden
IIRC, the project() command can be called once per directory. So you can have each directory be a separate project via add_subdirectory(). I just tried it out and it seems to create a solution (*.sln) for each project(). I can't answer the other questions, sorry. On Tue, Mar 8, 2016 at 10:03

Re: [CMake] Create main and sub-projects; be able to compile them together and individually.

2016-03-08 Thread Nicholas Braden
Have you looked into ExternalProject_Add? It allows just using a local path instead of downloading a remote repository: https://cmake.org/cmake/help/latest/module/ExternalProject.html On Tue, Mar 8, 2016 at 12:12 PM, Muhammad Osama wrote: > Hi Jan, > > Thank you for your

Re: [CMake] Subprojects and Cmake?

2016-03-06 Thread Nicholas Braden
If you are using the add_subdirectory approach, I believe you should not be using find_package and instead you just need to use target_link_libraries to have everything handled for you. Another approach would be making a superproject that builds your dependencies and your own project via

Re: [CMake] How to deal with generated source files (w/ dependency tracking) for globs

2016-04-04 Thread Nicholas Braden
I haven't tested this myself, but instead of using a glob, you could have a build step that generates a CMake script file with the list of generated files in it (e.g. via execute_process to run another CMake script whose only job is to generate the CMake script inception-style) and just include

Re: [CMake] Mixing up project language settings?

2016-03-31 Thread Nicholas Braden
If the new C++ components are built optionally, I would use enable_language(CXX): https://cmake.org/cmake/help/latest/command/enable_language.html Otherwise, if the project will always need C++ support from now on, amend the project() statement. In this case it doesn't matter whether you add CXX

Re: [CMake] Unknown CMake command "macro_ensure_version"

2016-05-01 Thread Nicholas Braden
I found several different versions of basically the same code in many projects, but it looks like openbabel is what you are trying to compile: https://github.com/baoilleach/openbabel-svn-mirror/blob/master/cmake/modules/MacroEnsureVersion.cmake Do you have this file in /cmake/modules/ ? It looks

Re: [CMake] c++11 feature and cmake feature name mapping

2016-04-14 Thread Nicholas Braden
I don't think CMake can yet detect features of the standard library implementation, only features of the language. One compiler may support more features than another compiler which supports more of the standard library, and in some cases the same compiler can support two or more different

Re: [CMake] FindFreetype works with MinGW but not Visual Studio?

2016-07-21 Thread Nicholas Braden
rt Mentzer <stuart_ment...@objexx.com> wrote: > On 7/21/2016 6:15 AM, Nicholas Braden wrote: >> >> I'm having a weird issue that is driving me crazy. I've attached a >> minimal test case - it downloads and builds Freetype 2.6.4 as static >> and then configures a pr

[CMake] Empty libraries?

2016-08-14 Thread Nicholas Braden
I noticed it is possible to create empty libraries like this: add_library(header-only "header.hpp") set_property(TARGET header-only PROPERTY LINKER_LANGUAGE CXX) On my machine, MinGW spits out an empty 8-byte libheader-only.a, and Visual Studio works too but outputs nothing. Is this even

Re: [CMake] Confusion over INTERFACE vs STATIC|SHARED IMPORTED vs INTERFACE IMPORTED

2016-07-05 Thread Nicholas Braden
>From what I understand, interface libraries just don't have sources or build results. INTERFACE IMPORTED would then mean there is no compiled binary to be linked against, just as INTERFACE alone means there are no sources to create said binary from. At least, that is my understanding. > My

Re: [CMake] Confusion over INTERFACE vs STATIC|SHARED IMPORTED vs INTERFACE IMPORTED

2016-07-06 Thread Nicholas Braden
.. confusing? Based on the description of what an > /imported target/ is, I would think that it is the same thing that > add_library(foo <STATIC|SHARED> IMPORTED) produces? > > > > On Tue, Jul 5, 2016 at 4:09 PM, Nicholas Braden <nicholas11bra...@gmail.com> > wrote: >

Re: [CMake] How do you handle recursive dependencies in CMake

2016-06-30 Thread Nicholas Braden
If find_project is not enough, and ExternalProject's only problem is build duplication, then I think it makes sense to consider a CMake-based dependency manager such as hunter: https://github.com/ruslo/hunter On Thu, Jun 30, 2016 at 3:59 AM, Sven Baars wrote: > This is a reply

Re: [CMake] Private dependencies of static libraries exported as targets

2016-08-16 Thread Nicholas Braden
Yes, the behavior is documented in several places, the most prominent being here: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#transitive-usage-requirements On Mon, Aug 15, 2016 at 9:22 PM, Ivan Shapovalov wrote: > On 2016-08-15 at 21:46 -0400,

Re: [CMake] Private dependencies of static libraries exported as targets

2016-08-16 Thread Nicholas Braden
n Tue, Aug 16, 2016 at 7:44 PM, Ivan Shapovalov <inte...@intelfx.name> wrote: > TBH, I do not see the "PRIVATE dependencies are made PUBLIC for the > purposes of linking when the dependent is static library" there. > > -- > Ivan Shapovalov / intelfx / > > > O

Re: [CMake] dependencies between external projects (not DEPENDS)

2016-08-17 Thread Nicholas Braden
Usually there would be variables like A_ROOT which allow the FindA.cmake module being used by B to correctly find everything. If there isn't, you'd have to write your own FindA.cmake module in either case. If you can't modify B, you could use the patch step of the external project to replace the

Re: [CMake] ExternalProject_Add

2017-01-22 Thread Nicholas Braden
Yes, that is what I do in my superbuilds. Generally I make is such that my project could be built without the superbuild, and the superbuild is just a convenience. On Sat, Jan 21, 2017 at 12:17 PM, Saad Khattak wrote: > >> One possibility is the often mentioned superbuild

Re: [CMake] externalproject_add and generating sources

2017-01-26 Thread Nicholas Braden
You'll also want to build your own project with ExternalProject, and use the DEPENDS option to control build order. This ensures that all dependencies are fully installed before your own project is even configured. The project with all the ExternalProject calls is typically called a superbuild,

Re: [CMake] Private dependencies of static libraries exported as targets

2016-08-18 Thread Nicholas Braden
5 PM, Ivan Shapovalov <inte...@intelfx.name> > wrote: >> >> On 2016-08-17 at 05:19 -0500, Nicholas Braden wrote: >> > Huh, this is weird. It seems to be an issue with the export/import >> > mechanism. If you make a project where everything is in the same >&

Re: [CMake] How to add -fPIC to a static library?

2016-08-28 Thread Nicholas Braden
Have you tried set_property(TARGET cpp-netlib_pic PROPERTY POSITION_INDEPENDENT_CODE ON)? I think you must specify the value ON for it to work. On Sun, Aug 28, 2016 at 4:28 PM, Steve Lorimer wrote: > I'm trying to create a static library with -fPIC specified. > >

Re: [CMake] Convert UTF8 to UTF16 (Windows)

2016-08-29 Thread Nicholas Braden
Are you sure about this UTF16 requirement? I have many projects ranging from Visual Studio 2008 to 2015 that use .rc files and all of them are ANSI/UTF8. On Mon, Aug 29, 2016 at 2:43 AM, tonka tonka wrote: > Hey, > > I have a little problem with files which has to be UTF 16

Re: [CMake] ExternalProject_Add not honoring the INSTALL_DIR argument.

2016-08-29 Thread Nicholas Braden
Have you tried changing the = to a space, as with the other parameters? On Mon, Aug 29, 2016 at 10:52 AM, Michael Jackson wrote: > I have the following CMake file: > > set(QHull_GIT_REPO "git://github.com/qhull/qhull") > set(QHull_GIT_TAG "") > set(QHull_INSTALL_NAME

Re: [CMake] ExternalProject_Add not honoring the INSTALL_DIR argument.

2016-08-29 Thread Nicholas Braden
> -- > Michael A. Jackson > BlueQuartz Software, LLC > [e]: mike.jack...@bluequartz.net > > > Nicholas Braden wrote: >> >> Have you tried changing the = to a space, as with the other parameters? >> >> On Mon, Aug 29, 2016 at 10:52 AM, Michael Jackson >&

Re: [CMake] ExternalProject_Add

2017-01-08 Thread Nicholas Braden
The way to solve this is to use a superbuild project layout - you use ExternalProject_Add to build your dependencies AND your own project, using the DEPENDS option to control build order. Thus by the time it gets around to configuring your project, the dependencies have already been built and