From bb63aa9e9b7888efe8f098f9b8eb72acf71173a5 Mon Sep 17 00:00:00 2001 From: dimitri Date: Mon, 24 Jul 2017 07:17:37 +0200 Subject: [PATCH 1/5] Modifications suggested by conan team. --- util/conan-package/.gitignore | 3 ++- util/conan-package/FindGLM.cmake | 10 ++++++++++ util/conan-package/conanfile.py | 6 +++--- util/conan-package/test_package/conanfile.py | 4 ---- 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 util/conan-package/FindGLM.cmake diff --git a/util/conan-package/.gitignore b/util/conan-package/.gitignore index d4478c02..85846948 100644 --- a/util/conan-package/.gitignore +++ b/util/conan-package/.gitignore @@ -15,4 +15,5 @@ test_package/build conanfile.pyc conaninfo.txt conanbuildinfo.txt -conanbuildinfo.cmake \ No newline at end of file +conanbuildinfo.cmake +!FindGLM.cmake diff --git a/util/conan-package/FindGLM.cmake b/util/conan-package/FindGLM.cmake new file mode 100644 index 00000000..c1af8d51 --- /dev/null +++ b/util/conan-package/FindGLM.cmake @@ -0,0 +1,10 @@ +FIND_PATH( + GLM_INCLUDE_DIR + NAMES + glm + PATHS + include) + +INCLUDE(FindPackageHandleStandardArgs) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLM REQUIRED_VARS GLM_INCLUDE_DIR) diff --git a/util/conan-package/conanfile.py b/util/conan-package/conanfile.py index 8d609a62..bf81e343 100644 --- a/util/conan-package/conanfile.py +++ b/util/conan-package/conanfile.py @@ -8,11 +8,11 @@ class GlmConan(ConanFile): url="https://github.com/g-truc/glm" description="OpenGL Mathematics (GLM)" license = "https://github.com/g-truc/glm/blob/manual/copying.txt" - exports = ["FindGLM.cmake", "lib_licenses/*", os.sep.join([".", "..", "..", "*"])] + exports_sources = ["FindGLM.cmake", os.sep.join([".", "..", "..", "*"])] + exports = "lib_licenses/*" def build(self): - self.output.warn("No compilation necessary for GLM") - self.output.warn(os.sep.join([".", "..", "..", "*"])) + self.output.info("No compilation necessary for GLM") def package(self): self.copy("FindGLM.cmake", ".", ".") diff --git a/util/conan-package/test_package/conanfile.py b/util/conan-package/test_package/conanfile.py index 7189f150..a0a6d2c8 100644 --- a/util/conan-package/test_package/conanfile.py +++ b/util/conan-package/test_package/conanfile.py @@ -1,12 +1,8 @@ from conans import ConanFile, CMake import os -channel = os.getenv("CONAN_CHANNEL", "testing") -username = os.getenv("CONAN_USERNAME", "g-truc") - class TestGlm(ConanFile): settings = "os", "compiler", "build_type", "arch" - requires = "glm/master@%s/%s" % (username, channel) generators = "cmake" def build(self): From 2c617b45aa71218c12e9356461314047fc52166a Mon Sep 17 00:00:00 2001 From: dimitri Date: Mon, 24 Jul 2017 22:58:22 +0200 Subject: [PATCH 2/5] Corrected relative path. --- util/conan-package/conanfile.py | 2 +- util/conan-package/test_package/CMakeLists.txt | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/util/conan-package/conanfile.py b/util/conan-package/conanfile.py index bf81e343..777adc35 100644 --- a/util/conan-package/conanfile.py +++ b/util/conan-package/conanfile.py @@ -8,7 +8,7 @@ class GlmConan(ConanFile): url="https://github.com/g-truc/glm" description="OpenGL Mathematics (GLM)" license = "https://github.com/g-truc/glm/blob/manual/copying.txt" - exports_sources = ["FindGLM.cmake", os.sep.join([".", "..", "..", "*"])] + exports_sources = ["FindGLM.cmake", os.sep.join(["..", "..", "*"])] exports = "lib_licenses/*" def build(self): diff --git a/util/conan-package/test_package/CMakeLists.txt b/util/conan-package/test_package/CMakeLists.txt index c2b30814..7aeab766 100644 --- a/util/conan-package/test_package/CMakeLists.txt +++ b/util/conan-package/test_package/CMakeLists.txt @@ -3,11 +3,10 @@ cmake_minimum_required(VERSION 3.0.0) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() -set(CMAKE_C_FLAGS "${CONAN_C_FLAGS}") -set(CMAKE_CXX_FLAGS "${CONAN_CXX_FLAGS}") -set(CMAKE_SHARED_LINKER_FLAGS "${CONAN_SHARED_LINKER_FLAGS}") +if(MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") +endif(MSVC) add_executable(testGlm main.cpp) -TARGET_COMPILE_DEFINITIONS(testGlm PUBLIC "${CONAN_DEFINES}") -TARGET_LINK_LIBRARIES(testGlm PUBLIC "${CONAN_LIBS}") -SET_TARGET_PROPERTIES(testGlm PROPERTIES LINK_FLAGS "${CONAN_EXE_LINKER_FLAGS}") + + From 2f36000a4d9f050666af1df6e173a472ba0315e8 Mon Sep 17 00:00:00 2001 From: dimitri Date: Tue, 25 Jul 2017 06:15:31 +0200 Subject: [PATCH 3/5] Only exporting glm directory to export_source. --- util/conan-package/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/conan-package/conanfile.py b/util/conan-package/conanfile.py index 777adc35..d89db047 100644 --- a/util/conan-package/conanfile.py +++ b/util/conan-package/conanfile.py @@ -8,7 +8,7 @@ class GlmConan(ConanFile): url="https://github.com/g-truc/glm" description="OpenGL Mathematics (GLM)" license = "https://github.com/g-truc/glm/blob/manual/copying.txt" - exports_sources = ["FindGLM.cmake", os.sep.join(["..", "..", "*"])] + exports_sources = ["FindGLM.cmake", os.sep.join(["..", "..", "glm*"])] exports = "lib_licenses/*" def build(self): From bfdee5f201ac399fd0121ef9dab310dfacbba0be Mon Sep 17 00:00:00 2001 From: dimitri Date: Tue, 25 Jul 2017 12:06:54 +0200 Subject: [PATCH 4/5] Update README.md --- util/conan-package/README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/util/conan-package/README.md b/util/conan-package/README.md index 5c57221a..4e79bd9e 100644 --- a/util/conan-package/README.md +++ b/util/conan-package/README.md @@ -1,8 +1,5 @@ Conan package for the [GLM](https://github.com/g-truc/glm) library -The package is hosted on [bintray](https://bintray.com/dimi309/conan-packages/glm%3Ag-truc). Until it gets accepted to the conan-center repository, in order to use it, you need to add this repository as a remote to your conan installation: - - conan remote add bintraydimi309 https://api.bintray.com/conan/dimi309/conan-packages +The package is hosted on [bintray](https://bintray.com/dimi309/conan-packages/glm%3Ag-truc). It works on Windows (Visual Studio or MinGW), MacOS/OSX and Linux. - From 819039447c6be2fbdbfda333fceac0298b443b0e Mon Sep 17 00:00:00 2001 From: dimitri Date: Tue, 25 Jul 2017 12:07:56 +0200 Subject: [PATCH 5/5] Update README.md --- util/conan-package/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/conan-package/README.md b/util/conan-package/README.md index 4e79bd9e..1127e2a3 100644 --- a/util/conan-package/README.md +++ b/util/conan-package/README.md @@ -1,5 +1,5 @@ Conan package for the [GLM](https://github.com/g-truc/glm) library -The package is hosted on [bintray](https://bintray.com/dimi309/conan-packages/glm%3Ag-truc). +The package is hosted on [bintray](https://bintray.com/conan/conan-center?filterByPkgName=glm%3Ag-truc). It works on Windows (Visual Studio or MinGW), MacOS/OSX and Linux.