Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
Pages: 1
How to build Scol vm with cmake?
First, here the recommended directory layout for your local copy:
D:/Scol/ScolBuild
D:/Scol/trunk
Download cmake from http://www.cmake.org/cmake/resources/software.html (at least v2.8), and install it.
Next, if you are under ms windows, go to the "trunk/dependencies" dir, and execute "setWindowsSearchPaths.bat"(you may need to exec it as with admin mode), this will setup some environment variable that will help cmake to find the scol dependencies.
Verify in windows environment variable dialog box (params/system) that you have a "SCOL_DEPENDENCIES_PATH" variable, pointing to the "dependencies" dir.
Once this done, you can run cmake gui. The following window appears:
In the "where is the source code" textbox, you will have to... tell where the global cmake script is, in my case, it's "D:/Scol/trunk/scol" (not "D:/Scol/trunk" !!!).
And in "where to build the binaries" textbox, indicate a build directory (for me it's "D:/Scol/ScolBuild", if it not exists, then cmake will create it for you). All the projects or makefiles will be generated here, that's means that the "trunk" directory stay clean, containing only the source code.
Next, hit the "configure" button. The first time you feed a new "build directory", cmake will ask you wich "target" (or compilation environment) you want to use. I have msvc 2008 on my laptop, so lets select that.
If all the dependencies are found (only zlib at the moment where i write those lines, so no problem normaly), a little message will indicate it (else you'll have some weird red messages, if that happens, please report on the forum).
Check the additionnals option that you want to set for your project (not much can be selected for the moment, as vm as no builds options), and hit the "configure" button one more time.
The non-configurated options that were red on the first hit are now setted, and you can now generate your projects files by hitting the "generate" button.
A message will tell you if everything was ok:
Finally, go to your build dir, and launch your solution file (""). You now just have to build the library the same way as usual.
Hope thats help!
Nodrev.
ps: only tested on windows, but linux developments should be easier now...
pps: you may see "doxygen" as a dependency in the screenshots, it's an "optional dependency", so you won't have to install it if you don't have it. And it's not used for the moment...
Offline
Hello,
Under GNU/Linux kernel 2.6.32.26, gcc 4.4.3, cmake 2.8.1
Ok, no problem to "Configure" but i have an error when i generate the project :
CMake Error in vm/kernel5/CMakeLists.txt:
Cannot find source file "scolFindData.cpp".
In vm/kernel5/CMakeLists.txt file (line 215 - 221)
elseif (UNIX)
set(OS_SPECIFIC_HEADER_FILES
include/scolFindData.h
)
set(OS_SPECIFIC_SOURCE_FILES
src/scolFindData.cpp
)
if i comment this two files, ok, i can generate the project. I tried to search them, but no success.
After, a make command, the compilation begins ...
A lot of code are for Windows. So, we still have work !! ;-)
iri
Offline
Hi iri,
I think that maybe you have miss a point: it's a cmake conversion, not a unix conversion, this last point still have to be done.
"scolFindData" are two files i wrote for ubuntu (in fact, i took them from ogre), and they simply 'emulate' two or tree function that do not exist within linux.
Anyway, I'll post those files asap, to let you try the unix compilation (but i'm pretty sure it won't work without modifications, as i saw when converting to cmake some windows api calls not within "#if SCOL_PLATFORM == SCOL_PLATFORM_WINDOWS").
Nodrev
Offline
The files are now on svn.
Nodrev
Offline
Hi,
It's cleaner to use "#if SCOL_PLATFORM == SCOL_PLATFORM_WINDOWS", look at the platform detection macro in "scolPlatform.h".
You can add a platform if necessary there if you want.
Nodrev
Offline
Hi everybody.
Lib 2D OS as been ported to Cmake.
To make it compile, you'll have to update trunk/dependencies, trunk/scol (and trunk/tools too).
You'll need to re-run setWindowsSearchPaths.bat, as there's new dependencies. I added a small text file to explain how to compile the dependencies if you are using another msvs version than 2008 (there's pre-compiled libs for msvc 2008, so no need to build them).
<edit>As Arkeon noticed me, you may have to "Delete cache" from cmake menu before generating the project</edit>
Next, launch cmake as usual.
PS: As lib2dOS is windows only, it will not appears on others platforms, but i wish i do not broke cmake scripts for unix.
Last edited by Nodrev (29-Nov-2010 09:19:50)
Offline
Hi,
@rem set Zlib library search path
@echo Registering zlib registry entry to "%SCOL_DEPENDENCIES_PATH%/zlib"
REG ADD HKLM\SOFTWARE\GnuWin32\Zlib /v InstallPath /d "%currentPath%/zlib" /f
REG ADD HKLM\SOFTWARE\Wow6432Node\GnuWin32\Zlib /v InstallPath /d "%currentPath%/zlib" /f
why zlib must write reg?
Doesn't it can be like png and jpeg lib?
I prefer this : patch file download
Index: dependencies/setWindowsSearchPaths.bat
===================================================================
--- dependencies/setWindowsSearchPaths.bat (revision 1915)
+++ dependencies/setWindowsSearchPaths.bat (working copy)
@@ -23,9 +23,9 @@
@rem @setx NEWTON_ROOT "%currentPath%/Newton" -m
@rem set Zlib library search path
-@echo Registering zlib registry entry to "%SCOL_DEPENDENCIES_PATH%/zlib"
-REG ADD HKLM\SOFTWARE\GnuWin32\Zlib /v InstallPath /d "%currentPath%/zlib" /f
-REG ADD HKLM\SOFTWARE\Wow6432Node\GnuWin32\Zlib /v InstallPath /d "%currentPath%/zlib" /f
+@rem @echo Registering zlib registry entry to "%SCOL_DEPENDENCIES_PATH%/zlib"
+@rem REG ADD HKLM\SOFTWARE\GnuWin32\Zlib /v InstallPath /d "%currentPath%/zlib" /f
+@rem REG ADD HKLM\SOFTWARE\Wow6432Node\GnuWin32\Zlib /v InstallPath /d "%currentPath%/zlib" /f
@echo All Done!
@pause
Index: scol/CMake/ScolDependencies.cmake
===================================================================
--- scol/CMake/ScolDependencies.cmake (revision 1915)
+++ scol/CMake/ScolDependencies.cmake (working copy)
@@ -23,6 +23,8 @@
${ENV_SCOL_DEPENDENCIES_PATH}/libpng/lib
${ENV_SCOL_DEPENDENCIES_PATH}/libjpeg
${ENV_SCOL_DEPENDENCIES_PATH}/libjpeg/Release
+ ${ENV_SCOL_DEPENDENCIES_PATH}/zlib/include
+ ${ENV_SCOL_DEPENDENCIES_PATH}/zlib/lib
)
set(Scol_DEP_SEARCH_PATH
Last edited by kenshin1987 (2-Dec-2010 06:25:49)
Offline
Hi again ^^
Zlib needs to write on the registry, cause that's the way cmake found it:
Each dependency is finded using a cmake command (check Scol/CMake/ScolDependencies.cmake): find_package(LibName)
This command use a script file named FindLibName.cmake to check where the dependency files (headers and .lib) should be found.
Lots of Findxxx scripts are installed with cmake (in Programs Files\Cmake\Share\Module if i remind well), so when they exists, i use cmake provided scripts.
If you open the FindZLIB file you'll see that it use pkglib to find zlib on unix platforms, and the registry to find it on Windows (not very clean, i must accept that, but it's the cmake official zlib Find script).
Hopes my explications are clear ^^
PS: most of other cmake "Find scripts" provide an aenvironment variable to find the root directory for a dependency, but FindJPEG.cmake and FindPNG.cmake do not provided some, so, it's mostly a hack to add "${ENV_SCOL_DEPENDENCIES_PATH}/libjpeg" to the scol cmake search path, that's not the cmake "normal way" of doing.
Last edited by Nodrev (2-Dec-2010 22:54:40)
Offline
Scol kernel now compile on Linux (in fact it's about one month it's done, see http://www.scolring.org/forum/viewtopic … 1098#p1098), using cmake.
Tested on Ubuntu only. I downgraded the cmake required version to 2.6, as the actual Ubuntu distribution only provide this version.
I'm working currently on a multi-platform "Scol.exe", should be ready in a couple of week I think (not much time to work on it...).
Last edited by Nodrev (4-May-2011 23:33:52)
Offline
Hello
Well, to compile Scol with Cmake on Win XP SP3 (virtualized) : kernel and lib2dOS only
- I download the jpeg library (http://gnuwin32.sourceforge.net/packages/jpeg.htm) and png library (http://gnuwin32.sourceforge.net/packages/libpng.htm). I copy them into the dependancies directory.
- I reinstall Cmake (2.8.4 at this date) : http://www.cmake.org/cmake/resources/software.html
- I relaunch the setWindowsSearchPaths.bat (but maybe not really useful ?).
Warning : setx is unknown on XP. So, i install this addon http://www.microsoft.com/downloads/en/d … en&pf=true
- I click on Configure button
I have some errors (differents files not found). Then, i check the « Show Advanced Values » check box on the top right of cmake window.
I search the key (e.g. JPEG_INCLUDE_DIR and more) and i give the good path (at right).
I reconfigure, it should be ok.
- I click on Generate button.
It's ok.
I open these projects with MS Visual Studio C++ Express 2010 (free of charge, not free software), it's ok.
Compilation is ok too.
Offline
For windows, I thinks that jpeg dependencies are in "dependencies" directory, no need to download, no?
Ok for setX, but, nowadays, who develops on xp (apart you ^^)? Aniway, that's good that you found a workaround, the other solution is to add manually the environment variables
Anyway, good to know that it works on xp too.
Offline
No, this jpeg dependancies is not good.
For XP, i have a license, that's all !
Not for Vista or 7.
To install VC++ Express 2010, a registered license is required (not an evaluation Windows version with 30/120 day !...), so when the code use specific MS library, flags, etc (not free, of course !), no choice.
Otherwise, with Code::Blocks and MingW (free softwares !) and a standard / multiplateform code, no problem
Offline
Hi,
For information, I took the time to convert some plugins to cmake system, so do not expect to find them in "trunk/plugins" directory anymore, they were moved to "trunk/scol/plugins":
- Emotiv's Epoc
- Data Glove 5DT
- Joypad
- Nonin's WristOx2 medical pulse/oxymeter
- Template (the tuto plugin)
Of course, the cmake scripts detects automatically dependencies that are needed and where they are (tested on win32 & win64, but has i saw MsWindows related code in all the listed library, they won't compile "as this" on linux).
They are not the most useful plugins, but that's a start (30 plugins left )!
Offline
Let me know if you need some help, one of the aspect of this conversion is to get rid of the "scol sdk" include files (not the scol_sdk directory, i'm talking about the scol sdk setup with 3 ugly includes files in it), and using the file from the vm. This way we are sure that the structures/defines shared along the plugins and the vm are consistent (the "scol sdk" includes is actually made from peace of code extracted from multiple vm include files, that's not "clean").
Last edited by Nodrev (31-May-2012 17:49:19)
Offline
Extra motivation tonight, one more converted, and a relatively big one, lib2d ('graphics'). This one have no Ms Windows dependencies at all, it will be easy to convert it for linux (but that's not for now, sorry ).
The redmine's svn links are up to date too.
Offline
For the GNU/Linux version :
The 2dgraphics library needs the 2d os graphics (not for the compilation but for use). The 2d os graphic is full obsolete because it based on GTK1.2.
My libGTK library is based on GTK+ 2 and 3 fully compatible Windows and Linux. It could replaced in the new Scol code these two libraries but i have much works to do
About the "Scol sdk", i should see this. I got mine, based on C. This does several times that i should compare them ...
Currently, i make the new Scolring, but i hope soon resume my todo list
Thanks for your work !
PS : my code is not updated in the svn
Offline
Pages: 1