Re: [CMake] Fwd: Visual Studio command line from CMake
All, My FLTK EmbeddedProject woes are solved. As it turns out, the path of least resistance was the one I hadn't tried While the FLKT CMake files were indeed out of date, they weren't that bad. Fixing them was by far the best solution. I have a few more libraries for my project, but hopefully they'll go more smoothly. Best, Rob -- 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: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Fwd: Visual Studio command line from CMake
Bill, I've scoured those examples and read the documentation many times. I'm also making pretty (perhaps overly) complex use of ExternalProject_Add. I should have been more specific in my request for tips. I have not found examples of ExternalProject driving Visual Studio projects or nmake files. All the common examples drive either ./configure, pure make, or CMake setups. Rob On Thu, Jan 9, 2014 at 11:28 AM, Bill Hoffman wrote: > On 1/9/2014 2:13 PM, Rob McDonald wrote: > >> Bill, >> >> This sounds interesting. After FLTK, I have a couple other libraries >> that need to be packaged as an ExternalProject. >> >> I'd appreciate some more details or a link to an example if you have one. >> >> Thanks, >> > See Dave Cole's message at the end: > http://cmake.3232098.n2.nabble.com/ExternalProjects- > Add-limitations-td7586432.html > > Also, here: > > http://www.kitware.com/media/html/BuildingExternalProjectsWithCM > ake2.8.html > > -- > Bill Hoffman > Kitware, Inc. > 28 Corporate Drive > Clifton Park, NY 12065 > bill.hoff...@kitware.com > http://www.kitware.com > 518 881-4905 (Direct) > 518 371-3971 x105 > Fax (518) 371-4573 > -- 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: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Filtering out libraries in custom toolchain
Hi all, We have a 3rd-party project that builds on multiple OSes via CMake, with one of them being VxWorks using a custom toolchain (fairly specific to our platform/tools). This project consists of multiple shared libraries with a fairly complex hierarchy, All of this was working just fine until this project was updated to include a few static libraries as well. The issue I am running into is that VxWorks doesn't really have a concept of DLLs linking to each other, so our toolchain file currently neglects to bother passing into the linker command line. However, now that we have static libraries, it suddenly needs to do this, since includes both static and shared libraries (although these can be differentiated via extension). Basically, I need to filter our to only include static libs but not shared libraries. I can't really modify the dependencies at the outer layer to just remove non-static dependencies, because this removes the build-order-dependency information that CMake needs (some components generate files needed by others to build). What is confusing me is that the syntax for creating toolchain command lines is "special" with variables in angle brackets and I'm not sure how best to do this. Our toolchain file looks something like this: set(CMAKE_CXX_CREATE_SHARED_LIBRARY " -o ... and I need it to look something like this: set(CMAKE_CXX_CREATE_SHARED_LIBRARY " -o ... Can anyone give me some advice on how to create this "LINK_STATIC_LIBRARIES" behavior (versus "LINK_LIBRARIES") ? Thanks, Eric Gross-- 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: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Fwd: Visual Studio command line from CMake
All of that is available from selecting a generator and toolset for your machine; cmake uses the registry to find devenv to build visual studio projects --- part I stole to make sure it uses msbuild.exe in favor of devenv.com --- if( MSVC10 ) IF(NOT CMAKE_CROSSCOMPILING) FIND_PROGRAM(REAL_CMAKE_MAKE_PROGRAM NAMES MSBuild HINTS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir] "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/" "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/" "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0;CLR Version]/") ENDIF() set( CMAKE_MAKE_PROGRAM ${REAL_CMAKE_MAKE_PROGRAM} ) endif( MSVC10 ) if( MSVC11 ) IF(NOT CMAKE_CROSSCOMPILING) FIND_PROGRAM(REAL_CMAKE_MAKE_PROGRAM NAMES MSBuild HINTS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/" "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/" "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0;CLR Version]/") ENDIF() set( CMAKE_MAKE_PROGRAM ${REAL_CMAKE_MAKE_PROGRAM} ) set( CMAKE_VS_PLATFORM_TOOLSET v110_xp ) endif( MSVC11 ) -- There is also a setting for the toolset to select arm, or XP compatiblity mode set( CMAKE_VS_PLATFORM_TOOLSET v110_xp ) On Thu, Jan 9, 2014 at 3:48 PM, Rob McDonald wrote: > All, > > Thanks for all the help, I'm getting closer. My current approach does > this > > > CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) > INCLUDE( ExternalProject ) > > SET( VS_MAKEFILE_ZIP vsnet-makefiles.0.85.zip ) > > IF( MSVC ) > IF( MSVC_VERSION EQUAL 1200 ) > SET( VS_TOOLS_PATH $ENV{VS60COMNTOOLS} ) > SET( VS_ENV_BAT ${VS_TOOLS_PATH}vsvars32.bat ) > ELSEIF( MSVC_VERSION EQUAL 1300 ) > SET( VS_TOOLS_PATH $ENV{VS70COMNTOOLS} ) > SET( VS_ENV_BAT ${VS_TOOLS_PATH}vsvars32.bat ) > ELSEIF( MSVC_VERSION EQUAL 1310 ) > SET( VS_TOOLS_PATH $ENV{VS71COMNTOOLS} ) > SET( VS_ENV_BAT ${VS_TOOLS_PATH}vsvars32.bat ) > ELSEIF( MSVC_VERSION EQUAL 1400 ) > SET( VS_TOOLS_PATH $ENV{VS80COMNTOOLS} ) > SET( VS_ENV_BAT ${VS_TOOLS_PATH}vsvars32.bat ) > ELSEIF( MSVC_VERSION EQUAL 1500 ) > SET( VS_TOOLS_PATH $ENV{VS90COMNTOOLS} ) > SET( VS_ENV_BAT ${VS_TOOLS_PATH}vsvars32.bat ) > ELSEIF( MSVC_VERSION EQUAL 1600 ) > SET( VS_TOOLS_PATH $ENV{VS100COMNTOOLS} ) > SET( VS_ENV_BAT ${VS_TOOLS_PATH}vsvars32.bat ) > ELSEIF( MSVC_VERSION EQUAL 1700 ) > SET( VS_TOOLS_PATH $ENV{VS110COMNTOOLS} ) > SET( VS_ENV_BAT ${VS_TOOLS_PATH}VsDevCmd.bat ) > ELSEIF( MSVC_VERSION EQUAL 1800 ) > SET( VS_TOOLS_PATH $ENV{VS120COMNTOOLS} ) > SET( VS_ENV_BAT ${VS_TOOLS_PATH}VsDevCmd.bat ) > ENDIF( MSVC_VERSION EQUAL 1200 ) > ENDIF ( MSVC ) > > file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/opts.txt > "R > V") > > file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/runthis.bat > "call \"${VS_ENV_BAT}\" > gmake < opts.txt") > > > ExternalProject_Add( FLTK > URL ${CMAKE_SOURCE_DIR}/fltk-1.3.2-source.tar > UPDATE_COMMAND > ${CMAKE_COMMAND} -E copy_if_different > ${CMAKE_SOURCE_DIR}/${VS_MAKEFILE_ZIP} > /${VS_MAKEFILE_ZIP} > COMMAND > ${CMAKE_COMMAND} -E tar -xzf /${VS_MAKEFILE_ZIP} > COMMAND > ${CMAKE_COMMAND} -E copy_if_different > ${CMAKE_CURRENT_BINARY_DIR}/opts.txt > /opts.txt > > COMMAND > ${CMAKE_COMMAND} -E copy_if_different > ${CMAKE_CURRENT_BINARY_DIR}/runthis.bat > /runthis.bat > > PATCH_COMMAND "" > CONFIGURE_COMMAND runthis.bat > BUILD_COMMAND "" > INSTALL_COMMAND "" > BUILD_IN_SOURCE 1 > ) > > > It doesn't fully work. > > -- I create the opts.txt and runthis.bat files in CMAKE_CURRENT_BINARY_DIR > and then copy them to . I couldn't figure out how to write them > within ExternalProject_Add and doesn't exist before unless I > want to reset its value. Suggestions Welcome. > > -- opts.txt and runthis.bat end up where I want them and contain what I > want. > > -- If you double-click runthis.bat, it successfully builds FLTK. > > -- However, running 'runthis.bat' from inside ExternalProject fails. I've > tried 'cmd runthis.bat' '/runthis.bat' and a few other things, > none work. > > I think it may be a problem with the command to run the batch program > doesn't create a new environment, or doesn't keep the environment variables > set by vsvars32.bat. > > Suggestions Welcome. > > Rob > > P.S. The mess of IF code to detect the MSVC version and use the environment > variable has not been vetted and is mostly a guess at this point. From all > the googling I could do, it is probably closeish to right. > > P.P.S. vsvarsall.bat Is special be
Re: [CMake] Fwd: Visual Studio command line from CMake
All, Thanks for all the help, I'm getting closer. My current approach does this CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) INCLUDE( ExternalProject ) SET( VS_MAKEFILE_ZIP vsnet-makefiles.0.85.zip ) IF( MSVC ) IF( MSVC_VERSION EQUAL 1200 ) SET( VS_TOOLS_PATH $ENV{VS60COMNTOOLS} ) SET( VS_ENV_BAT ${VS_TOOLS_PATH}vsvars32.bat ) ELSEIF( MSVC_VERSION EQUAL 1300 ) SET( VS_TOOLS_PATH $ENV{VS70COMNTOOLS} ) SET( VS_ENV_BAT ${VS_TOOLS_PATH}vsvars32.bat ) ELSEIF( MSVC_VERSION EQUAL 1310 ) SET( VS_TOOLS_PATH $ENV{VS71COMNTOOLS} ) SET( VS_ENV_BAT ${VS_TOOLS_PATH}vsvars32.bat ) ELSEIF( MSVC_VERSION EQUAL 1400 ) SET( VS_TOOLS_PATH $ENV{VS80COMNTOOLS} ) SET( VS_ENV_BAT ${VS_TOOLS_PATH}vsvars32.bat ) ELSEIF( MSVC_VERSION EQUAL 1500 ) SET( VS_TOOLS_PATH $ENV{VS90COMNTOOLS} ) SET( VS_ENV_BAT ${VS_TOOLS_PATH}vsvars32.bat ) ELSEIF( MSVC_VERSION EQUAL 1600 ) SET( VS_TOOLS_PATH $ENV{VS100COMNTOOLS} ) SET( VS_ENV_BAT ${VS_TOOLS_PATH}vsvars32.bat ) ELSEIF( MSVC_VERSION EQUAL 1700 ) SET( VS_TOOLS_PATH $ENV{VS110COMNTOOLS} ) SET( VS_ENV_BAT ${VS_TOOLS_PATH}VsDevCmd.bat ) ELSEIF( MSVC_VERSION EQUAL 1800 ) SET( VS_TOOLS_PATH $ENV{VS120COMNTOOLS} ) SET( VS_ENV_BAT ${VS_TOOLS_PATH}VsDevCmd.bat ) ENDIF( MSVC_VERSION EQUAL 1200 ) ENDIF ( MSVC ) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/opts.txt "R V") file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/runthis.bat "call \"${VS_ENV_BAT}\" gmake < opts.txt") ExternalProject_Add( FLTK URL ${CMAKE_SOURCE_DIR}/fltk-1.3.2-source.tar UPDATE_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/${VS_MAKEFILE_ZIP} /${VS_MAKEFILE_ZIP} COMMAND ${CMAKE_COMMAND} -E tar -xzf /${VS_MAKEFILE_ZIP} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/opts.txt /opts.txt COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/runthis.bat /runthis.bat PATCH_COMMAND "" CONFIGURE_COMMAND runthis.bat BUILD_COMMAND "" INSTALL_COMMAND "" BUILD_IN_SOURCE 1 ) It doesn't fully work. -- I create the opts.txt and runthis.bat files in CMAKE_CURRENT_BINARY_DIR and then copy them to . I couldn't figure out how to write them within ExternalProject_Add and doesn't exist before unless I want to reset its value. Suggestions Welcome. -- opts.txt and runthis.bat end up where I want them and contain what I want. -- If you double-click runthis.bat, it successfully builds FLTK. -- However, running 'runthis.bat' from inside ExternalProject fails. I've tried 'cmd runthis.bat' '/runthis.bat' and a few other things, none work. I think it may be a problem with the command to run the batch program doesn't create a new environment, or doesn't keep the environment variables set by vsvars32.bat. Suggestions Welcome. Rob P.S. The mess of IF code to detect the MSVC version and use the environment variable has not been vetted and is mostly a guess at this point. From all the googling I could do, it is probably closeish to right. P.P.S. vsvarsall.bat Is special because it lets you set 32/64/arm target and also 32/64 host environments. I would like to support 32/64 target, but you can't set target without knowing the host environment. Is there a CMake way to detect whether the Visual Studio host environment is 32/64 bit? On Thu, Jan 9, 2014 at 10:48 AM, Rob McDonald wrote: > > Correct, this is one of the concerns that makes it more complex than just searching for the first vcvarsall.bat you come to. > > I'd like to match up the vcvarsall to the version of visual studio currently in use by CMake. > > I think there are now enough pieces that I can write a CMake 'FindVSEnvironment.cmake'. While I can't test it for a large number of MSVC versions, I'll post it and hopefully others can help out. > > Rob > > > On Thu, Jan 9, 2014 at 6:44 AM, John Drescher wrote: >> >> > Why not just write your own batch ('buildit.bat') file that does: >> > >> >call vcvarsall.bat >> >nmake >> > >> > (or whatever the command to build in the VS command prompt is...) >> > >> > And then your command to build is: >> > >> >C:/full/path/to/buildit.bat >> > >> > It's presumably in a Windows-specific chunk of your CMakeLists anyway, so >> > that should work fairly simply. >> >> I think the part of problem would be figuring out what vcvarsall.bat >> to run especially if you have more than 1 version of Visual Studio. >> >> John > > -- 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 t
[CMake] "find_package(MPI)" overriding "set(MPIEXEC)" in CmakeList.txt
Hello, On a Cray XE6, I am using find_package(MPI REQUIRED) in my CMakeLists.txt. It correctly finds all of the MPI stuff, except that it sets the MPIEXEC to the login node mpiexec command. I would like to override this behavior and set the MPIEXEC command to the "aprun" wrapper, but it is not working. I have tried using set(MPIEXEC "aprun") both before and after the find_package(MPI REQUIRED) in my CMakeLists.txt. Thanks Lucas This electronic message transmission and any attachments that accompany it contain information from DRCĀ® (Dynamics Research Corporation) or its subsidiaries, or the intended recipient, which is privileged, proprietary, business confidential, or otherwise protected from disclosure and is the exclusive property of DRC and/or the intended recipient. The information in this email is solely intended for the use of the individual or entity that is the intended recipient. If you are not the intended recipient, any use, dissemination, distribution, retention, or copying of this communication, attachments, or substance is prohibited. If you have received this electronic transmission in error, please immediately reply to the author via email that you received the message by mistake and also promptly and permanently delete this message and all copies of this email and any attachments. We thank you for your assistance and apologize for any inconvenience. -- 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: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Fwd: Visual Studio command line from CMake
But using BUILD_COMMAND() you can get the appropriate build command, the full path ends up specified; it is determined duing the cmake configuration phase and would be the same; hence the same script I showed worked to build makeit.bat that runs Linux GCC Make, MinGW Make, Watcom Make, Visual Studio msbuild or devenv as appropriate. NMake has been depricated you don't need vcvarsall after the initial configuration because all tools and include/link paths are saved as full paths in the script. On Thu, Jan 9, 2014 at 11:03 AM, Bill Hoffman wrote: > On 1/9/2014 1:48 PM, Rob McDonald wrote: >> >> Correct, this is one of the concerns that makes it more complex than >> just searching for the first vcvarsall.bat you come to. >> >> I'd like to match up the vcvarsall to the version of visual studio >> currently in use by CMake. >> >> I think there are now enough pieces that I can write a CMake >> 'FindVSEnvironment.cmake'. While I can't test it for a large number of >> MSVC versions, I'll post it and hopefully others can help out. > > Another interesting way to approach this would be to use external project, > and use a Visual Studio IDE generator to build the nmake environment. It > is not cmake based, but I have done this with Qt and it works great. When > the IDE builds the external project the environment is all setup, and you > can build from any command line or from a GUI with no environment set. > > -Bill > > -- > > 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: > http://www.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: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Fwd: Visual Studio command line from CMake
On 1/9/2014 1:48 PM, Rob McDonald wrote: Correct, this is one of the concerns that makes it more complex than just searching for the first vcvarsall.bat you come to. I'd like to match up the vcvarsall to the version of visual studio currently in use by CMake. I think there are now enough pieces that I can write a CMake 'FindVSEnvironment.cmake'. While I can't test it for a large number of MSVC versions, I'll post it and hopefully others can help out. Another interesting way to approach this would be to use external project, and use a Visual Studio IDE generator to build the nmake environment. It is not cmake based, but I have done this with Qt and it works great. When the IDE builds the external project the environment is all setup, and you can build from any command line or from a GUI with no environment set. -Bill -- 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: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Fwd: Visual Studio command line from CMake
Correct, this is one of the concerns that makes it more complex than just searching for the first vcvarsall.bat you come to. I'd like to match up the vcvarsall to the version of visual studio currently in use by CMake. I think there are now enough pieces that I can write a CMake 'FindVSEnvironment.cmake'. While I can't test it for a large number of MSVC versions, I'll post it and hopefully others can help out. Rob On Thu, Jan 9, 2014 at 6:44 AM, John Drescher wrote: > > Why not just write your own batch ('buildit.bat') file that does: > > > >call vcvarsall.bat > >nmake > > > > (or whatever the command to build in the VS command prompt is...) > > > > And then your command to build is: > > > >C:/full/path/to/buildit.bat > > > > It's presumably in a Windows-specific chunk of your CMakeLists anyway, so > > that should work fairly simply. > > I think the part of problem would be figuring out what vcvarsall.bat > to run especially if you have more than 1 version of Visual Studio. > > John > -- 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: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Fwd: Visual Studio command line from CMake
I've got a batch file that does something like this to detect the "most recent" available Visual Studio: @rem ** Add "Developer Command Prompt" for VS2013, 2012 or 2010 environment: @set _vsver= @set _vs12env=%VS120COMNTOOLS%VsDevCmd.bat @if "%_vsver%" equ "" if exist "%_vs12env%" set _vsver=12 @set _vs11env=%VS110COMNTOOLS%VsDevCmd.bat @if "%_vsver%" equ "" if exist "%_vs11env%" set _vsver=11 @set _vs10env=%VS100COMNTOOLS%vsvars32.bat @if "%_vsver%" equ "" if exist "%_vs10env%" set _vsver=10 @if "%_vsver%" equ "10" set _vsenv=%_vs10env% @if "%_vsver%" equ "10" set _vstools=%VS100COMNTOOLS% @if "%_vsver%" equ "11" set _vsenv=%_vs11env% @if "%_vsver%" equ "11" set _vstools=%VS110COMNTOOLS% @if "%_vsver%" equ "12" set _vsenv=%_vs12env% @if "%_vsver%" equ "12" set _vstools=%VS120COMNTOOLS% @if exist "%_vsenv%" call "%_vsenv%" -- 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: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Fwd: Visual Studio command line from CMake
Each Visual Studio sets a environment variable that helps you locate the installed location. So for Visual Studio 2008 it is VS90COMNTOOLS, and for Visual Studio 2010 it is VS100COMNTOOLS. So you can have a single bat file that is configured by cmake to determine both the correct env variable to use, and the proper args to pass to vcvarsall.bat. On Thu, Jan 9, 2014 at 9:44 AM, John Drescher wrote: > > Why not just write your own batch ('buildit.bat') file that does: > > > >call vcvarsall.bat > >nmake > > > > (or whatever the command to build in the VS command prompt is...) > > > > And then your command to build is: > > > >C:/full/path/to/buildit.bat > > > > It's presumably in a Windows-specific chunk of your CMakeLists anyway, so > > that should work fairly simply. > > I think the part of problem would be figuring out what vcvarsall.bat > to run especially if you have more than 1 version of Visual Studio. > > John > -- > > 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: > http://www.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: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Fwd: Visual Studio command line from CMake
> Why not just write your own batch ('buildit.bat') file that does: > >call vcvarsall.bat >nmake > > (or whatever the command to build in the VS command prompt is...) > > And then your command to build is: > >C:/full/path/to/buildit.bat > > It's presumably in a Windows-specific chunk of your CMakeLists anyway, so > that should work fairly simply. I think the part of problem would be figuring out what vcvarsall.bat to run especially if you have more than 1 version of Visual Studio. John -- 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: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Fwd: Visual Studio command line from CMake
Why not just write your own batch ('buildit.bat') file that does: call vcvarsall.bat nmake (or whatever the command to build in the VS command prompt is...) And then your command to build is: C:/full/path/to/buildit.bat It's presumably in a Windows-specific chunk of your CMakeLists anyway, so that should work fairly simply. HTH, David C. -- 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: http://www.cmake.org/mailman/listinfo/cmake