Discussion:
[CMake] Cannot add a Dependency to INSTALL Target
d***@agilent.com
2009-02-26 17:43:05 UTC
Permalink
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



-- Adding 3rd_party_install ALL DEPENDS -complist_install;tcltk_install-

CMake Error at tools/CMakeLists.txt:15 (ADD_DEPENDENCIES):

add_dependencies Adding dependency to non-existent target: INSTALL





-dave b.
Tyler Roscoe
2009-02-26 19:39:23 UTC
Permalink
Post by d***@agilent.com
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
d***@agilent.com
2009-02-26 19:46:41 UTC
Permalink
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:***@cryptio.net]
Sent: Thursday, February 26, 2009 11:39 AM
To: BJORNBAK,DAVID (A-Sonoma,ex1)
Cc: ***@cmake.org
Subject: Re: [CMake] Cannot add a Dependency to INSTALL Target
Post by d***@agilent.com
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

Continue reading on narkive:
Loading...