I am using test project for understanding external project features.
There are main project with main.cpp source file in <main_dir>:<br>
<br>
cmake_minimum_required (VERSION 2.8) <br>
<br>
set (PROJECT_NAME main)<br>
project(${PROJECT_NAME})<br>
<br>
include(ExternalProject)<br>
<br>
ExternalProject_Add(libhello<br>
URL ${CMAKE_CURRENT_LIST_DIR}/<div id=":t9">hello<br>
PREFIX ${CMAKE_CURRENT_LIST_DIR}/prefix/hello <br>
CMAKE_ARGS ${CMARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR><br>
)<br>
<br>
ExternalProject_Add_Step(libhello forceconfigure<br>
COMMAND ${CMAKE_COMMAND} -E echo "Force configure of libhello"<div class="im"><br>
DEPENDEES update<br>
DEPENDERS configure<br>
ALWAYS 1)<br></div>
include_directories(${CMAKE_CURRENT_LIST_DIR}/prefix/hello/include)<br>
if(BUILD_ANDROID)<br>
link_directories(${CMAKE_CURRENT_LIST_DIR}/prefix/hello/libs/${ANDROID_NDK_ABI_NAME})<br>
else()<br>
link_directories(${CMAKE_CURRENT_LIST_DIR}/prefix/hello/lib)<br>
endif()<br>
<br>
add_executable(${PROJECT_NAME} main.cpp)<br>
add_dependencies(${PROJECT_NAME} libhello)<br>
<br>
target_link_libraries(${PROJECT_NAME} hello)<br>
<br>
in <main_dir>/hello test external lib sources - hello.cpp, another.cpp and hello.h header:<br>
<br>
cmake_minimum_required (VERSION 2.8) <br>
<br>
set (PROJECT_NAME hello)<br>
project(${PROJECT_NAME})<br>
<br>
set(SOURCES hello.cpp<br>
another.cpp)<br>
<br>
add_library(${PROJECT_NAME} SHARED ${SOURCES})<br>
<br>
if(BUILD_ANDROID)<br>
install(TARGETS ${PROJECT_NAME} DESTINATION libs/${ANDROID_NDK_ABI_NAME})<br>
else(BUILD_ANDROID)<br>
install(TARGETS ${PROJECT_NAME} DESTINATION lib)<br>
endif(BUILD_ANDROID)<br>
<br>
install(FILES hello.h DESTINATION include)<br>
<br>
I run cmake .. in <main_dir>/build and make after that. All builds
correctly. But if i change, for example,
<main_dir>/hello/hello.cpp , there is no rebuild after make.<br>
<br>
Cmake version - 2.8.3. <br>
There are some cross-compile Android things, but as i can understand they has no effect on external project module. <br>
<br>
Sorry for poor english.<div class="yj6qo ajU"><div id=":tp" class="ajR" tabindex="0"><img class="ajT" src="images/cleardot.gif"></div></div></div><br><br><div class="gmail_quote">On Mon, Jul 2, 2012 at 8:54 PM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That should work already.<br>
<br>
If you change the URL of an ExternalProject, it should re-execute the<br>
download and all subsequent steps.<br>
<br>
If you're having problems with that, please post a piece of sample<br>
CMake code that we can use to try to reproduce your problem.<br>
<br>
<br>
Thanks,<br>
David<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Mon, Jul 2, 2012 at 10:30 AM, Evgeny Startsev<br>
<<a href="mailto:exbluesbreaker@gmail.com">exbluesbreaker@gmail.com</a>> wrote:<br>
> Thank you, for answers! Sorry, i not accurately describe the problem. I<br>
> interested in support rebuild, then source in External_project URL changed.<br>
> As i understand it correctly this solution for changes in downloaded local<br>
> sources?<br>
><br>
> I found only solution with rsync based download command and force rsync step<br>
> before install for rebuild, if sources from URL changed.<br>
><br>
> On Mon, Jul 2, 2012 at 6:13 PM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
>><br>
>> It's possible without modifying ExternalProject as well. One technique<br>
>> we've adopted on several projects looks something like this:<br>
>><br>
>> # After the ExternalProject_Add call for "myProject"<br>
>> ExternalProject_Add_Step(myProject forceconfigure<br>
>> COMMAND ${CMAKE_COMMAND} -E echo "Force configure of myProject"<br>
>> DEPENDEES update<br>
>> DEPENDERS configure<br>
>> ALWAYS 1)<br>
>><br>
>> Or, you can use "DEPENDEES configure DEPENDERS build" as a "forcebuild"<br>
>> step.<br>
>><br>
>> This is such a common request, that we will probably add<br>
>> ALWAYS_CONFIGURE and ALWAYS_BUILD options to ExternalProject_Add in a<br>
>> future version.<br>
>><br>
>><br>
>> HTH,<br>
>> David<br>
>><br>
>><br>
>> On Mon, Jul 2, 2012 at 7:55 AM, Yuri Timenkov <<a href="mailto:yuri@timenkov.ru">yuri@timenkov.ru</a>> wrote:<br>
>> > Hi,<br>
>> ><br>
>> > It's possible with some modifications to ExternalProject.cmake:<br>
>> > <a href="http://public.kitware.com/Bug/view.php?id=12322" target="_blank">http://public.kitware.com/Bug/view.php?id=12322</a><br>
>> ><br>
>> > However it is not encouraged by CMake developers.<br>
>> ><br>
>> > On Mon, Jul 2, 2012 at 2:25 PM, Evgeny Startsev<br>
>> > <<a href="mailto:exbluesbreaker@gmail.com">exbluesbreaker@gmail.com</a>> wrote:<br>
>> >> I am using external project module for cmake. Is there any way to<br>
>> >> rebuild<br>
>> >> local external project (from local directory), then its sources was<br>
>> >> changed?<br>
>> >> I have tried special DOWNLOAD_COMMAND or UPDATE_COMMAND, but this<br>
>> >> commands<br>
>> >> called only first time.<br>
>> >><br>
>> >> --<br>
>> >><br>
>> >> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> >><br>
>> >> Visit other Kitware open-source projects at<br>
>> >> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> >><br>
>> >> Please keep messages on-topic and check the CMake FAQ at:<br>
>> >> <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>> >><br>
>> >> Follow this link to subscribe/unsubscribe:<br>
>> >> <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
>> > --<br>
>> ><br>
>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> ><br>
>> > Visit other Kitware open-source projects at<br>
>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> ><br>
>> > Please keep messages on-topic and check the CMake FAQ at:<br>
>> > <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>> ><br>
>> > Follow this link to subscribe/unsubscribe:<br>
>> > <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
><br>
><br>
</div></div></blockquote></div><br>