Commit 3350eb98 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - install now does not symlink each lib. This is not needed in an...

[CHANGE] - install now does not symlink each lib. This is not needed in an installation (only needed in dev package). Modified module loader to accept this
parent 7a5e1da8
......@@ -5,7 +5,7 @@ BINDIR=`dirname "$0"`
cd "$BINDIR/.."
# We want to avoid that multiple system installations of OpenWalnut cause some weird loading of libs. We want ours to be loaded:
export LD_PRELOAD="lib/libopenwalnut.so:lib/libopenwalnut_biosig.so:lib/libopenwalnut_eep.so:lib/libopenwalnut_niftiio.so:lib/libopenwalnut_niftiznz.so"
export LD_PRELOAD="lib/libopenwalnut.so.1:lib/libopenwalnut_biosig.so.1:lib/libopenwalnut_eep.so.1:lib/libopenwalnut_niftiio.so.1:lib/libopenwalnut_niftiznz.so.1"
# Run OpenWalnut
bin/openwalnut-qt4 $@
......
......@@ -298,6 +298,7 @@ ENDIF()
# Setup everything in ../resources
SETUP_RESOURCES()
SETUP_ADDITIONAL_FILES( ${OW_DOC_DIR_RELATIVE}
"SHARE"
"${PROJECT_SOURCE_DIR}/../README"
"${PROJECT_SOURCE_DIR}/../AUTHORS"
"${PROJECT_SOURCE_DIR}/../CONTRIBUTORS"
......@@ -307,6 +308,7 @@ SETUP_ADDITIONAL_FILES( ${OW_DOC_DIR_RELATIVE}
# NOTE: use this "double-negative" to use the fact that undefined variables yield FALSE.
IF( NOT OW_PACKAGE_NOCOPY_LICENSE )
SETUP_ADDITIONAL_FILES( ${OW_DOC_DIR_RELATIVE}
"SHARE"
"${PROJECT_SOURCE_DIR}/../COPYING"
"${PROJECT_SOURCE_DIR}/../COPYING.LESSER"
)
......@@ -315,10 +317,12 @@ ENDIF()
# also copy all the user documentation we have
SETUP_ADDITIONAL_DIRECTORY( ${OW_DOC_DIR_RELATIVE}
${PROJECT_SOURCE_DIR}/../doc/user/
"SHARE"
TRUE # this denotes that the contents of doc/user should be copied instead of user directly
)
SETUP_ADDITIONAL_DIRECTORY( ${OW_MAN_DIR_RELATIVE}
${PROJECT_SOURCE_DIR}/../doc/man/
"SHARE"
TRUE # this denotes that the contents of doc/man should be copied instead of user directly
)
......
......@@ -74,7 +74,8 @@ INSTALL( TARGETS ${LibName}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
COMPONENT "RUNTIME"
NAMELINK_SKIP
COMPONENT "LIB"
)
# ---------------------------------------------------------------------------------------------------------------------------------------------------
......@@ -89,7 +90,7 @@ SETUP_TESTS( "${TARGET_TEST_FILES}" "${LibName}" "" )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
COLLECT_SHADER_FILES( ${CMAKE_CURRENT_SOURCE_DIR} TARGET_GLSL_FILES )
SETUP_SHADERS( "${TARGET_GLSL_FILES}" "${OW_SHARE_DIR_RELATIVE}/shaders" )
SETUP_SHADERS( "${TARGET_GLSL_FILES}" "${OW_SHARE_DIR_RELATIVE}/shaders" "LIB" )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Style Checker
......
......@@ -26,6 +26,8 @@
#include <string>
#include <vector>
#include <boost/regex.hpp>
#include "../common/WIOTools.h"
#include "../common/WPathHelper.h"
#include "../common/WSharedLib.h"
......@@ -68,8 +70,12 @@ void WModuleLoader::load( WSharedAssociativeContainer< std::set< boost::shared_p
std::string relPath = i->path().file_string();
relPath.erase( 0, dir.file_string().length() + 1 ); // NOTE: +1 because we want to remove the "/" too
// is it a lib?
if( !boost::filesystem::is_directory( *i ) && ( suffix == WSharedLib::getSystemSuffix() ) &&
// is it a lib? Use a regular expression to check this
static const boost::regex CheckLibMMP( "^.*\\.so\\.[0-9]+\\.[0-9]+\\.[0-9]+$" );
boost::smatch matches;
if( !boost::filesystem::is_directory( *i ) &&
( boost::regex_match( i->path().string(), matches, CheckLibMMP ) ) &&
( stem.compare( 0, getModulePrefix().length(), getModulePrefix() ) == 0 )
#ifdef _MSC_VER
&& supposedFilename == isFileName
......
......@@ -36,5 +36,6 @@ INSTALL( TARGETS ${OWExtBioSigName}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
NAMELINK_SKIP
COMPONENT "LIB"
)
......@@ -36,4 +36,6 @@ INSTALL( TARGETS ${OWExtBioSigName}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
NAMELINK_SKIP
COMPONENT "LIB"
)
......@@ -39,4 +39,6 @@ INSTALL( TARGETS ${OWExtEEPName}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
NAMELINK_SKIP
COMPONENT "LIB"
)
......@@ -72,4 +72,6 @@ INSTALL( TARGETS ${NIFTI_NIFTILIB_NAME} ${NIFTI_ZNZLIB_NAME}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
NAMELINK_SKIP
COMPONENT "LIB"
)
......@@ -78,7 +78,7 @@ SETUP_TESTS( "${TARGET_TEST_FILES}" "${MODULE_NAME}" "${_MODULE_DEPENDENCIES}" )
# -----------------------------------------------------------------------------------------------------------------------------------------------
COLLECT_SHADER_FILES( ${MODULE_SOURCE_DIR} TARGET_GLSL_FILES )
SETUP_SHADERS( "${TARGET_GLSL_FILES}" "${MODULE_TARGET_DIR_RELATIVE}/shaders" )
SETUP_SHADERS( "${TARGET_GLSL_FILES}" "${MODULE_TARGET_DIR_RELATIVE}/shaders" "MODULES" )
# -----------------------------------------------------------------------------------------------------------------------------------------------
# Style Checker
......
......@@ -96,6 +96,7 @@ SETUP_TESTS( "${TARGET_TEST_FILES}" "${BinName}" "" )
# Our user-help needs the icons too. Copy them.
SETUP_ADDITIONAL_DIRECTORY( "${OW_DOC_DIR_RELATIVE}/${LibName}/icons"
"${CMAKE_CURRENT_SOURCE_DIR}/icons"
"SHARE"
FALSE # this denoted that the whole directory icons should be copied instead of its contents
)
......
......@@ -102,7 +102,8 @@ FUNCTION( SETUP_MODULE _MODULE_NAME _MODULE_SOURCE_DIR _MODULE_DEPENDENCIES _MOD
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
COMPONENT "RUNTIME"
NAMELINK_SKIP
COMPONENT "MODULES"
)
# TODO(all): someone needs to explain this
......@@ -122,7 +123,7 @@ FUNCTION( SETUP_MODULE _MODULE_NAME _MODULE_SOURCE_DIR _MODULE_DEPENDENCIES _MOD
# -----------------------------------------------------------------------------------------------------------------------------------------------
COLLECT_SHADER_FILES( ${MODULE_SOURCE_DIR} TARGET_GLSL_FILES )
SETUP_SHADERS( "${TARGET_GLSL_FILES}" "${MODULE_TARGET_DIR_RELATIVE}/shaders" )
SETUP_SHADERS( "${TARGET_GLSL_FILES}" "${MODULE_TARGET_DIR_RELATIVE}/shaders" "MODULES" )
# -----------------------------------------------------------------------------------------------------------------------------------------------
# Style Checker
......
......@@ -151,7 +151,8 @@ ENDFUNCTION( SETUP_TESTS )
# _Shaders list of shaders
# _TargetDir the directory where to put the shaders. Relative to ${PROJECT_BINARY_DIR} and install dir. You should avoid ".." stuff. This can
# break the install targets
FUNCTION( SETUP_SHADERS _Shaders _TargetDir )
# _Component the name of the install component
FUNCTION( SETUP_SHADERS _Shaders _TargetDir _Component )
# only if we are allowed to
IF( OW_HANDLE_SHADERS )
EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E make_directory ${_TargetDir} )
......@@ -174,7 +175,7 @@ FUNCTION( SETUP_SHADERS _Shaders _TargetDir )
# now add install targets for each shader. All paths are relative to the current source dir.
FOREACH( fname ${_Shaders} )
INSTALL( FILES ${fname} DESTINATION ${_TargetDir}
COMPONENT "RUNTIME"
COMPONENT ${_Component}
)
ENDFOREACH( fname )
ENDIF( OW_HANDLE_SHADERS )
......@@ -245,7 +246,7 @@ FUNCTION( SETUP_RESOURCES )
# Also specify install target
INSTALL( DIRECTORY ${ResourcesPath}
DESTINATION "."
COMPONENT "RUNTIME"
COMPONENT "SHARE"
PATTERN "bin/*" # binaries need to be executable
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
......@@ -257,8 +258,9 @@ ENDFUNCTION( SETUP_RESOURCES )
# This function eases the process of copying and installing additional files which not reside in the resource path.
# It creates a target (ALL is depending on it) AND the INSTALL operation.
# _destination where to put them. This MUST be relative to the build dir and install dir.
# _component the name of the component for these files
# _OTHERS you can add an arbitrary list of additional arguments which represent the files to copy.
FUNCTION( SETUP_ADDITIONAL_FILES _destination )
FUNCTION( SETUP_ADDITIONAL_FILES _destination _component )
FOREACH( _file ${ARGN} )
FILE_TO_TARGETSTRING( ${_file} fileTarget )
......@@ -272,7 +274,7 @@ FUNCTION( SETUP_ADDITIONAL_FILES _destination )
# add a INSTALL operation for this file
INSTALL( FILES ${_file} DESTINATION ${_destination}
COMPONENT "RUNTIME"
COMPONENT ${_component}
)
ENDFOREACH()
ENDFUNCTION( SETUP_ADDITIONAL_FILES )
......@@ -281,9 +283,10 @@ ENDFUNCTION( SETUP_ADDITIONAL_FILES )
# somehow, we needed to trick here.
# _destination where to put the directory/its contents. Realtive to build dir and install dir.
# _directory the directory to copy
# _component the name of the component for these files
# _contents if TRUE, the contents of _directory are copied into _destination. If FALSE, _destination as-is is copied to _destination/.. (sorry
# for this weird stuff. Complain at cmake mailing list ;-))
FUNCTION( SETUP_ADDITIONAL_DIRECTORY _destination _directory _contents )
FUNCTION( SETUP_ADDITIONAL_DIRECTORY _destination _directory _component _contents )
# create a nice target name
FILE_TO_TARGETSTRING( ${_directory} directoryTarget )
......@@ -310,7 +313,7 @@ FUNCTION( SETUP_ADDITIONAL_DIRECTORY _destination _directory _contents )
# add a INSTALL operation for this file
INSTALL( DIRECTORY ${_directory}
DESTINATION ${InstallDestination}
COMPONENT "RUNTIME"
COMPONENT ${_component}
)
ENDFUNCTION( SETUP_ADDITIONAL_DIRECTORY )
......
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