Jump to content
  • Advertisement
Sign in to follow this  

CMake - ExternalProject targets slowing down everything

This topic is 1330 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Edited by TheComet

Share this post


Link to post
Share on other sites
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()

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!