Sfoglia il codice sorgente

switch to cmake 3.0

Jens Reimann 7 anni fa
parent
commit
b5dbf0e024
3 ha cambiato i file con 18 aggiunte e 10 eliminazioni
  1. 0 3
      .tito/packages/.readme
  2. 5 3
      CMakeLists.txt
  3. 13 4
      open62541.spec

+ 0 - 3
.tito/packages/.readme

@@ -1,3 +0,0 @@
-the .tito/packages directory contains metadata files
-named after their packages. Each file has the latest tagged
-version and the project's relative directory.

+ 5 - 3
CMakeLists.txt

@@ -15,6 +15,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 
+set(LIB_INSTALL_DIR /usr/lib CACHE PATH "Installation path of libraries")
+
 ###########
 # Version #
 ###########
@@ -604,7 +606,7 @@ add_dependencies(lint open62541)
 # specify install location with `-DCMAKE_INSTALL_PREFIX=xyz`
 # Enable shared library with `-DBUILD_SHARED_LIBS=ON`
 
-set(cmake_configfile_install lib/cmake)
+set(cmake_configfile_install ${LIB_INSTALL_DIR}/cmake3)
 set(target_install_dest_name "${cmake_configfile_install}/open62541Targets.cmake")
 set(open62541_tools_dir share/open62541/tools)
 set(open62541_deps_dir include/open62541/deps)
@@ -615,7 +617,7 @@ install(TARGETS open62541
         LIBRARY DESTINATION ${LIB_INSTALL_DIR}
         ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
         RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
-        INCLUDES DESTINATION include/open62541 ${open62541_deps_dir})
+        INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR}/open62541 ${open62541_deps_dir})
 
 include(CMakePackageConfigHelpers)
 configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/open62541-config.cmake.in"
@@ -641,7 +643,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/open62541-config.cmake"
 
 if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
     install(FILES "${PROJECT_BINARY_DIR}/src_generated/open62541.pc"
-            DESTINATION lib/pkgconfig)
+            DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 endif()
 # export amalgamated header open62541.h which is generated due to build of open62541-object
 if(UA_ENABLE_AMALGAMATION)

+ 13 - 4
open62541.spec

@@ -1,12 +1,12 @@
 Name:     open62541
-Version:  0.2
+Version:  0.3
 Release:  1%{?dist}
 Summary:  OPC UA implementation
 License:  MPLv2.0
 URL:      http://open62541.org
 Source0:  https://github.com/open62541/open62541/archive/%{name}-%{version}.tar.gz
 
-BuildRequires: cmake, python
+BuildRequires: cmake3, python
 
 %description
 open62541 is a C-based library (linking with C++ projects is possible)
@@ -25,7 +25,7 @@ developing applications that use %{name}.
 %setup -q -n %{name}-%{name}-%{version} # double-name prefix by GitHub
 
 %build
-%cmake -DUA_ENABLE_AMALGAMATION=ON .
+%cmake3 -DUA_ENABLE_AMALGAMATION=ON .
 make
 
 %install
@@ -46,11 +46,20 @@ rm examples/CMakeLists.txt
 %files devel
 %license LICENSE LICENSE-CC0
 %{_libdir}/libopen62541.so
-%{_includedir}/open62541.h
+%{_libdir}/pkgconfig/open62541.pc
+%dir %{_includedir}/open62541
+%{_includedir}/open62541/*
+%{_libdir}/cmake3/open62541*
+%dir %{_exec_prefix}/share/open62541
+%{_exec_prefix}/share/open62541/*
+
 %doc FEATURES.md
 %doc examples/
 
 %changelog
+* Tue Sep 05 2017 Jens Reimann <jreimann@redhat.com> - 0.3-1
+- New version of open62541
+- Adapt for cmake3
 * Thu Aug 31 2017 Jens Reimann <jreimann@redhat.com> - 0.2-1
 - Initial version of the package