Skip to content

Commit

Permalink
do not copy CMakeLists to src folder
Browse files Browse the repository at this point in the history
  • Loading branch information
xakod committed Jan 20, 2023
1 parent 49c864e commit 53a3be4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
12 changes: 6 additions & 6 deletions recipes/libev/all/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ project(ev C)

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

set(LIBEV_PUBLIC_HEADERS
ev.h
config.h)
add_library(ev ev.c)
set(EV_PUBLIC_HEADERS
"${EV_SRC_DIR}/ev.h"
"${EV_SRC_DIR}/config.h")
add_library(ev "${EV_SRC_DIR}/ev.c")
target_link_libraries(ev PUBLIC ws2_32)
target_compile_definitions(ev PRIVATE HAVE_CONFIG_H=1)
target_include_directories(ev PUBLIC ${PROJECT_SOURCE_DIR})
target_include_directories(ev PUBLIC ${EV_SRC_DIR})

set_target_properties(ev PROPERTIES PUBLIC_HEADER "${LIBEV_PUBLIC_HEADERS}")
set_target_properties(ev PROPERTIES PUBLIC_HEADER "${EV_PUBLIC_HEADERS}")
include(GNUInstallDirs)

install(TARGETS ev
Expand Down
5 changes: 3 additions & 2 deletions recipes/libev/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _settings_build(self):
return getattr(self, "settings_build", self.settings)

def export_sources(self):
copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src"))
copy(self, "CMakeLists.txt", self.recipe_folder, dst=self.export_sources_folder)
copy(self, "config.h", self.recipe_folder, os.path.join(self.export_sources_folder, "src"))

def config_options(self):
Expand Down Expand Up @@ -71,6 +71,7 @@ def source(self):
def generate(self):
if is_msvc(self):
tc = CMakeToolchain(self)
tc.variables["EV_SRC_DIR"] = self.source_folder.replace("\\", "/")
tc.generate()
else:
env = VirtualBuildEnv(self)
Expand All @@ -81,7 +82,7 @@ def generate(self):
def build(self):
if is_msvc(self):
cmake = CMake(self)
cmake.configure()
cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir))
cmake.build()
else:
autotools = Autotools(self)
Expand Down

0 comments on commit 53a3be4

Please sign in to comment.