Hello,
Using CMake 3.3 and VS2012.
The below cmake scripts generate "Policy CMP0040 is not set: The target in the
TARGET signature of add_custom_command must exists". Why cannot the
custom/CMakeLists.txt file see the target created in app/CMakeLists.txt ?
Moving the ADD_CUSTOM_COMMAND to the app/CMakeLists.txt fixes the problem but I
would like to keep them separate if possible.
PROJECT(TEST)
ADD_DIRECTORY(app)
ADD_DIRECTORY(custom)
The app CMakeLists.txt looks like this;
ADD_EXECUTABLE(app main.cpp)
TARGET_LINK_LIBRARIES(app)
The custom CMakeLists.txt looks like this;
ADD_CUSTOM_COMMAND(
TARGET app
POST_BUILD
COMMAND tbd.exe)
Appreciate any input.
Kind regards, Lars
--
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:
http://public.kitware.com/mailman/listinfo/cmake