0


I'm relatively new in the CMake domain. I try to describe my VS project in CMake. This works fine, but I would also like to transfer some "macros" to CMake, like a special defined configuration(for example "Debug Dll") as a "rebuild" in Visual Studio only uses default values and, as a result, does not find directories described with Macros.

Is there a possibility to transfer those variables in CMake?

user2550641
  • 317
  • 4
  • 18
  • CMake command : `cmake srcDir/ -DMY_VAR=Yes` and in CMake file you can check : `if (MY_VAR)` Is this what you are looking for ? – MokaT Sep 22 '15 at 07:58
  • I'm not sure I think I mean a command like: set(CMAKE_CONFIGURATION $(Configuration)). So I want to save the macros, which I had defined in Visual Studio in variables within the CMakefile – user2550641 Sep 22 '15 at 08:18
  • To see how you can extend/change the configurations see [Cmake generators for Visual Studio do not set CMAKE_CONFIGURATION_TYPES](http://stackoverflow.com/questions/31661264/cmake-generators-for-visual-studio-do-not-set-cmake-configuration-types). And generally speaking I don't think you need your "macros" anymore. CMake can handle a lot of things for you. E.g. output directories can be set per configuration, see [here](http://stackoverflow.com/questions/32414587/parent-cmakelists-txt-overwriting-child-cmakelists-txt-output-directory-options). Can you give a list of things you want to achieve? – Florian Sep 22 '15 at 11:37

0 Answers0