[CMake] ExternalProject_Add without download of local sources?

David Cole david.cole at kitware.com
Thu Sep 15 12:30:06 EDT 2011


Luigi is correct:

To use an existing source directory (just use the source in its place
without any copy operations), simply say:

  DOWNLOAD_COMMAND ""
  SOURCE_DIR ${Log4Qt_SOURCE_DIR}

The default behavior of copying the source tree when it is specified
via URL is present for two reasons:
  (1) some packages require an in-source build, and copying the source
tree is a good way to keep a clean copy of the source tree around
  (2) it's the same as all the other URL operations: in the http case,
it's downloaded and then extracted ("copied") into the SOURCE_DIR
location, in a local directory case, we also chose to make the copy
simply for ease of implementation


HTH,
David


On Thu, Sep 15, 2011 at 12:17 PM, Thomas Wolf
<thomas.wolf at vision.ee.ethz.ch> wrote:
> On 15.09.2011 17:48, Luigi Calori wrote:
>> Did you tried specifying SOURCE_DIR without any URL and / or
>> DOWNLOAD_COMMAND ""
>> UPDATE_COMMAND ""
>>
>> Not sure this is correct but for my case seems to work
>>
>> HTH
>
> mhm,
>
> i swapped URL for the SOURCE_DIR, yes, and there is also no
> DOWNLOAD_COMMAND or UPDATE_COMMAND. My build always reports 'succeeded'
> without doing anything.
>
> well, i just have:
>
>
> ------->
> ExternalProject_Add(${proj}
>  SOURCE_DIR ${Log4Qt_SOURCE_DIR}
>  BINARY_DIR ${proj}_bin
>  INSTALL_DIR ${proj}_install
>  INSTALL_COMMAND ""
>  CMAKE_GENERATOR ${gen}
>  CMAKE_ARGS
>    ${common_args}
> -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
>  CMAKE_CACHE_ARGS
>    -DCMAKE_INCLUDE_CURRENT_DIR:BOOL=ON
>   DEPENDS ${proj_DEPENDENCIES}
>                 )
> <-------
>
> with common_args beeing:
>
> ----->
>  -DBUILD_TESTING:BOOL=${ep_build_testing}
>  -DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
>  -DBUILD_SHARED_LIBS:BOOL=ON
>  -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
>  -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
>  -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
>  -DCMAKE_C_FLAGS:STRING=${ep_common_C_FLAGS}
>  -DCMAKE_CXX_FLAGS:STRING=${ep_common_CXX_FLAGS}
>  #debug flags
>  -DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
>  -DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG}
>  #release flags
>  -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
>  -DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}
>  #relwithdebinfo
>  -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
>  -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO}
> )
> <------------
>
> Regards,
> Thomas
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list