CMake can generate a Ninja configured project, which can then be built from KDevelop.
However I already get my Ninja files with another tool (Meson).
How can I make KDevelop use the Ninja files I provide, without calling CMake?
I don't think there is a way other than using Custom buildsystem plugin yet. So, eiter use CMake build system with Ninja generator, or custom buildsystem.
But the good news are that Meson plugin for KDevelop is already being baked and hopefully will see a release!
Related
I'm trying to set up a multiplattform project using CMake, so its easy to setup on any PC.
Basicly the CMAKE script sets up all settings for the projects and finds all libraries automatically.
But after trying a few IDE's like codeblocks and eclipse it seams like CMake integration in these is pretty lackluster.
Does anybody have a few recommendations for better IDE's?
They should have an included debugger and code completion and should be easy to setup on windows and linux.
Have a look at clion, that fully integrates CMake, but I dislike the editor, not really user friendly.
Starting with version 2.6.0 CMake includes a generator for Eclipse CDT 4.0 or newer. It works together with the Makefile generators (i.e. "Unix Makefiles", "MinGW Makefiles", "MSYS Makefiles", and maybe "NMake Makefiles"). This generator creates a set of .project/.cproject files that can be imported in Eclipse using File > Import > Existing Eclipse project.
https://cmake.org/Wiki/Eclipse_CDT4_Generator
I need to create a cmake project which should be able to be built on linux and windows. So I looked into cmake Tutorials and all of them told me to setup the build process by hand. Bit looking at other projects made with cmake, the scripts seam like they were created by a computer (no formatting no comments). So I was wondering if there was a more automated aproach or tool that can be used for cmake files. Or are most cmake scripts really written by hand?
Yes, CMakeLists.txt are generally written by hand. Generated are SomeProjectConfig.cmake modules, which contain exported targets and information how the project was built. These modules are used by find_package command when you want to use SomeProject from your own project.
I'm trying to use KDevelop as an IDE for development of a C++ shared library. An earlier posts here indicate that I need to edit a CMake makefile for doing that. This is quite painful and very time consuming as it means converting our custom gmake-oriented build system into something of CMake.
Is there any other way for doing that?
KDevelop doesn't force you to use a specific buildsystem like many other IDEs do. CMake is just the default as it's very well integrated and many if not all KDE projects use cmake.
You can use a different build system by choosing "Custom Buildsystem" or "Custom Makefile Project Manager".
Custom Makefile Project Manager simply calls "make" - your current build system should work this that.
I come from a unixy background, so tend to prefer command-line style automation over ide's.
I'm tryng to get deeper into windows development. I have previously written programs on Windows just using the cl compiler to compile the c code. I'd like to move to an automated build system like cmake.
I can get cmake to create an Visual Studio solution, which will compile. But that is not quite what I am looking for. What I am looking for is for cmake to invoke to cl to compile/link the code itself, just like make invokes gcc.
Is cmake able to do this or would Scons be better suited for me?
Once you have your project created with CMake, cmake can also run the build.
cd builddir
cmake --build .
You can also use CMake to create nmake or jom (parallel nmake) makefiles, or even gmake. So, it is certainly possible to use CMake from the command line and use VS compilers.
Found out, as per Peter's comment, that cmake is a build-generator tool. It's generates makefiles that external build tools can run. So I'll either use cmake+namke or scons.
Im not so sure about cmake, but SCons has some builders dedicated just to Microsoft Visual Studio.
Look for the following in the SCons builder documentation:
MSVSProject()
MSVSSolution()
Plus SCons has a much nicer syntax, its python! :)
Has someone compiled pjsip using cmake?
The project does not have a way of using CMake to build the library itself (yet). But you can link to pjproject libs from your CMake project.
Here's a snippet from one of mine that uses pjproject as a dependency:
find_package(PKGCONFIG REQUIRED)
pkg_check_modules(PJSIP libpjproject>=1.14 REQUIRED)
include_directories(${PJSIP_INCLUDE_DIRS})
...
target_link_libraries(your_target ${PJSIP_LIBRARIES})
This requires pkg-config as well, and that pjproject.pc should be in it's default search path, or in directory in $PKG_CONFIG_PATH.
This should work on Linux and OS X.
I just made cmake-based compilation of PJSIP v2.3.
I use this compilation only on Windows platform for now, not tested on linux.
On Linux I recommend use PKG_CONFIG tool to discover PJSIP for your app.
Having peeked at their repository, the project is auto-tools/configure based. You would need to port the build system yourself. Depending on complexity, it is not that hard to accomplish. I have converted many projects to cmake. Maybe the pjsip comunity would welcome an upgrade to their build system, as I see they support multiple platforms like iphone, and windows through visual studio.
If you are using Clion IDE then it can automatically generate cmake file for pjproject. Just import it and it will open a wizard. You’ll need to specify the location of the sources, then select project files and include directories. Clion has the ability to make the cmake file from existing projects. for more help please see this link Clion Documentation