Skip to content

Commit

Permalink
Merge pull request #2 from uilianries/jasper-2.0.16
Browse files Browse the repository at this point in the history
Configure cmake module path for jasper
  • Loading branch information
SpaceIm authored Feb 12, 2020
2 parents dbbc853 + 7fb8c85 commit d20a569
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 4 additions & 2 deletions recipes/jasper/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 2.8.12)
project(cmake_wrapper)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
include(conanbuildinfo.cmake)
conan_basic_setup()

include(CMakeLists_original.txt)
set(CMAKE_MODULE_PATH ${CONAN_CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/source_subfolder/build/cmake/modules ${CMAKE_MODULE_PATH})

add_subdirectory(source_subfolder)
11 changes: 5 additions & 6 deletions recipes/jasper/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import glob
import os
import shutil
from conans import ConanFile, CMake, tools


Expand All @@ -25,6 +24,10 @@ class JasperConan(ConanFile):
def _source_subfolder(self):
return "source_subfolder"

@property
def _build_subfolder(self):
return "build_subfolder"

def requirements(self):
if self.options.jpegturbo:
self.requires.add("libjpeg-turbo/2.0.4")
Expand Down Expand Up @@ -53,14 +56,10 @@ def _configure_cmake(self):
self._cmake.definitions["JAS_ENABLE_SHARED"] = self.options.shared
self._cmake.definitions["JAS_LIBJPEG_REQUIRED"] = "REQUIRED"
self._cmake.definitions["JAS_ENABLE_OPENGL"] = False
self._cmake.configure(source_folder=self._source_subfolder)
self._cmake.configure(build_folder=self._build_subfolder)
return self._cmake

def build(self):
os.rename(os.path.join(self._source_subfolder, "CMakeLists.txt"),
os.path.join(self._source_subfolder, "CMakeLists_original.txt"))
shutil.copy("CMakeLists.txt",
os.path.join(self._source_subfolder, "CMakeLists.txt"))
cmake = self._configure_cmake()
cmake.build()

Expand Down

0 comments on commit d20a569

Please sign in to comment.