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