From 5c7ccd86ab8ebcd345d50a352314f93418fdbd66 Mon Sep 17 00:00:00 2001 From: mrceresa Date: Mon, 22 Mar 2010 09:15:28 +0000 Subject: [PATCH] Adds CMake configuration export commands to fix bug 575606 --- RPLYConfig.cmake.in | 8 ++++++++ import.log | 1 + rply.spec | 15 ++++++++++++++- rply_CMakeLists.txt | 7 +++++++ rply_cmake_export_cmakelists.txt | 26 ++++++++++++++++++++++++++ 5 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 RPLYConfig.cmake.in create mode 100644 rply_cmake_export_cmakelists.txt diff --git a/RPLYConfig.cmake.in b/RPLYConfig.cmake.in new file mode 100644 index 0000000..aad66da --- /dev/null +++ b/RPLYConfig.cmake.in @@ -0,0 +1,8 @@ +# The RPLY library directory. +SET(RPLY_LIBRARY_DIR "@LIB_INSTALL_DIR@") +SET(RPLY_INCLUDE_DIR "@INCLUDE_INSTALL_DIR@") +SET(RPLY_LIBRARY "@RPLY_LIBRARY@") + + + + diff --git a/import.log b/import.log index 562b319..c9e5b67 100644 --- a/import.log +++ b/import.log @@ -1 +1,2 @@ rply-1_01-2_fc12:HEAD:rply-1.01-2.fc12.src.rpm:1267876689 +rply-1_01-3_fc12:HEAD:rply-1.01-3.fc12.src.rpm:1269249281 diff --git a/rply.spec b/rply.spec index e362e72..777ccb5 100644 --- a/rply.spec +++ b/rply.spec @@ -1,12 +1,14 @@ Name: rply Version: 1.01 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A library to read and write PLY files Group: Development/Libraries License: MIT URL: http://www.tecgraf.puc-rio.br/~diego/professional/rply/ Source0: http://www.tecgraf.puc-rio.br/~diego/professional/rply/rply-1.01.tar.gz Source1: rply_CMakeLists.txt +Source2: RPLYConfig.cmake.in +Source3: rply_cmake_export_cmakelists.txt Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: cmake >= 2.6.0 @@ -32,6 +34,12 @@ efficient, and well tested. The highlights are: # Add CMakeLists.txt file cp %{SOURCE1} CMakeLists.txt +# Add CMake detection modules +mkdir -p CMake/export +mkdir -p CMake/Modules +cp %{SOURCE2} CMake/Modules/ +cp %{SOURCE3} CMake/export/CMakeLists.txt + %build %cmake -DCMAKE_BUILD_TYPE:STRING="Release"\ -DCMAKE_VERBOSE_MAKEFILE=ON . @@ -73,8 +81,13 @@ Rply Library Header Files and Link Libraries %dir %{_includedir}/%{name}/ %{_includedir}/%{name}/* %{_libdir}/*.so +%dir %{_datadir}/%{name}/ +%{_datadir}/%{name}/rplyConfig.cmake %changelog +* Sun Mar 21 2010 Mario Ceresa mrceresa@gmail.com rply 1.01-3 +- Added CMake modules to detect the package + * Thu Mar 04 2010 Mario Ceresa mrceresa@gmail.com rply 1.01-2 - Fixed problems detected in https://bugzilla.redhat.com/show_bug.cgi?id=570258#c2 diff --git a/rply_CMakeLists.txt b/rply_CMakeLists.txt index fa2fcd8..a5a36d8 100644 --- a/rply_CMakeLists.txt +++ b/rply_CMakeLists.txt @@ -4,6 +4,9 @@ cmake_minimum_required(VERSION 2.6) SET(RPLY_LIB_MAJOR_VERSION 1) SET(RPLY_LIB_MINOR_VERSION 01) +SET(RPLY_CMAKE_DIR ${CMAKE_SOURCE_DIR}/CMake/ ) +SET(RPLY_LIBRARY librply.so ) + add_library(rply SHARED rply.c ) set_target_properties( rply PROPERTIES VERSION ${RPLY_LIB_MAJOR_VERSION}.${RPLY_LIB_MINOR_VERSION} @@ -27,4 +30,8 @@ install(TARGETS rply_convert RUNTIME DESTINATION bin) install(TARGETS rply_dump RUNTIME DESTINATION bin) install(TARGETS rply_sconvert RUNTIME DESTINATION bin) +#This should be the last line of the project +SUBDIRS( CMake/export ) + + diff --git a/rply_cmake_export_cmakelists.txt b/rply_cmake_export_cmakelists.txt new file mode 100644 index 0000000..896696e --- /dev/null +++ b/rply_cmake_export_cmakelists.txt @@ -0,0 +1,26 @@ +# This CMakeLists.txt file handles the creation of files needed by +# other client projects that use RPLY. Nothing is built by this +# CMakeLists.txt file. This CMakeLists.txt file must be processed by +# CMake after all the other CMakeLists.txt files in the RPLY tree, +# which is why the SUBDIRS(CMake/export) command is at the end +# of the top level CMakeLists.txt file. + +# Save the compiler settings so another project can import them. +INCLUDE(${CMAKE_ROOT}/Modules/CMakeExportBuildSettings.cmake) +SET(RPLY_BUILD_SETTINGS_FILE ${rply_BINARY_DIR}/RPLYBuildSettings.cmake) +SET(RPLY_EXPORT_BUILD_SETTINGS_FILE + ${CMAKE_INSTALL_PREFIX}/share/rply/cmake/RPLYBuildSettings.cmake +) +CMAKE_EXPORT_BUILD_SETTINGS(${RPLY_BUILD_SETTINGS_FILE}) + +# Create the VXLConfig.cmake file for the build tree. +CONFIGURE_FILE(${RPLY_CMAKE_DIR}Modules/RPLYConfig.cmake.in + ${CMAKE_BINARY_DIR}/rplyConfig.cmake @ONLY IMMEDIATE) + +INSTALL_FILES(/share/rply FILES + ${CMAKE_BINARY_DIR}/rplyConfig.cmake +# ${RPLY_BINARY_DIR}/RPLYBuildSettings.cmake +# ${RPLY_BINARY_DIR}/RPLYLibraryDepends.cmake +# ${RPLY_CMAKE_DIR}/RPLYStandardOptions.cmake +# ${RPLY_CMAKE_DIR}/UseRPLY.cmake +)