Skip to content

Commit a7d39bc

Browse files
committed
SConstruct : Install Windows DLLs to bin
1 parent ec23650 commit a7d39bc

File tree

1 file changed

+46
-24
lines changed

1 file changed

+46
-24
lines changed

SConstruct

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,12 @@ o.Add(
623623
"$INSTALL_PREFIX/lib/$IECORE_NAME",
624624
)
625625

626+
o.Add(
627+
"INSTALL_BIN_NAME",
628+
"The name under which to install the binaries. Only used on Windows.",
629+
"$INSTALL_PREFIX/bin/$IECORE_NAME",
630+
)
631+
626632
o.Add(
627633
"INSTALL_PYTHONLIB_NAME",
628634
"The name under which to install the python library. This can "
@@ -1742,11 +1748,13 @@ corePythonScripts = glob.glob( "python/IECore/*.py" )
17421748
coreLibrary = coreEnv.SharedLibrary( "lib/" + os.path.basename( coreEnv.subst( "$INSTALL_LIB_NAME" ) ), coreSources )
17431749
coreLibraryInstall = coreEnv.Install( os.path.dirname( coreEnv.subst( "$INSTALL_LIB_NAME" ) ), coreLibrary )
17441750
coreEnv.NoCache( coreLibraryInstall )
1751+
coreLibraryMoveBinary = coreEnv.Command( coreEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), coreEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
1752+
coreEnv.NoCache( coreLibraryMoveBinary )
17451753
if env["INSTALL_CREATE_SYMLINKS"] :
17461754
coreEnv.AddPostAction( coreLibraryInstall, lambda target, source, env : makeLibSymLinks( coreEnv ) )
1747-
coreEnv.Alias( "install", [ coreLibraryInstall ] )
1748-
coreEnv.Alias( "installCore", [ coreLibraryInstall ] )
1749-
coreEnv.Alias( "installLib", [ coreLibraryInstall ] )
1755+
coreEnv.Alias( "install", [ coreLibraryInstall ] + [ coreLibraryMoveBinary ] if coreEnv["PLATFORM"] == "win32" else [] )
1756+
coreEnv.Alias( "installCore", [ coreLibraryInstall ] + [ coreLibraryMoveBinary ] if coreEnv["PLATFORM"] == "win32" else [] )
1757+
coreEnv.Alias( "installLib", [ coreLibraryInstall ] + [ coreLibraryMoveBinary ] if coreEnv["PLATFORM"] == "win32" else [] )
17501758

17511759
# headers
17521760

@@ -1778,11 +1786,13 @@ corePythonEnv.Append( LIBS = os.path.basename( coreEnv.subst( "$INSTALL_LIB_NAME
17781786
corePythonLibrary = corePythonEnv.SharedLibrary( "lib/" + os.path.basename( corePythonEnv.subst( "$INSTALL_PYTHONLIB_NAME" ) ), corePythonSources )
17791787
corePythonLibraryInstall = corePythonEnv.Install( os.path.dirname( corePythonEnv.subst( "$INSTALL_PYTHONLIB_NAME" ) ), corePythonLibrary )
17801788
corePythonEnv.NoCache( corePythonLibraryInstall )
1789+
corePythonLibraryMoveBinary = coreEnv.Command( corePythonEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), corePythonEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
1790+
corePythonEnv.NoCache( corePythonLibraryMoveBinary )
17811791
if env["INSTALL_CREATE_SYMLINKS"] :
17821792
corePythonEnv.AddPostAction( corePythonLibraryInstall, lambda target, source, env : makeLibSymLinks( corePythonEnv, libNameVar="INSTALL_PYTHONLIB_NAME" ) )
1783-
corePythonEnv.Alias( "install", [ corePythonLibraryInstall ] )
1784-
corePythonEnv.Alias( "installCore", [ corePythonLibraryInstall ] )
1785-
corePythonEnv.Alias( "installLib", [ corePythonLibraryInstall ] )
1793+
corePythonEnv.Alias( "install", [ corePythonLibraryInstall ] + [ corePythonLibraryMoveBinary ] if corePythonEnv["PLATFORM"] == "win32" else [] )
1794+
corePythonEnv.Alias( "installCore", [ corePythonLibraryInstall ] + [ corePythonLibraryMoveBinary ] if corePythonEnv["PLATFORM"] == "win32" else [] )
1795+
corePythonEnv.Alias( "installLib", [ corePythonLibraryInstall ] + [ corePythonLibraryMoveBinary ] if corePythonEnv["PLATFORM"] == "win32" else [] )
17861796

17871797
# python headers
17881798
pythonHeaderInstall = coreEnv.Install( "$INSTALL_HEADER_DIR/IECorePython", corePythonHeaders )
@@ -1917,11 +1927,13 @@ if doConfigure :
19171927
imageLibrary = imageEnv.SharedLibrary( "lib/" + os.path.basename( imageEnv.subst( "$INSTALL_LIB_NAME" ) ), imageSources )
19181928
imageLibraryInstall = imageEnv.Install( os.path.dirname( imageEnv.subst( "$INSTALL_LIB_NAME" ) ), imageLibrary )
19191929
imageEnv.NoCache( imageLibraryInstall )
1930+
imageLibraryMoveBinary = imageEnv.Command( imageEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), imageEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
1931+
imageEnv.NoCache( imageLibraryMoveBinary )
19201932
if env[ "INSTALL_CREATE_SYMLINKS" ] :
19211933
imageEnv.AddPostAction( imageLibraryInstall, lambda target, source, env : makeLibSymLinks( imageEnv ) )
1922-
imageEnv.Alias( "install", imageLibraryInstall )
1923-
imageEnv.Alias( "installImage", imageLibraryInstall )
1924-
imageEnv.Alias( "installLib", [ imageLibraryInstall ] )
1934+
imageEnv.Alias( "install", [ imageLibraryInstall ] + [ imageLibraryMoveBinary ] if imageEnv["PLATFORM"] == "win32" else [] )
1935+
imageEnv.Alias( "installImage", [ imageLibraryInstall ] + [ imageLibraryMoveBinary ] if imageEnv["PLATFORM"] == "win32" else [])
1936+
imageEnv.Alias( "installLib", [ imageLibraryInstall ] + [ imageLibraryMoveBinary ] if imageEnv["PLATFORM"] == "win32" else [] )
19251937

19261938
# headers
19271939
imageHeaderInstall = imageEnv.Install( "$INSTALL_HEADER_DIR/IECoreImage", imageHeaders )
@@ -2007,11 +2019,13 @@ if doConfigure :
20072019
sceneLibrary = sceneEnv.SharedLibrary( "lib/" + os.path.basename( sceneEnv.subst( "$INSTALL_LIB_NAME" ) ), sceneSources )
20082020
sceneLibraryInstall = sceneEnv.Install( os.path.dirname( sceneEnv.subst( "$INSTALL_LIB_NAME" ) ), sceneLibrary )
20092021
sceneEnv.NoCache( sceneLibraryInstall )
2022+
sceneLibraryMoveBinary = sceneEnv.Command( sceneEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), sceneEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
2023+
sceneEnv.NoCache( sceneLibraryMoveBinary )
20102024
if env[ "INSTALL_CREATE_SYMLINKS" ] :
20112025
sceneEnv.AddPostAction( sceneLibraryInstall, lambda target, source, env : makeLibSymLinks( sceneEnv ) )
2012-
sceneEnv.Alias( "install", [ sceneLibraryInstall ] )
2013-
sceneEnv.Alias( "installScene", [ sceneLibraryInstall ] )
2014-
sceneEnv.Alias( "installSceneLib", [ sceneLibraryInstall ] )
2026+
sceneEnv.Alias( "install", [ sceneLibraryInstall ] + [ sceneLibraryMoveBinary ] if sceneEnv["PLATFORM"] == "win32" else [] )
2027+
sceneEnv.Alias( "installScene", [ sceneLibraryInstall ] + [ sceneLibraryMoveBinary ] if sceneEnv["PLATFORM"] == "win32" else [] )
2028+
sceneEnv.Alias( "installSceneLib", [ sceneLibraryInstall ] + [ sceneLibraryMoveBinary ] if sceneEnv["PLATFORM"] == "win32" else [] )
20152029

20162030
# headers
20172031
sceneHeaderInstall = sceneEnv.Install( "$INSTALL_HEADER_DIR/IECoreScene", sceneHeaders )
@@ -2106,11 +2120,13 @@ if doConfigure :
21062120
vdbLibrary = vdbEnv.SharedLibrary( "lib/" + os.path.basename( vdbEnv.subst( "$INSTALL_LIB_NAME" ) ), vdbSources )
21072121
vdbLibraryInstall = vdbEnv.Install( os.path.dirname( vdbEnv.subst( "$INSTALL_LIB_NAME" ) ), vdbLibrary )
21082122
vdbEnv.NoCache( vdbLibraryInstall )
2123+
vdbLibraryMoveBinary = vdbEnv.Command( vdbEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), vdbEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
2124+
vdbEnv.NoCache( vdbLibraryMoveBinary )
21092125
if env[ "INSTALL_CREATE_SYMLINKS" ] :
21102126
vdbEnv.AddPostAction( vdbLibraryInstall, lambda target, source, env : makeLibSymLinks( vdbEnv ) )
2111-
vdbEnv.Alias( "install", [ vdbLibraryInstall ] )
2112-
vdbEnv.Alias( "installVDB", [ vdbLibraryInstall ] )
2113-
vdbEnv.Alias( "installVDBLib", [ vdbLibraryInstall ] )
2127+
vdbEnv.Alias( "install", [ vdbLibraryInstall ] + [ vdbLibraryMoveBinary ] if vdbEnv["PLATFORM"] == "win32" else [] )
2128+
vdbEnv.Alias( "installVDB", [ vdbLibraryInstall ] + [ vdbLibraryMoveBinary ] if vdbEnv["PLATFORM"] == "win32" else [] )
2129+
vdbEnv.Alias( "installVDBLib", [ vdbLibraryInstall ] + [ vdbLibraryMoveBinary ] if vdbEnv["PLATFORM"] == "win32" else [] )
21142130

21152131
# headers
21162132
vdbHeaderInstall = sceneEnv.Install( "$INSTALL_HEADER_DIR/IECoreVDB", vdbHeaders )
@@ -2246,11 +2262,13 @@ if env["WITH_GL"] and doConfigure :
22462262
glLibrary = glEnv.SharedLibrary( "lib/" + os.path.basename( glEnv.subst( "$INSTALL_LIB_NAME" ) ), glSources )
22472263
glLibraryInstall = glEnv.Install( os.path.dirname( glEnv.subst( "$INSTALL_LIB_NAME" ) ), glLibrary )
22482264
glEnv.NoCache( glLibraryInstall )
2265+
glLibraryMoveBinary = glEnv.Command( glEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), glEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
2266+
glEnv.NoCache( glLibraryMoveBinary )
22492267
if env[ "INSTALL_CREATE_SYMLINKS" ] :
22502268
glEnv.AddPostAction( glLibraryInstall, lambda target, source, env : makeLibSymLinks( glEnv ) )
2251-
glEnv.Alias( "install", glLibraryInstall )
2252-
glEnv.Alias( "installGL", glLibraryInstall )
2253-
glEnv.Alias( "installLib", [ glLibraryInstall ] )
2269+
glEnv.Alias( "install", [ glLibraryInstall ] + [ glLibraryMoveBinary ] if glEnv["PLATFORM"] == "win32" else [] )
2270+
glEnv.Alias( "installGL", [ glLibraryInstall ] + [ glLibraryMoveBinary ] if glEnv["PLATFORM"] == "win32" else [] )
2271+
glEnv.Alias( "installLib", [ glLibraryInstall ] + [ glLibraryMoveBinary ] if glEnv["PLATFORM"] == "win32" else [] )
22542272

22552273
glHeaders = glob.glob( "include/IECoreGL/*.h" ) + glob.glob( "include/IECoreGL/*.inl" )
22562274
glHeaderInstall = glEnv.Install( "$INSTALL_HEADER_DIR/IECoreGL", glHeaders )
@@ -3133,11 +3151,13 @@ if doConfigure :
31333151
usdLibrary = usdEnv.SharedLibrary( "lib/" + os.path.basename( usdEnv.subst( "$INSTALL_USDLIB_NAME" ) ), usdSources )
31343152
usdLibraryInstall = usdEnv.Install( os.path.dirname( usdEnv.subst( "$INSTALL_USDLIB_NAME" ) ), usdLibrary )
31353153
usdEnv.NoCache( usdLibraryInstall )
3154+
usdLibraryMoveBinary = usdEnv.Command( usdEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), usdEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
3155+
usdEnv.NoCache( usdLibraryMoveBinary )
31363156
if env[ "INSTALL_CREATE_SYMLINKS" ] :
31373157
usdEnv.AddPostAction( usdLibraryInstall, lambda target, source, env : makeLibSymLinks( usdEnv ) )
3138-
usdEnv.Alias( "install", usdLibraryInstall )
3139-
usdEnv.Alias( "installUSD", usdLibraryInstall )
3140-
usdEnv.Alias( "installLib", [ usdLibraryInstall ] )
3158+
usdEnv.Alias( "install", [ usdLibraryInstall ] + [ usdLibraryMoveBinary ] if usdEnv["PLATFORM"] == "win32" else [] )
3159+
usdEnv.Alias( "installUSD", [ usdLibraryInstall ] + [ usdLibraryMoveBinary ] if usdEnv["PLATFORM"] == "win32" else [] )
3160+
usdEnv.Alias( "installLib", [ usdLibraryInstall ] + [ usdLibraryMoveBinary ] if usdEnv["PLATFORM"] == "win32" else [] )
31413161

31423162
# headers
31433163
usdHeaderInstall = usdEnv.Install( "$INSTALL_HEADER_DIR/IECoreUSD", usdHeaders )
@@ -3285,11 +3305,13 @@ if doConfigure :
32853305
alembicLibrary = alembicEnv.SharedLibrary( "lib/" + os.path.basename( alembicEnv.subst( "$INSTALL_ALEMBICLIB_NAME" ) ), alembicSources )
32863306
alembicLibraryInstall = alembicEnv.Install( os.path.dirname( alembicEnv.subst( "$INSTALL_ALEMBICLIB_NAME" ) ), alembicLibrary )
32873307
alembicEnv.NoCache( alembicLibraryInstall )
3308+
alembicLibraryMoveBinary = alembicEnv.Command( alembicEnv.subst( "$INSTALL_BIN_NAME$SHLIBSUFFIX" ), alembicEnv.subst( "$INSTALL_LIB_NAME$SHLIBSUFFIX" ), Move( "$TARGET", "$SOURCE" ) )
3309+
alembicEnv.NoCache( alembicLibraryMoveBinary )
32883310
if env[ "INSTALL_CREATE_SYMLINKS" ] :
32893311
alembicEnv.AddPostAction( alembicLibraryInstall, lambda target, source, env : makeLibSymLinks( alembicEnv ) )
3290-
alembicEnv.Alias( "install", alembicLibraryInstall )
3291-
alembicEnv.Alias( "installAlembic", alembicLibraryInstall )
3292-
alembicEnv.Alias( "installLib", [ alembicLibraryInstall ] )
3312+
alembicEnv.Alias( "install", [ alembicLibraryInstall ] + [ alembicLibraryMoveBinary ] if alembicEnv["PLATFORM"] == "win32" else [] )
3313+
alembicEnv.Alias( "installAlembic", [ alembicLibraryInstall ] + [ alembicLibraryMoveBinary ] if alembicEnv["PLATFORM"] == "win32" else [] )
3314+
alembicEnv.Alias( "installLib", [ alembicLibraryInstall ] + [ alembicLibraryMoveBinary ] if alembicEnv["PLATFORM"] == "win32" else [] )
32933315

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

0 commit comments

Comments
 (0)