Skip to content

Commit 186a982

Browse files
authored
Tweaks for cmake compatibility (#22)
1 parent 8345c4d commit 186a982

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ if(CMAKE_VERSION VERSION_LESS 3.18)
7979
endif()
8080

8181
if(FLIBCPP_USE_SWIG)
82-
find_package(SWIG COMPONENTS fortran REQUIRED)
82+
if(NOT SWIG_fortran_FOUND)
83+
find_package(SWIG COMPONENTS fortran REQUIRED)
84+
endif()
8385

8486
if(CMAKE_VERSION VERSION_LESS 3.12)
8587
message(FATAL_ERROR "CMake 3.12 or higher is required to regenerate the "

cmake/FlibcppVersion.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ FlibcppVersion
1414
1515
1616
``<projname>``
17-
Name of the project.
17+
Name of the project.
1818
1919
This command sets the following variables in the parent package::
2020
@@ -55,7 +55,7 @@ function(flibcpp_find_version PROJNAME GIT_VERSION_FILE)
5555
RESULT_VARIABLE _GIT_RESULT
5656
OUTPUT_STRIP_TRAILING_WHITESPACE
5757
)
58-
if(NOT _GIT_RESULT EQUAL "0")
58+
if(_GIT_RESULT)
5959
message(WARNING "Failed to get ${PROJNAME} version from git: "
6060
"${_GIT_ERR}")
6161
elseif(NOT _VERSION_STRING)

0 commit comments

Comments
 (0)