Commit Graph

6724 Commits

Author SHA1 Message Date
Brad King 0c46750d2c Merge topic 'FindEXPAT-use-PkgConfig'
fc695a77 FindEXPAT: use hints from PkgConfig
2016-09-01 10:39:43 -04:00
Christoph Junghans fc695a776b FindEXPAT: use hints from PkgConfig 2016-08-31 11:52:11 -06:00
Stephen Sorley 900ee0b800 FindCUDA: Allow cuda_compile* macros to be called more than once per directory
Added a counter as a directory property that gets incremented every time one
of the cuda_compile* macros is called. The value of this counter is then added
to the phony target name passed to CUDA_WRAP_SRCS. This ensures that every call
to one of these macros has its own unique intermediate output directory.
2016-08-31 11:53:01 -04:00
Stephen Sorley 6442709bae FindCUDA: Fix for broken cuda_compile* commands.
The macros CUDA_COMPILE, CUDA_COMPILE_PTX, CUDA_COMPILE_FATBIN, and
CUDA_COMPILE_CUBIN were broken by commit 7ded655 (FindCUDA: Take NVCC
include directories from target properties, 2016-08-16).  This bug is
due to the fact that all of these macros call CUDA_WRAP_SRCS with a
target name that's not an actual target, causing the new generator
expressions to fail.

Fix the bug by changing these macros to pass "PHONY" to CUDA_WRAP_SRCS.
Now, when CUDA_WRAP_SRCS sees "PHONY", it falls back to the old behavior
of populating the include directories and compile definitions from
directory properties, instead of using target generator expressions.
2016-08-31 11:52:43 -04:00
Brad King a9affa07cd Merge topic 'FindOpenSSL-new-windows-names'
ed1758f8 FindOpenSSL: Fix detection of OpenSSL 1.1 Win32/64
2016-08-31 09:19:44 -04:00
Brad King 7a25220776 Merge topic 'fortran-macOS-sysroot'
d6f96207 Fortran: Use -isysroot and -mmacosx-version-min= on macOS if available
2016-08-31 09:19:40 -04:00
Alexis Murzeau ed1758f8eb FindOpenSSL: Fix detection of OpenSSL 1.1 Win32/64
Since OpenSSL 1.1.0, Windows binaries are libcrypto and libssl instead of
the old names libeay32 and ssleay32.
When using MSVC, FindOpenSSL was searching for the old lib names only so
this add the new names to be able to find OpenSSL 1.1.0 libraries.

For example, the files in lib directory of OpenSSL 1.1.0 Win64 :
 - libcrypto.lib
 - libssl.lib
 - VC/libcrypto64MD.lib
 - VC/libcrypto64MDd.lib
 - VC/libcrypto64MT.lib
 - VC/libcrypto64MTd.lib
 - VC/libssl64MD.lib
 - VC/libssl64MDd.lib
 - VC/libssl64MT.lib
 - VC/libssl64MTd.lib

32 bits OpenSSL has the same files with "32" instead of "64" for files in
VC directory.

MinGW still works and use lib/libcrypto.lib and lib/libssl.lib.

This patch also add libssl and libcrypto for other windows compilers too (like
Intel).
2016-08-30 10:51:25 -04:00
Brad King d6f96207c3 Fortran: Use -isysroot and -mmacosx-version-min= on macOS if available
Closes: #16265
2016-08-30 10:37:21 -04:00
Raffi Enficiaud bf09271b65 FindMatlab: adding handling of component "MAT"
- documentation
- test
- cosmetic changes
2016-08-30 14:50:20 +02:00
Brad King 41f03f5fa7 Merge topic 'cpack-rpm-debuginfo-pkg'
426f97d3 CPack/RPM: Add test for debuginfo package generation
bc8c0add CPack RPM debuginfo packages generation
2016-08-26 09:45:36 -04:00
Istvan Bodnar bc8c0add7f CPack RPM debuginfo packages generation
Added new variable to CPackRPM for debuginfo rpm package
generation. Binaries will be checked for debug symbols.
2016-08-25 18:36:09 +02:00
Brad King 20d7da5276 FindwxWidgets: Add VS-versioned library directory prefixes
Add Visual Studio version number (supported: VS2008 to VS2015) to
WX_LIB_DIR_PREFIX (old: vc / vc_x64; new: vc120 / vc120_x64).

