Skip to content

Commit

Permalink
Now pfunit is found through an environment variable
Browse files Browse the repository at this point in the history
-Lawrence
  • Loading branch information
Lawrence Campbell committed Feb 19, 2018
1 parent 883bfa4 commit 86a438c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,16 @@ configure_file(doc/fortran.dxg.in doc/fortran.dxg)

add_subdirectory(source)

set(PFUNIT_INSTALL $ENV{PFUNIT_INSTALL})
if (ENABLE_TESTING)
add_subdirectory(test)
if(DEFINED PFUNIT_INSTALL)
message(STATUS "PFUNIT_INSTALL: ${PFUNIT_INSTALL}")
set(PFUNIT_DIR ${PFUNIT_INSTALL})
add_subdirectory(test)
else()
message(STATUS "Tests requested, but need PFUNIT_INSTALL specified...")
message(STATUS "...so skipping tests. Define top level PFUNIT_INSTALL.")
endif (DEFINED PFUNIT_INSTALL)
endif (ENABLE_TESTING)


Expand Down
11 changes: 6 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
enable_language (Fortran)
##set (PFUNIT /home/jonny/contrib-gcc540/pFUnit-3.2.8-ser)
# set (PFUNIT /home/tml/src/pFUnit)
set (PFUNIT /home/tml/bin/pfunit-parallel)
set (PFUNIT ${PFUNIT_INSTALL})
set (CMAKE_VERBOSE_MAKEFILE "On")

find_library(PFUNITLIB NAMES pfunit
PATHS ${PFUNIT} ${PFUNIT}/lib
)
Expand All @@ -21,17 +22,17 @@ include_directories(
# Status message:

message(STATUS "PFUNIT ${PFUNIT}")
message(STATUS "PFUNITLIB ${PFUNITLIB}")


# Define tests do build:

#set (PFTESTS testTests testFFunctions testHdf5Puff)
set (PFTESTS testTests testFFunctions)


#

#FILE(GLOB PFUNIT_MODULES ${PFUNIT}/mod/*.mod)
FILE(GLOB PFUNIT_MODULES ${PFUNIT}/mod/*.mod)
FILE(GLOB F_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../source/*f90)
FILE(GLOB C_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../source/*.c)
set(F_SOURCES ${F_SOURCES} "${CMAKE_CURRENT_SOURCE_DIR}/../source/hdf5_puff.f90")
Expand Down Expand Up @@ -107,15 +108,15 @@ message(STATUS "F_SOURCE_MODS : ${F_SOURCE_MODS}")
# PFUnit must be built! :

add_custom_command(OUTPUT libpfunit.a
COMMAND cp ${PFUNIT}/source/libpfunit.a .
COMMAND cp ${PFUNIT}/lib/libpfunit.a .
COMMENT "Looking to copy of libpfunit.a"
VERBATIM
)

add_custom_target(fortran_test_files DEPENDS ${PFTEST_FORTRAN_FILES})
add_custom_target(fortran_source_modules DEPENDS ${F_SOURCE_MODS})

message(STATUS "fortran test files: " ${PFTEST_FORTRAN_FILES})
message(STATUS "fortran test files: ${PFTEST_FORTRAN_FILES}")
message(STATUS "include directories: ${PFUNIT} and ${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "PFUNIT MODULES: ${PFUNIT_MODULES}")

Expand Down

0 comments on commit 86a438c

Please sign in to comment.