[CMake] Using CMake with ifort compiler
Vivek Venugopal
vivek.v80 at gmail.com
Thu May 3 09:25:39 EDT 2012
Thanks Kelly.
But i still get this error:
CMake cannot determine linker language for target:helloworld
Thanks,
Vivek
--
Vivek Venugopal
On May 2, 2012, at 6:36 PM, "Thompson, Kelly G" <kgt at lanl.gov> wrote:
> My bad. You need to tell CMake that this is a Fortran project. Try this:
>
> # CMakeLists.txt
> cmake_minimum_required(VERSION 2.8.7)
> project(helloworldproject Fortran)
> add_subdirectory(src)
>
> # src/CMakeLists.txt
> cmake_minimum_required(VERSION 2.8.7)
> file(GLOB helloworld_SOURCES *.f90)
> add_executable(helloworld ${helloworld_SOURCES})
>
> -kt
>
> From: Vivek Venugopal [mailto:vivek.v80 at gmail.com]
> Sent: Wednesday, May 02, 2012 11:45 AM
> To: Thompson, Kelly G
> Subject: Re: [CMake] Using CMake with ifort compiler
>
> I see an error during generate:
> CMake Error: CMake cannot determine linker language for target:helloworld
> CMake Error: Cannot determine link language for target "helloworld"
>
> --
> Vivek Venugopal
>
>
>
> On May 2, 2012, at 12:45 PM, "Thompson, Kelly G" <kgt at lanl.gov> wrote:
>
> Try this:
>
> # CMakeLists.txt
> cmake_minimum_required(VERSION 2.8.7)
> project(helloworldproject)
> add_subdirectory(src)
>
> # src/CMakeLists.txt
> cmake_minimum_required(VERSION 2.8.7)
> file(GLOB helloworld_SOURCES *.f90)
> add_executable(helloworld ${helloworld_SOURCES})
>
> -kt
>
> From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of Vivek Venugopal
> Sent: Wednesday, May 02, 2012 9:39 AM
> To: cmake at cmake.org
> Subject: [CMake] Using CMake with ifort compiler
>
>
> I am using CMake 2.8.7 on a Linux machine with Intel 11.0 compilers. I am trying to use CMake for the first time as I would like to build this project on both Windows and Linux machines.
>
> I though of using a simple approach first and used a standard Hello World example: My src/HelloWorld.f90:
>
>
> !Test helloworld in Fortran using Cmake
> program hello
> print *, "Hello World!"
> end program hello
> My main CMakeLists.txt:
>
>
> # States that CMake required version must be greater than 2.8.7
> cmake_minimum_required(VERSION 2.8.7)
> enable_language (Fortran)
> project(helloworld Fortran)
> add_subdirectory(src)
> SET_TARGET_PROPERTIES(helloworld PROPERTIES LINKER_LANGUAGE FORTRAN)
> My src/CMakeLists.txt:
>
>
> cmake_minimum_required(VERSION 2.8.7)
>
> # Include the directory itself as a path to include directories
> set(CMAKE_INCLUDE_CURRENT_DIR ON)
>
> # For a large number of source files you can create it in a simpler way
> # using file() function:
> file(GLOB helloworld_SOURCES *.f90)
> I still get an error which says CMAKE_FORTRAN_LINK_EXECUTABLE variable missing. I looked at Abinader's CMake tutorial#1, but haven't had success so far.
> any suggestions?? Thanks in advance !
>
> �]�ܙ��B�
�[�
�
[OH��\�^�N�L�\
ٛY�[Z[
N��][��\�X[ �][�� �][���[��\�\�Y��][�ȏ�[�H
�Y��\�[ۜ���[���[�Y
�[��HO��[��Μ��Μ���B��]��B��]��B��]��B�؛���][�O�B��]��B��]��B�؛�
O�B��
[�B
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120503/573e6d59/attachment.htm>
More information about the CMake
mailing list