{section: Overview} -The instructions on building Condor in releases prior to 7.5.5, see {wiki: BuildingCondorPriorToCmakeOnWindows Building Condor prior to 7.5.5}. +For instructions on building Condor in releases *prior to 7.5.5*, see {wiki: BuildingCondorPriorToCmakeOnWindows Building Condor prior to 7.5.5 on Windows}. For information about the conversion of the build process from project files to cmake see {wiki: BuildModernization} -{section: Prerequisites } +{section: Building Condor with cmake on Windows} +{subsection: Prerequisites } In order to build Condor on Windows, the following prerequisites are required. They need to be in the PATH before you can build. There is a batch file =msconfig\set_build_env.bat= in the condor sources that will locate the installed prerequisites and set the PATH for you if you don't wish to add them to your global PATH. @@ -38,7 +39,7 @@ 6: [Optional] Install WiX 3.0 on your windows machine (Depends on Visual Studio). WiX is not needed to build, but it is needed to create the MSI installer. *::http://wix.codeplex.com/ -{section: Building Condor with cmake on Windows} +{subsection: Building } 1.) Open a windows commmand prompt @@ -48,55 +49,59 @@ 4.) add cmake\bin to your PATH if it is not already. One way to do this is to execute =CONDOR_SRC\msconfig\set_build_env.bat=. This will setup PATH, LIB, and INCLUDE environment variables to build Condor. If this batch file cannot find cmake.exe It will report an error. -5.) [Optional] set the environment variable =CONDOR_BLD_EXTERNAL_STAGE= to the path of the externals cache to use cached externals. Using cached externals can save a lot of time if you plan to build condor repeatedly. +5.) [Optional] If you want to use cached externals set the environment variable =CONDOR_BLD_EXTERNAL_STAGE= to the path of the externals cache. Using cached externals can save a lot of time if you plan to build condor more than once. For example {code} set CONDOR_BLD_EXTERNAL_STAGE=c:\scratch\condor_externals {endcode} -6.) The cmake files support both in-source and out-of-source builds. For in-source builds execute +6.) The the cmake build supports both in-source and out-of-source builds. For in-source builds execute {code} cmake -G "Visual Studio 9 2008" . {endcode} -for out-of-source builds, navigate to the build destination folder and execute cmake; passing it the path to the condor sources. +for out-of-source builds, navigate to the build destination folder and execute cmake; passing it the path to the condor sources. For example {code} +// assuming that the current directory is CONDOR_SRC set _condor_sources=%CD% md c:\scratch\condor\build_dest cd /d c:\scratch\condor\build_dest cmake CMakeLists.txt -G "Visual Studio 9 2008" %_condor_sources% {endcode} -running cmake will create Visual Studio project and solution files. -Many options can be passed to cmake, see CondorCmakeBuildOptions for more information. or use the cmake-gui. +This will create Visual Studio Project and Solution files to build condor. +Many options can be passed to cmake, see CondorCmakeBuildOptions for more information. You can also use the cmake-gui to set options. -6.) execute +6.) Once you have used cmake to build Condor.sln, you can build on the command line or interactively. The options are {code} devenv condor.sln /Rebuild RelWithDebInfo /project ALL_BUILD {endcode} or {code} -msbuild condor.sln +msbuild condor.sln /t:ALL_BUILD /p:Configuration:RelWithDebugInfo {endcode} -or -{code} -start condor.sln -{endcode} -This last command will open the condor.sln file in Visual Studio. You can then build interactively. +or open *Condor.sln* in Visual Studio and build interactively. + +{subsection: Building Tests} + +Build the *tests* target in the Condor.sln Solution File. Once built you can run all the batch tests as before. -{section: Installing} -There is a cmake file that will copy the build products to a destination, this can be used to overwrite an existing Condor install. On a clean system that does not already have Condor installer, you must use the MSI installer to install Condor. +{subsection: Copying Build results to the release Directory} +There is a cmake file that will copy the build products to the correct subdirectories of a condor installation. This can be used to overwrite an existing Condor install, or to layout the condor files in preparation for making the installer. {code} -cmake -DCMAKE_INSTALL_PREFIX:PATH=c:\condor -P cmake_install.cmake +cmake -DCMAKE_INSTALL_PREFIX:PATH=c:\scratch\condor\release_dir -P cmake_install.cmake {endcode} +Note: Building the *INSTALL* target in the Condor.sln solution file invokes this cmake file. It will copy build results to $(SolutionDir)\release_dir -{section: Testing} -The code has been restructured so *all* things test related are bundled under a single target, and all binaries relating to that target set their output to condor_tests. +{subsection: Making the MSI installer} -Build the *tests* target in the Condor.sln Solution File. Once built you can run all the batch tests as before. +The WiX programs are used to create the MSI installer. Before you can create the MSI, you must copy build results to a release directory. See above. -{section: Packaging} +To build the MSI, make sure that WiX is in your PATH, then navigate to the release dir and run =etc\WiX\do_wix.bat= passing the path to the release dir and the name of the output MSI file as arguments. For example, if your release dir is =c:\scratch\condor\release_dir= you would execute -Execute the do_wix.bat file in etc\WiX +{code} +cd c:\scratch\condor\release_dir +etc\WiX\do_wix.bat %CD% c:\scratch\condor\Condor-X.Y.Z-winnt-x86.msi +{endcode} {section: Gotchas} @@ -128,9 +133,3 @@ {code} CMD /V:ON /E:ON {endcode} - -{section: Links} - -{link: http://www.cmake.org/cmake/help/documentation.html CMake Official Documentation} - -{link: http://www.google.com/codesearch Google Code Search for open source examples}