[CMake] Proposal for new generator options

Jochen Wilhelmy j.wilhelmy at arcor.de
Sat Jan 16 16:11:34 EST 2010


> I would suspect that most users use the default values. I pretty much
> go with the defaults with the addition of adding the /MP parameter
> inside my main CMakeLists.txt file. 
If you are the author of some software then this is fine. But I have the 
case where I have
to use some existing visual studio projects using /MT and a cmake 
project, both of which
I am not the maintainer and therefore changes cannot be made. So it was 
quite complicated
to get it working.

But what is against my proposal of splitting the -G option? for visual 
studio there are
two more platforms except Win32 and Win64, some smartphone and mobile stuff.
So the number of generators will explode anyway. with four versions and 
four platforms
this are a whopping number of 16 generators for visual studio alone.

-Jochen


> To avoid any problems with other
> users not having the right .dll runtimes I just have CMake bundle the
> runtime with the install it generates.
>
> Here is what I have in my packaging for my current application:
>
> IF(PACKAGE_FOR_INSTALL)
>
> SET(CPACK_PACKAGE_VERSION_MAJOR ${StudyManager_VERSION_MAJOR})
> SET(CPACK_PACKAGE_VERSION_MINOR ${StudyManager_VERSION_MINOR})
> SET(CPACK_PACKAGE_VERSION_PATCH ${StudyManager_VERSION_PATCH})
>
> IF(CMAKE_CL_64)
>      SET(CMAKE_MSVC_ARCH amd64)
>    ELSE(CMAKE_CL_64)
>      SET(CMAKE_MSVC_ARCH x86)
> ENDIF(CMAKE_CL_64)
>
> IF(MSVC80)
>
>     FIND_PROGRAM(MSVC_REDIST NAMES
> vcredist_${CMAKE_MSVC_ARCH}/vcredist_${CMAKE_MSVC_ARCH}.exe
>       PATHS
>       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../SDK/v2.0/BootStrapper/Packages/"
>       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../SDK/v2.0/BootStrapper/Packages/"
>       )
>     GET_FILENAME_COMPONENT(vcredist_name "${MSVC_REDIST}" NAME)
>     INSTALL(PROGRAMS ${MSVC_REDIST} COMPONENT Runtime DESTINATION bin)
>     SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait
> '\\\"$INSTDIR\\\\bin\\\\${vcredist_name}\\\"'")
> ENDIF(MSVC80)
>
> IF(WIN32)
> 	SET(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
> 	SET(CPACK_PACKAGE_EXECUTABLES "StudyManager")
>
> 	INSTALL(FILES
> 			"${QT_BINARY_DIR}/QtCore${QT_VERSION_MAJOR}.dll"
> 			"${QT_BINARY_DIR}/QtXml${QT_VERSION_MAJOR}.dll"
> 			"${QT_BINARY_DIR}/QtTest${QT_VERSION_MAJOR}.dll"
> 			"${QT_BINARY_DIR}/QtGui${QT_VERSION_MAJOR}.dll"
> 			"${QT_BINARY_DIR}/QtNetwork${QT_VERSION_MAJOR}.dll"
> 			"${QT_BINARY_DIR}/QtScript${QT_VERSION_MAJOR}.dll"
> 			"${QT_BINARY_DIR}/QtSql${QT_VERSION_MAJOR}.dll"
> 			DESTINATION bin
> 			COMPONENT Applications
> 	)
> ENDIF(WIN32)
>
> set(CPACK_COMPONENTS_ALL Applications Runtime)
>
> INCLUDE(CPack)
> ENDIF(PACKAGE_FOR_INSTALL)
>   



More information about the CMake mailing list