Skip to content

Commit

Permalink
Update CMakeLists.txt to avoid deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kmokstad committed Jan 20, 2025
1 parent a44a273 commit cd764b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 25 deletions.
24 changes: 8 additions & 16 deletions pFUnit/pFUnit-3.3.3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,11 @@
#
# ------------------------------------------------------------------------ #
INCLUDE(CMakeForceCompiler)
cmake_minimum_required(VERSION 3.0...3.5)
cmake_minimum_required(VERSION 3.0...3.10)
cmake_policy(SET CMP0048 NEW)
project (pFUnit
VERSION 3.1.1
LANGUAGES Fortran)
#enable_language (Fortran)

# MESSAGE(ENV{PFUNIT}:"$ENV{PFUNIT}")
# set (ENV_PFUNIT "$ENV{PFUNIT}")
# MESSAGE(OK:"${ENV_PFUNIT}")
# OPTION(INSTALL_PATH "Use PFUNIT for development" "$ENV{PFUNIT}")
# OPTION(INSTALL_PATH "Use PFUNIT for development" "${ENV_PFUNIT}")
OPTION(INSTALL_PATH "Use PFUNIT for development" OFF)
project(pFUnit VERSION 3.1.1 LANGUAGES Fortran)

OPTION(INSTALL_PATH "Use PFUNIT for development" OFF)
IF(NOT INSTALL_PATH)
IF(DEFINED ENV{PFUNIT})
set (INSTALL_PATH "$ENV{PFUNIT}")
Expand Down Expand Up @@ -94,10 +86,10 @@ endif()
if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")

if (UNIX)
execute_process (COMMAND ifort --version
OUTPUT_VARIABLE INTEL_COMPILER_VERSION)
string (REGEX MATCH "([0-9]+)"
NUM_VERSION ${INTEL_COMPILER_VERSION})
execute_process (COMMAND ifort --version
OUTPUT_VARIABLE INTEL_COMPILER_VERSION)
string (REGEX MATCH "([0-9]+)"
NUM_VERSION ${INTEL_COMPILER_VERSION})
if ("${NUM_VERSION}" STREQUAL "13")
add_definitions(-DINTEL_13)
endif ()
Expand Down
16 changes: 7 additions & 9 deletions pFUnit/pFUnit-3.3.3/source/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 2.8...3.5)
cmake_minimum_required(VERSION 2.8...3.10)

SET (CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/mod)
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/mod)

if (CMAKE_VERSION VERSION_LESS 3.12)
find_package(PythonInterp REQUIRED) #Sets ${PYTHON_EXECUTABLE}
Expand All @@ -27,8 +27,8 @@ execute_process(
OUTPUT_VARIABLE generated_sources_output
)

message( STATUS "Including generated file(s) '${generated_sources_output}'" )
include( ${CMAKE_CURRENT_BINARY_DIR}/${generated_sources_output} )
message(STATUS "Including generated file(s) '${generated_sources_output}'")
include(${CMAKE_CURRENT_BINARY_DIR}/${generated_sources_output})

list(APPEND srcs AssertBasic.F90)

Expand Down Expand Up @@ -87,12 +87,10 @@ list(APPEND pysrcs CodeUtilities.py)
list(APPEND pysrcs GenerateAssertsOnArrays.py)
list(APPEND pysrcs Utilities.py)

set(SOURCES ${srcs})

add_library(pfunit STATIC ${SOURCES})
add_library(pfunit STATIC ${srcs})

include_directories(${CMAKE_BINARY_DIR}/mod)
include_directories(${CMAKE_BINARY_DIR}/source)

INSTALL(TARGETS pfunit DESTINATION lib)
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/mod DESTINATION .)
install(TARGETS pfunit DESTINATION lib)
install(DIRECTORY ${CMAKE_BINARY_DIR}/mod DESTINATION .)

0 comments on commit cd764b0

Please sign in to comment.