[CMake] [VS] How to set static run-time for static lib release config?

Ryan Pavlik rpavlik at iastate.edu
Fri Jul 30 07:52:05 EDT 2010


  On 7/30/10 5:25 AM, Olaf van der Spek wrote:
> Hi,
>
> CMake creates a VS project file that uses the dynamic run-time for
> static libs. This is not what I want in release builds.
> How do I change this?
>
> Greetings,
>
> Olaf
>
> cmake_minimum_required(VERSION 2.4)
> set(CMAKE_BUILD_TYPE release)
> include_directories(.)
> add_library(
> 	xbt
> 	sql/database.cpp
> 	sql/sql_query.cpp
> 	sql/sql_result.cpp
> )
> install(TARGETS xbt DESTINATION lib)

Almost nobody uses the static runtime unless someone else's lib forces 
them to, after which they will probably mutter under their breath.  With 
that disclaimer aside:

http://github.com/rpavlik/physical-modeling-utilities/blob/master/cmake/MSVCStaticRuntime.cmake

-- 
Ryan Pavlik
Human-Computer Interaction Graduate Student
Virtual Reality Applications Center
Iowa State University

rpavlik at iastate.edu
http://academic.cleardefinition.com/



More information about the CMake mailing list