CMake - ExternalProject targets slowing down everything

Started by
1 comment, last by TheComet 9 years, 6 months ago

My project uses CMake's externalproject module for pulling in dependencies not found on the host system. It was a great idea until I actually started working on the project's source code again.

Whenever I "make myproject", all dependencies are also pulled in to the make command. This means all repositories are pulled, all configure scripts are executed, and all dependencies are re-installed. Given the number and size of dependencies, this can take an annoying 20 seconds.

Is there a way to to tell CMake to build an externalproject exactly once and then ignore it if it was successful in the future?

"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty
Advertisement

You can just check if you have already downloaded or built it by creating a file after download or build steps and checking for that file later on.

Here is where I got this code from: https://projects.kde.org/projects/kde/superbuild/repository/revisions/master/entry/SuperBuild.cmake


# are we building a source package or should we download from the internet ?
	
if(EXISTS ${CMAKE_SOURCE_DIR}/ThisIsASourcePackage.valid )	
  set(buildFromSourcePackage TRUE)
else()
  set(buildFromSourcePackage FALSE)
endif()

Engineering Manager at Deloitte Australia

Thanks! That works perfectly.

"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty

This topic is closed to new replies.

Advertisement