On Thu, 2019-03-28 at 16:07 -0400, Norton Allen wrote:
> Kyle,
> What you say makes sense, and I can even understand why
> add_custom_target might do that, but I cannot get this to actually
> work. Here is a minimal CMakeLists.txt. mysourcefile is just and
> empty file.
> I have these files in test/cmake, and I:
> cd test
> mkdir build-cmake
> cd build-cmake
> cmake ../cmake
> make
> and there is no sign of mygeneratedfile. I then try
> make install
> and I get:
> $ make install
> Install the project...
> -- Install configuration: ""
> CMake Error at cmake_install.cmake:31 (file):
>   file INSTALL cannot find "/home/nort/test/build-
> cmake/mygeneratedfile".
> 
> 
> make: *** [Makefile:84: install] Error 1
> Where is my mistake?
One more thing: if you want the custom target to be built by "make" or
"make all", you have to give it the ALL argument:
add_custom_target(mygeneratedtarget ALL
  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/mygeneratedfile
)
Otherwise you can build the target with "make mygeneratedtarget".
Kyle
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to