From 87bbc3bab2e3b71bddaffafc73b39e6332e65bc5 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Sat, 10 Aug 2024 03:21:06 +0000 Subject: [PATCH] Clean up InitSharedLibrary.cmake --- cmake/InitSharedLibrary.cmake | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cmake/InitSharedLibrary.cmake b/cmake/InitSharedLibrary.cmake index f8f18468b..eee39acc8 100644 --- a/cmake/InitSharedLibrary.cmake +++ b/cmake/InitSharedLibrary.cmake @@ -1,7 +1,3 @@ -function(set_parent_scope VAR_NAME) - set(${VAR_NAME} ${${VAR_NAME}} PARENT_SCOPE) -endfunction() - function(init_shared_library) set(source_dir) if (${ARGC} EQUAL 0) @@ -20,12 +16,13 @@ function(init_shared_library) # set(${PROJECT_NAME}_Sources ${${PROJECT_NAME}_Sources} PARENT_SCOPE) # Note: cpp files inside 'tests' dir(s) are considered tests. # Remove tests from main sources, and add them to test sources - set(${PROJECT_NAME}_Test_Sources PARENT_SCOPE) + set(${PROJECT_NAME}_Test_Sources) foreach(item ${${PROJECT_NAME}_Sources}) if(${item} MATCHES "tests/*.cpp") list(REMOVE_ITEM ${PROJECT_NAME}_Sources ${item}) list(APPEND ${PROJECT_NAME}_Test_Sources ${item}) endif() + set(${PROJECT_NAME}_Test_Sources ${${PROJECT_NAME}_Test_Sources} PARENT_SCOPE) endforeach() # Add main library