Peter Kümmel wrote:
> attached a patch which reads the project filename from CMakeLists.txt
here a better patch:
first try <packagename>.sln, then parse CMakeLists.txt, then use slnBaseName.
Peter
Index: kdesettings-example.bat
===================================================================
--- kdesettings-example.bat (revision 1047621)
+++ kdesettings-example.bat (working copy)
@@ -144,6 +144,12 @@
rem for all other packages this option doesn't have any effect
rem set EMERGE_DEFAULTCATEGORY=kde-4.3
+
+rem This option configures CMake to generate Visual Studio solution files
instead of nmake files.
+rem set EMERGE_OPTION=cmake.useIDE=1
+
+
+
rem No editing should be necessary below this line (in an ideal world)
rem ##################################################################
Index: bin/BuildSystem/CMakeBuildSystem.py
===================================================================
--- bin/BuildSystem/CMakeBuildSystem.py (revision 1047621)
+++ bin/BuildSystem/CMakeBuildSystem.py (working copy)
@@ -96,10 +96,29 @@
os.putenv( "PATH", os.path.join( self.rootdir, self.envPath ) +
";" + os.getenv("PATH") )
if self.compiler() == "msvc2008" and self.subinfo.options.cmake.useIDE:
- if self.subinfo.options.make.slnBaseName:
- command = "start %s.sln" %
self.subinfo.options.make.slnBaseName
- else:
- command = "start %s.sln" % self.package
+ slnpackage = "%s.sln" % self.package
+ if os.path.exists(os.path.join(self.buildDir(),slnpackage)):
+ command = "vcbuild /M2 %s.sln \"Debug|Win32\"" % self.package
+ else:
+ topLevelCMakeList =
os.path.join(self.sourceDir(),"CMakeLists.txt")
+ if os.path.exists(topLevelCMakeList):
+ f = open(topLevelCMakeList,'r')
+ lines = f.read().splitlines()
+ f.close()
+ for line in lines:
+ if line.find("project(") > -1:
+ a = line.split("(")
+ a = a[1].split(")")
+ slnname = a[0].strip()
+ if slnname:
+ command = "vcbuild /M2 %s.sln \"Debug|Win32\"" % slnname
+ else:
+ if self.subinfo.options.make.slnBaseName:
+ command = "vcbuild /M2 %s.sln \"Debug|Win32\"" %
self.subinfo.options.make.slnBaseName
+ else:
+ msg = "No solution file found for package %s." %
self.package
+ utils.warning(msg)
+
else:
command = self.makeProgramm
@@ -122,14 +141,17 @@
if not self.noFast:
fastString = "/fast"
- if self.subinfo.options.install.useMakeToolForInstall == True:
- command = "%s DESTDIR=%s install%s" % ( self.makeProgramm,
self.installDir(), fastString )
+ if self.subinfo.options.install.useMakeToolForInstall == True:
+ if self.compiler() == "msvc2008" and
self.subinfo.options.cmake.useIDE:
+ command = "vcbuild INSTALL.vcproj \"Debug|Win32\""
+ else:
+ command = "%s DESTDIR=%s install%s" % ( self.makeProgramm,
self.installDir(), fastString )
else:
command = "cmake -DCMAKE_INSTALL_PREFIX=%s -P cmake_install.cmake"
% self.installDir()
self.system( command, "install" )
- if self.subinfo.options.install.useMakeToolForInstall == True:
+ if self.subinfo.options.install.useMakeToolForInstall == True and not
self.subinfo.options.cmake.useIDE:
utils.fixCmakeImageDir( self.installDir(),
self.mergeDestinationDir() )
return True
_______________________________________________
Kde-windows mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-windows