Skip to content

Commit

Permalink
Merge pull request #8 from ESMCI/jgfouca/cmake_fixes
Browse files Browse the repository at this point in the history
Some CMake fixes for when cprnc is included in a bigger project
  • Loading branch information
jgfouca authored Dec 13, 2023
2 parents 5e2ca5b + 3cee6af commit d6971c9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include (CheckFunctionExists)
include (ExternalProject)

#===== Local modules =====
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

#==============================================================================
# DEFINE THE TARGET
Expand Down Expand Up @@ -37,8 +37,11 @@ endif()

#===== genf90 =====
if (DEFINED GENF90_PATH)
add_custom_target(genf90
DEPENDS ${GENF90_PATH}/genf90.pl)
# If GENF90_PATH is defined, the target may also already be defined
if (NOT TARGET genf90)
add_custom_target(genf90
DEPENDS ${GENF90_PATH}/genf90.pl)
endif()
else ()
ExternalProject_Add (genf90
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/genf90
Expand Down

0 comments on commit d6971c9

Please sign in to comment.