Skip to content

Commit 3ced354

Browse files
committed
Add support for override_mrpt_version for local builds
1 parent 3545df4 commit 3ced354

File tree

15 files changed

+197
-58
lines changed

15 files changed

+197
-58
lines changed

mrpt_apps/CMakeLists.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,24 @@ include(ExternalProject)
88
#----
99
# Extract version from package.xml
1010
# Example line:" <version>0.3.2</version>"
11-
file(READ package.xml contentPackageXML)
12-
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
13-
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
14-
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} (detected in package.xml)")
11+
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake)
12+
include(${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake REQUIRED)
13+
endif()
14+
if(NOT MRPT_VERSION_TO_DOWNLOAD)
15+
file(READ package.xml contentPackageXML)
16+
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
17+
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
18+
set(_VERSION_SRC "(detected in package.xml)")
19+
else()
20+
set(_VERSION_SRC "(***OVERRIDEN VERSION***)")
21+
endif()
22+
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} ${_VERSION_SRC}")
1523
#----
1624

1725
# For local builds, avoid the waste of time and disk of cloning mrpt within each package,
1826
# which makes sense only in build farms:
1927
# --------------------------------------------------------------------------------------------
20-
if (EXISTS ${CMAKE_BINARY_DIR}/../mrpt_libbase/mrpt-build/src/mrpt/CMakeLists.txt AND NOT "$ENV{HOME}" STREQUAL "/home/buildfarm")
28+
if(EXISTS ${CMAKE_BINARY_DIR}/../mrpt_libbase/mrpt-build/src/mrpt/CMakeLists.txt AND NOT "$ENV{HOME}" STREQUAL "/home/buildfarm")
2129
# reuse existing cloned version:
2230
set(src_cmds
2331
SOURCE_DIR ${CMAKE_BINARY_DIR}/../mrpt_libbase/mrpt-build/src/mrpt/

mrpt_libapps/CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ include(ExternalProject)
99
#----
1010
# Extract version from package.xml
1111
# Example line:" <version>0.3.2</version>"
12-
file(READ package.xml contentPackageXML)
13-
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
14-
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
15-
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} (detected in package.xml)")
12+
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake)
13+
include(${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake REQUIRED)
14+
endif()
15+
if(NOT MRPT_VERSION_TO_DOWNLOAD)
16+
file(READ package.xml contentPackageXML)
17+
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
18+
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
19+
set(_VERSION_SRC "(detected in package.xml)")
20+
else()
21+
set(_VERSION_SRC "(***OVERRIDEN VERSION***)")
22+
endif()
23+
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} ${_VERSION_SRC}")
1624
#----
1725

26+
1827
# For local builds, avoid the waste of time and disk of cloning mrpt within each package,
1928
# which makes sense only in build farms:
2029
# --------------------------------------------------------------------------------------------

mrpt_libbase/CMakeLists.txt

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,31 @@ include(ExternalProject)
99
#----
1010
# Extract version from package.xml
1111
# Example line:" <version>0.3.2</version>"
12-
file(READ package.xml contentPackageXML)
13-
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
14-
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
15-
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} (detected in package.xml)")
12+
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake)
13+
include(${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake REQUIRED)
14+
endif()
15+
if(NOT MRPT_VERSION_TO_DOWNLOAD)
16+
file(READ package.xml contentPackageXML)
17+
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
18+
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
19+
set(_VERSION_SRC "(detected in package.xml)")
20+
else()
21+
set(_VERSION_SRC "(***OVERRIDEN VERSION***)")
22+
endif()
23+
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} ${_VERSION_SRC}")
24+
#----
25+
26+
#----
27+
set(VERSION_CACHE ${CMAKE_BINARY_DIR}/../mrpt_libbase/mrpt-build/MRPT_VERSION_TO_DOWNLOAD.txt)
28+
if(EXISTS ${VERSION_CACHE})
29+
file(READ ${VERSION_CACHE} CURRENT_DOWNLOADED_MRPT_VERSION)
30+
endif()
1631
#----
1732

