From: Diane Trout Date: Fri, 7 Apr 2006 02:09:28 +0000 (+0000) Subject: put build environment support tools in makelib X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=commitdiff_plain;h=9051e2cf23f24b50b89c91c14f605012499320d0 put build environment support tools in makelib --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 529e66a..3a13315 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,10 @@ PROJECT(mussa) ENABLE_TESTING() # try to include our cmake modules -SET (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}) +SET (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/makelib) + +# debug it! +SET (CXX_FLAGS "-g") # all of our source files al relative to the root of our project INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) diff --git a/FindBoost.cmake b/FindBoost.cmake deleted file mode 100644 index 5e71bc6..0000000 --- a/FindBoost.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# - Find Boost libraries -# Go hunting for boost compoments -# Defines: -# BOOST_INCLUDE - -FIND_PATH(BOOST_INCLUDE_DIR weak_ptr.hpp /usr/include /usr/local/include ) - -FIND_LIBRARY( BOOST_UNIT_TEST_LIB NAMES boost_unit_test_framework - PATHS /usr/lib /usr/local/lib C:\\Boost\\lib ) -FIND_LIBRARY( BOOST_PROGRAM_OPTIONS_LIB NAMES boost_program_options - PATHS /usr/lib /usr/local/lib C:\\Boost\\lib ) -FIND_LIBRARY( BOOST_FILESYSTEM_LIB NAMES boost_filesystem - PATHS /usr/lib /usr/local/lib C:\\Boost\\lib ) - -IF (BOOST_INCLUDE_DIR) - SET(BOOST_FOUND TRUE) -ENDIF (BOOST_INCLUDE_DIR) - -IF (BOOST_FOUND) - IF (NOT Boost_FIND_QUIETLY) - MESSAGE(STATUS "Found Boost: ${BOOST_INCLUDE_DIR}") - ENDIF (NOT Boost_FIND_QUIETLY) -ELSE(BOOST_FOUND) - IF (Boost_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find Boost") - ENDIF (Boost_FIND_REQUIRED) -ENDIF (BOOST_FOUND) - diff --git a/makelib/FindBoost.cmake b/makelib/FindBoost.cmake new file mode 100644 index 0000000..5e71bc6 --- /dev/null +++ b/makelib/FindBoost.cmake @@ -0,0 +1,28 @@ +# - Find Boost libraries +# Go hunting for boost compoments +# Defines: +# BOOST_INCLUDE + +FIND_PATH(BOOST_INCLUDE_DIR weak_ptr.hpp /usr/include /usr/local/include ) + +FIND_LIBRARY( BOOST_UNIT_TEST_LIB NAMES boost_unit_test_framework + PATHS /usr/lib /usr/local/lib C:\\Boost\\lib ) +FIND_LIBRARY( BOOST_PROGRAM_OPTIONS_LIB NAMES boost_program_options + PATHS /usr/lib /usr/local/lib C:\\Boost\\lib ) +FIND_LIBRARY( BOOST_FILESYSTEM_LIB NAMES boost_filesystem + PATHS /usr/lib /usr/local/lib C:\\Boost\\lib ) + +IF (BOOST_INCLUDE_DIR) + SET(BOOST_FOUND TRUE) +ENDIF (BOOST_INCLUDE_DIR) + +IF (BOOST_FOUND) + IF (NOT Boost_FIND_QUIETLY) + MESSAGE(STATUS "Found Boost: ${BOOST_INCLUDE_DIR}") + ENDIF (NOT Boost_FIND_QUIETLY) +ELSE(BOOST_FOUND) + IF (Boost_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Boost") + ENDIF (Boost_FIND_REQUIRED) +ENDIF (BOOST_FOUND) + diff --git a/makelib/osxdist.py b/makelib/osxdist.py new file mode 100644 index 0000000..500cdd5 --- /dev/null +++ b/makelib/osxdist.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python + +import os +import sys +from shutil import copy, copytree + +def system(cmdline): + #print >>sys.stderr, cmdline + return os.system(cmdline) + +def mkdir(path): + path_list = [] + head, tail = os.path.split(path) + path_list.insert(0, tail) + while len(head) > 0: + head, tail = os.path.split(head) + path_list.insert(0, tail) + created_path = "" + for path_element in path_list: + created_path = os.path.join(created_path, path_element) + if not os.path.exists(created_path): + os.mkdir(created_path) + +# useful information about building dmgs +# http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix +# http://developer.apple.com/documentation/developertools/Conceptual/SoftwareDistribution/Concepts/sd_disk_images.html + +def makedmg(dirlist, volname): + # need to detect what the real volume name is + mussa_mount = '/Volumes/%s' %(volname) + mussarw_dmg = '%sw.dmg' %(volname) + mussa_dmg = '%s.dmg' %(volname) + system('hdiutil detach '+mussa_mount) + if os.path.exists(mussa_mount): + print >>sys.stderr, "Something is in", mussa_mount + return + if os.path.exists(mussarw_dmg): + os.unlink(mussarw_dmg) + if os.path.exists(mussa_dmg): + os.unlink(mussa_dmg) + system('hdiutil create -size 64m -fs HFS+ -volname "%s" %s'%(volname, mussarw_dmg)) + system('hdiutil attach '+mussarw_dmg) + # copy files + for d in dirlist: + copytree(d, os.path.join(mussa_mount, d)) + + system('hdiutil detach '+mussa_mount) + system('hdiutil convert '+mussarw_dmg +' -format UDZO -o '+mussa_dmg) + #system('hdiutil internet-enable -yes '+mussa_dmg) + +def main(args): + framework_subpath = os.path.join("%(framework)s.framework", "Versions", "4.0", "%(framework)s") + frameworks = ['QtCore', 'QtGui', 'QtOpenGL'] + + qt_lib_dir="/usr/local/qt-4.1.1/lib" + qt_framework=os.path.join(qt_lib_dir, framework_subpath) + + app_name="mussagl" + app_dir=app_name+".app" + app_binary=app_dir+"/Contents/MacOS/"+app_name + app_framework=os.path.join(app_dir, "Contents", "Frameworks", framework_subpath) + if not os.path.exists(app_dir): + print >>sys.stderr, "please build mussagl first" + return 1 + + # install frameworks and update binary + for frame in frameworks: + qtframe = qt_framework % ({'framework': frame}) + appframe = app_framework % ({'framework': frame}) + exe_path = "@executable_path/../Frameworks/" + framework_subpath + exe_path %= ({'framework': frame}) + mkdir(os.path.split(appframe)[0]) + # update binary + copy(qtframe, appframe) + system("install_name_tool -id "+exe_path+" "+appframe) + system("install_name_tool -change "+qtframe+" "+exe_path+" "+app_binary) + # now that everything is in place change the frameworks + # references + for frame2 in frameworks: + qtframe2 = qt_framework % ({'framework': frame2}) + contents_exe_path = "@executable_path/../Frameworks/" + framework_subpath + contents_exe_path %= ({'framework': frame2}) + system("install_name_tool -change "+qtframe2+" "+contents_exe_path+" "+ + appframe) + makedmg([app_dir], 'mussa') + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/makelib/wininst.iss b/makelib/wininst.iss new file mode 100644 index 0000000..79b9dac --- /dev/null +++ b/makelib/wininst.iss @@ -0,0 +1,60 @@ +[Setup] +AppCopyright=California Institute of California +AppName=Mussagl +AppVerName=Mussagl build 141 +DefaultGroupName=Mussagl +OutputDir=win32_mussagl_installer +OutputBaseFilename=mussagl-setup-build-141 +VersionInfoVersion=141 +VersionInfoCompany=California Institute of Technology +VersionInfoDescription=Mussagl +VersionInfoTextVersion=Mussagl build 141 +VersionInfoCopyright=California Institute of Technology +LicenseFile=LICENSE.txt +ShowLanguageDialog=yes +AppPublisher=Wold Lab - Caltech +AppPublisherURL=http://woldlab.caltech.edu +AppSupportURL=http://mussa.caltech.edu +AppUpdatesURL=http://mussa.caltech.edu +AppVersion=build 141 +AppID={{5B060311-9241-4015-B73D-D9D2822458E7} +UninstallDisplayName=Mussagl +DefaultDirName={pf}\Mussagl +[Dirs] +Name: {app}\examples +Name: {app}\icons +Name: {app}\examples\seq +[Files] +Source: icons\viewmag.png; DestDir: {app}\icons +Source: icons\exit.png; DestDir: {app}\icons +Source: icons\filenew.png; DestDir: {app}\icons +Source: icons\fileopen.png; DestDir: {app}\icons +Source: icons\filesave.png; DestDir: {app}\icons +Source: icons\help.png; DestDir: {app}\icons +Source: icons\image2.png; DestDir: {app}\icons +Source: icons\info.png; DestDir: {app}\icons +Source: icons\lock.png; DestDir: {app}\icons +Source: icons\motif_icon.png; DestDir: {app}\icons +Source: icons\README.txt; DestDir: {app}\icons +Source: examples\test_motif.txt; DestDir: {app}\examples +Source: examples\mck3test.mupa; DestDir: {app}\examples +Source: examples\mck3test_example.museq; DestDir: {app}\examples +Source: examples\mck3test_example.muway; DestDir: {app}\examples +Source: examples\mm_mck3test.annot; DestDir: {app}\examples +Source: examples\seq\rabbit_mck_pro.fa; DestDir: {app}\examples\seq +Source: examples\seq\human_mck_pro.fa; DestDir: {app}\examples\seq +Source: examples\seq\mouse_mck_pro.fa; DestDir: {app}\examples\seq +Source: release\mussagl.exe; DestDir: {app} +Source: ..\..\MinGW\bin\mingwm10.dll; DestDir: {app} +Source: ..\..\Qt\4.1.0\bin\QtCore4.dll; DestDir: {app} +Source: ..\..\Qt\4.1.0\bin\QtGui4.dll; DestDir: {app} +Source: ..\..\Qt\4.1.0\bin\QtOpenGL4.dll; DestDir: {app} +[Icons] +Name: {group}\Mussagl; Filename: {app}\mussagl.exe; WorkingDir: {app}; IconFilename: {app}\mussagl.exe; Flags: createonlyiffileexists +Name: {group}\{cm:UninstallProgram, Mussagl}; Filename: {uninstallexe} +[INI] +Filename: {app}\mussa.url; Section: InternetShortcut; Key: URL; String: http://mussa.caltech.edu/ +Filename: {app}\woldlab.url; Section: InternetShortcut; Key: URL; String: http://woldlab.caltech.edu +[UninstallDelete] +Type: files; Name: {app}\mussa.url +Type: files; Name: {app}\woldlab.url diff --git a/osxdist.py b/osxdist.py deleted file mode 100644 index 500cdd5..0000000 --- a/osxdist.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -from shutil import copy, copytree - -def system(cmdline): - #print >>sys.stderr, cmdline - return os.system(cmdline) - -def mkdir(path): - path_list = [] - head, tail = os.path.split(path) - path_list.insert(0, tail) - while len(head) > 0: - head, tail = os.path.split(head) - path_list.insert(0, tail) - created_path = "" - for path_element in path_list: - created_path = os.path.join(created_path, path_element) - if not os.path.exists(created_path): - os.mkdir(created_path) - -# useful information about building dmgs -# http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix -# http://developer.apple.com/documentation/developertools/Conceptual/SoftwareDistribution/Concepts/sd_disk_images.html - -def makedmg(dirlist, volname): - # need to detect what the real volume name is - mussa_mount = '/Volumes/%s' %(volname) - mussarw_dmg = '%sw.dmg' %(volname) - mussa_dmg = '%s.dmg' %(volname) - system('hdiutil detach '+mussa_mount) - if os.path.exists(mussa_mount): - print >>sys.stderr, "Something is in", mussa_mount - return - if os.path.exists(mussarw_dmg): - os.unlink(mussarw_dmg) - if os.path.exists(mussa_dmg): - os.unlink(mussa_dmg) - system('hdiutil create -size 64m -fs HFS+ -volname "%s" %s'%(volname, mussarw_dmg)) - system('hdiutil attach '+mussarw_dmg) - # copy files - for d in dirlist: - copytree(d, os.path.join(mussa_mount, d)) - - system('hdiutil detach '+mussa_mount) - system('hdiutil convert '+mussarw_dmg +' -format UDZO -o '+mussa_dmg) - #system('hdiutil internet-enable -yes '+mussa_dmg) - -def main(args): - framework_subpath = os.path.join("%(framework)s.framework", "Versions", "4.0", "%(framework)s") - frameworks = ['QtCore', 'QtGui', 'QtOpenGL'] - - qt_lib_dir="/usr/local/qt-4.1.1/lib" - qt_framework=os.path.join(qt_lib_dir, framework_subpath) - - app_name="mussagl" - app_dir=app_name+".app" - app_binary=app_dir+"/Contents/MacOS/"+app_name - app_framework=os.path.join(app_dir, "Contents", "Frameworks", framework_subpath) - if not os.path.exists(app_dir): - print >>sys.stderr, "please build mussagl first" - return 1 - - # install frameworks and update binary - for frame in frameworks: - qtframe = qt_framework % ({'framework': frame}) - appframe = app_framework % ({'framework': frame}) - exe_path = "@executable_path/../Frameworks/" + framework_subpath - exe_path %= ({'framework': frame}) - mkdir(os.path.split(appframe)[0]) - # update binary - copy(qtframe, appframe) - system("install_name_tool -id "+exe_path+" "+appframe) - system("install_name_tool -change "+qtframe+" "+exe_path+" "+app_binary) - # now that everything is in place change the frameworks - # references - for frame2 in frameworks: - qtframe2 = qt_framework % ({'framework': frame2}) - contents_exe_path = "@executable_path/../Frameworks/" + framework_subpath - contents_exe_path %= ({'framework': frame2}) - system("install_name_tool -change "+qtframe2+" "+contents_exe_path+" "+ - appframe) - makedmg([app_dir], 'mussa') - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/wininst.iss b/wininst.iss deleted file mode 100644 index 79b9dac..0000000 --- a/wininst.iss +++ /dev/null @@ -1,60 +0,0 @@ -[Setup] -AppCopyright=California Institute of California -AppName=Mussagl -AppVerName=Mussagl build 141 -DefaultGroupName=Mussagl -OutputDir=win32_mussagl_installer -OutputBaseFilename=mussagl-setup-build-141 -VersionInfoVersion=141 -VersionInfoCompany=California Institute of Technology -VersionInfoDescription=Mussagl -VersionInfoTextVersion=Mussagl build 141 -VersionInfoCopyright=California Institute of Technology -LicenseFile=LICENSE.txt -ShowLanguageDialog=yes -AppPublisher=Wold Lab - Caltech -AppPublisherURL=http://woldlab.caltech.edu -AppSupportURL=http://mussa.caltech.edu -AppUpdatesURL=http://mussa.caltech.edu -AppVersion=build 141 -AppID={{5B060311-9241-4015-B73D-D9D2822458E7} -UninstallDisplayName=Mussagl -DefaultDirName={pf}\Mussagl -[Dirs] -Name: {app}\examples -Name: {app}\icons -Name: {app}\examples\seq -[Files] -Source: icons\viewmag.png; DestDir: {app}\icons -Source: icons\exit.png; DestDir: {app}\icons -Source: icons\filenew.png; DestDir: {app}\icons -Source: icons\fileopen.png; DestDir: {app}\icons -Source: icons\filesave.png; DestDir: {app}\icons -Source: icons\help.png; DestDir: {app}\icons -Source: icons\image2.png; DestDir: {app}\icons -Source: icons\info.png; DestDir: {app}\icons -Source: icons\lock.png; DestDir: {app}\icons -Source: icons\motif_icon.png; DestDir: {app}\icons -Source: icons\README.txt; DestDir: {app}\icons -Source: examples\test_motif.txt; DestDir: {app}\examples -Source: examples\mck3test.mupa; DestDir: {app}\examples -Source: examples\mck3test_example.museq; DestDir: {app}\examples -Source: examples\mck3test_example.muway; DestDir: {app}\examples -Source: examples\mm_mck3test.annot; DestDir: {app}\examples -Source: examples\seq\rabbit_mck_pro.fa; DestDir: {app}\examples\seq -Source: examples\seq\human_mck_pro.fa; DestDir: {app}\examples\seq -Source: examples\seq\mouse_mck_pro.fa; DestDir: {app}\examples\seq -Source: release\mussagl.exe; DestDir: {app} -Source: ..\..\MinGW\bin\mingwm10.dll; DestDir: {app} -Source: ..\..\Qt\4.1.0\bin\QtCore4.dll; DestDir: {app} -Source: ..\..\Qt\4.1.0\bin\QtGui4.dll; DestDir: {app} -Source: ..\..\Qt\4.1.0\bin\QtOpenGL4.dll; DestDir: {app} -[Icons] -Name: {group}\Mussagl; Filename: {app}\mussagl.exe; WorkingDir: {app}; IconFilename: {app}\mussagl.exe; Flags: createonlyiffileexists -Name: {group}\{cm:UninstallProgram, Mussagl}; Filename: {uninstallexe} -[INI] -Filename: {app}\mussa.url; Section: InternetShortcut; Key: URL; String: http://mussa.caltech.edu/ -Filename: {app}\woldlab.url; Section: InternetShortcut; Key: URL; String: http://woldlab.caltech.edu -[UninstallDelete] -Type: files; Name: {app}\mussa.url -Type: files; Name: {app}\woldlab.url