Skip to content

Commit

Permalink
Merge branch 'release/0.20.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
lasote committed Mar 6, 2017
2 parents 57fbd90 + 7931bfe commit 250fe05
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion conans/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
COMPLEX_SEARCH_CAPABILITY = "complex_search"
SERVER_CAPABILITIES = [COMPLEX_SEARCH_CAPABILITY, ]

__version__ = '0.20.2'
__version__ = '0.20.3'
5 changes: 3 additions & 2 deletions conans/client/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@

class CMake(object):

def __init__(self, settings, generator=None):
def __init__(self, settings, generator=None, cmake_system_name=True):
assert isinstance(settings, Settings)
self._settings = settings
self.generator = generator or self._generator()
self.build_dir = None
self._cmake_system_name = cmake_system_name

@staticmethod
def options_cmd_line(options, option_upper=True, value_upper=True):
Expand Down Expand Up @@ -73,7 +74,7 @@ def _cmake_compiler_options(self, os, os_ver, arch):
# CMake defines MacOS as Darwin
os = "Darwin"

if platform.system() != os or os_ver:
if self._cmake_system_name and (platform.system() != os or os_ver):
if os:
cmake_flags.append("-DCMAKE_SYSTEM_NAME=%s" % os)
if os_ver:
Expand Down
6 changes: 3 additions & 3 deletions conans/client/generators/cmake_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def cmake_global_vars(deps, build_type=""):
set_property(TARGET {name} PROPERTY INTERFACE_COMPILE_DEFINITIONS ${{CONAN_COMPILE_DEFINITIONS_{uname}}}
$<$<CONFIG:Release>:${{CONAN_COMPILE_DEFINITIONS_{uname}_RELEASE}}>
$<$<CONFIG:Debug>:${{CONAN_COMPILE_DEFINITIONS_{uname}_DEBUG}}>)
set_property(TARGET {name} PROPERTY INTERFACE_COMPILE_OPTIONS ${{CONAN_CFLAGS_{uname}}} ${{CONAN_CXX_FLAGS_{uname}}}
$<$<CONFIG:Release>:${{CONAN_CFLAGS_{uname}_RELEASE}} ${{CONAN_CXX_FLAGS_{uname}_RELEASE}}>
$<$<CONFIG:Debug>:${{CONAN_CFLAGS_{uname}_DEBUG}} ${{CONAN_CXX_FLAGS_{uname}_DEBUG}}>)
set_property(TARGET {name} PROPERTY INTERFACE_COMPILE_OPTIONS ${{CONAN_C_FLAGS_{uname}}} ${{CONAN_CXX_FLAGS_{uname}}}
$<$<CONFIG:Release>:${{CONAN_C_FLAGS_{uname}_RELEASE}} ${{CONAN_CXX_FLAGS_{uname}_RELEASE}}>
$<$<CONFIG:Debug>:${{CONAN_C_FLAGS_{uname}_DEBUG}} ${{CONAN_CXX_FLAGS_{uname}_DEBUG}}>)
"""


Expand Down
13 changes: 7 additions & 6 deletions conans/test/cmake_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ def loads_default_test(self):

def check(text, build_config, generator=None):
os = str(settings.os)
cross = ("-DCMAKE_SYSTEM_NAME=%s " % {"Macos": "Darwin"}.get(os, os)
if platform.system() != os else "")
cmake = CMake(settings, generator=generator)
text = text.replace("-DCONAN_EXPORTED", "%s-DCONAN_EXPORTED" % cross)
self.assertEqual(text, cmake.command_line)
self.assertEqual(build_config, cmake.build_config)
for cmake_system_name in (True, False):
cross = ("-DCMAKE_SYSTEM_NAME=%s " % {"Macos": "Darwin"}.get(os, os)
if (platform.system() != os and cmake_system_name) else "")
cmake = CMake(settings, generator=generator, cmake_system_name=cmake_system_name)
new_text = text.replace("-DCONAN_EXPORTED", "%s-DCONAN_EXPORTED" % cross)
self.assertEqual(new_text, cmake.command_line)
self.assertEqual(build_config, cmake.build_config)

check('-G "Visual Studio 12 2013" -DCONAN_EXPORTED=1 '
'-DCONAN_COMPILER="Visual Studio" -DCONAN_COMPILER_VERSION="12" -Wno-dev',
Expand Down

0 comments on commit 250fe05

Please sign in to comment.