1833
# For local builds, avoid the waste of time and disk of cloning mrpt within each package,
1934
# which makes sense only in build farms:
2035
# --------------------------------------------------------------------------------------------
21-
if (EXISTS ${CMAKE_BINARY_DIR}/../mrpt_libbase/mrpt-build/src/mrpt/CMakeLists.txt AND NOT "$ENV{HOME}" STREQUAL "/home/buildfarm")
36+
if (EXISTS ${CMAKE_BINARY_DIR}/../mrpt_libbase/mrpt-build/src/mrpt/CMakeLists.txt AND (NOT "$ENV{HOME}" STREQUAL "/home/buildfarm") AND "${CURRENT_DOWNLOADED_MRPT_VERSION}" STREQUAL "${MRPT_VERSION_TO_DOWNLOAD}")
2237
# reuse existing cloned version:
2338
set(src_cmds
2439
SOURCE_DIR ${CMAKE_BINARY_DIR}/../mrpt_libbase/mrpt-build/src/mrpt/
@@ -30,6 +45,7 @@ else()
3045
GIT_TAG ${MRPT_VERSION_TO_DOWNLOAD}
3146
)
3247
endif()
48+
file(WRITE ${VERSION_CACHE} ${MRPT_VERSION_TO_DOWNLOAD})
3349

3450
# EP:
3551
# -------------------------------

mrpt_libgui/CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,21 @@ include(ExternalProject)
88
#----
99
# Extract version from package.xml
1010
# Example line:" <version>0.3.2</version>"
11-
file(READ package.xml contentPackageXML)
12-
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
13-
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
14-
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} (detected in package.xml)")
11+
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake)
12+
include(${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake REQUIRED)
13+
endif()
14+
if(NOT MRPT_VERSION_TO_DOWNLOAD)
15+
file(READ package.xml contentPackageXML)
16+
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
17+
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
18+
set(_VERSION_SRC "(detected in package.xml)")
19+
else()
20+
set(_VERSION_SRC "(***OVERRIDEN VERSION***)")
21+
endif()
22+
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} ${_VERSION_SRC}")
1523
#----
1624

25+
1726
# For local builds, avoid the waste of time and disk of cloning mrpt within each package,
1827
# which makes sense only in build farms:
1928
# --------------------------------------------------------------------------------------------

mrpt_libhwdrivers/CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ include(ExternalProject)
99
#----
1010
# Extract version from package.xml
1111
# Example line:" <version>0.3.2</version>"
12-
file(READ package.xml contentPackageXML)
13-
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
14-
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
15-
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} (detected in package.xml)")
12+
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake)
13+
include(${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake REQUIRED)
14+
endif()
15+
if(NOT MRPT_VERSION_TO_DOWNLOAD)
16+
file(READ package.xml contentPackageXML)
17+
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
18+
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
19+
set(_VERSION_SRC "(detected in package.xml)")
20+
else()
21+
set(_VERSION_SRC "(***OVERRIDEN VERSION***)")
22+
endif()
23+
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} ${_VERSION_SRC}")
1624
#----
1725

26+
1827
# For local builds, avoid the waste of time and disk of cloning mrpt within each package,
1928
# which makes sense only in build farms:
2029
# --------------------------------------------------------------------------------------------

mrpt_libmaps/CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ include(ExternalProject)
99
#----
1010
# Extract version from package.xml
1111
# Example line:" <version>0.3.2</version>"
12-
file(READ package.xml contentPackageXML)
13-
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
14-
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
15-
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} (detected in package.xml)")
12+
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake)
13+
include(${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake REQUIRED)
14+
endif()
15+
if(NOT MRPT_VERSION_TO_DOWNLOAD)
16+
file(READ package.xml contentPackageXML)
17+
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
18+
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
19+
set(_VERSION_SRC "(detected in package.xml)")
20+
else()
21+
set(_VERSION_SRC "(***OVERRIDEN VERSION***)")
22+
endif()
23+
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} ${_VERSION_SRC}")
1624
#----
1725

26+
1827
# For local builds, avoid the waste of time and disk of cloning mrpt within each package,
1928
# which makes sense only in build farms:
2029
# --------------------------------------------------------------------------------------------

