summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeRCInformation.cmake11
-rw-r--r--Modules/FindMPI.cmake8
-rw-r--r--Modules/FindMatlab.cmake14
3 files changed, 30 insertions, 3 deletions
diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake
index 7bf6567..7c3a5ab 100644
--- a/Modules/CMakeRCInformation.cmake
+++ b/Modules/CMakeRCInformation.cmake
@@ -17,6 +17,17 @@ set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
+# This should be included before the _INIT variables are
+# used to initialize the cache. Since the rule variables
+# have if blocks on them, users can still define them here.
+# But, it should still be after the platform file so changes can
+# be made to those values.
+if(CMAKE_USER_MAKE_RULES_OVERRIDE)
+ # Save the full path of the file so try_compile can use it.
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+endif()
+
set(CMAKE_RC_FLAGS_INIT "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}")
cmake_initialize_per_config_variable(CMAKE_RC_FLAGS "Flags for Windows Resource Compiler")
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index fc9810c..2ff6afe 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -310,11 +310,15 @@ foreach (LANG IN ITEMS C CXX Fortran)
set(_MPI_${LANG}_COMPILER_NAMES "")
foreach (id IN ITEMS GNU Intel MSVC PGI XL)
if (NOT CMAKE_${LANG}_COMPILER_ID OR CMAKE_${LANG}_COMPILER_ID STREQUAL id)
- list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${id}_${LANG}_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX})
+ foreach(_COMPILER_NAME IN LISTS _MPI_${id}_${LANG}_COMPILER_NAMES)
+ list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_COMPILER_NAME}${MPI_EXECUTABLE_SUFFIX})
+ endforeach()
endif()
unset(_MPI_${id}_${LANG}_COMPILER_NAMES)
endforeach()
- list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${LANG}_GENERIC_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX})
+ foreach(_COMPILER_NAME IN LISTS _MPI_${LANG}_GENERIC_COMPILER_NAMES)
+ list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_COMPILER_NAME}${MPI_EXECUTABLE_SUFFIX})
+ endforeach()
unset(_MPI_${LANG}_GENERIC_COMPILER_NAMES)
endforeach()
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 5138f2a..03f1500 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -889,6 +889,7 @@ endfunction()
[DOCUMENTATION file.txt]
[LINK_TO target1 target2 ...]
[R2017b | R2018a]
+ [EXCLUDE_FROM_ALL]
[...]
)
@@ -918,6 +919,10 @@ endfunction()
``MODULE`` or ``SHARED`` may be given to specify the type of library to be
created. ``EXECUTABLE`` may be given to create an executable instead of
a library. If no type is given explicitly, the type is ``SHARED``.
+ ``EXCLUDE_FROM_ALL``
+ This option has the same meaning as for :prop_tgt:`EXCLUDE_FROM_ALL` and
+ is forwarded to :command:`add_library` or :command:`add_executable`
+ commands.
The documentation file is not processed and should be in the following
format:
@@ -944,7 +949,7 @@ function(matlab_add_mex)
endif()
- set(options EXECUTABLE MODULE SHARED R2017b R2018a)
+ set(options EXECUTABLE MODULE SHARED R2017b R2018a EXCLUDE_FROM_ALL)
set(oneValueArgs NAME DOCUMENTATION OUTPUT_NAME)
set(multiValueArgs LINK_TO SRC)
@@ -974,8 +979,14 @@ function(matlab_add_mex)
endif()
endif()
+ set(_option_EXCLUDE_FROM_ALL)
+ if(${prefix}_EXCLUDE_FROM_ALL)
+ set(_option_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
+ endif()
+
if(${prefix}_EXECUTABLE)
add_executable(${${prefix}_NAME}
+ ${_option_EXCLUDE_FROM_ALL}
${${prefix}_SRC}
${MEX_VERSION_FILE}
${${prefix}_DOCUMENTATION}
@@ -989,6 +1000,7 @@ function(matlab_add_mex)
add_library(${${prefix}_NAME}
${type}
+ ${_option_EXCLUDE_FROM_ALL}
${${prefix}_SRC}
${MEX_VERSION_FILE}
${${prefix}_DOCUMENTATION}