Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: Compile with C++ main and Fortran module

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Re: Compile with C++ main and Fortran module


Chronological Thread 
  • From: "Laurent Rineau (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Re: Compile with C++ main and Fortran module
  • Date: Wed, 27 Oct 2010 10:03:52 +0200
  • Organization: GeometryFactory

Le mercredi 27 octobre 2010 06:32:42, stevepny a écrit :
> Ok, here's the output. I changed the names of all fortran function calls
> from C++ to the format that worked with my own make file (without CGAL),
> {moduleName}_{functionName}_
>
> make VERBOSE=1; output:
>
> [100%] Building CXX object CMakeFiles/local_clib.dir/local_clib.cpp.o
> /usr/bin/c++ -DMOM2_ELF -frounding-math -O3 -DNDEBUG

What is the purpose of -DMOM2_ELF? It is not used in your home-made Makefile.

Anyway, I propose the following CMakeLists.txt, which is simplier: no
libraries creation, directly complile the sources (both C++ and Fortran) into
a target "local_exe".

# To indicate that this is mixed language project
PROJECT( mom2_elf CXX Fortran )

# C++ files
SET(CXX_TEST_SRCS local_clib.cpp)

# Fortran files
SET(FORT_TEST_SRCS letkfio.f90)

ADD_DEFINITIONS(-DMOM2_ELF)

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)

set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)

if ( COMMAND cmake_policy )
cmake_policy( SET CMP0003 NEW )
endif()

find_package(CGAL REQUIRED COMPONENTS Core )
include( ${CGAL_USE_FILE} )
include( CGAL_CreateSingleSourceCGALProgram )
include_directories (BEFORE ../../include)

create_single_source_cgal_program( local_exe ${CXX_TEST_SRCS}
${FORT_TEST_SRCS} )

# To explicitly specify that your MAIN is C++'s main.
SET_TARGET_PROPERTIES(local_exe PROPERTIES LINKER_LANGUAGE CXX)

--
Laurent Rineau, PhD
Release Manager of the CGAL Project http://www.cgal.org/
R&D Engineer at GeometryFactory http://www.geometryfactory.com/



Archive powered by MHonArc 2.6.16.

Top of Page