mrpt_libmath/CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ include(ExternalProject)
99
#----
1010
# Extract version from package.xml
1111
# Example line:" <version>0.3.2</version>"
12-
file(READ package.xml contentPackageXML)
13-
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
14-
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
15-
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} (detected in package.xml)")
12+
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake)
13+
include(${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake REQUIRED)
14+
endif()
15+
if(NOT MRPT_VERSION_TO_DOWNLOAD)
16+
file(READ package.xml contentPackageXML)
17+
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
18+
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
19+
set(_VERSION_SRC "(detected in package.xml)")
20+
else()
21+
set(_VERSION_SRC "(***OVERRIDEN VERSION***)")
22+
endif()
23+
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} ${_VERSION_SRC}")
1624
#----
1725

26+
1827
# For local builds, avoid the waste of time and disk of cloning mrpt within each package,
1928
# which makes sense only in build farms:
2029
# --------------------------------------------------------------------------------------------

mrpt_libnav/CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ include(ExternalProject)
99
#----
1010
# Extract version from package.xml
1111
# Example line:" <version>0.3.2</version>"
12-
file(READ package.xml contentPackageXML)
13-
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
14-
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
15-
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} (detected in package.xml)")
12+
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake)
13+
include(${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake REQUIRED)
14+
endif()
15+
if(NOT MRPT_VERSION_TO_DOWNLOAD)
16+
file(READ package.xml contentPackageXML)
17+
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
18+
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
19+
set(_VERSION_SRC "(detected in package.xml)")
20+
else()
21+
set(_VERSION_SRC "(***OVERRIDEN VERSION***)")
22+
endif()
23+
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} ${_VERSION_SRC}")
1624
#----
1725

26+
1827
# For local builds, avoid the waste of time and disk of cloning mrpt within each package,
1928
# which makes sense only in build farms:
2029
# --------------------------------------------------------------------------------------------

mrpt_libobs/CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ include(ExternalProject)
99
#----
1010
# Extract version from package.xml
1111
# Example line:" <version>0.3.2</version>"
12-
file(READ package.xml contentPackageXML)
13-
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
14-
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
15-
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} (detected in package.xml)")
12+
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake)
13+
include(${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake REQUIRED)
14+
endif()
15+
if(NOT MRPT_VERSION_TO_DOWNLOAD)
16+
file(READ package.xml contentPackageXML)
17+
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
18+
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
19+
set(_VERSION_SRC "(detected in package.xml)")
20+
else()
21+
set(_VERSION_SRC "(***OVERRIDEN VERSION***)")
22+
endif()
23+
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} ${_VERSION_SRC}")
1624
#----
1725

26+
1827
# For local builds, avoid the waste of time and disk of cloning mrpt within each package,
1928
# which makes sense only in build farms:
2029
# --------------------------------------------------------------------------------------------

mrpt_libopengl/CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ include(ExternalProject)
99
#----
1010
# Extract version from package.xml
1111
# Example line:" <version>0.3.2</version>"
12-
file(READ package.xml contentPackageXML)
13-
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
14-
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
15-
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} (detected in package.xml)")
12+
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake)
13+
include(${CMAKE_CURRENT_LIST_DIR}/../override_mrpt_version.cmake REQUIRED)
14+
endif()
15+
if(NOT MRPT_VERSION_TO_DOWNLOAD)
16+
file(READ package.xml contentPackageXML)
17+
string(REGEX MATCH "<version>([0-9\.]*)</version>" _ ${contentPackageXML})
18+
set(MRPT_VERSION_TO_DOWNLOAD ${CMAKE_MATCH_1})
19+
set(_VERSION_SRC "(detected in package.xml)")
20+
else()
21+
set(_VERSION_SRC "(***OVERRIDEN VERSION***)")
22+
endif()
23+
message(STATUS "MRPT_VERSION_TO_DOWNLOAD: ${MRPT_VERSION_TO_DOWNLOAD} ${_VERSION_SRC}")
1624
#----
1725

26+
1827
# For local builds, avoid the waste of time and disk of cloning mrpt within each package,
1928
# which makes sense only in build farms:
2029
# --------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)