summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/include_external_msproject
diff options
context:
space:
mode:
authorMyungJoo Ham <myungjoo.ham@samsung.com>2017-10-11 15:16:57 +0900
committerMyungJoo Ham <myungjoo.ham@samsung.com>2017-10-11 15:16:57 +0900
commit915c76ded744c0f5f151402b9fa69f3fd8452573 (patch)
treeca6a387466543248890f346847acaa8343989b22 /Tests/RunCMake/include_external_msproject
parent317dbdb79761ef65e45c7358cfc7571c6afa54ad (diff)
downloadcmake-915c76ded744c0f5f151402b9fa69f3fd8452573.tar.gz
cmake-915c76ded744c0f5f151402b9fa69f3fd8452573.tar.bz2
cmake-915c76ded744c0f5f151402b9fa69f3fd8452573.zip
Imported Upstream version 3.9.4upstream/3.9.4
Diffstat (limited to 'Tests/RunCMake/include_external_msproject')
-rw-r--r--Tests/RunCMake/include_external_msproject/CustomConfig-check.cmake1
-rw-r--r--Tests/RunCMake/include_external_msproject/CustomConfig.cmake3
-rw-r--r--Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake2
-rw-r--r--Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake2
-rw-r--r--Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake2
-rw-r--r--Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/include_external_msproject/check_utils.cmake37
7 files changed, 40 insertions, 8 deletions
diff --git a/Tests/RunCMake/include_external_msproject/CustomConfig-check.cmake b/Tests/RunCMake/include_external_msproject/CustomConfig-check.cmake
new file mode 100644
index 000000000..1a940b810
--- /dev/null
+++ b/Tests/RunCMake/include_external_msproject/CustomConfig-check.cmake
@@ -0,0 +1 @@
+check_project(CustomConfig external "aaa-bbb-ccc-000" "" "" "Custom - Release")
diff --git a/Tests/RunCMake/include_external_msproject/CustomConfig.cmake b/Tests/RunCMake/include_external_msproject/CustomConfig.cmake
new file mode 100644
index 000000000..1f935cd58
--- /dev/null
+++ b/Tests/RunCMake/include_external_msproject/CustomConfig.cmake
@@ -0,0 +1,3 @@
+include_external_msproject(external external.project
+ GUID aaa-bbb-ccc-000)
+set_target_properties(external PROPERTIES MAP_IMPORTED_CONFIG_RELEASE "Custom - Release")
diff --git a/Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake b/Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake
index 68dec4c08..3747934db 100644
--- a/Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake
+++ b/Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake
@@ -1 +1 @@
-check_project(CustomGuid external "aaa-bbb-ccc-000" "" "")
+check_project(CustomGuid external "aaa-bbb-ccc-000" "" "" "")
diff --git a/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake b/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake
index 614712ee6..0b2ac1db0 100644
--- a/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake
+++ b/Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake
@@ -1 +1 @@
-check_project(CustomGuidTypePlatform external "aaa-bbb-ccc-111" "aaa-bbb-ccc-ddd-eee" "Custom Platform")
+check_project(CustomGuidTypePlatform external "aaa-bbb-ccc-111" "aaa-bbb-ccc-ddd-eee" "Custom Platform" "")
diff --git a/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake b/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake
index 054eeb037..c431b03d6 100644
--- a/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake
+++ b/Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake
@@ -1 +1 @@
-check_project(CustomTypePlatform external "" "aaa-bbb-ccc-ddd-eee" "Custom Platform")
+check_project(CustomTypePlatform external "" "aaa-bbb-ccc-ddd-eee" "Custom Platform" "")
diff --git a/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake b/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake
index 90710f9bf..47dac349f 100644
--- a/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake
@@ -4,3 +4,4 @@ include(${CMAKE_CURRENT_LIST_DIR}/check_utils.cmake)
run_cmake(CustomGuid)
run_cmake(CustomTypePlatform)
run_cmake(CustomGuidTypePlatform)
+run_cmake(CustomConfig)
diff --git a/Tests/RunCMake/include_external_msproject/check_utils.cmake b/Tests/RunCMake/include_external_msproject/check_utils.cmake
index 7f5ef5394..e9e9cac72 100644
--- a/Tests/RunCMake/include_external_msproject/check_utils.cmake
+++ b/Tests/RunCMake/include_external_msproject/check_utils.cmake
@@ -71,8 +71,24 @@ function(check_custom_platform TARGET_FILE PROJECT_NAME PLATFORM_NAME RESULT)
set(${RESULT} ${IS_FOUND} PARENT_SCOPE)
endfunction()
+# Search project's build configuration line by project name and target configuration name.
+# Returns TRUE if found and FALSE otherwise
+function(check_custom_configuration TARGET_FILE PROJECT_NAME SLN_CONFIG DST_CONFIG RESULT)
+ set(${RESULT} "FALSE" PARENT_SCOPE)
+ # extract project guid
+ parse_project_section(${TARGET_FILE} ${PROJECT_NAME})
+ if(NOT IS_FOUND)
+ return()
+ endif()
+
+ set(REG_EXP "^(\t)*\\{${FOUND_GUID}\\}\\.${SLN_CONFIG}[^ ]*\\.ActiveCfg = ${DST_CONFIG}\\|.*$")
+ check_line_exists(${TARGET_FILE} REG_EXP)
+
+ set(${RESULT} ${IS_FOUND} PARENT_SCOPE)
+endfunction()
+
# RunCMake test check helper
-function(check_project test name guid type platform)
+function(check_project test name guid type platform imported_release_config_name)
set(sln "${RunCMake_TEST_BINARY_DIR}/${test}.sln")
set(sep "")
set(failed "")
@@ -80,16 +96,21 @@ function(check_project test name guid type platform)
set(type 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942)
endif()
if(NOT platform)
- if("${RunCMake_GENERATOR}" MATCHES "Win64")
+ if(RunCMake_GENERATOR_PLATFORM)
+ set(platform "${RunCMake_GENERATOR_PLATFORM}")
+ elseif("${RunCMake_GENERATOR}" MATCHES "Win64")
set(platform "x64")
else()
set(platform "Win32")
endif()
endif()
+ if(NOT imported_release_config_name)
+ set(imported_release_config_name "Release")
+ endif()
if(guid)
check_project_guid("${sln}" "${name}" "${guid}" passed_guid)
if(NOT passed_guid)
- set(failed "${failed}${sep}${name} solution has no project with expected GUID=${guid}")
+ string(APPEND failed "${sep}${name} solution has no project with expected GUID=${guid}")
set(sep "\n")
endif()
else()
@@ -97,13 +118,19 @@ function(check_project test name guid type platform)
endif()
check_project_type("${sln}" "${name}" "${type}" passed_type)
if(NOT passed_type)
- set(failed "${failed}${sep}${name} solution has no project with expected TYPE=${type}")
+ string(APPEND failed "${sep}${name} solution has no project with expected TYPE=${type}")
set(sep "\n")
endif()
check_custom_platform("${sln}" "${name}" "${platform}" passed_platform)
if(NOT passed_platform)
- set(failed "${failed}${sep}${name} solution has no project with expected PLATFORM=${platform}")
+ string(APPEND failed "${sep}${name} solution has no project with expected PLATFORM=${platform}")
+ set(sep "\n")
+ endif()
+ check_custom_configuration("${sln}" "${name}" "Release" "${imported_release_config_name}" passed_configuration)
+ if(NOT passed_configuration)
+ string(APPEND failed "${sep}${name} solution has no project with expected CONFIG=${imported_release_config_name}")
set(sep "\n")
endif()
+
set(RunCMake_TEST_FAILED "${failed}" PARENT_SCOPE)
endfunction()