On 11/05/2010 07:21 PM, luxInteg wrote:
> Greetings,
> 
> I have  a little learning progect using cmake with gfortran.  
> 
> SOURCE files: aaaa.f, bbbb.f  xxx.f  and yyyy.f zzzz.y
> 
> I  want to do the following:-
> 
> 
> a)   create a shared library libFFF.so and a static one  libFFF.a  (from   
> say 
> xxx.f and yyy.f)

ADD_LIBRARY(FFF-shared SHARED xxx.f yyy.f)
ADD_LIBRARY(FFF-static STATIC xxx.f yyy.f)
SET_TARGET_PROPERTIES(FFF-shared FFF-static PROPERTIES OUTPUT_NAME FFF)

> b)   find   installed  fortran  librar(ies)    say libOLD.a  libOLD.so  and 
> link   libOLD.so to libFFF.so

FIND_LIBRARY(OLD-static libOLD.a ...)
FIND_LIBRARY(OLD-shared libOLD.so ...)
TARGET_LINK_LIBRARIES(FFF-shared ${OLD-shared})

> c)   when creating libFFF.a  tell compiler to compile in libOLD.a

TARGET_LINK_LIBRARIES(FFF-static ${OLD-static})

> d)   compile zzzz.f, aaaa.f  into   executible  AAA   to  link in  libFFF.so 

ADD_EXECUTABLE(AAA zzzz.f aaaa.f)
TARGET_LINK_LIBRARIES(AAA FFF-shared)

> e)   compile  bbbb.f    into executible BBB and compile in  libFFF.a

ADD_EXECUTABLE(BBB bbbb.f)
TARGET_LINK_LIBRARIES(BBB FFF-static)

> I am a novice at cmake and some helo with a)-e) would be appreciated.

In short and not tested.

Regards,

Michael
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to