From 727bb0bd242bcd998f989c493d98ca1faf60e408 Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Mon, 28 Oct 2024 13:27:34 -0700 Subject: [PATCH] FileParse_Branch stored as global variable. --- CMakeLists.txt | 4 +++- src/CMakeLists.txt | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 73f6166..14a3370 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,10 +40,12 @@ include(FetchContent) # Test from FileParse should not be visible here set(BUILD_FileParse_tests OFF CACHE BOOL "Build FileParse tests" FORCE) +set(FileParse_Branch "main") + FetchContent_Declare( FileParse GIT_REPOSITORY https://github.com/LBNL-ETA/FileParse.git - GIT_TAG main + GIT_TAG ${FileParse_Branch} ) FetchContent_MakeAvailable(FileParse) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a11b533..b487456 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,8 +12,8 @@ add_library( ${LIB_NAME} target_link_libraries(${LIB_NAME} PRIVATE xmlParser) target_link_libraries(${LIB_NAME} PRIVATE FileParse) -# Set a property on the existing target -set_property(TARGET ${LIB_NAME} PROPERTY variable_name "test") +# Setting variable for parent projects so it can be checked if same version is used +set_property(TARGET ${LIB_NAME} PROPERTY FileParse_Branch ${FileParse_Branch}) if(NOT "${fPIC}") set(fPIC ON)