[CMake] Does cmake support fortran lang with F extension?

Bill Hoffman bill.hoffman at kitware.com
Sat Jan 3 11:12:32 EST 2009


谢歆 wrote:
> hi,
> 
> I decide to use cmake for an old FORTAN program what consists a lot of
> F extension source code and wrote a simple CMakelists.txt.
> Hoever, the default setting did not seem to support F extension.
> \

ukmorad_SRCS  has to be set BEFORE the add_library call.


> My cmakelists.txt is as follows:
> 
> cmake_minimum_required(VERSION 2.6)
> project(testukmo)
> 
> include_directories(ukmorad/headers)
> link_directories(ukmorad)
> 
> enable_language(Fortran)
> add_executable(testukmo
>   main.F
> )
> 
> add_library(ukmoradlib STATIC ${ukmorad_SRCS})
> target_link_libraries(testukmo ukmoradlib)
> 
> set(ukmorad_SRCS
>   ${ukmorad_main_SRCS}
>   ${ukmorad_ses_setup_SRCS}
>   ${ukmorad_common_SRCS}
>   ${ukmorad_ses_flux_calc_SRCS}
>

-Bill


More information about the CMake mailing list