Re: [CMake] environment variables and visual studio
Sylvain Benner wrote: Is there any way for CMake to set environment variables which can be picked up in Visual Studio's pre/post-build steps? I'm working on a system where I've got a couple of studio project included via the INCLUDE_EXTERNAL_MSPROJECT(), and I would like to be able to refer to things like CMAKE_BINARY_DIR, so that the external msprojects can put their output relative to the CMake build dir. You can still generate the projects you are including with the INCLUDE_EXTERNAL_MSPROJECT. It make sense since they are part of your CMake framework (you want to rely on CMake variables). No, I can't. The reason I don't generate them is that they have to be portable since they are shipped to customers as a part of an SDK, and as I understand it the project files CMake generates are not portable/movable (due to absolute paths, etc). At start, it can be a lot of work to write the CMakeLists.txt for each projects but you need to do it only once. I actually had CMakeLists.txt for the projects, but had to discard them for the reason above. -- /Jesper ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] environment variables and visual studio
Bill Hoffman wrote: Jesper Eskilson wrote: Is there any way for CMake to set environment variables which can be picked up in Visual Studio's pre/post-build steps? I'm working on a system where I've got a couple of studio project included via the INCLUDE_EXTERNAL_MSPROJECT(), and I would like to be able to refer to things like CMAKE_BINARY_DIR, so that the external msprojects can put their output relative to the CMake build dir. No, this is not possible. CMake is no longer running when the project is built. I do not think there is a way to set variables in the .sln file which is where they would have to be set. I was afraid you might say that. Oh, well, I'll have to think of another solution. -- /Jesper ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] environment variables and visual studio
No, I can't. The reason I don't generate them is that they have to be portable since they are shipped to customers as a part of an SDK, and as I understand it the project files CMake generates are not portable/movable (due to absolute paths, etc). You can generate relative paths with the following switch CMAKE_USE_RELATIVE_PATHS. We managed to have portable generated projects that we can ship. After the CMake pass it should be no difference between a generated project and a manually constructed project. In fact CMake assure that the projects are consistent since it's an automated process, I encourage you to use CMake for all your projects. --Sylvain ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] environment variables and visual studio
Is there any way for CMake to set environment variables which can be picked up in Visual Studio's pre/post-build steps? I'm working on a system where I've got a couple of studio project included via the INCLUDE_EXTERNAL_MSPROJECT(), and I would like to be able to refer to things like CMAKE_BINARY_DIR, so that the external msprojects can put their output relative to the CMake build dir. -- /Jesper ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] environment variables and visual studio
Jesper Eskilson wrote: Is there any way for CMake to set environment variables which can be picked up in Visual Studio's pre/post-build steps? I'm working on a system where I've got a couple of studio project included via the INCLUDE_EXTERNAL_MSPROJECT(), and I would like to be able to refer to things like CMAKE_BINARY_DIR, so that the external msprojects can put their output relative to the CMake build dir. No, this is not possible. CMake is no longer running when the project is built. I do not think there is a way to set variables in the .sln file which is where they would have to be set. -Bill ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] environment variables and visual studio
Is there any way for CMake to set environment variables which can be picked up in Visual Studio's pre/post-build steps? I'm working on a system where I've got a couple of studio project included via the INCLUDE_EXTERNAL_MSPROJECT(), and I would like to be able to refer to things like CMAKE_BINARY_DIR, so that the external msprojects can put their output relative to the CMake build dir. You can still generate the projects you are including with the INCLUDE_EXTERNAL_MSPROJECT. It make sense since they are part of your CMake framework (you want to rely on CMake variables). At start, it can be a lot of work to write the CMakeLists.txt for each projects but you need to do it only once. --Sylvain ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake