Skip to content

Commit

Permalink
Update after review
Browse files Browse the repository at this point in the history
  • Loading branch information
kyllingstad committed Oct 9, 2023
1 parent 7ab93a1 commit 95929da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class FMILibraryConan(ConanFile):
options = {"shared": [True, False]}
default_options = {"shared": False}

tool_requires = "cmake/[>=3.15]"
generators = "CMakeDeps"

exports_sources = "build-static-c99snprintf.patch"
Expand All @@ -31,9 +32,10 @@ def layout(self):

def generate(self):
tc = CMakeToolchain(self)
tc.cache_variables["FMILIB_BUILD_STATIC_LIB"] = False if self.options.shared else True
tc.cache_variables["FMILIB_BUILD_SHARED_LIB"] = True if self.options.shared else False
tc.cache_variables["FMILIB_BUILD_STATIC_LIB"] = not self.options.shared
tc.cache_variables["FMILIB_BUILD_SHARED_LIB"] = not not self.options.shared
tc.cache_variables["FMILIB_BUILD_TESTS"] = False
tc.cache_variables["FMILIB_GENERATE_DOXYGEN_DOC"] = False
tc.cache_variables["FMILIB_INSTALL_PREFIX"] = pathlib.Path(os.path.join(self.build_folder, "install")).as_posix()
tc.generate()

Expand Down
2 changes: 1 addition & 1 deletion test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.15)
project(PackageTest CXX)

find_package(fmilibrary CONFIG REQUIRED)
Expand Down

0 comments on commit 95929da

Please sign in to comment.