Patch-by: Hannes Grobler (Johnny_xy on gitlab.kitware.com)
2016-08-25 11:26:34 -04:00
Brad King 4ef8a205ed FindwxWidgets: Add version 3.1.0
Patch-by: Hannes Grobler (Johnny_xy on gitlab.kitware.com)
2016-08-25 11:25:38 -04:00
Brad King 96de37092a Merge topic 'android-platform-modules'
7b637ebd Android: Add `ANDROID` variable to indicate the target
c2f561e5 Android: Add test cases covering use of the NDK and standalone toolchains
6b84df8d Help: Document cross compiling for Android
d7d40830 Android: Select the STL type for NDK builds
b22294bc Android: Populate compiler flags for current ABI
b6a3102a Android: Add a CMAKE_BUILD_TYPE default
d1e3cec2 Android: Add Clang -target option for current ABI
504db72d Android: Add placeholders for compiler/abi-specific settings
fa632578 Android: Avoid interfering with common pre-existing toolchain files
6299693f Android: Search for NDK and standalone toolchain in more places
29b51379 Android: Detect and save a standalone toolchain without the NDK
7d9b49fb Android: Detect settings from the CMAKE_SYSROOT if it is set
4389664a Android: Detect and save a toolchain from the NDK
328191f6 Android: Set CMAKE_SYSROOT automatically
9e032304 Android: Detect and save the architecture, ABI, and processor
fde59c4d Android: Detect and save the API level
...
2016-08-24 09:45:50 -04:00
Brad King 7b637ebdc9 Android: Add `ANDROID` variable to indicate the target
Allow projects to use `if(ANDROID)` to condition their Android-specific
code paths.
2016-08-23 13:10:51 -04:00
Brad King d7d4083025 Android: Select the STL type for NDK builds
Populate standard include directories and link libraries for the
platform.  Select the STL corresponding to CMAKE_ANDROID_STL_TYPE and
matching the current ABI and toolchain to be used.  Refer to the NDK
sources/cxx-stl/*/Android.mk files for the needed file locations.
2016-08-23 12:53:10 -04:00
Brad King b22294bc41 Android: Populate compiler flags for current ABI
Initialize the CMAKE_{C,CXX}_FLAGS{,_<CONFIG>} cache entries with
flags for each ABI as specified by NDK toolchain `setup.mk` files.
2016-08-23 12:51:58 -04:00
Boris Fomitchev 2dc9a754b5 FindCUDA: Support `2.1(2.0)` architecture notation
Also tweak some messages and comments.
2016-08-23 10:47:27 -04:00
Peter Boettcher 7ded655f7b FindCUDA: Take NVCC include directories from target properties
Fixes issue where include directories specified on the target are
not passed on to NVCC.  This includes both target_include_directories()
as well as include directories added by dependency chaining.

Closes: #14201
2016-08-16 14:16:35 -04:00
Brad King e240a7c017 Merge topic 'ExternalProject-SOURCE_SUBDIR'
a8345d65 ExternalProject: Add SOURCE_SUBDIR option
2016-08-16 13:26:22 -04:00
Brad King 074d098ffb Merge topic 'FindMatlab-mingw'
8ba204a6 FindMatlab: Use pre-built libraries for MinGW if needed
2016-08-16 13:26:19 -04:00
Brad King 447b142b6a Merge topic 'issue-tracker-urls'
2bdba83e issues: update references to the CMake issue tracker
2016-08-16 13:26:15 -04:00
Matthew Woehlke a8345d65f3 ExternalProject: Add SOURCE_SUBDIR option
Add a new SOURCE_SUBDIR option to ExternalProject_Add that allows
specifying the location of the CMakeLists.txt to use as the project root
relative to the SOURCE_DIR.

This is helpful for projects that have unusual layouts, or projects that
provide both a superbuild and project-only build depending on which
CMakeLists.txt is used.

Fixes: #15118
2016-08-16 13:18:18 -04:00
Ben Boeckel 2bdba83e4b issues: update references to the CMake issue tracker
References to specific comments are left as-is since comments were not
migrated.
2016-08-15 09:34:06 -04:00
Sebastian Niemann 8ba204a696 FindMatlab: Use pre-built libraries for MinGW if needed 2016-08-15 09:28:54 -04:00
Brad King 7fe5c79dd0 Merge topic 'FindCUDA-fixes'
1aa5c1be FindCUDA: Fix missing librt on Linux when using static cuda runtime.
aab1f6e9 FindCUDA: Restore default behavior of CUDA_USE_STATIC_CUDA_RUNTIME
2016-08-15 08:59:48 -04:00
Brad King d47abe40b6 Merge topic 'GetPrerequisites-fix-regression'
a2d5c25a GetPrerequisites: Fix regression in gp_resolved_file_type
2016-08-15 08:59:43 -04:00
Brad King b6a3102a9f Android: Add a CMAKE_BUILD_TYPE default
Android NDK builds are always `debug` or `release`.  We may populate
flags for these configurations that are needed to produce compatible
binaries.  Ensure they are used by default.
2016-08-12 10:40:54 -04:00
Brad King d1e3cec2aa Android: Add Clang -target option for current ABI 2016-08-12 10:40:54 -04:00
Brad King 504db72d99 Android: Add placeholders for compiler/abi-specific settings
The Android NDK source repository at

  https://android.googlesource.com/platform/ndk.git

has `<ndk>/build/core/toolchains/*/setup.mk` files that store tables of
information for their build system.  Add an equivalent file for each
compiler/abi combination.
2016-08-12 10:40:54 -04:00
Brad King fa63257821 Android: Avoid interfering with common pre-existing toolchain files
Commonly used Android toolchain files that pre-date CMake upstream
support may need to be updated to work with our new functionality.
They typically set CMAKE_SYSTEM_VERSION to 1, so detect that and
skip our upstream Android settings.  When such toolchain files are
updated to account for our upstream support, they can then set
CMAKE_SYSTEM_VERSION to a valid Android API and get new behavior.
2016-08-12 10:40:54 -04:00
Brad King 6299693f8a Android: Search for NDK and standalone toolchain in more places
Commonly used Android toolchain files that pre-date CMake upstream
support use a few environment and CMake variables as search locations.
Use them too to aid transition.
2016-08-12 10:40:53 -04:00
Brad King 29b51379de Android: Detect and save a standalone toolchain without the NDK 2016-08-12 10:40:53 -04:00
Brad King 7d9b49fbdf Android: Detect settings from the CMAKE_SYSROOT if it is set 2016-08-12 10:40:53 -04:00
Brad King 4389664a26 Android: Detect and save a toolchain from the NDK 2016-08-12 10:40:53 -04:00
Brad King 328191f65f Android: Set CMAKE_SYSROOT automatically
Compute CMAKE_SYSROOT automatically for the current API and architecture
selection.  This causes the --sysroot option to be passed to GNU and
Clang compilers.
2016-08-12 10:40:52 -04:00
Brad King 9e032304ea Android: Detect and save the architecture, ABI, and processor
Add new CMakeSystem.cmake entries for the architecture and ABI.
Store the processor in CMAKE_SYSTEM_PROCESSOR.
2016-08-12 10:40:52 -04:00
Brad King fde59c4d88 Android: Detect and save the API level
Store the Android API level in CMAKE_SYSTEM_VERSION.  If it is not
provided by the user, initialize it from CMAKE_ANDROID_API or fall back
to finding the latest available in the NDK.
2016-08-12 10:40:52 -04:00
Brad King 52b6effd81 Android: Detect and save the NDK directory
Add a new CMakeSystem.cmake entry for the NDK location.
2016-08-12 10:40:52 -04:00
Brad King 8e0cb45e55 Android: Suppress new functionality with Nsight Tegra in VS IDE builds
Support for NVIDIA Nsight Tegra Visual Studio Edition was previously
implemented in the CMake VS IDE generators.  Avoid interfering with
that functionality for now.  Later we may try to integrate this.
2016-08-12 10:40:52 -04:00
Brad King d5e7d5f3eb Android: Add placeholders for platform-specific initialization
Add infrastructure modules to be loaded when initializing builds
targeting Android platforms.
2016-08-12 10:40:51 -04:00
Brad King 64be1ae4a3 Android: Add placeholders for platform-specific compiler selection
Add infrastructure modules to be loaded for determining a compiler
selection when targeting Android platforms.
2016-08-12 10:40:51 -04:00
Brad King 47866770ce Android: Add placeholders for platform-specific compiler settings
Add infrastructure modules to be loaded for Clang and GNU compilers
when targeting Android platforms.
2016-08-12 10:40:51 -04:00
Brad King 735f168bf0 CMakeDetermine*Compiler: Add hook to save custom compiler information
Provide a way for Platform/<os>-Determine-<lang>.cmake modules to save
platform-specific information about the compiler in the configured
CMake<lang>Compiler.cmake modules.
2016-08-12 10:40:51 -04:00
Brad King c148803a57 CMakeDetermineSystem: Load platform-specific helper modules
Once CMAKE_SYSTEM_NAME is known, load a platform-specific

  Platform/<os>-Determine

module in order to enable custom determination of the other settings
needed for the CMakeSystem module (e.g. CMAKE_SYSTEM_PROCESSOR).  Also
add a hook in Modules/CMakeSystem.cmake.in to allow platform-specific
information to be saved.
2016-08-12 10:40:51 -04:00
Brad King a2d5c25a7a GetPrerequisites: Fix regression in gp_resolved_file_type
Since commit v3.6.0-rc1~287^2 (GetPrerequisites: Fix
gp_resolved_file_type on non-canonical paths, 2016-03-08) we
accidentally convert relative paths (e.g. system dll file names) to
absolute paths even when we do not know the base directory.  Fix this by
canonicalizing only paths that are already absolute.

Closes: #16240
2016-08-12 10:24:48 -04:00
Stephen Sorley 1aa5c1bec8 FindCUDA: Fix missing librt on Linux when using static cuda runtime.
Commit 7229ae72 (FindCUDA: Refactor Android(Tegra) support, 2016-04-19)
changed the logic to only add librt to the link line for CUDA versions
6.5 and older.  However, newer versions of CUDA still require librt.
2016-08-12 09:28:38 -04:00
Stephen Sorley aab1f6e984 FindCUDA: Restore default behavior of CUDA_USE_STATIC_CUDA_RUNTIME
Fix bug introduced by commit 7229ae72 (FindCUDA: Refactor Android(Tegra)
support, 2016-04-19).  `CUDA_USE_STATIC_CUDA_RUNTIME` should be enabled
by default if `cudart_static` is available, and silently disabled if
it is not.
2016-08-12 09:26:30 -04:00
Brad King 50ada755e3 Merge topic '15687-xcode-support-system-include'
93ac2a78 Xcode: Obey SYSTEM keyword for includes (#15687)
2016-08-10 11:16:01 -04:00
Gregor Jasny 93ac2a78d5 Xcode: Obey SYSTEM keyword for includes (#15687)
CMake used to put all header search paths into HEADER_SEARCH_PATHS
attribute. Unfortunately this attribute does not support to declare
a search path as a system include.

As a hack one could add a -isystem /path to the cflags but then include
ordering is not deterministic. A better approach was chosen with this
patch by not filling HEADER_SEARCH_PATHS at all and to populate
the C, C++, and Fortran flags directly. The include paths used by
Xcode should be now identical to the ones used by Unix Makefiles and
Ninja generator.
2016-08-09 20:30:07 +02:00