From: Damien B. <dam...@le...> - 2012-05-16 22:40:33
|
Hello dear json_cpp developers, I worked recently with json-rpc-cpp based on json_cpp and I wrote CMakeFile support for both. I wanted to provide my small contribution to this nice library by sending you this patch. I was wondering if it could be integrated in the mainline or if you want to keep it as a patch aside, but I have the feeling that it should be mainline, because CMake is really one of the best choice for cross compilation and recompilation on any platform. It has an advantage over scons in the fact that cross compilation is generically and uniformly supported. This makes any CMake project cross compilable seamlessly for any platform without any specificf platform configuration in the makefile other than a cross cmake toolchain file provided by the user or by the toolchain itself. However I don't think it shoud replace scons, because certainly many project have based their integration of your project with it. I just think it could come additionally to ease building and integration for CMake based projects. Especially for embedded and multiplatform projects I think (e.g. I use it in a ptxdist and a yocto project for cross compiling for ARM Cortex A8, PPC, Windows 7 and Linux i386, this is for building automation softwares and devices). I added the patch on sourcefore at this address : https://sourceforge.net/tracker/?func=detail&atid=758828&aid=3527408&group_id=144446 Cheers, -- daminetreg alias Damien Buhl |
From: Francis B. <fra...@cm...> - 2012-05-17 01:11:29
|
The good thing about jsoncpp is that there's almost no OS-dependent bits and it has only a few files. And it gets even better with the nice Python script that packages it up in even fewer files. This makes it a marvel to work with compared to most other 3rdparty library I have to deal with. So, because of that, I don't really feel the need to use the build system that comes with it. In fact, I think of it more as a tutorial than an official way of building jsoncpp. The build system could even be removed entirely from the repository and I would not even notice because I added the jsoncpp to my own SCons build system that I use for all my projects. jsoncpp just always works, whatever compiler I use, or whatever compiler flags I throw at it... and I need to support multiple version of GCC on both Linux and MacOS as well as 3 versions of MSVC. Shared libraries, static libraries, optimizations, instrumentation... you name it, I tried. Seriously, it just works flawlessly every time. Kudos to the developers. This is real portable C++. But then, I also realize that there are newcomers to software engineering that don't know anything about build systems and are tied to a specific IDE (like Microsoft Visual Studio users for example). For those people, I think CMake is a good choice, because it will generate some IDE-specific projects that can be used right away. And for those of us who know what we're doing, we don't even need a build system for working with jsoncpp. On Wed, May 16, 2012 at 6:27 PM, Damien Buhl <dam...@le...> wrote: > Hello dear json_cpp developers, > > I worked recently with json-rpc-cpp based on json_cpp and I wrote > CMakeFile support for both. I wanted to provide my small contribution to > this nice library by sending you this patch. > > I was wondering if it could be integrated in the mainline or if you want > to keep it as a patch aside, but I have the feeling that it should be > mainline, because CMake is really one of the best choice for cross > compilation and recompilation on any platform. It has an advantage over > scons in the fact that cross compilation is generically and uniformly > supported. This makes any CMake project cross compilable seamlessly for > any platform without any specificf platform configuration in the > makefile other than a cross cmake toolchain file provided by the user or > by the toolchain itself. > > However I don't think it shoud replace scons, because certainly many > project have based their integration of your project with it. I just > think it could come additionally to ease building and integration for > CMake based projects. Especially for embedded and multiplatform projects > I think (e.g. I use it in a ptxdist and a yocto project for cross > compiling for ARM Cortex A8, PPC, Windows 7 and Linux i386, this is for > building automation softwares and devices). > > I added the patch on sourcefore at this address : > https://sourceforge.net/tracker/?func=detail&atid=758828&aid=3527408&group_id=144446 > > Cheers, > -- > daminetreg > alias Damien Buhl > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Jsoncpp-devel mailing list > Jso...@li... > https://lists.sourceforge.net/lists/listinfo/jsoncpp-devel -- Francis Bolduc, B.Sc. CM-Labs Simulation Inc. |
From: Damien B. <dam...@le...> - 2012-05-18 07:32:02
|
Hi Francis Bolduc, I agree with the fact that it's integrable in any way with any build system because of the simplicity and portability of the library, it's even because of that that I was able to write easily the CMakeLists :). The fact that it always works with any compiler is why I think CMake is a good choice, because CMake just want to know which compiler to use and search for the libs itself. There isn't any platform condition in the CMakeLists I wrote and the one I write generally, I prefer to abstract that in the code, if really needed, but I come across such case not so often. I think the advantages of CMake comes when you are not tied to any compiler, I'm in this case I have to build same projects on windows with MinGW & MSVC following for which components it goes and on linux with g++ and for the different embedded platforms. CMake is great in this way that it can from one configuration generates either Unix Makefiles, eclipse projects, Visual Studio projects, MinGW makefiles and the list is longer. :) I'm usually developing on Linux with Vim and the Unix Makefiles CMake generates, but I have other people in the team using eclipse and when I go on windows I just eventually recompile and make some fix directly with gvim and the MinGW makefiles or with MSVC with Visual Studio. Additionnally there is an important point that I find necessary: finding dependent libraries, because when you build complex systems or whole OS with multiple components developed separately, like in my case, you cannot have all the libs in your project, you rather install them all in an install prefix which plays the role of sysroot and which gathers all the produced binaries and headers. That's why the CMake find_package is highly needed, to let the makefile tell if it found the library or not. It makes it easier also for other peoples to recompile later by retrieving the dependencies, instead of just getting a linker error that most of the beginners don't understand. > And > for those of us who know what we're doing, we don't even need a build > system for working with jsoncpp. That's right, because we can recompile it without too much work but in this case we still need to write our own makefiles. So I think that one flexible build system is needed, if the lib already ships with a configure script or better with CMake files it makes it recompilable without any additional work for any platform : the library user just has to type : "mkdir build && cd build && cmake .. && make -j3" and because CMake search for the dependencies and so on, we can simply integrates it in a complex build system and in a flexible way. It's also easier to maintain, you don't have to adapt your project build system if the lib has to be compiled another way due to some new version, you simply tell it to be built, and eventually pass some compiler flags if you are not happy with the default ones :). (e.g. Our build server is configured to pass to all libraries makefiles the -Wall -Werror for linux) And embedded build systems like yocto or ptxdist automagically makes the command for you, there is only the need to tell : "hey I want json-cpp 0.6.0 on the produced linux system, do it for arm and ppc please", it will simply tell then to CMake where to find the compiler and what install prefix to use and everything will be done. If you don't already have CMake files in the project or an autoreconf script (which are less portable than CMake, needs MSYS on windows which isn't cool for MSVC) then you have to write it, and I don't think a library user should bother about that, it should be able to integrates it in it's build system like he wants to, and that's why I find the flexibility of CMake a great choice. :) But anything could be great if it is flexible and accepts any platforms and works on any platforms, I personally only know CMake, autoreconf and scons. Thank you for your reaction and explanations on this point :) Cheers, -- daminetreg alias Damien Buhl On 05/17/2012 02:41 AM, Francis Bolduc wrote: > The good thing about jsoncpp is that there's almost no OS-dependent > bits and it has only a few files. And it gets even better with the > nice Python script that packages it up in even fewer files. This makes > it a marvel to work with compared to most other 3rdparty library I > have to deal with. > > So, because of that, I don't really feel the need to use the build > system that comes with it. In fact, I think of it more as a tutorial > than an official way of building jsoncpp. The build system could even > be removed entirely from the repository and I would not even notice > because I added the jsoncpp to my own SCons build system that I use > for all my projects. > > jsoncpp just always works, whatever compiler I use, or whatever > compiler flags I throw at it... and I need to support multiple version > of GCC on both Linux and MacOS as well as 3 versions of MSVC. Shared > libraries, static libraries, optimizations, instrumentation... you > name it, I tried. Seriously, it just works flawlessly every time. > Kudos to the developers. This is real portable C++. > > But then, I also realize that there are newcomers to software > engineering that don't know anything about build systems and are tied > to a specific IDE (like Microsoft Visual Studio users for example). > For those people, I think CMake is a good choice, because it will > generate some IDE-specific projects that can be used right away. And > for those of us who know what we're doing, we don't even need a build > system for working with jsoncpp. > > On Wed, May 16, 2012 at 6:27 PM, Damien Buhl<dam...@le...> wrote: >> Hello dear json_cpp developers, >> >> I worked recently with json-rpc-cpp based on json_cpp and I wrote >> CMakeFile support for both. I wanted to provide my small contribution to >> this nice library by sending you this patch. >> >> I was wondering if it could be integrated in the mainline or if you want >> to keep it as a patch aside, but I have the feeling that it should be >> mainline, because CMake is really one of the best choice for cross >> compilation and recompilation on any platform. It has an advantage over >> scons in the fact that cross compilation is generically and uniformly >> supported. This makes any CMake project cross compilable seamlessly for >> any platform without any specificf platform configuration in the >> makefile other than a cross cmake toolchain file provided by the user or >> by the toolchain itself. >> >> However I don't think it shoud replace scons, because certainly many >> project have based their integration of your project with it. I just >> think it could come additionally to ease building and integration for >> CMake based projects. Especially for embedded and multiplatform projects >> I think (e.g. I use it in a ptxdist and a yocto project for cross >> compiling for ARM Cortex A8, PPC, Windows 7 and Linux i386, this is for >> building automation softwares and devices). >> >> I added the patch on sourcefore at this address : >> https://sourceforge.net/tracker/?func=detail&atid=758828&aid=3527408&group_id=144446 >> >> Cheers, >> -- >> daminetreg >> alias Damien Buhl >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Jsoncpp-devel mailing list >> Jso...@li... >> https://lists.sourceforge.net/lists/listinfo/jsoncpp-devel > > |