CMake: run install step of ExternalProject_add target before build step of another target - cmake

My CMake build process brings in and builds another CMake-based project through ExternalProject_add. I need to run the INSTALL step for this target before the main project will build. However, I can't seem to specify the INSTALL step of my external project as a dependency for the build step of my main project. What would this target be called? Do INSTALL targets have names?

I fixed this on OSX and Linux with ExternalProject_Add_StepTargets(MYPROJECT install), although it doesn't seem to work on Windows. Will investigate further when I get a chance, but for now that's the answer I'm sticking with :S

Related

How to reference npm project locally?

I am using npm, yarn build as manager tool. Using these tech, create two project , CommonLib and SampleProject. so first I build CommonLib project, release its library and publish it to AWS codeartifact then ref that published artifact to SampleProject.
This flow looks fine and works well as well. But this whole process force us to publish our changes to artifact which block other.
So not think to do change locally in IDE (here is mscode), release it locally and then ref it to SampleProject.
I used npm install ../CommonLib command to install the package and IDE start point to locally project. But it doesn't compile the project.
Can anyone help me on this, what could be wrong here.

Build configuration error using Android NDK

There is a build configuration error (Gradle sync failed) starting a new simple Android project using IntelliJ IDEA and the installed Android SDK (API 28) to include C++ support.
If I can remember, it worked when first installed, but now any attempt to compile and build the project using the IntelliJ GUI fail. LLDB, CMake and NDK are all installed correctly in the correct folders and the local.properties file references the location of the SDK and NDK.
All attempts to refresh linked C++ projects or clear caches (invalidate caches/restart) make no difference.
CMake_server_log.txt suggests:
CMAKE SERVER: CMake Error: CMake was unable to find a build program
corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You
probably need to select a different build tool.
Build output (edited to remove path):
Cause: executing external native build for cmake CMakeLists.txt
There appears to be a lack of configuration to complete the build or missing PATH or ENVIRONMENT variable. Should I manually try to change this or add some extra code to the build.gradle or CMakeLists.txt? There is the ninja application in the cmake bin directory.
Even importing other NDK sample projects fail (after downloading any required dependencies e.g. Gradle version).
Reinstalling LLDB, CMake and the NDK via SDK Tools do not solve the issue either.
I get the impression that I need to completely uninstall IntelliJ IDEA on Windows and remove any remaining folders/files associated with it, before reinstalling it. That would be a shame as IntelliJ IDEA works for other type of Android projects not requiring native C++ support.

How can I build in KDevelop a Ninja project without using CMake?

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!

(Chromium build) How can I generate Ninja project files for the third_party/webrtc/examples?

I'm doing this on windows but I'm not sure it matters. It appears that the command to generate the Ninja project files for the Chromium source tree:
gn gen out\Default
Only builds projects files for some of the code in third_party\webrtc. I need to build project files for third_party\webrtc\examples. I've been trying to make changes to the BUILD.gn files but so far I haven't had any luck in getting gn to make me some project files for the examples.
Is there any switch or other flag I could set to build the examples?
Thank you for any suggestions.
You probably need to checkout webrtc and build run gn gen from there. The chromium build does not necessarily build all of the targets in webrtc.
See the webrtc docs for info on how to build.

pjsip using cmake

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