Skip to content

Commit 5343394

Browse files
committed
Export flibcpp configure options
1 parent 348d959 commit 5343394

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ if (FLIBCPP_USE_SWIG AND SWIG_FOUND)
8484
cmake_policy(SET CMP0086 "NEW")
8585
include(UseSWIG)
8686
endif()
87+
set(FLIBCPP_SWIG_EXECUTABLE "${SWIG_EXECUTABLE}")
88+
set(FLIBCPP_SWIG_DIR "${SWIG_DIR}")
8789
else()
8890
set(FLIBCPP_USE_SWIG FALSE)
8991
endif()
@@ -102,7 +104,7 @@ set(FLIBCPP_INTERFACE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
102104
set(FLIBCPP_GENERATE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
103105
set(FLIBCPP_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/Flibcpp")
104106
set(FLIBCPP_INSTALL_MODULEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
105-
set(FLIBCPP_NAMESPACE Flibcpp::)
107+
set(FLIBCPP_NAMESPACE "Flibcpp::")
106108

107109
# List of libraries exported by cmake/FlibcppConfig.cmake.in
108110
set(FLIBCPP_LIBRARIES)
@@ -158,6 +160,7 @@ function(flibcpp_add_module name)
158160
cxx_std_11
159161
)
160162
if (_FLIBCPP_STD_FLAGS)
163+
# Compile Fortran code with a particular standard
161164
target_compile_options(${name}
162165
PUBLIC $<$<COMPILE_LANGUAGE:Fortran>:${_FLIBCPP_STD_FLAGS}>
163166
)

cmake/FlibcppConfig.cmake.in

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ endif()
99

1010
set(Flibcpp_LIBRARIES @FLIBCPP_LIBRARIES@)
1111

12-
set(Flibcpp_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
12+
set(FLIBCPP_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
13+
set(FLIBCPP_USE_SWIG @FLIBCPP_USE_SWIG@)
14+
set(FLIBCPP_FORTRAN_STD @FLIBCPP_FORTRAN_STD@)
15+
set(FLIBCPP_SWIG_EXECUTABLE @FLIBCPP_SWIG_EXECUTABLE@)
16+
set(FLIBCPP_SWIG_DIR @FLIBCPP_SWIG_DIR@)
1317

14-
if (NOT "@Flibcpp_BUILD_SHARED_LIBS@")
18+
if (NOT FLIBCPP_BUILD_SHARED_LIBS)
1519
# Downstream libraries must find and link to the C++ runtimes themselves since
1620
# they can't use the shared library dependencies
1721
enable_language(CXX)

0 commit comments

Comments
 (0)