Re: [CMake] Different behavior between building using "cmake --build" and building in Visual Studio
Hi Scott, Yes, I can invoke msbuild directly on the CMake generated solution using: msbuild theproject.sln /p:Platform=Win32 And everything builds fine. I cannot get the same behaviour using CMake --build - is there a way to determine exactly the arguments CMake is invoking msbuild with? On 2019-01-22 03:01, Scott Bloom wrote: Can you make it work by running msbuild directly? What about building using visual studio from the command line? Scott -Original Message- From: CMake On Behalf Of n...@appletonaudio.com Sent: Sunday, January 20, 2019 21:02 To: cmake@cmake.org Subject: [CMake] Different behavior between building using "cmake --build" and building in Visual Studio 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 -- 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
Re: [CMake] Different behavior between building using "cmake --build" and building in Visual Studio
Strange... When I had a similar problem, the command line for msbuild required the same level of detail. What about running it from visual studio on the command line? Scott -Original Message- From: n...@appletonaudio.com Sent: Monday, January 21, 2019 14:33 To: Scott Bloom Cc: cmake@cmake.org Subject: Re: [CMake] Different behavior between building using "cmake --build" and building in Visual Studio Hi Scott, Yes, I can invoke msbuild directly on the CMake generated solution using: msbuild theproject.sln /p:Platform=Win32 And everything builds fine. I cannot get the same behaviour using CMake --build - is there a way to determine exactly the arguments CMake is invoking msbuild with? On 2019-01-22 03:01, Scott Bloom wrote: > Can you make it work by running msbuild directly? > > What about building using visual studio from the command line? > > Scott > > -Original Message- > From: CMake On Behalf Of > n...@appletonaudio.com > Sent: Sunday, January 20, 2019 21:02 > To: cmake@cmake.org > Subject: [CMake] Different behavior between building using "cmake > --build" and building in Visual Studio > > 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 -- 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
Re: [CMake] Different behavior between building using "cmake --build" and building in Visual Studio
Can you make it work by running msbuild directly? What about building using visual studio from the command line? Scott -Original Message- From: CMake On Behalf Of n...@appletonaudio.com Sent: Sunday, January 20, 2019 21:02 To: cmake@cmake.org Subject: [CMake] Different behavior between building using "cmake --build" and building in Visual Studio 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 -- 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] find_package config and install
Hello, We are creating a foo-config.cmake file for a package. The 'foo' package contain a dynamic library that provides two interfaces and a number of configuration files. There is a mapping between an interface and required configuration files. What is the recommended approach for installing targets and necessary configuration files in this context? Should this be performed by foo-config.cmake or system that performed find_package? If foo-config.cmake should perform the install, how should it be informed of which interface is required? Can the "components" tag be used for this task? Qt 5.11 support config mode but does not perform any install. Does anyone know why? We are using CMake 3.13.2 kind regards, Lars -- 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