Commit c4803709 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CLEAN] - furter cleanup[ADD] - added simple (TOO simple) config for CPack to...

[CLEAN] - furter cleanup[ADD] - added simple (TOO simple) config for CPack to generate deb and tgz. But seems to work.
parent 15440baf
OpenWalnut is an open source tool for multi-modal medical and brain data
visualization. Its universality allows it to be easily extended and used in a
large variety of application cases. It is both, a tool for the scientific user
and a powerful framework for the visualization researcher. OpenWalnut is
licensed under the terms of the GNU Lesser General Public License. Written
entirely in Standard C++ and using a number of portable libraries (e.g.
OpenSceneGraph and Qt), it runs on all Windows platforms, OSX, and
GNU/Linux operating systems.
......@@ -2,3 +2,14 @@ OpenWalnut
----------
- please refer to http://www.openwalnut.org for extensive documentation and information.
Authors and Contributors:
-------------------------
See the files "AUTHORS" and "CONTRIBUTORS"
Licence:
--------
See "COPYING" and "COPYING.LESSER"
......@@ -37,13 +37,13 @@ IF( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
ENDIF()
# append search path for FindModules:
LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../tools/CMakeModules )
LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../tools/cmake )
# here, we have certain utilities. For example ASSERT_GE_VERSION which ensures a specific minimum version
INCLUDE( ${PROJECT_SOURCE_DIR}/../tools/CMakeModules/Utils.cmake )
INCLUDE( ${CMAKE_MODULE_PATH}/Utils.cmake )
# These scripts contains all the needed tools to setup the build
INCLUDE( ${PROJECT_SOURCE_DIR}/../tools/CMakeModules/BuildUtils.cmake )
INCLUDE( ${PROJECT_SOURCE_DIR}/../tools/CMakeModules/BuildModuleUtils.cmake )
INCLUDE( ${CMAKE_MODULE_PATH}/BuildUtils.cmake )
INCLUDE( ${CMAKE_MODULE_PATH}/BuildModuleUtils.cmake )
# CMAKE automatism to select static vs. shared building:
IF( NOT CMAKE_GENERATOR MATCHES "Visual Studio" )
......@@ -226,13 +226,13 @@ INCLUDE_DIRECTORIES( ${OPENSCENEGRAPH_INCLUDE_DIRS} )
# Try to find it
FIND_PACKAGE( CxxTest QUIET )
MARK_AS_ADVANCED( CXXTEST_PERL_TESTGEN_EXECUTABLE )
# If it is found, and OW_USE_TESTS is on, build the tests and activate CMake's test mechanisms
IF( CXXTEST_FOUND )
# To enable testing
OPTION( OW_USE_TESTS "This enables compilation of tests" ON )
INCLUDE_DIRECTORIES( ${CXXTEST_INCLUDE_DIR} )
INCLUDE_DIRECTORIES( ${CXXTEST_INCLUDE_DIRS} )
INCLUDE_DIRECTORIES( ${CXXTEST_INCLUDE_DIR} ) # NOTE: old FindCXXTest versions used this name
IF( OW_USE_TESTS )
SET( OW_COMPILE_TESTS ON ) #We need this variable because this is tested more often.
# Package settings:
......@@ -277,9 +277,10 @@ INSTALL( FILES ${PROJECT_SOURCE_DIR}/../resources/etc/OpenWalnut/walnut.cfg.offi
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# TODO(ebaum): use try_run for this
# Determines the number of cores available on this machine
IF( NOT CMAKE_GENERATOR MATCHES "Visual Studio" )
SET( NUM_CORES_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../tools/numCores )
SET( NUM_CORES_SOURCE_DIR ${CMAKE_MODULE_PATH}/numCores )
SET( NUM_CORES_BINARY_DIR ${PROJECT_BINARY_DIR}/numCores )
SET( NUM_CORES_BINARY ${NUM_CORES_BINARY_DIR}/numCores )
ADD_CUSTOM_TARGET( numCores
......@@ -404,3 +405,42 @@ ADD_SUBDIRECTORY( qt4gui )
# build modules
ADD_SUBDIRECTORY( modules )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# CPack - Packaging
# - TGZ, Deb, RPM
# NOTE: Not yet production ready!
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# For a list of possible generators, see http://www.vtk.org/Wiki/CMake:CPackPackageGenerators
SET( CPACK_GENERATOR DEB TGZ )
# For a list of possible settings for CPack, see http://www.cmake.org/Wiki/CMake:CPackConfiguration
# Disallow CPack to create an top-level directory?
# SET( CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0 )
SET( CPACK_PACKAGE_DESCRIPTION_FILE ${PROJECT_SOURCE_DIR}/../resources/share/doc/OpenWalnut/ABOUT )
SET( CPACK_PACKAGE_VENDOR "OpenWalnut Community" )
SET( CPACK_PACKAGE_CONTACT "Sebastian Eichelbaum <eichelbaum@informatik.uni-leipzig.de>" )
SET( CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/../resources/share/doc/OpenWalnut/COPYING )
SET( CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/../resources/share/doc/OpenWalnut/README )
# Version
# TODO(all): we should somehot automate this (using hg for example)
SET( CPACK_PACKAGE_VERSION_MAJOR "1" )
SET( CPACK_PACKAGE_VERSION_MINOR "2" )
SET( CPACK_PACKAGE_VERSION_PATCH "0" )
# TODO(all): how to determine this? Maybe dpkg --print-architecture Hm Seems to be set (correct) automatically, unlike the docu wants me to
# believe#
# SET( CPACK_DEBIAN_PACKAGE_ARCHITECTURE )
# TODO(ebaum): this might be automated using objdunp -p walnut | grep -i needed or similar stuff
#SET( CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libgcc1 (>= 1:3.4.2-12)")
# TODO(ebaum): find some nice value
# SET( CPACK_DEBIAN_PACKAGE_SECTION "what" )
# TODO(ebaum): maybe cuda and this stuff can be added here
# SET( CPACK_DEBIAN_PACKAGE_RECOMMENDS "" )
SET( CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE} )
INCLUDE(CPack)
# - Try to find Eigen3 lib
#
# This module supports requiring a minimum version, e.g. you can do
# find_package(Eigen3 3.1.2)
# to require version 3.1.2 or newer of Eigen3.
#
# Once done this will define
#
# EIGEN3_FOUND - system has eigen lib with correct version
# EIGEN3_INCLUDE_DIR - the eigen include directory
# EIGEN3_VERSION - eigen version
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
if(NOT Eigen3_FIND_VERSION)
if(NOT Eigen3_FIND_VERSION_MAJOR)
set(Eigen3_FIND_VERSION_MAJOR 2)
endif(NOT Eigen3_FIND_VERSION_MAJOR)
if(NOT Eigen3_FIND_VERSION_MINOR)
set(Eigen3_FIND_VERSION_MINOR 91)
endif(NOT Eigen3_FIND_VERSION_MINOR)
if(NOT Eigen3_FIND_VERSION_PATCH)
set(Eigen3_FIND_VERSION_PATCH 0)
endif(NOT Eigen3_FIND_VERSION_PATCH)
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
endif(NOT Eigen3_FIND_VERSION)
macro(_eigen3_check_version)
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
set(EIGEN3_VERSION_OK FALSE)
else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
set(EIGEN3_VERSION_OK TRUE)
endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
if(NOT EIGEN3_VERSION_OK)
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
"but at least version ${Eigen3_FIND_VERSION} is required")
endif(NOT EIGEN3_VERSION_OK)
endmacro(_eigen3_check_version)
if (EIGEN3_INCLUDE_DIR)
# in cache already
_eigen3_check_version()
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
else (EIGEN3_INCLUDE_DIR)
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
PATHS
${CMAKE_INSTALL_PREFIX}/include
${KDE4_INCLUDE_DIR}
PATH_SUFFIXES eigen3 eigen
)
if(EIGEN3_INCLUDE_DIR)
_eigen3_check_version()
endif(EIGEN3_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
mark_as_advanced(EIGEN3_INCLUDE_DIR)
endif(EIGEN3_INCLUDE_DIR)
FIND_PATH( OSSIM_INCLUDE_DIR ossimVersion.h /usr/include/ossim /usr/local/include/ossim )
# FIND_PATH( OSSIM_LIBDIR libossim.so /usr/lib /usr/local/lib )
FIND_LIBRARY( OSSIM_LIBRARY NAMES ossim PATH /usr/lib /usr/local/lib )
IF ( OSSIM_INCLUDE_DIR AND OSSIM_LIBRARY )
SET( OSSIM_FOUND TRUE )
ENDIF ( OSSIM_INCLUDE_DIR AND OSSIM_LIBRARY )
IF ( OSSIM_FOUND )
IF ( NOT OSSIM_FIND_QUIETLY )
MESSAGE( STATUS "Found OSSIM: ${FOO_LIBRARY}" )
ENDIF ( NOT OSSIM_FIND_QUIETLY )
ELSE ( OSSIM_FOUND )
IF (OSSIM_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Could not find OSSIM" )
ENDIF ( OSSIM_FIND_REQUIRED )
ENDIF ( OSSIM_FOUND )
#!/usr/bin/env python
#
# little helper script for OpenWalnut to copy files if they dont exist or differ from the one existing
# especialy useful with generated files that should not trigger a rebuild when they get generated the same
# By Robin Ledig - Oct 2010
import sys
import os
import string
import os.path
HELP_USAGE = "Usage: copyIfNes.py srcFile targetFile \n"
#read a complete file into a stringlist
def read_file (filename):
usefn = filename
pos = string.find(usefn,"\n")
if ( pos >= 0 ):
usefn = filename[:pos]
if not os.path.exists(usefn):
print "File " + usefn + " doesn't exist."
return ()
f = file(usefn, "r")
lines = f.readlines()
f.close()
for i in range(len(lines)):
lines[i] = string.rstrip(lines[i],"\n")
return lines
def writeFile(filename,lines):
for i in range(len(lines)):
lines[i] = string.rstrip(lines[i],"\n")
lines[i] = lines[i] + "\n"
f = open(filename, "w")
f.writelines(lines)
f.close()
def main(argv):
num_args = len(sys.argv)-1
if num_args != 2:
print HELP_USAGE
return
orgFile = read_file(sys.argv[1])
#if the target file doesn't exist, just write it
if ( not os.path.exists(sys.argv[2]) ):
writeFile(sys.argv[2],orgFile)
return
targetFile = read_file(sys.argv[2])
#unequal line count -> overwrite the file
if ( len(orgFile) != len(targetFile) ):
writeFile(sys.argv[2],orgFile)
return
# check if all lines match, if not overwrite otherwise done
identical = 1
for i in range(len(orgFile)):
if ( string.find(orgFile[i],targetFile[i]) == -1 ):
identical = 0
break
if ( identical == 0 ):
writeFile(sys.argv[2],orgFile)
if __name__ == "__main__":
main( sys.argv )
#!/usr/bin/env python
import os
import string
import shutil
import sys
HELP_USAGE = "Usage: copyWinRelease.py\n"
def get_immediate_subdirectories(dir):
return [name for name in os.listdir(dir)
if os.path.isdir(os.path.join(dir, name))]
def copyRelevantBinarys(fromDir,toDir):
shutil.copy2( fromDir + "/walnut.exe", toDir )
shutil.copy2( fromDir + "/OWcommon.dll", toDir )
shutil.copy2( fromDir + "/OWdataHandler.dll", toDir )
shutil.copy2( fromDir + "/OWge.dll", toDir )
shutil.copy2( fromDir + "/OWkernel.dll", toDir )
def main(argv):
num_args = len(sys.argv)-1
if num_args != 0:
print HELP_USAGE
return
# assume we are in the output directory (build)
# first create a folder were all the ow binary release is put
# copy from /bin all the relevant dll's and the executable
# copy the share folder
# get a list of directorys from /src/modules
# remove all the folders in build/lib/modules not in the list before
# in the target dir create a folder lib/modules
# iterate over the list and copy all the release dll's (OWmodule_%MODULE_NAME%.dll) and if existing the shaders
OWBinDir = "OWBinary"
if ( os.path.exists(OWBinDir) ):
shutil.rmtree(OWBinDir)
os.mkdir(OWBinDir)
OWBinExec = OWBinDir + "/bin"
os.mkdir(OWBinExec)
copyRelevantBinarys("bin",OWBinExec)
shutil.copytree("share",OWBinDir+"/share")
moduleExistingDirs = get_immediate_subdirectories("../src/modules")
moduleCompDirs = get_immediate_subdirectories("lib/modules")
# delete leftover compiled modules, e.g. if renamed removed or sth like this
for module in moduleCompDirs:
found = 0
for srcModule in moduleExistingDirs:
if ( string.find(module,srcModule) != -1 ):
found = 1
if ( found == 0 ):
print "lib/modules/"+module +" not found in src, deleting"
shutil.rmtree("lib/modules"+"/"+module)
OWBinModuleDir = OWBinDir + "/lib/modules"
os.makedirs(OWBinModuleDir)
for cpymodule in moduleExistingDirs:
currentModuleDir = OWBinModuleDir+"/"+cpymodule
currentSrcDir = "lib/modules/"+cpymodule
if ( os.path.exists(currentSrcDir) ):
os.mkdir(currentModuleDir)
if ( os.path.exists(currentSrcDir+"/OWmodule_"+cpymodule+".dll") ):
shutil.copy2(currentSrcDir+"/OWmodule_"+cpymodule+".dll",currentModuleDir)
if ( os.path.exists(currentSrcDir+"/shaders") ):
shutil.copytree(currentSrcDir+"/shaders",currentModuleDir+"/shaders")
if __name__ == "__main__":
main( sys.argv )
#!/usr/bin/env python
import codecs
import string
import sys
import unicodedata
import os
HELP_USAGE = "Usage: removeWinLineEnding.py fileListFile\n"
def read_file (filename):
usefn = filename
pos = string.find(usefn,"\n")
if ( pos >= 0 ):
usefn = filename[:pos]
if not os.path.exists(usefn):
print "File " + usefn + " doesn't exist."
return ()
f = file(usefn, "r")
lines = f.readlines()
f.close()
for i in range(len(lines)):
lines[i] = string.rstrip(lines[i],"\n")
return lines
def writeFile(filename,lines):
for i in range(len(lines)):
lines[i] = string.rstrip(lines[i],"\n")
lines[i] = lines[i] + "\n"
f = open(filename, "w")
f.writelines(lines)
f.close()
def removeWinLineEndingFromFile(filename):
if filename == '-':
lines = codecs.StreamReaderWriter(sys.stdin,
codecs.getreader('utf8'),
codecs.getwriter('utf8'),
'replace').read().split('\n')
else:
lines = codecs.open(filename, 'r', 'utf8', 'replace').read().split('\n')
carriage_return_found = False
# Remove trailing '\r'.
replaced = 0
for linenum in range(len(lines)):
if lines[linenum].endswith('\r'):
lines[linenum] = lines[linenum].rstrip('\r')
carriage_return_found = True
replaced += 1
if ( carriage_return_found == True ):
writeFile(filename,lines)
print "replaced " +str(replaced)+" rolbacks in "+filename
def main(argv):
num_args = len(sys.argv)-1
if num_args != 1:
print HELP_USAGE
return
fileListFile = sys.argv[1];
filesInList = read_file(fileListFile)
for files in filesInList:
removeWinLineEndingFromFile(files)
if __name__ == "__main__":
main( sys.argv )
File mode changed from 100644 to 100755
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