Hi Ryan, I've started using your MSVCStaticRuntime.cmake and everything
worked well until I tested it with "NMake Makefiles" generator, that
doesn't use CMAKE_CONFIGURATION_TYPES, so I edited your file to add the
content of CMAKE_BUILD_TYPE to the SUFFIXES of list_combinations in
order to make the replace works correctly.

Attached to this email the edited version.


Bye

> 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
>
>
# - Modify compile flags to use the static runtimes of MSVC
#
#  include(MSVCStaticRuntime)
#
# Requires these CMake modules:
#  ListCombinations.cmake
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpav...@iastate.edu> <abir...@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC

if(MSVC)
	string(TOUPPER "${CMAKE_CONFIGURATION_TYPES}" _conftypesUC)
	string(TOUPPER "${CMAKE_BUILD_TYPE}" _buildtypeUC)
	
	include(ListCombinations)
	list_combinations(_flags
		PREFIXES
			CMAKE_C_FLAGS_
			CMAKE_CXX_FLAGS_
		SUFFIXES
			${_conftypesUC}
			${_buildtypeUC})
			
	foreach(_var ${_flags} CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
		string(REPLACE "/MD" "/MT" ${_var} "${${_var}}")
	endforeach()
endif()

set(Boost_USE_STATIC_LIBS ON)
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to