MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0015914 | CMake | CMake | public | 2016-01-12 16:29 | 2016-06-10 14:31 |
Reporter | Kim Topley | ||||
Assigned To | Kitware Robot | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | Mac | OS | OS X | OS Version | 11.2 |
Product Version | CMake 3.4 | ||||
Target Version | Fixed in Version | ||||
Summary | 0015914: Update and subsequent steps of ExternalProject_Add are executed even when there is no change in the downloaded source | ||||
Description | I have several CMake files that download and build source from a Git repo or a file on SourceForge, using ExternalProject_Add. Everything works, except that the software is rebuilt every time I run make, even if nothing new was pulled from Git or the downloaded source file did not change. This means that builds that should take a couple of seconds take many minutes. | ||||
Steps To Reproduce | I use a file that imports the following snippet: include(ExternalProject) set(JEMALLOC_PREFIX_DIR ${CMAKE_BINARY_DIR}/Jemalloc) set(JEMALLOC_SRC_DIR ${JEMALLOC_PREFIX_DIR}/src/Jemalloc) set(JEMALLOC_INSTALL_DIR ${JEMALLOC_PREFIX_DIR}/install) ExternalProject_Add(Jemalloc GIT_REPOSITORY https://github.com/jemalloc/jemalloc.git [^] GIT_TAG master PREFIX ${JEMALLOC_PREFIX_DIR} CONFIGURE_COMMAND echo Configuring jemalloc && cd ${JEMALLOC_SRC_DIR} && ./autogen.sh && ./configure --prefix=${JEMALLOC_INSTALL_DIR} --with-jemalloc-prefix=je_ --enable-prof BUILD_COMMAND echo Building jemalloc && cd ${JEMALLOC_SRC_DIR} && make install_lib_static install_include INSTALL_COMMAND "" ) # Create libjemalloc and libjemalloc-pic targets to be used as # dependencies add_library(libjemalloc STATIC IMPORTED GLOBAL) add_library(libjemalloc-pic STATIC IMPORTED GLOBAL) set_target_properties(libjemalloc PROPERTIES "IMPORTED_LOCATION" "${JEMALLOC_INSTALL_DIR}/lib/libjemalloc.a") set_target_properties(libjemalloc-pic PROPERTIES "IMPORTED_LOCATION" "${JEMALLOC_INSTALL_DIR}/lib/libjemalloc-pic.a") # Make the targets depend on the external project download. add_dependencies(libjemalloc Jemalloc) add_dependencies(libjemalloc-pic Jemalloc) # Export the include directory path. set(JEMALLOC_INCLUDE_DIR ${JEMALLOC_INSTALL_DIR}/include) | ||||
Additional Information | The issue seems to be that the -update target in the generated Makefile is always seen to be out of date. It looks like that's because it doesn't do a touch at the end, unlike all of the other similar targets. I added a touch to the generated file and it stopped rebuilding the source: Jemalloc/src/Jemalloc-stamp/Jemalloc-update: Jemalloc/src/Jemalloc-stamp/Jemalloc-download @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=/Users/kim/clionprojects/Hacking2/XYZZY/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Performing update step for 'Jemalloc'" cd /Users/kim/clionprojects/Hacking2/XYZZY/Jemalloc/src/Jemalloc && /Applications/CMake.app/Contents/bin/cmake -P /Users/kim/clionprojects/Hacking2/XYZZY/Jemalloc/tmp/Jemalloc-gitupdate.cmake echo I ADDED THE NEXT LINE..... cd /Users/kim/clionprojects/Hacking2/XYZZY/Jemalloc/src && /Applications/CMake.app/Contents/bin/cmake -E touch /Users/kim/clionprojects/Hacking2/XYZZY/Jemalloc/src/Jemalloc-stamp/Jemalloc-update | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2016-01-12 16:29 | Kim Topley | New Issue | |||
2016-06-10 14:29 | Kitware Robot | Note Added: 0042911 | |||
2016-06-10 14:29 | Kitware Robot | Status | new => resolved | ||
2016-06-10 14:29 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:29 | Kitware Robot | Assigned To | => Kitware Robot | ||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|