From 8c14e17fd24bba53f7a48fed026caa7b08ca0cfc Mon Sep 17 00:00:00 2001 From: Alex Tyler Chapman Date: Wed, 13 Mar 2024 12:02:10 -0700 Subject: [PATCH] Update cmake paths to use 'project' counterpart --- CMakeLists.txt | 10 +++++----- src/CMakeLists.txt | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca7eebed7..8b2db6541 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,7 +122,7 @@ if(HIOP_USE_MPI) set(HIOP_EXTRA_MPI_FLAGS "" CACHE STRING "Extra arguments to mpiexec when running tests") endif(HIOP_USE_MPI) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) +list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) target_compile_features(hiop_options INTERFACE @@ -393,11 +393,11 @@ endif() # The binary dir is already a global include directory configure_file( - "${CMAKE_SOURCE_DIR}/src/Interface/hiop_defs.hpp.in" - "${CMAKE_BINARY_DIR}/hiop_defs.hpp") + "${PROJECT_SOURCE_DIR}/src/Interface/hiop_defs.hpp.in" + "${PROJECT_BINARY_DIR}/hiop_defs.hpp") # include build directory for Fortran name mangling header -include_directories(${CMAKE_BINARY_DIR}) +include_directories(${PROJECT_BINARY_DIR}) include_directories(src/Interface) include_directories(src/ExecBackends) @@ -422,7 +422,7 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "") endif("${CMAKE_BUILD_TYPE}" STREQUAL "") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/_dist-${CMAKE_BUILD_TYPE}") + set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/_dist-${CMAKE_BUILD_TYPE}") endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) ########################################################## diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eb1683d21..c79823969 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,8 +6,8 @@ add_subdirectory(Utils) # Interface headers not already picked up by another subdirectory set(hiop_INTERFACE_HEADERS - ${CMAKE_BINARY_DIR}/hiop_defs.hpp - ${CMAKE_BINARY_DIR}/FortranCInterface.hpp + ${PROJECT_BINARY_DIR}/hiop_defs.hpp + ${PROJECT_BINARY_DIR}/FortranCInterface.hpp ) install(