Skip to content

Commit

Permalink
(#17245) soci: fix linking against dependencies with conanv1
Browse files Browse the repository at this point in the history
* soci: fix linking against dependencies with conanv1

soci searches for POSTGRESQL_LIBRARIES etc. instead of what conan
defines (PostgreSQL_LIBRARIES).

fixes #11628

* soci: fix @rpath on MacOS
  • Loading branch information
Cogitri authored Apr 30, 2023
1 parent 4d9b247 commit d33327e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions recipes/soci/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ def source(self):
def generate(self):
tc = CMakeToolchain(self)

# MacOS @rpath
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW"
tc.variables["SOCI_SHARED"] = self.options.shared
tc.variables["SOCI_STATIC"] = not self.options.shared
tc.variables["SOCI_TESTS"] = False
Expand All @@ -126,6 +128,9 @@ def generate(self):
tc.generate()

deps = CMakeDeps(self)
deps.set_property("mysql", "cmake_file_name", "MYSQL")
deps.set_property("libpq", "cmake_file_name", "POSTGRESQL")
deps.set_property("sqlite3", "cmake_file_name", "SQLITE3")
deps.generate()

def build(self):
Expand Down

0 comments on commit d33327e

Please sign in to comment.