Repository: conan-io/conan

Issue:
Rename CMAKE_SHARED_LINK_FLAGS
I couldn't find any CMake documentation for CMAKE_SHARED_LINK_FLAGS which shows up when generating conanbuildinfo.cmake. Is this a typo that should be [CMAKE_SHARED_LINKER_FLAGS](https://cmake.org/cmake/help/v3.0/variable/CMAKE_SHARED_LINKER_FLAGS.html)?

I'm not currently conan with CMake myself, so I haven't tested if it causes any errors at the moment.



Discussion:
Yes, it seems a bug. I have assigned to 0.7 milestone.


Resolving patch:
diff --git a/conans/client/cmake.py b/conans/client/cmake.py
--- a/conans/client/cmake.py
+++ b/conans/client/cmake.py
@@ -110,7 +110,7 @@ def flags(self):
         if arch == "x86":
             if op_system == "Linux":
                 flags.extend(["-DCONAN_CXX_FLAGS=-m32",
-                             "-DCONAN_SHARED_LINK_FLAGS=-m32",
+                             "-DCONAN_SHARED_LINKER_FLAGS=-m32",
                              "-DCONAN_C_FLAGS=-m32"])
             elif op_system == "Macos":
                 flags.append("-DCMAKE_OSX_ARCHITECTURES=i386")
diff --git a/conans/client/generators/cmake.py b/conans/client/generators/cmake.py
--- a/conans/client/generators/cmake.py
+++ b/conans/client/generators/cmake.py
@@ -37,7 +37,7 @@ def content(self):
                         'set(CONAN_LIBS_{dep} {deps.libs})\n'
                         'set(CONAN_DEFINES_{dep} {deps.defines})\n'
                         'set(CONAN_CXX_FLAGS_{dep} "{deps.cppflags}")\n'
-                        'set(CONAN_SHARED_LINK_FLAGS_{dep} "{deps.sharedlinkflags}")\n'
+                        'set(CONAN_SHARED_LINKER_FLAGS_{dep} "{deps.sharedlinkflags}")\n'
                         'set(CONAN_EXE_LINKER_FLAGS_{dep} "{deps.exelinkflags}")\n'
                         'set(CONAN_C_FLAGS_{dep} "{deps.cflags}")\n')
 
@@ -56,7 +56,7 @@ def content(self):
             'set(CONAN_LIBS {deps.libs} ${{CONAN_LIBS}})\n'
             'set(CONAN_DEFINES {deps.defines} ${{CONAN_DEFINES}})\n'
             'set(CONAN_CXX_FLAGS "{deps.cppflags} ${{CONAN_CXX_FLAGS}}")\n'
-            'set(CONAN_SHARED_LINK_FLAGS "{deps.sharedlinkflags} ${{CONAN_SHARED_LINK_FLAGS}}")\n'
+            'set(CONAN_SHARED_LINKER_FLAGS "{deps.sharedlinkflags} ${{CONAN_SHARED_LINKER_FLAGS}}")\n'
             'set(CONAN_EXE_LINKER_FLAGS "{deps.exelinkflags} ${{CONAN_EXE_LINKER_FLAGS}}")\n'
             'set(CONAN_C_FLAGS "{deps.cflags} ${{CONAN_C_FLAGS}}")\n'
             'set(CONAN_CMAKE_MODULE_PATH {module_paths} ${{CONAN_CMAKE_MODULE_PATH}})')
@@ -92,7 +92,7 @@ def _aux_cmake_test_setup(self):
 
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CONAN_CXX_FLAGS}")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CONAN_C_FLAGS}")
-    set(CMAKE_SHARED_LINK_FLAGS "${CMAKE_SHARED_LINK_FLAGS} ${CONAN_SHARED_LINK_FLAGS}")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CONAN_SHARED_LINKER_FLAGS}")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CONAN_EXE_LINKER_FLAGS}")
 
     if(APPLE)
@@ -127,7 +127,7 @@ def _aux_cmake_test_setup(self):
 
 macro(CONAN_CHECK_COMPILER)
     if("${CONAN_COMPILER}" STREQUAL "Visual Studio")
-        if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL MSVC)
+        if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
             message(FATAL_ERROR "The current compiler is not MSVC")
         endif()
     elseif("${CONAN_COMPILER}" STREQUAL "gcc")


Test patch:
diff --git a/conans/test/cmake_test.py b/conans/test/cmake_test.py
--- a/conans/test/cmake_test.py
+++ b/conans/test/cmake_test.py
@@ -35,7 +35,7 @@ def loads_default_test(self):
         settings.arch = "x86"
         self.assertEqual('-G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug  -DCONAN_COMPILER="gcc" '
                          '-DCONAN_COMPILER_VERSION="4.8" -DCONAN_CXX_FLAGS=-m32 '
-                         '-DCONAN_SHARED_LINK_FLAGS=-m32 -DCONAN_C_FLAGS=-m32 -Wno-dev',
+                         '-DCONAN_SHARED_LINKER_FLAGS=-m32 -DCONAN_C_FLAGS=-m32 -Wno-dev',
                          cmake.command_line)
 
     def deleted_os_test(self):