set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if (MSVC)
- foreach(flag_var
- CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
- CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
- if(${flag_var} MATCHES "/Z[iI]")
- string(REGEX REPLACE "/Z[iI]" "/Z7" ${flag_var} "${${flag_var}}")
- endif(${flag_var} MATCHES "/Z[iI]")
- endforeach(flag_var)
+ if(MSVC_Z7_OVERRIDE)
+ foreach(flag_var
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+ if(${flag_var} MATCHES "/Z[iI]")
+ string(REGEX REPLACE "/Z[iI]" "/Z7" ${flag_var} "${${flag_var}}")
+ endif(${flag_var} MATCHES "/Z[iI]")
+ endforeach(flag_var)
+ endif(MSVC_Z7_OVERRIDE)
endif(MSVC)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/protobuf/cmake)