zathizh / rcf-cpp

Automatically exported from code.google.com/p/rcf-cpp
0 stars 0 forks source link

Cmake aproach - Automated compiled library installer #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Jarl

I´m Miguel Penteado from FCA UNESP University in Brazil, Botucatu city, 
São Paulo province.

 I try RFC in my Master Degree Project software, Aton System [do not to 
confuse it with Atom], a Solar Radiometry OpenSource Software. 

So, i had use cmake 2.6 to create an automated library install process for 
windows and make library more popular in Brazil. 

before continue you will need to install

Cmake 2.6 
http://www.cmake.org/HTML/Download.html

and NULLSOFT NSIS
http://nsis.sourceforge.net/Download

(This will should work in Posix too, with some adjust.)

# What is modified

The packet RCF-0.9d-P1 has in it this directory structure:

              |----demo--- .... 
              |
              |               |----RCF-- "Headers"
              |----include----|
              |               |----SF-- "Headers"
              |
              |                 |---RCF--- "Compilable code" ->*RCF.cpp*
RCF-0.9d-P1---|----src----------|
              |                 |---SF---- "Compilable code" ->*SF.cpp*
              |
              |
              |----test---------....
              |

so i add the VC into tree (that contain Visual C++ 2009 project generated 
by cMake).

              |----demo--- .... 
              |
              |               |----RCF-- "Headers"
              |----include----|
              |               |----SF-- "Headers"
              |
              |                 |---RCF--- "Compilable code" ->*RCF.cpp*
RCF-0.9d-P1---|----src----------|
              |                 |---SF---- "Compilable code" ->*SF.cpp*
              |
              |
              |----vc---- "Cmake generated Visual c++ Project "
              |
              |----test---------....
              |

And include cmalists.txt (that will guide Cmake project creation) into 
directory tree like next:

                              |----demo--- .... 
                              |
                              |               |----RCF-- 
                              |----include----|
                              |               |----SF-- 
                              |
                              |                    |-RCF-CmakeLists.txt 
RCF-0.9d-P1--CmakeLists.txt---|-src-CmakeLists.txt-|
                              |                    |-SF--CmakeLists.txt 
                              |
                              |
                              |----vc---- 
                              |
                              |----test---------....
                              |

# What you need to do:
if you want to build package installer only 
  1- You need Visual c++ 8 (2009) installed 
  2- go into ..\RCF-0.9d-P1\vc\
  3- open RCF.sln project
  4- Build subproject install
  5- Build subproject PACKAGE
  6- RCF-0.9d.0-win32.exe will be created
  7- install it

if you want to rebuild c++ visual studio package project 
  1- Open Cmake for windows
  2- point "Where is source code" to 
   (your_unpack_source_dir)\RCF-0.9d-P1\
  3- point "Where to build binaries" to 
   (your_unpack_source_dir)\RCF-0.9d-P1\vc\

  press configure button 2 or 3 times (ignore warnings)
  When OK button is enables, prees it

  4- go into ..\RCF-0.9d-P1\vc\
  5- open RCF.sln project
  6- Build subproject install
  7- Build subproject PACKAGE
  8- RCF-0.9d.0-win32.exe will be created
  9- install it

Then, this will generate a c++ project for a binary package that will 
install this tree into Win32 structure:

                              |----demo--- .... 
                              |
                              |               |----RCF-- "*.hpp"
                              |----include----|
                              |               |----SF-- "*.hpp"
                              |
                              |                    |-RCF--- "*.cpp" 
C:\Program Files\RCF\0.9d\----|-src----------------|
                              |                    |-SF-----"*.cpp" 
                              |
                              |           |--RCF.DLL
                              |----lib----|--RCF.lib
                              |           |--SF.DLL
                              |           |--SF.lib
                              |
                              |----test---------....
                              |

So, user 
# after install package
1- add C:\Program Files\RCF\0.9d\include in %INCLUDE% System variable
2- add C:\Program Files\RCF\0.9d\lib     in %LIB%     System variable

And run samples in 
http://www.codeproject.com/KB/threads/Rcf_Ipc_For_Cpp.aspx?display=Print

The source modified is set attached for you.

Thanks for RCF

Miguel Suarez Xavier Penteado
Aton Solar Radiometry System Developer
miguel_penteado_at_fca.unesp.br

Original issue reported on code.google.com by miguel7p...@gmail.com on 28 May 2008 at 3:40

Attachments:

GoogleCodeExporter commented 8 years ago
PS: 1- Sorry by too poor english
    2- This report is no a defect ... i´m new in google code

Original comment by miguel7p...@gmail.com on 28 May 2008 at 4:00

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
nice idea, but:

configuring works fine, but at "generate" following failure appears:
--------------------------------------------------------------------------------
-
CMake Error: Cannot find source file "CMakeLists.txt"
Tried 
extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx
Generating done
--------------------------------------------------------------------------------
-

problem:
SF doesn't conatain a CMakeLists.txt file -> add_subdirectory (include) fails

work, but some approvements should be done:

1. asio path hard coded... should get an own variable
2. boost include directory is defined as link-dir but is never tested if it's 
available (or even needed - you can compile RCF without using boost)
3. windows: supporting different compilers (MSVC 6-8, MinGW, Code::Blocks (you 
can 
use CMAKE flags for that). Right now it doesn't follow the CMake idea of 
platform/compiler independend coding ;-)

I think the best way would be to have only ONE CMakeLists.txt file or kicking 
the 
dependencies at the sub-CMakeListFiles or use some Cach-variables to make it 
more 
transparent.

But all in all I like it to see that other people are using CMake at RCF :-)

SirAnn

Original comment by SirAnnTh...@googlemail.com on 30 May 2008 at 7:49

GoogleCodeExporter commented 8 years ago

Original comment by jarl.lin...@gmail.com on 12 Aug 2008 at 1:35

GoogleCodeExporter commented 8 years ago
The demo project in RCF 1.0 has a cmake build script, which can be used as a 
starting point for anyone using cmake as their build system.

Original comment by jarl.lin...@gmail.com on 22 Oct 2008 at 5:50

GoogleCodeExporter commented 8 years ago

Original comment by jarl.lin...@gmail.com on 28 May 2009 at 1:43