[CMake] Cannot add a Dependency to INSTALL Target

david_bjornbak at agilent.com david_bjornbak at agilent.com
Thu Feb 26 14:46:41 EST 2009


Tyler,

What I'm really working is,  I want to install debian files ( *.deb files ) during an installation or INSTALL target.

I tried using INSTALL(CODE [SCRIPT]....  point to execute_process command but,  execute_process does not play nice with this path either.

I prefer to have ALL_BUILD just for compilation and only have one INSTALL but, I'm going with the workaround of using a second fake_install has you suggest.

-dave b.

-----Original Message-----
From: Tyler Roscoe [mailto:tyler at cryptio.net] 
Sent: Thursday, February 26, 2009 11:39 AM
To: BJORNBAK,DAVID (A-Sonoma,ex1)
Cc: cmake at cmake.org
Subject: Re: [CMake] Cannot add a Dependency to INSTALL Target

On Thu, Feb 26, 2009 at 10:43:05AM -0700, david_bjornbak at agilent.com wrote:
> Under CMakeLists.txt files, I want to add a dependency so Install will run a target
> 
> add_custom_target(3rd_party_install  ALL)
> 
> ADD_DEPENDENCIES(INSTALL 3rd_party_install )
> 
> When I run cmake, it complains INSTALL is not defined yet but, it is if I exclude this new depenency

I believe that INSTALL (along with ALL and CLEAN) are not "real"
targets, so your strategy won't work.

I don't know what the best workaround is, but maybe you could create a
dummy target (fake_install) and add your targets as dependencies on that
dummy target?

tyler




More information about the CMake mailing list