mirror of
https://github.com/OpenAMP/libmetal.git
synced 2026-09-21 17:13:50 +08:00
cmake: fix VERSION file path
cmake fails when the variable CMAKE_SOURCE_DIR does not point to the libmetal directory. This is the case, for example, for the Zephyr project. Fix by defining LIBMETAL_ROOT_DIR in the main CmakeLists.txt. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
This commit is contained in:
committed by
Arnaud Pouliquen
parent
59e2f084d3
commit
04cf5d9e0e
@@ -7,6 +7,8 @@ if (POLICY CMP0077)
|
||||
cmake_policy(SET CMP0077 NEW)
|
||||
endif()
|
||||
|
||||
set (LIBMETAL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
list (APPEND CMAKE_MODULE_PATH
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
file(READ ${CMAKE_SOURCE_DIR}/VERSION ver)
|
||||
file(READ ${LIBMETAL_ROOT_DIR}/VERSION ver)
|
||||
|
||||
string(REGEX MATCH "VERSION_MAJOR = ([0-9]*)" _ ${ver})
|
||||
set(PROJECT_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
|
||||
Reference in New Issue
Block a user