Skip to content

Commit

Permalink
SConstruct : Install Windows DLLs to bin
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmehl committed Nov 14, 2024
1 parent ec23650 commit a7d39bc
Showing 1 changed file with 46 additions and 24 deletions.
70 changes: 46 additions & 24 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,12 @@ o.Add(
"$INSTALL_PREFIX/lib/$IECORE_NAME",
)

o.Add(
"INSTALL_BIN_NAME",
"The name under which to install the binaries. Only used on Windows.",
"$INSTALL_PREFIX/bin/$IECORE_NAME",
)

o.Add(
"INSTALL_PYTHONLIB_NAME",
"The name under which to install the python library. This can "
Expand Down Expand Up @@ -1742,11 +1748,13 @@ corePythonScripts = glob.glob( "python/IECore/*.py" )
coreLibrary = coreEnv.SharedLibrary( "lib/" + os.path.basename( coreEnv.subst( "$INSTALL_LIB_NAME" ) ), coreSources )
coreLibraryInstall = coreEnv.Install( os.path.dirname( coreEnv.subst( "$INSTALL_LIB_NAME" ) ), coreLibrary )
coreEnv.NoCache( coreLibraryInstall )
coreLibraryMoveBinary = coreEnv.Command( coreEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), coreEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
coreEnv.NoCache( coreLibraryMoveBinary )
if env["INSTALL_CREATE_SYMLINKS"] :
coreEnv.AddPostAction( coreLibraryInstall, lambda target, source, env : makeLibSymLinks( coreEnv ) )
coreEnv.Alias( "install", [ coreLibraryInstall ] )
coreEnv.Alias( "installCore", [ coreLibraryInstall ] )
coreEnv.Alias( "installLib", [ coreLibraryInstall ] )
coreEnv.Alias( "install", [ coreLibraryInstall ] + [ coreLibraryMoveBinary ] if coreEnv["PLATFORM"] == "win32" else [] )
coreEnv.Alias( "installCore", [ coreLibraryInstall ] + [ coreLibraryMoveBinary ] if coreEnv["PLATFORM"] == "win32" else [] )
coreEnv.Alias( "installLib", [ coreLibraryInstall ] + [ coreLibraryMoveBinary ] if coreEnv["PLATFORM"] == "win32" else [] )

# headers

Expand Down Expand Up @@ -1778,11 +1786,13 @@ corePythonEnv.Append( LIBS = os.path.basename( coreEnv.subst( "$INSTALL_LIB_NAME
corePythonLibrary = corePythonEnv.SharedLibrary( "lib/" + os.path.basename( corePythonEnv.subst( "$INSTALL_PYTHONLIB_NAME" ) ), corePythonSources )
corePythonLibraryInstall = corePythonEnv.Install( os.path.dirname( corePythonEnv.subst( "$INSTALL_PYTHONLIB_NAME" ) ), corePythonLibrary )
corePythonEnv.NoCache( corePythonLibraryInstall )
corePythonLibraryMoveBinary = coreEnv.Command( corePythonEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), corePythonEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
corePythonEnv.NoCache( corePythonLibraryMoveBinary )
if env["INSTALL_CREATE_SYMLINKS"] :
corePythonEnv.AddPostAction( corePythonLibraryInstall, lambda target, source, env : makeLibSymLinks( corePythonEnv, libNameVar="INSTALL_PYTHONLIB_NAME" ) )
corePythonEnv.Alias( "install", [ corePythonLibraryInstall ] )
corePythonEnv.Alias( "installCore", [ corePythonLibraryInstall ] )
corePythonEnv.Alias( "installLib", [ corePythonLibraryInstall ] )
corePythonEnv.Alias( "install", [ corePythonLibraryInstall ] + [ corePythonLibraryMoveBinary ] if corePythonEnv["PLATFORM"] == "win32" else [] )
corePythonEnv.Alias( "installCore", [ corePythonLibraryInstall ] + [ corePythonLibraryMoveBinary ] if corePythonEnv["PLATFORM"] == "win32" else [] )
corePythonEnv.Alias( "installLib", [ corePythonLibraryInstall ] + [ corePythonLibraryMoveBinary ] if corePythonEnv["PLATFORM"] == "win32" else [] )

# python headers
pythonHeaderInstall = coreEnv.Install( "$INSTALL_HEADER_DIR/IECorePython", corePythonHeaders )
Expand Down Expand Up @@ -1917,11 +1927,13 @@ if doConfigure :
imageLibrary = imageEnv.SharedLibrary( "lib/" + os.path.basename( imageEnv.subst( "$INSTALL_LIB_NAME" ) ), imageSources )
imageLibraryInstall = imageEnv.Install( os.path.dirname( imageEnv.subst( "$INSTALL_LIB_NAME" ) ), imageLibrary )
imageEnv.NoCache( imageLibraryInstall )
imageLibraryMoveBinary = imageEnv.Command( imageEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), imageEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
imageEnv.NoCache( imageLibraryMoveBinary )
if env[ "INSTALL_CREATE_SYMLINKS" ] :
imageEnv.AddPostAction( imageLibraryInstall, lambda target, source, env : makeLibSymLinks( imageEnv ) )
imageEnv.Alias( "install", imageLibraryInstall )
imageEnv.Alias( "installImage", imageLibraryInstall )
imageEnv.Alias( "installLib", [ imageLibraryInstall ] )
imageEnv.Alias( "install", [ imageLibraryInstall ] + [ imageLibraryMoveBinary ] if imageEnv["PLATFORM"] == "win32" else [] )
imageEnv.Alias( "installImage", [ imageLibraryInstall ] + [ imageLibraryMoveBinary ] if imageEnv["PLATFORM"] == "win32" else [])
imageEnv.Alias( "installLib", [ imageLibraryInstall ] + [ imageLibraryMoveBinary ] if imageEnv["PLATFORM"] == "win32" else [] )

# headers
imageHeaderInstall = imageEnv.Install( "$INSTALL_HEADER_DIR/IECoreImage", imageHeaders )
Expand Down Expand Up @@ -2007,11 +2019,13 @@ if doConfigure :
sceneLibrary = sceneEnv.SharedLibrary( "lib/" + os.path.basename( sceneEnv.subst( "$INSTALL_LIB_NAME" ) ), sceneSources )
sceneLibraryInstall = sceneEnv.Install( os.path.dirname( sceneEnv.subst( "$INSTALL_LIB_NAME" ) ), sceneLibrary )
sceneEnv.NoCache( sceneLibraryInstall )
sceneLibraryMoveBinary = sceneEnv.Command( sceneEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), sceneEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
sceneEnv.NoCache( sceneLibraryMoveBinary )
if env[ "INSTALL_CREATE_SYMLINKS" ] :
sceneEnv.AddPostAction( sceneLibraryInstall, lambda target, source, env : makeLibSymLinks( sceneEnv ) )
sceneEnv.Alias( "install", [ sceneLibraryInstall ] )
sceneEnv.Alias( "installScene", [ sceneLibraryInstall ] )
sceneEnv.Alias( "installSceneLib", [ sceneLibraryInstall ] )
sceneEnv.Alias( "install", [ sceneLibraryInstall ] + [ sceneLibraryMoveBinary ] if sceneEnv["PLATFORM"] == "win32" else [] )
sceneEnv.Alias( "installScene", [ sceneLibraryInstall ] + [ sceneLibraryMoveBinary ] if sceneEnv["PLATFORM"] == "win32" else [] )
sceneEnv.Alias( "installSceneLib", [ sceneLibraryInstall ] + [ sceneLibraryMoveBinary ] if sceneEnv["PLATFORM"] == "win32" else [] )

# headers
sceneHeaderInstall = sceneEnv.Install( "$INSTALL_HEADER_DIR/IECoreScene", sceneHeaders )
Expand Down Expand Up @@ -2106,11 +2120,13 @@ if doConfigure :
vdbLibrary = vdbEnv.SharedLibrary( "lib/" + os.path.basename( vdbEnv.subst( "$INSTALL_LIB_NAME" ) ), vdbSources )
vdbLibraryInstall = vdbEnv.Install( os.path.dirname( vdbEnv.subst( "$INSTALL_LIB_NAME" ) ), vdbLibrary )
vdbEnv.NoCache( vdbLibraryInstall )
vdbLibraryMoveBinary = vdbEnv.Command( vdbEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), vdbEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
vdbEnv.NoCache( vdbLibraryMoveBinary )
if env[ "INSTALL_CREATE_SYMLINKS" ] :
vdbEnv.AddPostAction( vdbLibraryInstall, lambda target, source, env : makeLibSymLinks( vdbEnv ) )
vdbEnv.Alias( "install", [ vdbLibraryInstall ] )
vdbEnv.Alias( "installVDB", [ vdbLibraryInstall ] )
vdbEnv.Alias( "installVDBLib", [ vdbLibraryInstall ] )
vdbEnv.Alias( "install", [ vdbLibraryInstall ] + [ vdbLibraryMoveBinary ] if vdbEnv["PLATFORM"] == "win32" else [] )
vdbEnv.Alias( "installVDB", [ vdbLibraryInstall ] + [ vdbLibraryMoveBinary ] if vdbEnv["PLATFORM"] == "win32" else [] )
vdbEnv.Alias( "installVDBLib", [ vdbLibraryInstall ] + [ vdbLibraryMoveBinary ] if vdbEnv["PLATFORM"] == "win32" else [] )

# headers
vdbHeaderInstall = sceneEnv.Install( "$INSTALL_HEADER_DIR/IECoreVDB", vdbHeaders )
Expand Down Expand Up @@ -2246,11 +2262,13 @@ if env["WITH_GL"] and doConfigure :
glLibrary = glEnv.SharedLibrary( "lib/" + os.path.basename( glEnv.subst( "$INSTALL_LIB_NAME" ) ), glSources )
glLibraryInstall = glEnv.Install( os.path.dirname( glEnv.subst( "$INSTALL_LIB_NAME" ) ), glLibrary )
glEnv.NoCache( glLibraryInstall )
glLibraryMoveBinary = glEnv.Command( glEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), glEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
glEnv.NoCache( glLibraryMoveBinary )
if env[ "INSTALL_CREATE_SYMLINKS" ] :
glEnv.AddPostAction( glLibraryInstall, lambda target, source, env : makeLibSymLinks( glEnv ) )
glEnv.Alias( "install", glLibraryInstall )
glEnv.Alias( "installGL", glLibraryInstall )
glEnv.Alias( "installLib", [ glLibraryInstall ] )
glEnv.Alias( "install", [ glLibraryInstall ] + [ glLibraryMoveBinary ] if glEnv["PLATFORM"] == "win32" else [] )
glEnv.Alias( "installGL", [ glLibraryInstall ] + [ glLibraryMoveBinary ] if glEnv["PLATFORM"] == "win32" else [] )
glEnv.Alias( "installLib", [ glLibraryInstall ] + [ glLibraryMoveBinary ] if glEnv["PLATFORM"] == "win32" else [] )

glHeaders = glob.glob( "include/IECoreGL/*.h" ) + glob.glob( "include/IECoreGL/*.inl" )
glHeaderInstall = glEnv.Install( "$INSTALL_HEADER_DIR/IECoreGL", glHeaders )
Expand Down Expand Up @@ -3133,11 +3151,13 @@ if doConfigure :
usdLibrary = usdEnv.SharedLibrary( "lib/" + os.path.basename( usdEnv.subst( "$INSTALL_USDLIB_NAME" ) ), usdSources )
usdLibraryInstall = usdEnv.Install( os.path.dirname( usdEnv.subst( "$INSTALL_USDLIB_NAME" ) ), usdLibrary )
usdEnv.NoCache( usdLibraryInstall )
usdLibraryMoveBinary = usdEnv.Command( usdEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), usdEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
usdEnv.NoCache( usdLibraryMoveBinary )
if env[ "INSTALL_CREATE_SYMLINKS" ] :
usdEnv.AddPostAction( usdLibraryInstall, lambda target, source, env : makeLibSymLinks( usdEnv ) )
usdEnv.Alias( "install", usdLibraryInstall )
usdEnv.Alias( "installUSD", usdLibraryInstall )
usdEnv.Alias( "installLib", [ usdLibraryInstall ] )
usdEnv.Alias( "install", [ usdLibraryInstall ] + [ usdLibraryMoveBinary ] if usdEnv["PLATFORM"] == "win32" else [] )
usdEnv.Alias( "installUSD", [ usdLibraryInstall ] + [ usdLibraryMoveBinary ] if usdEnv["PLATFORM"] == "win32" else [] )
usdEnv.Alias( "installLib", [ usdLibraryInstall ] + [ usdLibraryMoveBinary ] if usdEnv["PLATFORM"] == "win32" else [] )

# headers
usdHeaderInstall = usdEnv.Install( "$INSTALL_HEADER_DIR/IECoreUSD", usdHeaders )
Expand Down Expand Up @@ -3285,11 +3305,13 @@ if doConfigure :
alembicLibrary = alembicEnv.SharedLibrary( "lib/" + os.path.basename( alembicEnv.subst( "$INSTALL_ALEMBICLIB_NAME" ) ), alembicSources )
alembicLibraryInstall = alembicEnv.Install( os.path.dirname( alembicEnv.subst( "$INSTALL_ALEMBICLIB_NAME" ) ), alembicLibrary )
alembicEnv.NoCache( alembicLibraryInstall )
alembicLibraryMoveBinary = alembicEnv.Command( alembicEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), alembicEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
alembicEnv.NoCache( alembicLibraryMoveBinary )
if env[ "INSTALL_CREATE_SYMLINKS" ] :
alembicEnv.AddPostAction( alembicLibraryInstall, lambda target, source, env : makeLibSymLinks( alembicEnv ) )
alembicEnv.Alias( "install", alembicLibraryInstall )
alembicEnv.Alias( "installAlembic", alembicLibraryInstall )
alembicEnv.Alias( "installLib", [ alembicLibraryInstall ] )
alembicEnv.Alias( "install", [ alembicLibraryInstall ] + [ alembicLibraryMoveBinary ] if alembicEnv["PLATFORM"] == "win32" else [] )
alembicEnv.Alias( "installAlembic", [ alembicLibraryInstall ] + [ alembicLibraryMoveBinary ] if alembicEnv["PLATFORM"] == "win32" else [] )
alembicEnv.Alias( "installLib", [ alembicLibraryInstall ] + [ alembicLibraryMoveBinary ] if alembicEnv["PLATFORM"] == "win32" else [] )

# headers
alembicHeaderInstall = alembicEnv.Install( "$INSTALL_HEADER_DIR/IECoreAlembic", alembicHeaders )
Expand Down

0 comments on commit a7d39bc

Please sign in to comment.