Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifications suggested by conan team #662

Merged
merged 6 commits into from Aug 16, 2017
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion util/conan-package/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ test_package/build
conanfile.pyc
conaninfo.txt
conanbuildinfo.txt
conanbuildinfo.cmake
conanbuildinfo.cmake
!FindGLM.cmake

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to explicitly include FindGLM? Does it match some other ignore pattern?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an exclusion of all .cmake files in the .gitignore of the top level directory:

https://github.com/g-truc/glm/blob/master/.gitignore

10 changes: 10 additions & 0 deletions util/conan-package/FindGLM.cmake
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 3 additions & 3 deletions util/conan-package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(["..", "..", "glm*"])]
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", ".", ".")
Expand Down
11 changes: 5 additions & 6 deletions util/conan-package/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Header only doesnt need further config

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. I've also updated the readme: https://github.com/dimi309/glm/blob/master/util/conan-package/README.md

I don't see how the conan packaging configuration could possibly affect the build. It is located within its own directory and, since it requires no compilation, it doesn't even have a travis or appveyor setup.


4 changes: 0 additions & 4 deletions util/conan-package/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down