Skip to content

Commit

Permalink
setting mod dir from variable
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed May 8, 2024
1 parent 5de918b commit c05af14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR}/cmake")

set(CMAKE_USER_MAKE_RULES_OVERRIDE "${PROJECT_SOURCE_DIR}/cmake/set_defaults.cmake")

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)

message ( STATUS "CMake build configuration for tuv-x(${CMAKE_BUILD_TYPE}) ${PROJECT_VERSION}" )

if(${CMAKE_VERSION} VERSION_LESS "3.21")
Expand All @@ -35,9 +41,11 @@ option(TUVX_ENABLE_COVERAGE "Enable code coverage output" OFF)
option(TUVX_ENABLE_MEMCHECK "Enable memory checking in tests" OFF)
option(TUVX_ENABLE_NC_CONFIG "Use nc-config to determine NetCDF libraries" OFF)
option(TUVX_BUILD_DOCS "Build the documentation" OFF)
set(TUVX_MOD_DIR "${PROJECT_BINARY_DIR}/include" CACHE PATH "Directory to find Fortran module files during the build")

message(STATUS "TUVX mod dir: ${TUVX_MOD_DIR}")

# Set up include and lib directories
set(TUVX_MOD_DIR "${PROJECT_BINARY_DIR}/include")
set(TUVX_LIB_DIR "${PROJECT_BINARY_DIR}/lib")
include(GNUInstallDirs)
set(INSTALL_PREFIX "tuvx-${PROJECT_VERSION}" )
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set_target_properties(tuvx_object PROPERTIES

target_include_directories(tuvx_object
PUBLIC
# $<BUILD_INTERFACE:${TUVX_MOD_DIR}>
$<BUILD_INTERFACE:${TUVX_MOD_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
$<INSTALL_INTERFACE:${INSTALL_MOD_DIR}>
$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}>
Expand Down

0 comments on commit c05af14

Please sign in to comment.