Use OPM_MACROS_ROOT to locate build scripts

By using a separate variable for this we can easily grep for where
the build system depends on its own location, and also change the
policy regarding this later.

Note that there is no opm-macros module; this is a "psuedo"-module
which links to an additional one (currently, the one we're in)
This commit is contained in:
Roland Kaufmann
2013-08-14 21:26:28 +02:00
parent 0f841e1bdf
commit e4a345a648
7 changed files with 9 additions and 9 deletions

View File

@@ -17,7 +17,7 @@ if (CMAKE_GENERATOR MATCHES "Unix Makefiles")
# amazingly, nothing depends on the generated Makefile, so this can be # 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 # run whenever in the build without trigging a compile of e.g. config.h
add_custom_target (dune-compat ALL 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" COMMENT "Patching Makefile to be DUNE compatible"
) )
endif (CMAKE_GENERATOR MATCHES "Unix Makefiles") endif (CMAKE_GENERATOR MATCHES "Unix Makefiles")

View File

@@ -141,7 +141,7 @@ function (configure_la name target)
# assume that we are in cmake/Modules, and that the template have been # 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 # 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 # 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 # only write an .la if libtool is found; otherwise we have no use

View File

@@ -68,7 +68,7 @@ macro (opm_dist_clean opm)
) )
endif (NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) endif (NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
# script to remove empty directories (can't believe this isn't included!) # 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 add_custom_target (distclean
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR} -- clean COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR} -- clean
COMMAND ${CMAKE_COMMAND} -E remove -f ${DISTCLEAN_FILES} COMMAND ${CMAKE_COMMAND} -E remove -f ${DISTCLEAN_FILES}

View File

@@ -13,7 +13,7 @@
macro (opm_doc opm doxy_dir) macro (opm_doc opm doxy_dir)
# combine the template with local customization # 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}") string (REPLACE ";" "\\;" _doxy_templ "${_doxy_templ}")
if (EXISTS ${PROJECT_SOURCE_DIR}/${doxy_dir}/Doxylocal) if (EXISTS ${PROJECT_SOURCE_DIR}/${doxy_dir}/Doxylocal)
file (READ ${PROJECT_SOURCE_DIR}/${doxy_dir}/Doxylocal _doxy_local) file (READ ${PROJECT_SOURCE_DIR}/${doxy_dir}/Doxylocal _doxy_local)

View File

@@ -17,17 +17,17 @@
# include special # include special
if (CMAKE_VERSION VERSION_LESS "2.8.3") if (CMAKE_VERSION VERSION_LESS "2.8.3")
message (STATUS "Enabling compatibility modules for CMake 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") endif (CMAKE_VERSION VERSION_LESS "2.8.3")
if (CMAKE_VERSION VERSION_LESS "2.8.5") if (CMAKE_VERSION VERSION_LESS "2.8.5")
message (STATUS "Enabling compatibility modules for CMake 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") endif (CMAKE_VERSION VERSION_LESS "2.8.5")
if (CMAKE_VERSION VERSION_LESS "2.8.7") if (CMAKE_VERSION VERSION_LESS "2.8.7")
message (STATUS "Enabling compatibility modules for CMake 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") endif (CMAKE_VERSION VERSION_LESS "2.8.7")
# don't write default flags into the cache, preserve that for user set values # don't write default flags into the cache, preserve that for user set values

View File

@@ -70,7 +70,7 @@ function (opm_cmake_config name)
# assume that the template is located in cmake/Templates (cannot use # assume that the template is located in cmake/Templates (cannot use
# the current directory since this is in a function and the directory # the current directory since this is in a function and the directory
# at runtime not at definition will be used # 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 # write configuration file to locate library
configure_cmake_file (${name} "config" "") configure_cmake_file (${name} "config" "")

View File

@@ -39,7 +39,7 @@ else ()
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR} -DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
-DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} -DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR}
-DPROJECT_LABEL=${${project}_LABEL} -DPROJECT_LABEL=${${project}_LABEL}
-P ${PROJECT_SOURCE_DIR}/cmake/Scripts/WriteVerSHA.cmake -P ${OPM_MACROS_ROOT}/cmake/Scripts/WriteVerSHA.cmake
COMMENT "Updating version information" COMMENT "Updating version information"
) )