Skip to content

Commit

Permalink
Merge pull request #544 from Anatoscope/fix_CImgPlugin_cmake
Browse files Browse the repository at this point in the history
[CImgPlugin] Use sofa cmake command to create proper package
  • Loading branch information
guparan authored Dec 19, 2017
2 parents b5c4527 + 59ca355 commit 1a3f4e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
11 changes: 11 additions & 0 deletions applications/plugins/CImgPlugin/CImgPluginConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# CMake package configuration file for the CImgPlugin plugin

@PACKAGE_INIT@

find_package(SofaGeneral REQUIRED)

if(NOT TARGET CImgPlugin)
include("${CMAKE_CURRENT_LIST_DIR}/CImgPluginTargets.cmake")
endif()

check_required_components(CImgPlugin)
12 changes: 6 additions & 6 deletions applications/plugins/CImgPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 2.8.12)
project(CImgPlugin)

set(${PROJECT_NAME}_MAJOR_VERSION 0)
set(${PROJECT_NAME}_MINOR_VERSION 1)
set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION})

## RPATH
if(UNIX)
set(CMAKE_INSTALL_RPATH "../lib")
Expand Down Expand Up @@ -90,10 +94,6 @@ target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CUR
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CImg_INCLUDE_DIRS}>")

install(TARGETS ${PROJECT_NAME}
COMPONENT CImgPlugin_libraries
EXPORT CImgPluginTargets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
## Install rules for the library; CMake package configurations files
sofa_create_package(${PROJECT_NAME} ${${PROJECT_NAME}_VERSION} ${PROJECT_NAME} ${PROJECT_NAME})

0 comments on commit 1a3f4e2

Please sign in to comment.