I want to build project with Ninja in Visual Studio 2019 environment. To do this, I have to call vcvarsall.bat. I want to build parent project with x64 while build subproject with x86. When I call vcvars64.bat, I cannot compile subproject with x86. So I am going to set compiler with x64 and x86 env each of parent project and subproject. How to set this option in CMakeLists.txt file?
Asked
Active
Viewed 107 times
0
-
If by "subproject" you mean a thing included via `add_subdirectory` from the parent project, then both subproject and parent project are technically a single CMake project and share the same platform, including the bitness. – Tsyvarev Nov 20 '20 at 08:02
-
Can I set technically different platform in single CMake parent and sub project? – littleboy Nov 20 '20 at 08:15
-
As I said, you cannot build parent project and subproject for different platform. You may, however, use commands like `execute_process` or `ExternalProject_Add` for build subproject: that way you will create a separate CMake project. But is is simpler to use some scripting (python, cmd, etc.) for build your "parent project" and "subproject" separately. – Tsyvarev Nov 20 '20 at 08:28