Commit 2c0b8371 authored by Chris Cantwell's avatar Chris Cantwell

Merge branch 'fix/pkg-cmake3' into 'master'

Fix/pkg cmake3

This MR fixes the packaging system for CMake 3.0

See merge request !435
parents 70168f1a f30974af
......@@ -2,7 +2,7 @@ function (find_lib_files PKG_INSTALL_LIBS PKG_INSTALL_LIBS_FILES)
# Find library file and add the versioned form of each library
set(PKG_INSTALL_LIBS_FILES)
foreach(l ${PKG_INSTALL_LIBS})
SET(TARGET_LOCATION $<TARGET_FILE:${l}>)
SET(TARGET_LOCATION $<TARGET_LINKER_FILE:${l}>)
if (NOT TARGET_LOCATION)
message(FATAL_ERROR "Target '${l}' could not be found.")
endif ()
......@@ -22,13 +22,11 @@ function (find_bin_files PKG_INSTALL_BINS PKG_INSTALL_BINS_FILES)
# Find binary files
set(PKG_INSTALL_BINS_FILES)
foreach(b ${PKG_INSTALL_BINS})
SET(TARGET_LOCATION $<TARGET_FILE:${l}>)
SET(TARGET_LOCATION $<TARGET_FILE:${b}>)
if (NOT TARGET_LOCATION)
message(FATAL_ERROR "Target '${b}' could not be found.")
endif ()
list(APPEND PKG_INSTALL_BINS_FILES ${TARGET_LOCATION})
list(APPEND PKG_INSTALL_BINS_FILES
${TARGET_LOCATION}-${NEKTAR_VERSION})
endforeach()
set(PKG_INSTALL_BINS_FILES ${PKG_INSTALL_BINS_FILES} PARENT_SCOPE)
endfunction ()
......@@ -46,6 +44,12 @@ macro (add_deb_package)
find_lib_files("${PKG_INSTALL_LIBS}" PKG_INSTALL_LIBS_FILES)
find_bin_files("${PKG_INSTALL_BINS}" PKG_INSTALL_BINS_FILES)
# Output the list of files to be installed in the package
file(GENERATE OUTPUT "${BUILD_DIR}/targets/install_libs.txt"
CONTENT "${PKG_INSTALL_LIBS_FILES}")
file(GENERATE OUTPUT "${BUILD_DIR}/targets/install_bins.txt"
CONTENT "${PKG_INSTALL_BINS_FILES}")
# Configure project for this package
configure_file(CMakeListsDpkg.txt.in
${BUILD_DIR}/CMakeLists.txt @ONLY)
......@@ -78,6 +82,12 @@ macro (add_rpm_package)
find_lib_files("${PKG_INSTALL_LIBS}" PKG_INSTALL_LIBS_FILES)
find_bin_files("${PKG_INSTALL_BINS}" PKG_INSTALL_BINS_FILES)
# Output the list of files to be installed in the package
file(GENERATE OUTPUT "${BUILD_DIR}/targets/install_libs.txt"
CONTENT "${PKG_INSTALL_LIBS_FILES}")
file(GENERATE OUTPUT "${BUILD_DIR}/targets/install_bins.txt"
CONTENT "${PKG_INSTALL_BINS_FILES}")
configure_file(CMakeListsRpm.txt.in
${BUILD_DIR}/CMakeLists.txt @ONLY)
add_custom_target(
......
......@@ -37,8 +37,8 @@ set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-1_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
# Files to go in the package
set(INSTALL_BINS_FILES "@PKG_INSTALL_BINS_FILES@")
set(INSTALL_LIBS_FILES "@PKG_INSTALL_LIBS_FILES@")
file(READ "targets/install_libs.txt" INSTALL_LIBS_FILES)
file(READ "targets/install_bins.txt" INSTALL_BINS_FILES)
if (INSTALL_BINS_FILES OR INSTALL_LIBS_FILES)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
......
......@@ -35,8 +35,8 @@ set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-1.${CPACK_RPM_PACKAGE_ARCHITECTURE}")
# Files to go in the package
set(INSTALL_BINS_FILES "@PKG_INSTALL_BINS_FILES@")
set(INSTALL_LIBS_FILES "@PKG_INSTALL_LIBS_FILES@")
file(READ "targets/install_libs.txt" INSTALL_LIBS_FILES)
file(READ "targets/install_bins.txt" INSTALL_BINS_FILES)
# Install any libraries in the lib directory
if(INSTALL_LIBS_FILES)
......
......@@ -28,8 +28,8 @@ set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${ARCHITECTURE}")
# Files to go in the package
set(INSTALL_BINS_FILES "@PKG_INSTALL_BINS_FILES@")
set(INSTALL_LIBS_FILES "@PKG_INSTALL_LIBS_FILES@")
file(READ "targets/install_libs.txt" INSTALL_LIBS_FILES)
file(READ "targets/install_bins.txt" INSTALL_BINS_FILES)
# Install any libraries in the lib directory
if(INSTALL_LIBS_FILES)
......
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