Example #1
0
 def test_exelinkflags(self):
     conanfile = ConanFile(Mock(), None)
     conanfile.initialize(Settings({}), EnvValues())
     framework_path = os.getcwd()  # must exist, otherwise filtered by framework_paths
     cpp_info = CppInfo("MyPkg", "/rootpath")
     cpp_info.exelinkflags = ["-llibrary_for_exe"]
     conanfile.deps_cpp_info.add("MyPkg", DepCppInfo(cpp_info))
     generator = QmakeGenerator(conanfile)
     content = generator.content
     qmake_lines = content.splitlines()
     self.assertIn('CONAN_QMAKE_LFLAGS_APP += -llibrary_for_exe', qmake_lines)
Example #2
0
 def test_system_libs(self):
     # https://github.com/conan-io/conan/issues/7558
     conanfile = ConanFile(TestBufferConanOutput(), None)
     conanfile.initialize(Settings({}), EnvValues())
     cpp_info = CppInfo("MyPkg", "/rootpath")
     cpp_info.libs = ["mypkg"]
     cpp_info.system_libs = ["pthread"]
     conanfile.deps_cpp_info.add("MyPkg", DepCppInfo(cpp_info))
     generator = QmakeGenerator(conanfile)
     content = generator.content
     qmake_lines = content.splitlines()
     self.assertIn('CONAN_LIBS += -lmypkg', qmake_lines)
     self.assertIn('CONAN_SYSTEMLIBS += -lpthread', qmake_lines)
Example #3
0
 def test_frameworks(self):
     conanfile = ConanFile(Mock(), None)
     conanfile.initialize(Settings({}), EnvValues())
     framework_path = os.getcwd()  # must exist, otherwise filtered by framework_paths
     cpp_info = CppInfo("MyPkg", "/rootpath")
     cpp_info.frameworks = ["HelloFramework"]
     cpp_info.frameworkdirs = [framework_path]
     conanfile.deps_cpp_info.add("MyPkg", DepCppInfo(cpp_info))
     generator = QmakeGenerator(conanfile)
     content = generator.content
     qmake_lines = content.splitlines()
     self.assertIn('CONAN_FRAMEWORKS += -framework HelloFramework', qmake_lines)
     self.assertIn('CONAN_FRAMEWORK_PATHS += -F%s' % framework_path, qmake_lines)