Commit 6a820f43 authored by Chris Cantwell's avatar Chris Cantwell

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

Fix/pkg cmake3 take2

See merge request !436
parents 2c0b8371 9c3e94b6
function (find_lib_files PKG_INSTALL_LIBS PKG_INSTALL_LIBS_FILES)
function (write_lib_files PKG_INSTALL_LIBS OUTPUT_FILE)
# 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_LINKER_FILE:${l}>)
IF(${CMAKE_MAJOR_VERSION} LESS 3)
get_target_property(TARGET_LOCATION ${l} LOCATION)
ELSE ()
SET(TARGET_LOCATION $<TARGET_LINKER_FILE:${l}>)
ENDIF()
if (NOT TARGET_LOCATION)
message(FATAL_ERROR "Target '${l}' could not be found.")
endif ()
......@@ -15,20 +19,38 @@ function (find_lib_files PKG_INSTALL_LIBS PKG_INSTALL_LIBS_FILES)
${TARGET_LOCATION}.${NEKTAR_VERSION})
endif()
endforeach()
set(PKG_INSTALL_LIBS_FILES ${PKG_INSTALL_LIBS_FILES} PARENT_SCOPE)
# Output the list of files to be installed in the package
IF(${CMAKE_MAJOR_VERSION} LESS 3)
file(WRITE "${OUTPUT_FILE}" "${PKG_INSTALL_LIBS_FILES}")
ELSE ()
file(GENERATE OUTPUT "${OUTPUT_FILE}"
CONTENT "${PKG_INSTALL_LIBS_FILES}")
ENDIF ()
endfunction ()
function (find_bin_files PKG_INSTALL_BINS PKG_INSTALL_BINS_FILES)
function (write_bin_files PKG_INSTALL_BINS OUTPUT_FILE)
# Find binary files
set(PKG_INSTALL_BINS_FILES)
foreach(b ${PKG_INSTALL_BINS})
SET(TARGET_LOCATION $<TARGET_FILE:${b}>)
IF(${CMAKE_MAJOR_VERSION} LESS 3)
get_target_property(TARGET_LOCATION ${b} LOCATION)
ELSE ()
SET(TARGET_LOCATION $<TARGET_FILE:${b}>)
ENDIF ()
if (NOT TARGET_LOCATION)
message(FATAL_ERROR "Target '${b}' could not be found.")
endif ()
list(APPEND PKG_INSTALL_BINS_FILES ${TARGET_LOCATION})
endforeach()
set(PKG_INSTALL_BINS_FILES ${PKG_INSTALL_BINS_FILES} PARENT_SCOPE)
# Output the list of files to be installed in the package
IF(${CMAKE_MAJOR_VERSION} LESS 3)
file(WRITE "${OUTPUT_FILE}" "${PKG_INSTALL_BINS_FILES}")
ELSE ()
file(GENERATE OUTPUT "${OUTPUT_FILE}"
CONTENT "${PKG_INSTALL_BINS_FILES}")
ENDIF ()
endfunction ()
macro (add_deb_package)
......@@ -41,14 +63,11 @@ macro (add_deb_package)
set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}-deb)
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}")
file(MAKE_DIRECTORY "${BUILD_DIR}/targets")
write_lib_files("${PKG_INSTALL_LIBS}"
"${BUILD_DIR}/targets/install_libs.txt")
write_bin_files("${PKG_INSTALL_BINS}"
"${BUILD_DIR}/targets/install_bins.txt")
# Configure project for this package
configure_file(CMakeListsDpkg.txt.in
......@@ -79,14 +98,11 @@ macro (add_rpm_package)
set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}-rpm)
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}")
file(MAKE_DIRECTORY "${BUILD_DIR}/targets")
write_lib_files("${PKG_INSTALL_LIBS}"
"${BUILD_DIR}/targets/install_libs.txt")
write_bin_files("${PKG_INSTALL_BINS}"
"${BUILD_DIR}/targets/install_bins.txt")
configure_file(CMakeListsRpm.txt.in
${BUILD_DIR}/CMakeLists.txt @ONLY)
......@@ -114,8 +130,11 @@ macro (add_tgz_package)
set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}-tgz)
find_lib_files("${PKG_INSTALL_LIBS}" PKG_INSTALL_LIBS_FILES)
find_bin_files("${PKG_INSTALL_BINS}" PKG_INSTALL_BINS_FILES)
file(MAKE_DIRECTORY "${BUILD_DIR}/targets")
write_lib_files("${PKG_INSTALL_LIBS}"
"${BUILD_DIR}/targets/install_libs.txt")
write_bin_files("${PKG_INSTALL_BINS}"
"${BUILD_DIR}/targets/install_bins.txt")
configure_file(CMakeListsTgz.txt.in
${BUILD_DIR}/CMakeLists.txt @ONLY)
......
......@@ -111,7 +111,6 @@ namespace Nektar
// Read electrogram points
// Always use dim = 3 to allow electrode to be above surface
const int dim = 3;
const NekDouble tol = 1e-06;
int i = 0;
while (!m_electrogramStream.fail())
......
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