[CMake] Different behavior between building using "cmake --build" and building in Visual Studio

2019-01-20 Thread nick

Hello,

I have a CMake project which is generating Visual Studio (VS2017) 
solutions which can be compiled using the Visual Studio IDE but cannot 
be built from the command line using "cmake --build".


The project contains a shared library which links against two static 
libraries. The two static libraries are non-CMake projects with .vcproj 
files which are generated using another (proprietary) build system. They 
are being included in the project on Windows using the 
include_external_msproject() command. These two projects do not have the 
standard configuration names ("Debug","Release",etc) and their 
configurations are mapped to the main CMake project's configurations 
using MAP_IMPORTED_CONFIG_XXX properties. This all works very well using 
the VS IDE.


There are two things that happen which I find surprising when I run 
"cmake --build":


1) It doesn't seem to automatically decide on the correct platform 
toolset version to use. So running "cmake.exe --build . --config Debug" 
ends up resulting in a build log containing lots of errors about missing 
tools. I can fix this by manually specifiying the toolset version as: 
"cmake.exe --build . --config Debug -- -property:PlatformToolset=v140" 
(if anyone can hint to why this happens, I would be interested - but it 
is secondary to the following issue) which results in:


2) The following issues in the build tool log:

"MY_DEVELOPMENT_PATH\PATH1\build\ALL_BUILD.vcxproj" (default target) (1) 
->

"MY_DEVELOPMENT_PATH\PATH2\library_1.vcxproj" (default target) (3) ->
(PrepareForBuild target) ->
  C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(349,5): 
error MSB8013: This project doesn't contain the Configuration and 
Platform combination of Debug|Win32. 
[MY_DEVELOPMENT_PATH\PATH2\dependent_library_1.vcxproj]



"MY_DEVELOPMENT_PATH\PATH1\build\ALL_BUILD.vcxproj" (default target) (1) 
->

"MY_DEVELOPMENT_PATH\PATH3\library_2.vcxproj" (default target) (4) ->
  C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(349,5): 
error MSB8013: This project doesn't contain the Configuration and 
Platform combination of Debug|Win32. 
[MY_DEVELOPMENT_PATH\PATH3\dependent_library_2.vcxproj]


Where library_1 and library_2 correspond to the two static libraries. 
Given the output, my guess is that the mapped configurations are not 
being honoured anymore (while they are definitely being honoured when 
the project is built inside Visual Studio). I would have assumed that 
CMake would invoke msbuild/devenv on the created solution and things 
would work, but it does not seem to be happening. Could anyone provide 
me with some information as to whether this is a bug in CMake or if I am 
missing something bigger here?


Thanks!

Nick
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[Cmake-commits] CMake branch, master, updated. v3.13.3-984-g7ac3844

2019-01-20 Thread Kitware Robot via Cmake-commits
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  7ac3844ab5a09ad4018c40569ccdc07c313eb407 (commit)
  from  41e02ea3b82c2c1a302096d3032dc2f52f52b686 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7ac3844ab5a09ad4018c40569ccdc07c313eb407
commit 7ac3844ab5a09ad4018c40569ccdc07c313eb407
Author: Kitware Robot 
AuthorDate: Mon Jan 21 00:01:06 2019 -0500
Commit: Kitware Robot 
CommitDate: Mon Jan 21 00:01:06 2019 -0500

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index e2a72e4..62f5f70 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 13)
-set(CMake_VERSION_PATCH 20190120)
+set(CMake_VERSION_PATCH 20190121)
 #set(CMake_VERSION_RC 1)

---

Summary of changes:
 Source/CMakeVersion.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits