summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VSSolution/solution_parsing.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/VSSolution/solution_parsing.cmake')
-rw-r--r--Tests/RunCMake/VSSolution/solution_parsing.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/VSSolution/solution_parsing.cmake b/Tests/RunCMake/VSSolution/solution_parsing.cmake
index dd158ef..001b584 100644
--- a/Tests/RunCMake/VSSolution/solution_parsing.cmake
+++ b/Tests/RunCMake/VSSolution/solution_parsing.cmake
@@ -50,6 +50,20 @@ macro(parseGlobalSections arg_out_pre arg_out_post testName)
endmacro()
+macro(getFirstProject arg_out_first_project testName)
+ set(${arg_out_first_project} "")
+ set(sln "${RunCMake_TEST_BINARY_DIR}/${testName}.sln")
+ if(NOT EXISTS "${sln}")
+ error("Expected solution file ${sln} does not exist")
+ endif()
+ file(STRINGS "${sln}" project_lines REGEX "^Project\\(")
+ list(GET project_lines 0 first_project)
+ string(REGEX REPLACE ".* = \"" "" first_project "${first_project}")
+ string(REGEX REPLACE "\", .*" "" first_project "${first_project}")
+ set(${arg_out_first_project} "${first_project}")
+endmacro()
+
+
macro(testGlobalSection prefix sectionName)
if(NOT DEFINED ${prefix}_${sectionName})
error("Section ${sectionName} does not exist")