[CMake] Name of Install target

James Bigler bigler at cs.utah.edu
Thu Feb 14 17:42:45 EST 2008


I want to create a custom command or target that is dependent on the  
install target.  What is the name of the install target.  I tried  
"install", but that didn't seem to do what I needed:

PROJECT(MyProj)

ADD_LIBRARY(mylib SHARED mylib.cc mylib.h)
ADD_EXECUTABLE(myprog myprog.cc)
TARGET_LINK_LIBRARIES(myprog mylib)
INSTALL(TARGETS mylib myprog
   ARCHIVE DESTINATION lib
   LIBRARY DESTINATION lib
   RUNTIME DESTINATION bin
   )

ADD_CUSTOM_TARGET(build_app
   DEPENDS install
   COMMENT "Running build_app"
   )

If I start out with a clean directory and where my  
CMAKE_INSTALL_PREFIX:PATH=/path/to/install, I get the following error:

$ make build_app
make[3]: *** No rule to make target `../install', needed by  
`CMakeFiles/build_app'.  Stop.
make[2]: *** [CMakeFiles/build_app.dir/all] Error 2
make[1]: *** [CMakeFiles/build_app.dir/rule] Error 2
make: *** [build_app] Error 2

I'm running CMake 2.4.7 on Mac 10.4

Thanks,
James



More information about the CMake mailing list