[Cmake-commits] CMake branch, next, updated. v2.8.6-1771-g08c020c

David Cole david.cole at kitware.com
Wed Nov 2 08:05:25 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  08c020cda0a8afb01aee22b155b42bdf63df16f3 (commit)
       via  b297da615aa2331a558a1c9aa8864e4db3e1f39a (commit)
      from  aba5f5771d959fee46258cf4e6cdb83a7e5eb729 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08c020cda0a8afb01aee22b155b42bdf63df16f3
commit 08c020cda0a8afb01aee22b155b42bdf63df16f3
Merge: aba5f57 b297da6
Author:     David Cole <david.cole at kitware.com>
AuthorDate: Wed Nov 2 08:05:23 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Nov 2 08:05:23 2011 -0400

    Merge topic 'add-mfc-test' into next
    
    b297da6 Tests: Fix MFC test w/ Make-based generators (#11213)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b297da615aa2331a558a1c9aa8864e4db3e1f39a
commit b297da615aa2331a558a1c9aa8864e4db3e1f39a
Author:     David Cole <david.cole at kitware.com>
AuthorDate: Wed Nov 2 08:03:12 2011 -0400
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Wed Nov 2 08:03:12 2011 -0400

    Tests: Fix MFC test w/ Make-based generators (#11213)
    
    An explicit add_definitions of _AFXDLL is required for shared
    library builds with non-Visual Studio generators.

diff --git a/Tests/MFC/CMakeLists.txt.in b/Tests/MFC/CMakeLists.txt.in
index 06ba8b3..e6bfabd 100644
--- a/Tests/MFC/CMakeLists.txt.in
+++ b/Tests/MFC/CMakeLists.txt.in
@@ -6,15 +6,23 @@ macro(replace_flags var these those)
     string(REGEX REPLACE "${these}" "${those}" ${var} "${${var}}")
     #message(STATUS "info: ${var} changed to '${${var}}'")
   endif()
+  message(STATUS "info: ${var}='${${var}}'")
 endmacro()
 
 macro(msvc_link_to_static_crt)
   if(MSVC)
+    set(has_correct_flag 0)
     foreach(lang C CXX)
     foreach(suffix "" _DEBUG _MINSIZEREL _RELEASE _RELWITHDEBINFO)
       replace_flags("CMAKE_${lang}_FLAGS${suffix}" "/MD" "/MT")
+      if(CMAKE_${lang}_FLAGS${suffix} MATCHES "/MT")
+        set(has_correct_flag 1)
+      endif()
     endforeach()
     endforeach()
+    if(NOT has_correct_flag)
+      message(FATAL_ERROR "no CMAKE_*_FLAGS var contains /MT")
+    endif()
   endif()
 endmacro()
 
@@ -39,6 +47,10 @@ set(CMAKE_MFC_FLAG "@CMAKE_MFC_FLAG_VALUE@")
 
 if("${CMAKE_MFC_FLAG}" STREQUAL "1")
   msvc_link_to_static_crt()
+else()
+  # VS generators add this automatically based on the CMAKE_MFC_FLAG value,
+  # but generators matching "Make" require:
+  add_definitions(-D_AFXDLL)
 endif()
 
 add_executable(mfc1 WIN32 ${files})

-----------------------------------------------------------------------

Summary of changes:
 Tests/MFC/CMakeLists.txt.in |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list