diff --git a/cmake/Modules/DuneCompat.cmake b/cmake/Modules/DuneCompat.cmake index e371c832f..fb868177c 100644 --- a/cmake/Modules/DuneCompat.cmake +++ b/cmake/Modules/DuneCompat.cmake @@ -17,7 +17,7 @@ if (CMAKE_GENERATOR MATCHES "Unix Makefiles") # amazingly, nothing depends on the generated Makefile, so this can be # run whenever in the build without trigging a compile of e.g. config.h add_custom_target (dune-compat ALL - COMMAND ${CMAKE_COMMAND} -DCMAKE_HOME_DIRECTORY=${CMAKE_HOME_DIRECTORY} -P ${PROJECT_SOURCE_DIR}/cmake/Scripts/DuneCompat2.cmake + COMMAND ${CMAKE_COMMAND} -DCMAKE_HOME_DIRECTORY=${CMAKE_HOME_DIRECTORY} -P ${OPM_MACROS_ROOT}/cmake/Scripts/DuneCompat2.cmake COMMENT "Patching Makefile to be DUNE compatible" ) endif (CMAKE_GENERATOR MATCHES "Unix Makefiles") diff --git a/cmake/Modules/LibtoolArchives.cmake b/cmake/Modules/LibtoolArchives.cmake index 8fbc7935c..2dc59334c 100644 --- a/cmake/Modules/LibtoolArchives.cmake +++ b/cmake/Modules/LibtoolArchives.cmake @@ -141,7 +141,7 @@ function (configure_la name target) # assume that we are in cmake/Modules, and that the template have been # put in cmake/Templates. we cannot use CMAKE_CURRENT_LIST_DIR because # this is in a function, and we cannot know who's calling us - set (templ_dir "${PROJECT_SOURCE_DIR}/cmake/Templates") + set (templ_dir "${OPM_MACROS_ROOT}/cmake/Templates") # only write an .la if libtool is found; otherwise we have no use diff --git a/cmake/Modules/OpmDistClean.cmake b/cmake/Modules/OpmDistClean.cmake index 5d6ebcebf..78908370c 100644 --- a/cmake/Modules/OpmDistClean.cmake +++ b/cmake/Modules/OpmDistClean.cmake @@ -68,7 +68,7 @@ macro (opm_dist_clean opm) ) endif (NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) # script to remove empty directories (can't believe this isn't included!) - set (rmdir "${PROJECT_SOURCE_DIR}/cmake/Scripts/RemoveEmptyDir.cmake") + set (rmdir "${OPM_MACROS_ROOT}/cmake/Scripts/RemoveEmptyDir.cmake") add_custom_target (distclean COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR} -- clean COMMAND ${CMAKE_COMMAND} -E remove -f ${DISTCLEAN_FILES} diff --git a/cmake/Modules/OpmDoc.cmake b/cmake/Modules/OpmDoc.cmake index df262ab75..1871c207b 100644 --- a/cmake/Modules/OpmDoc.cmake +++ b/cmake/Modules/OpmDoc.cmake @@ -13,7 +13,7 @@ macro (opm_doc opm doxy_dir) # combine the template with local customization - file (READ ${PROJECT_SOURCE_DIR}/cmake/Templates/Doxyfile _doxy_templ) + file (READ ${OPM_MACROS_ROOT}/cmake/Templates/Doxyfile _doxy_templ) string (REPLACE ";" "\\;" _doxy_templ "${_doxy_templ}") if (EXISTS ${PROJECT_SOURCE_DIR}/${doxy_dir}/Doxylocal) file (READ ${PROJECT_SOURCE_DIR}/${doxy_dir}/Doxylocal _doxy_local) diff --git a/cmake/Modules/OpmLibMain.cmake b/cmake/Modules/OpmLibMain.cmake index 6d8764e32..6240cc5df 100644 --- a/cmake/Modules/OpmLibMain.cmake +++ b/cmake/Modules/OpmLibMain.cmake @@ -17,17 +17,17 @@ # include special if (CMAKE_VERSION VERSION_LESS "2.8.3") message (STATUS "Enabling compatibility modules for CMake 2.8.3") - list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/compat-2.8.3") + list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.3") endif (CMAKE_VERSION VERSION_LESS "2.8.3") if (CMAKE_VERSION VERSION_LESS "2.8.5") message (STATUS "Enabling compatibility modules for CMake 2.8.5") - list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/compat-2.8.5") + list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.5") endif (CMAKE_VERSION VERSION_LESS "2.8.5") if (CMAKE_VERSION VERSION_LESS "2.8.7") message (STATUS "Enabling compatibility modules for CMake 2.8.7") - list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/compat-2.8.7") + list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.7") endif (CMAKE_VERSION VERSION_LESS "2.8.7") # don't write default flags into the cache, preserve that for user set values diff --git a/cmake/Modules/OpmProject.cmake b/cmake/Modules/OpmProject.cmake index 4ee05cac0..5f80a1a19 100644 --- a/cmake/Modules/OpmProject.cmake +++ b/cmake/Modules/OpmProject.cmake @@ -70,7 +70,7 @@ function (opm_cmake_config name) # assume that the template is located in cmake/Templates (cannot use # the current directory since this is in a function and the directory # at runtime not at definition will be used - set (template_dir "${PROJECT_SOURCE_DIR}/cmake/Templates") + set (template_dir "${OPM_MACROS_ROOT}/cmake/Templates") # write configuration file to locate library configure_cmake_file (${name} "config" "") diff --git a/cmake/Modules/UseVersion.cmake b/cmake/Modules/UseVersion.cmake index b77c5aac7..4954edf85 100644 --- a/cmake/Modules/UseVersion.cmake +++ b/cmake/Modules/UseVersion.cmake @@ -39,7 +39,7 @@ else () -DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR} -DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} -DPROJECT_LABEL=${${project}_LABEL} - -P ${PROJECT_SOURCE_DIR}/cmake/Scripts/WriteVerSHA.cmake + -P ${OPM_MACROS_ROOT}/cmake/Scripts/WriteVerSHA.cmake COMMENT "Updating version information" )