Skip to content

Commit

Permalink
Inject conan_basic_setup to properly set MD/MT flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Minimonium authored and horenmar committed Nov 2, 2020
1 parent 33bcdc6 commit 2f31f90
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
from conans import ConanFile, CMake
from conans import ConanFile, CMake, tools


class CatchConan(ConanFile):
Expand All @@ -18,6 +18,8 @@ class CatchConan(ConanFile):
options = {"with_main": [True, False]}
default_options = {"with_main": True}

generators = "cmake"

def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["BUILD_TESTING"] = "OFF"
Expand All @@ -27,6 +29,12 @@ def _configure_cmake(self):
return cmake

def build(self):
line_to_replace = 'list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")'
tools.replace_in_file("CMakeLists.txt", line_to_replace,
'''{}
include({}/conanbuildinfo.cmake)
conan_basic_setup()'''.format(line_to_replace, self.install_folder))

cmake = self._configure_cmake()
cmake.build()

Expand Down

0 comments on commit 2f31f90

Please sign in to comment.