mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
new option: INSTALL_DEPENDENCIES
This commit is contained in:
parent
79ffa00a52
commit
be6d060f4a
@ -24,6 +24,7 @@ option( USE_JPEG "enable snapshots using library libjpeg" OFF )
|
||||
option( USE_MPEG "enable video recording with FFmpeg, uses libavcodec" OFF )
|
||||
option( INTEL_MIC "cross compile for intel xeon phi")
|
||||
option( INSTALL_PROFILES "install environment variable settings to /etc/profile.d" OFF )
|
||||
option( INSTALL_DEPENDENCIES "install dependencies like tcl, useful for packaging" OFF )
|
||||
option( USE_CCACHE "use ccache")
|
||||
|
||||
|
||||
@ -263,6 +264,20 @@ if(INSTALL_PROFILES)
|
||||
set( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/postinst")
|
||||
endif(INSTALL_PROFILES)
|
||||
|
||||
#######################################################################
|
||||
if(INSTALL_DEPENDENCIES)
|
||||
include (InstallRequiredSystemLibraries)
|
||||
message("***********************************************")
|
||||
message("${CMAKE_C_STANDARD_LIBRARIES}")
|
||||
message("${CMAKE_CXX_STANDARD_LIBRARIES}")
|
||||
message("${CMAKE_C_STANDARD_LIBRARIES_INIT}")
|
||||
message("${CMAKE_CXX_STANDARD_LIBRARIES_INIT}")
|
||||
message("${CMAKE_STANDARD_LIBRARIES}")
|
||||
get_filename_component(MY_LIB_DIR ${TK_LIBRARY} DIRECTORY)
|
||||
message("my_tcl lib dir: ${MY_LIB_DIR}")
|
||||
install( DIRECTORY "${MY_LIB_DIR}" DESTINATION . COMPONENT netgen )
|
||||
install( FILES "${Boost_LIBRARIES}" DESTINATION lib COMPONENT netgen )
|
||||
endif(INSTALL_DEPENDENCIES)
|
||||
#######################################################################
|
||||
|
||||
add_subdirectory(libsrc)
|
||||
@ -317,16 +332,44 @@ if(UNIX)
|
||||
endif(UNIX)
|
||||
|
||||
if(APPLE)
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/startup2.sh DESTINATION bin)
|
||||
set(CPACK_GENERATOR "Bundle")
|
||||
set(CPACK_BUNDLE_NAME "NGSuite")
|
||||
set(CPACK_BUNDLE_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
|
||||
set(CPACK_BUNDLE_PLIST ${mac_plist})
|
||||
set(CPACK_BUNDLE_ICON
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../netgen/windows/netgen.ico)
|
||||
# set(CPACK_BUNDLE_STARTUP_COMMAND /Applications/NGSuite.app/Contents/MacOS/NGSuite)
|
||||
# set(CPACK_BUNDLE_STARTUP_COMMAND /Applications/NGSuite.app/Contents/Resources/bin/netgen)
|
||||
set(CPACK_BUNDLE_STARTUP_COMMAND startup.sh)
|
||||
# set(CPACK_SOURCE_GENERATOR "TGZ")
|
||||
|
||||
# create some auxiliary files
|
||||
set(mac_startup ${CMAKE_CURRENT_BINARY_DIR}/startup.sh)
|
||||
file(WRITE ${mac_startup} "#!/bin/sh\n")
|
||||
file(APPEND ${mac_startup} "NGSuite_BUNDLE=\"`echo \"$0\" | sed -e 's/\\/Contents\\/Resources\\/bin\\/startup.sh//'`\"\n")
|
||||
file(APPEND ${mac_startup} "NGSuite_RESOURCES=\"$NGSuite_BUNDLE/Contents/Resources\"\n")
|
||||
file(APPEND ${mac_startup} "export DYLD_LIBRARY_PATH=$NGSuite_RESOURCES/lib:$DYLD_LIBRARY_PATH\n")
|
||||
file(APPEND ${mac_startup} "export NETGENDIR=$NGSuite_RESOURCES/bin\n")
|
||||
file(APPEND ${mac_startup} "$NGSuite_RESOURCES/bin/netgen\n")
|
||||
install(PROGRAMS ${mac_startup} DESTINATION bin)
|
||||
|
||||
set(mac_ngsuite ${CMAKE_CURRENT_BINARY_DIR}/ngsuite.sh)
|
||||
file(WRITE ${mac_ngsuite} "#!/bin/sh\n")
|
||||
file(APPEND ${mac_ngsuite} "NGSuite_BUNDLE=\"`echo \"$0\" | sed -e 's/\\/Contents\\/MacOS\\/NGSuite//'`\"\n")
|
||||
file(APPEND ${mac_ngsuite} "NGSuite_RESOURCES=\"$NGSuite_BUNDLE/Contents/Resources\"\n")
|
||||
file(APPEND ${mac_ngsuite} "open -a /Applications/Utilities/Terminal.app $NGSuite_RESOURCES/bin/startup.sh\n")
|
||||
install(PROGRAMS ${mac_ngsuite} DESTINATION bin)
|
||||
|
||||
set(mac_plist ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
|
||||
file(WRITE ${mac_plist} "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
|
||||
file(APPEND ${mac_plist} "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n")
|
||||
file(APPEND ${mac_plist} "<plist version=\"1.0\">\n")
|
||||
file(APPEND ${mac_plist} "<dict>\n")
|
||||
file(APPEND ${mac_plist} " <key>CFBundleDevelopmentRegion</key>\n")
|
||||
file(APPEND ${mac_plist} " <string>English</string>\n")
|
||||
file(APPEND ${mac_plist} " <key>CFBundleExecutable</key>\n")
|
||||
file(APPEND ${mac_plist} " <string>NGSuite</string>\n")
|
||||
file(APPEND ${mac_plist} "</dict>\n")
|
||||
file(APPEND ${mac_plist} "</plist>\n")
|
||||
endif(APPLE)
|
||||
|
||||
include(CPack)
|
||||
|
Loading…
Reference in New Issue
Block a user