Commit 18331a5e authored by Tim Übelhör's avatar Tim Übelhör

catkin & rosdep instead of conan

parent f70e45fc
......@@ -2,27 +2,19 @@ project(scigl_render)
cmake_minimum_required(VERSION 2.8.3)
set (CMAKE_CXX_STANDARD 11)
set(SCIGL_RENDER_VERSION 0.6.1)
# using conan to manage dependencies
if(CONAN_EXPORTED) # when packaging
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
else() # in user space
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.13/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_run(CONANFILE conanfile.py
BASIC_SETUP
BUILD missing)
endif()
find_package(gl3w REQUIRED)
find_package(assimp REQUIRED)
find_package(glfw3 REQUIRED)
find_package(glm REQUIRED)
# prefer new ABI for OpenGL
set(OpenGL_GL_PREFERENCE "GLVND")
# -fPIC
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# library
# the core library
add_library(scigl_render
src/gl_context.cpp
src/buffer/frame_buffer.cpp
......@@ -40,10 +32,13 @@ add_library(scigl_render
src/shader/shader.cpp
src/shader/shader_builder.cpp
src/shader/single_color_shader.cpp)
target_include_directories(scigl_render PUBLIC include)
target_link_libraries(scigl_render ${CONAN_LIBS})
target_include_directories(scigl_render PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(scigl_render
PUBLIC assimp glfw glm gl3w)
# example apps
# example applications
add_executable(scigl_viewer
src/example/scigl_viewer.cpp)
target_link_libraries(scigl_viewer
......@@ -54,3 +49,42 @@ add_executable(scigl_depth_viewer
src/example/depth_offscreen_render.cpp)
target_link_libraries(scigl_depth_viewer
scigl_render)
# install, use GNUInstalDirs for CMAKE_INSTALL_ variables
include(GNUInstallDirs)
install(TARGETS scigl_render scigl_viewer scigl_depth_viewer
EXPORT scigl_renderTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(DIRECTORY include/scigl_render
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
# CMake package
include(CMakePackageConfigHelpers)
# in tree build
set (scigl_render_INCLUDE_DIRS "include")
configure_package_config_file(
scigl_renderConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/scigl_renderConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/scigl_render/cmake
PATH_VARS scigl_render_INCLUDE_DIRS)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/scigl_renderConfigVersion.cmake
VERSION ${SCIGL_RENDER_VERSION}
COMPATIBILITY SameMajorVersion)
export(TARGETS scigl_render
FILE ${CMAKE_CURRENT_BINARY_DIR}/scigl_renderTargets.cmake)
export(PACKAGE scigl_render)
# out of tree build
install (EXPORT scigl_renderTargets
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/scigl_render/cmake FILE "scigl_renderTargets.cmake" )
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/scigl_renderConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/scigl_renderConfigVersion.cmake
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/scigl_render/cmake)
from conans import ConanFile, CMake
class SciglRenderConan(ConanFile):
name = "scigl_render"
version = "0.6"
license = "MIT"
url = "https://git.rwth-aachen.de/robo_guide/scigl_render"
description = ("Library to simplify rendering objects via OpenGL."
"The intendet use case is scientific "
"(e.g. probabalistic filtering).")
settings = "os", "compiler", "build_type", "arch"
requires = ("Assimp/4.1.0@jacmoe/stable",
"gl3w/0.2@tuebel/testing",
"glm/0.9.9.1@g-truc/stable",
"glfw/3.2.1@bincrafters/stable")
generators = "cmake"
exports = "CMakeLists.txt"
exports_sources = "src/*", "include/*"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = "shared=False", "fPIC=True"
def configure(self):
if self.settings.compiler == 'Visual Studio':
del self.options.fPIC
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
self.copy("*.comp", dst="include", src="include", keep_path=True)
self.copy("*.frag", dst="include", src="include", keep_path=True)
self.copy("*.geom", dst="include", src="include", keep_path=True)
self.copy("*.tesc", dst="include", src="include", keep_path=True)
self.copy("*.tese", dst="include", src="include", keep_path=True)
self.copy("*.vert", dst="include", src="include", keep_path=True)
self.copy("*.h", dst="include", src="include", keep_path=True)
self.copy("*.hpp", dst="include", src="include", keep_path=True)
self.copy("*.lib", dst="lib", keep_path=False)
self.copy("*.dll", dst="bin", keep_path=False)
self.copy("*.dylib*", dst="lib", keep_path=False)
self.copy("*.so", dst="lib", keep_path=False)
self.copy("*.a", dst="lib", keep_path=False)
def package_info(self):
self.cpp_info.libs = ["scigl_render"]
......@@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>scigl_render</name>
<version>0.6</version>
<version>0.6.1</version>
<description>
Library to simplify rendering objects via OpenGL. The intendet use case
is scientific (e.g. probabalistic filtering). It is not supposed to be a
......@@ -20,12 +20,11 @@
<doc_depend>doxygen</doc_depend>
<buildtool_depend>cmake</buildtool_depend>
<buildtool_depend>conan</buildtool_depend>
<build_depend>gl3w</build_depend>
<depend>OpenGL</depend>
<depend>glfw</depend>
<depend>gl3w</depend>
<depend>opengl</depend>
<depend>libglfw3-dev</depend>
<depend>assimp</depend>
<depend>glm</depend>
<depend>libglm-dev</depend>
<export>
<build_type>cmake</build_type>
......
@PACKAGE_INIT@
set_and_check(scigl_render_INCLUDE_DIRS "@PACKAGE_scigl_render_INCLUDE_DIRS@")
set_and_check(SCIGL_RENDER_INCLUDE_DIRS "@PACKAGE_scigl_render_INCLUDE_DIRS@")
include (${CMAKE_CURRENT_LIST_DIR}/scigl_renderTargets.cmake)
check_required_components(Foo)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment