Commit 441839e8 authored by Eric Bruneton's avatar Eric Bruneton
Browse files

patch #13236 from Clement Menier

This patch adds support for ork installation (make install) along with pkgconfig files in the CMake framework. LIB_INSTALL_DIR is allowed to be manually overwritten to lib32 or lib64 (instead of the traditional "lib") if needed (depends on the Linux version).

git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/ork/trunk@30 28599a00-4e59-401b-b2d8-d34d4661a6c9
parent e18075b1
......@@ -2,6 +2,10 @@ project(Ork CXX C)
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)
SET(ORK_VERSION_MAJOR 3)
SET(ORK_VERSION_MINOR 2)
SET(ORK_VERSION "${ORK_VERSION_MAJOR}.${ORK_VERSION_MINOR}")
# Avoid source tree pollution
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-source builds are not permitted. Make a separate folder for building:\nmkdir build; cd build; cmake ..\nBefore that, remove the files already created:\nrm -rf CMakeCache.txt CMakeFiles")
......@@ -22,6 +26,8 @@ link_directories(${Glew_LIBRARY_DIRS})
find_package(GLUT)
set(LIB_INSTALL_DIR "lib" CACHE STRING "Library directory name (lib/lib32/lib64)" )
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
add_definitions("-DORK_API=" "-DTIXML_USE_STL" "-fPIC")
......
......@@ -3,4 +3,5 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
add_subdirectory(stbi)
add_subdirectory(tinyxml)
INSTALL(FILES pmath.h DESTINATION include/ork/math)
INSTALL(FILES tinyxml/tinyxml.h DESTINATION include/ork/resource/tinyxml)
......@@ -20,6 +20,23 @@ endif(BUILD_SHARED)
add_library(${LIBNAME} ${LIBTYPE} ${SOURCE_FILES})
target_link_libraries(${LIBNAME} ${LIBS})
# Adds SO Version and subversion. To be added to ensure ABI/API compatibility.
#SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES SOVERSION ${ORK_VERSION_MAJOR} VERSION ${ORK_VERSION})
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
link_directories(${PROJECT_SOURCE_DIR}/lib)
# Install headers
FOREACH(subdir core math render resource scenegraph taskgraph ui util)
FILE(GLOB include-files ${subdir}/*.h)
INSTALL(FILES ${include-files} DESTINATION include/ork/${subdir})
ENDFOREACH(subdir)
# Install library
INSTALL(TARGETS ork LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
SET(ORK_CFLAGS "-DORK_API= -DTIXML_USE_STL")
CONFIGURE_FILE(ork.pc.in ${PROJECT_BINARY_DIR}/ork.pc @ONLY)
INSTALL(FILES ${PROJECT_BINARY_DIR}/ork.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
prefix=@CMAKE_INSTALL_PREFIX@
libdir=${prefix}/@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: ork
Description: OpenGL Rendering Kernel
Version: @ORK_VERSION@
Requires:
Libs: -L${libdir} -lork
Cflags: -I${includedir} @ORK_CFLAGS@
Supports Markdown
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