Re: [CMake] Confikgurations and Platforms in Visual Studio 8
How are you arranging this, would you be able to let me see some of your CMakeList.txt files? It looks to me that I'm hitting a lot of edge cases in cmake, and It's not clear from the documentation, what the right way of doing this is. Can you help me avoid banging my head against the wall? :) Many thanks, Joe Our framework let us choose a platform, say WIN32_Dynamic or WIN32_Static. An included little cmake script choose the target type based on the platform name like this : # Regular IF(PLATFORM MATCHES .*Dynamic$) PROJECT_BUILD_TYPE(Shared) ENDIF(PLATFORM MATCHES .*Dynamic$) IF(PLATFORM MATCHES .*Static$) PROJECT_BUILD_TYPE(Static) ENDIF(PLATFORM MATCHES .*Static$) # XBox360 IF(PLATFORM MATCHES XBox360) PROJECT_BUILD_TYPE(Static) ENDIF(PLATFORM MATCHES XBox360) PROJECT_BUILD_TYPE is a macro which call the ADD_TARGET command with the specified type. As you see we have only one target per project, it's our choice to make things easier. Some projects are always static libraries or always executables so in these projects we don't include the above script, but we directly call PROJECT_BUILD_TYPE(Executable) so these projects will be executables on all platforms (both WIN32_Dynamic ans WIN32_Static). For the folder tree, here is our structure : - for vcproj: ${CMAKE_BINARY_DIR}/platform/generator/Projects - for sln: ${CMAKE_BINARY_DIR}/platform/generator/Solutions --Sylvain ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Confikgurations and Platforms in Visual Studio 8
Answering my own question, after a bit of research, it appears that cmake doesn't natively deal with cross-platform building for Visual Studio Projects. Instead it tests to see whether to generate Win32 or x64 project file configurations. In the environment we've got, we want to build Win32, Xbox 360 and Playstation 3 binaries, all from a Win32 box. I wonder what the best way to tweak cmake to do this is. My first thoughts are to do away with Visual Studio altogether, as its vcproj files are pretty hard coded into cmake. Instead I'm playing with using a traditional make, but I still need vcproj external make files, as the developers are using visual studio. I've ordered the book - perhaps I'll get some hints from there. I'd be interested in hearing from anyone who is already doing this kind of thing. Joe Well, you can generate one vcproj per platform. Yes it can end with a lot of project files but if it's well organized with a good folder tree, it is alright. Here we build on PS3, XBOX360,WII, WIN32, WINCE, MACOSX, each platform has its own vcproj and sln and other type of projects we need. We also differenciate between WIN32 static and WIN32 dynamic for instance because we have decided to have only one target per CMakeLists.txt at a time, this way it's easier to understand what is built in Visual Studio projects. --Sylvain ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Confikgurations and Platforms in Visual Studio 8
Answering my own question, after a bit of research, it appears that cmake doesn't natively deal with cross-platform building for Visual Studio Projects. Instead it tests to see whether to generate Win32 or x64 project file configurations. In the environment we've got, we want to build Win32, Xbox 360 and Playstation 3 binaries, all from a Win32 box. I wonder what the best way to tweak cmake to do this is. My first thoughts are to do away with Visual Studio altogether, as its vcproj files are pretty hard coded into cmake. Instead I'm playing with using a traditional make, but I still need vcproj external make files, as the developers are using visual studio. I've ordered the book - perhaps I'll get some hints from there. I'd be interested in hearing from anyone who is already doing this kind of thing. Joe Well, you can generate one vcproj per platform. Yes it can end with a lot of project files but if it's well organized with a good folder tree, it is alright. Here we build on PS3, XBOX360,WII, WIN32, WINCE, MACOSX, each platform has its own vcproj and sln and other type of projects we need. We also differenciate between WIN32 static and WIN32 dynamic for instance because we have decided to have only one target per CMakeLists.txt at a time, this way it's easier to understand what is built in Visual Studio projects. --Sylvain ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Confikgurations and Platforms in Visual Studio 8
Josef Karthauser wrote: I'm looking at cmake as a potential solution to some build problems I'm having. Am I right in thinking that cmake only allows for four hard-coded configuration labels, DEBUG/RELEASE/etc? Where should I look to add to these, as we've got more configurations than this. http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_extend_the_build_modes_wit h_a_custom_made_one_.3F Also, does cmake have an idea of platforms, or does it assume Win32? CMake does not assume anything about Win32 or any other platform. -Torsten ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Confikgurations and Platforms in Visual Studio 8
I'm looking at cmake as a potential solution to some build problems I'm having. Am I right in thinking that cmake only allows for four hard-coded configuration labels, DEBUG/RELEASE/etc? Where should I look to add to these, as we've got more configurations than this. http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_extend_the_build_modes_wit h_a_custom_made_one_.3F Brilliant, that looks good. Also, does cmake have an idea of platforms, or does it assume Win32? CMake does not assume anything about Win32 or any other platform. What I mean is, in vcproj files combine the configuration and the platform labels to form a compilation target, i.e Release|Win32, Debug|x64. How do I go about specifying the platform parts of these with cmake? For example, I say I have 'Release', 'Debug', and 'Special' configurations, and Win32 and x64 platforms. Now suppose that I only support the following configurations: Release|Win32 Release|x64 Debug|Win32 Debug|x64 Special|x64 How do I go about specifying that to cmake? Much appreciated, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Confikgurations and Platforms in Visual Studio 8
Also, does cmake have an idea of platforms, or does it assume Win32? CMake does not assume anything about Win32 or any other platform. What I mean is, in vcproj files combine the configuration and the platform labels to form a compilation target, i.e Release|Win32, Debug|x64. How do I go about specifying the platform parts of these with cmake? For example, I say I have 'Release', 'Debug', and 'Special' configurations, and Win32 and x64 platforms. Now suppose that I only support the following configurations: Release|Win32 Release|x64 Debug|Win32 Debug|x64 Special|x64 How do I go about specifying that to cmake? Looking at the source, it appears (from cmLocalVisualStudio7Generator.cxx) that cmake assumes that visual studio only supports 'x64', 'ia64' and 'win32' as target platforms, and that this can only be changed in code. Is this right? Three questions then, if I may: * How do I go about specifying a particular platform in the CMakeList.txt file? * What is the easiest way to add additional platform support; can this only happen through modifying the code, or is there some other magic that can be done. (Other embedded platforms exist in VC8, which we're targeting). * Are these issues dealt with in the book? Or is there some other on-line documentation that I'm missing? Thanks, Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
RE: [CMake] Confikgurations and Platforms in Visual Studio 8
Also, does cmake have an idea of platforms, or does it assume Win32? CMake does not assume anything about Win32 or any other platform. What I mean is, in vcproj files combine the configuration and the platform labels to form a compilation target, i.e Release|Win32, Debug|x64. How do I go about specifying the platform parts of these with cmake? For example, I say I have 'Release', 'Debug', and 'Special' configurations, and Win32 and x64 platforms. Now suppose that I only support the following configurations: Release|Win32 Release|x64 Debug|Win32 Debug|x64 Special|x64 How do I go about specifying that to cmake? Answering my own question, after a bit of research, it appears that cmake doesn't natively deal with cross-platform building for Visual Studio Projects. Instead it tests to see whether to generate Win32 or x64 project file configurations. In the environment we've got, we want to build Win32, Xbox 360 and Playstation 3 binaries, all from a Win32 box. I wonder what the best way to tweak cmake to do this is. My first thoughts are to do away with Visual Studio altogether, as its vcproj files are pretty hard coded into cmake. Instead I'm playing with using a traditional make, but I still need vcproj external make files, as the developers are using visual studio. I've ordered the book - perhaps I'll get some hints from there. I'd be interested in hearing from anyone who is already doing this kind of thing. Joe ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake