Discussion:
[CMake] Windows .rc resource files in Fortran projects?
Magne Rudshaug
2018-11-15 13:35:10 UTC
Permalink
Hi,

In some of my Fortran projects I have Windows resource files of type .rc associated. Just listing this file along with the other Fortran source files doesn't work.
In this case the project is interpreted as a C/C++ project. How can I get cmake to treat the .rc file correctly (compiled by the resource compiler) and at the same
time interpret the project as a Fortran project?

Thanks in advance for any reply?

Magne
Volker Enderlein
2018-11-15 14:22:50 UTC
Permalink
Hi,

how does the project command looks inside your CMakeLists.txt file?

project(<name> LANGUAGES Fortran) should work

Cheers Volker
Post by Magne Rudshaug
Hi,
In some of my Fortran projects I have Windows resource files of type
.rc associated. Just listing this file along with the other Fortran
source files doesn’t work.
In this case the project is interpreted as a C/C++ project. How can I
get cmake to treat the .rc file correctly (compiled by the resource
compiler) and at the same
time interpret the project as a Fortran project?
Thanks in advance for any reply?
Magne
--
--
Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Volker Enderlein
2018-11-16 10:07:38 UTC
Permalink
Hi Magne,

it looks like this is a common issue with fortran projects.

See
https://www.reddit.com/r/cmake/comments/5tzziu/building_fortran_application_with_resources/
for a solution.

Cheers, Volker
Hi Volker,
Thanks for your reply! I now have these lines in the top of my CMakeLists.txt file.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(ALICE LANGUAGES C CXX Fortran RC)
INCLUDE("${ALICE_SOURCE_DIR}/cmake_conf/ALICE.cmake")
ADD_SUBDIRECTORY("ALCEL3_BEREGN")
ADD_SUBDIRECTORY("ALCEL3_DISPLAY_PROTO")
ADD_SUBDIRECTORY("ALCEL3_INPUT")
ADD_SUBDIRECTORY("ALCEL3_OUTPUT")
ADD_SUBDIRECTORY("ALCEL3_PROTO_PRINT")
ADD_SUBDIRECTORY("ALFLU_MESH")
ADD_SUBDIRECTORY("ALFLU_MESH_NEW")
I get exactly the same behaviour, the Fortran projects that has a .rc file associated are interpreted as a C/CXX project. Once I remove this it is interpreted correctly as a Fortran project.
Magne
Magne Rudshaug, Ph.D. | Principal Scientist | Computational Materials Processing
Institute for Energy Technology | www.ife.no |+47 481 77 495
-----Original Message-----
Sent: 15. november 2018 18:39
To: Magne Rudshaug
Subject: Re: [CMake] Windows .rc resource files in Fortran projects?
Hi Magne,
AFAIK C and CXX are enabled by default if you do not specify a LANGUAGES
argument in the project command. You only **added** a language with
ENABLE_LANGUAGE.
BTW, you should move the cmake_minimum_required command to the top of
the file as it influences the setup inside of the project command.
Cheers, Volker
Hi Volker,
PROJECT(ALICE)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
ENABLE_LANGUAGE(Fortran)
Isn't this equivalent to what you wrote? If I remove the .rc file from the list of files. The project becomes a Fortran project again. But, then the .rc file is ignored, and that is not what I want.
-----Original Message-----
Sent: torsdag 15. november 2018 15:23
Subject: Re: [CMake] Windows .rc resource files in Fortran projects?
Hi,
how does the project command looks inside your CMakeLists.txt file?
project(<name> LANGUAGES Fortran) should work
Cheers Volker
Post by Magne Rudshaug
Hi,
In some of my Fortran projects I have Windows resource files of type
.rc associated. Just listing this file along with the other Fortran
source files doesn't work.
In this case the project is interpreted as a C/C++ project. How can I
get cmake to treat the .rc file correctly (compiled by the resource
compiler) and at the same
time interpret the project as a Fortran project?
Thanks in advance for any reply?
Magne
--
Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/uns
Magne Rudshaug
2018-11-16 11:05:21 UTC
Permalink
Hi Volker,

Thanks for the tip I'll try this and report back.

Magne

Magne Rudshaug, Ph.D. | Principal Scientist | Computational Materials Processing
Institute for Energy Technology | www.ife.no |+47 481 77 495


-----Original Message-----
From: Volker Enderlein [mailto:***@ifm-chemnitz.de]
Sent: 16. november 2018 11:08
To: Magne Rudshaug
Cc: cmake Mailing List
Subject: Re: [CMake] Windows .rc resource files in Fortran projects?

Hi Magne,

it looks like this is a common issue with fortran projects.

See
https://www.reddit.com/r/cmake/comments/5tzziu/building_fortran_application_with_resources/
for a solution.

Cheers, Volker
Hi Volker,
Thanks for your reply! I now have these lines in the top of my CMakeLists.txt file.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(ALICE LANGUAGES C CXX Fortran RC)
INCLUDE("${ALICE_SOURCE_DIR}/cmake_conf/ALICE.cmake")
ADD_SUBDIRECTORY("ALCEL3_BEREGN")
ADD_SUBDIRECTORY("ALCEL3_DISPLAY_PROTO")
ADD_SUBDIRECTORY("ALCEL3_INPUT")
ADD_SUBDIRECTORY("ALCEL3_OUTPUT")
ADD_SUBDIRECTORY("ALCEL3_PROTO_PRINT")
ADD_SUBDIRECTORY("ALFLU_MESH")
ADD_SUBDIRECTORY("ALFLU_MESH_NEW")
I get exactly the same behaviour, the Fortran projects that has a .rc file associated are interpreted as a C/CXX project. Once I remove this it is interpreted correctly as a Fortran project.
Magne
Magne Rudshaug, Ph.D. | Principal Scientist | Computational Materials Processing
Institute for Energy Technology | www.ife.no |+47 481 77 495
-----Original Message-----
Sent: 15. november 2018 18:39
To: Magne Rudshaug
Subject: Re: [CMake] Windows .rc resource files in Fortran projects?
Hi Magne,
AFAIK C and CXX are enabled by default if you do not specify a LANGUAGES
argument in the project command. You only **added** a language with
ENABLE_LANGUAGE.
BTW, you should move the cmake_minimum_required command to the top of
the file as it influences the setup inside of the project command.
Cheers, Volker
Hi Volker,
PROJECT(ALICE)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
ENABLE_LANGUAGE(Fortran)
Isn't this equivalent to what you wrote? If I remove the .rc file from the list of files. The project becomes a Fortran project again. But, then the .rc file is ignored, and that is not what I want.
-----Original Message-----
Sent: torsdag 15. november 2018 15:23
Subject: Re: [CMake] Windows .rc resource files in Fortran projects?
Hi,
how does the project command looks inside your CMakeLists.txt file?
project(<name> LANGUAGES Fortran) should work
Cheers Volker
Post by Magne Rudshaug
Hi,
In some of my Fortran projects I have Windows resource files of type
.rc associated. Just listing this file along with the other Fortran
source files doesn't work.
In this case the project is interpreted as a C/C++ project. How can I
get cmake to treat the .rc file correctly (compiled by the resource
compiler) and at the same
time interpret the project as a Fortran project?
Thanks in advance for any reply?
Magne
--
Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubs
Loading...