[Cmake-commits] CMake branch, master, updated. v3.12.1-487-gc549dee

2018-08-27 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  c549deed7fc6dec2c3f5f3ab5f9ded1acb916239 (commit)
  from  826e75814bf12434b989e19b18cd458abe5d0120 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c549deed7fc6dec2c3f5f3ab5f9ded1acb916239
commit c549deed7fc6dec2c3f5f3ab5f9ded1acb916239
Author: Kitware Robot 
AuthorDate: Tue Aug 28 00:01:10 2018 -0400
Commit: Kitware Robot 
CommitDate: Tue Aug 28 00:01:10 2018 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index dc64c6c..2c9922d 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 12)
-set(CMake_VERSION_PATCH 20180827)
+set(CMake_VERSION_PATCH 20180828)
 #set(CMake_VERSION_RC 1)

---

Summary of changes:
 Source/CMakeVersion.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, master, updated. v3.12.1-486-g826e758

2018-08-27 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  826e75814bf12434b989e19b18cd458abe5d0120 (commit)
   via  4431bb051617f34c0fa955faaa7a467b933cef17 (commit)
   via  2cd6ec6fe420aee6c52766125b0fd3fde71e2d92 (commit)
   via  5a655681c3d20cd15f4df074f5210a96d417fc60 (commit)
   via  aca65a9379526fb509ab5e86ae91143bc9e08d73 (commit)
   via  66f59bd7da8c024124e73d1a26c9c95356cfdc75 (commit)
  from  ce153cacc7010344afbe809973e5129d667ce289 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=826e75814bf12434b989e19b18cd458abe5d0120
commit 826e75814bf12434b989e19b18cd458abe5d0120
Merge: 4431bb0 5a65568
Author: Brad King 
AuthorDate: Mon Aug 27 18:05:44 2018 +
Commit: Kitware Robot 
CommitDate: Mon Aug 27 14:06:24 2018 -0400

Merge topic 'cray_cce_cxx14'

5a655681c3 Cray: Record C++14 compiler mode options

Acked-by: Kitware Robot 
Merge-request: !2307


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4431bb051617f34c0fa955faaa7a467b933cef17
commit 4431bb051617f34c0fa955faaa7a467b933cef17
Merge: 2cd6ec6 aca65a9
Author: Brad King 
AuthorDate: Mon Aug 27 18:05:29 2018 +
Commit: Kitware Robot 
CommitDate: Mon Aug 27 14:05:44 2018 -0400

Merge topic 'more-misc-typos'

aca65a9379 Maint: misc. typos

Acked-by: Kitware Robot 
Merge-request: !2301


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2cd6ec6fe420aee6c52766125b0fd3fde71e2d92
commit 2cd6ec6fe420aee6c52766125b0fd3fde71e2d92
Merge: ce153ca 66f59bd
Author: Brad King 
AuthorDate: Mon Aug 27 18:05:06 2018 +
Commit: Kitware Robot 
CommitDate: Mon Aug 27 14:05:12 2018 -0400

Merge topic 'update-icons'

66f59bd7da cmake-gui: Update icons

Acked-by: Kitware Robot 
Merge-request: !2295


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5a655681c3d20cd15f4df074f5210a96d417fc60
commit 5a655681c3d20cd15f4df074f5210a96d417fc60
Author: Kelly (KT) Thompson 
AuthorDate: Thu Aug 23 19:54:29 2018 -0600
Commit: Brad King 
CommitDate: Fri Aug 24 15:15:53 2018 -0400

Cray: Record C++14 compiler mode options

Fixes: #18270

diff --git a/Modules/Compiler/Cray-CXX.cmake b/Modules/Compiler/Cray-CXX.cmake
index a1899e6..ff97e92 100644
--- a/Modules/Compiler/Cray-CXX.cmake
+++ b/Modules/Compiler/Cray-CXX.cmake
@@ -13,6 +13,10 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1)
   if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.4)
 set(CMAKE_CXX11_STANDARD_COMPILE_OPTION  -h std=c++11)
 set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION -h std=c++11,gnu)
+  endif()
+  if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.6)
+set(CMAKE_CXX14_STANDARD_COMPILE_OPTION  -h std=c++14)
+set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION -h std=c++14,gnu)
   endif ()
 endif ()
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aca65a9379526fb509ab5e86ae91143bc9e08d73
commit aca65a9379526fb509ab5e86ae91143bc9e08d73
Author: luz.paz 
AuthorDate: Sun Aug 12 20:25:11 2018 -0400
Commit: Brad King 
CommitDate: Fri Aug 24 14:58:49 2018 -0400

Maint: misc. typos

Found via `codespell`.

diff --git a/Source/cmDocumentationFormatter.cxx 
b/Source/cmDocumentationFormatter.cxx
index 6b996e4..2267ef9 100644
--- a/Source/cmDocumentationFormatter.cxx
+++ b/Source/cmDocumentationFormatter.cxx
@@ -90,7 +90,7 @@ void cmDocumentationFormatter::SetIndent(const char* indent)
 
 void cmDocumentationFormatter::PrintColumn(std::ostream& os, const char* text)
 {
-  // Print text arranged in an indented column of fixed witdh.
+  // Print text arranged in an indented column of fixed width.
   const char* l = text;
   long column = 0;
   bool newSentence = false;
diff --git a/Source/cmTargetSourcesCommand.cxx 
b/Source/cmTargetSourcesCommand.cxx
index 62e323c..c57d68b 100644
--- a/Source/cmTargetSourcesCommand.cxx
+++ b/Source/cmTargetSourcesCommand.cxx
@@ -57,7 +57,7 @@ std::vector 
cmTargetSourcesCommand::ConvertToAbsoluteContent(
   cmTarget* tgt, const std::vector& content,
   bool isInterfaceContent)
 {
-  // Skip conversion in case old behavior has been explictly requested
+  // Skip conversion in case old behavior has been explicitly requested
   if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0076) ==
   cmPolicies::OLD) {
 return content;
diff --git a/Source/cmTryCompileCommand.h b/Source/cmTryCompileCommand.h
index fbe0d78..8237878 100644
--- a/Source/cmTryCompileCommand.h
+++ b/Source/cmTryCompileCommand.h
@@ -16,7 +16,7 @@ class cmExecutionStatus;
 /** \class cmTryCompileCommand
  * \brief Specifies where to install some 

[Cmake-commits] CMake branch, master, updated. v3.12.1-480-gce153ca

2018-08-27 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  ce153cacc7010344afbe809973e5129d667ce289 (commit)
   via  4a1b18db55935ab0a1a960fcea51247f1c5b4551 (commit)
   via  07556f15674b7720f9bd7c6b63aedec5d53d8597 (commit)
   via  fa2ecf7fceacc135df5c898d70eeafdcc21afb19 (commit)
   via  9903ec167795d35129c5656b89a56683e4c0fd60 (commit)
   via  fbbc6e2eef37bd3630b6c3a7571533f81070725d (commit)
   via  e558ada9774e0b47214d6cf395a7a926a8583ad6 (commit)
   via  974de0e19932d27576a5c7661905f75b2b8daaa9 (commit)
   via  e4ba1f5a94e25feb0b220637a34eea2e63000c54 (commit)
   via  180c2f8de8b1cc19e7dafeaf571d8fa2b203d78f (commit)
  from  92de93b97486ae93fd73829c8d69e6401858acd3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ce153cacc7010344afbe809973e5129d667ce289
commit ce153cacc7010344afbe809973e5129d667ce289
Merge: 4a1b18d 974de0e
Author: Brad King 
AuthorDate: Mon Aug 27 18:04:14 2018 +
Commit: Kitware Robot 
CommitDate: Mon Aug 27 14:04:22 2018 -0400

Merge topic 'static-lib-options'

974de0e199 static library: add property STATIC_LIBRARY_OPTIONS

Acked-by: Kitware Robot 
Merge-request: !2290


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4a1b18db55935ab0a1a960fcea51247f1c5b4551
commit 4a1b18db55935ab0a1a960fcea51247f1c5b4551
Merge: 07556f1 fbbc6e2
Author: Brad King 
AuthorDate: Mon Aug 27 18:02:46 2018 +
Commit: Kitware Robot 
CommitDate: Mon Aug 27 14:02:51 2018 -0400

Merge topic 'FindZLIB-ProgramFiles'

fbbc6e2eef FindZLIB: Fix path detection via ProgramFiles env variables

Acked-by: Kitware Robot 
Acked-by: RElesgoe 
Merge-request: !2287


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=07556f15674b7720f9bd7c6b63aedec5d53d8597
commit 07556f15674b7720f9bd7c6b63aedec5d53d8597
Merge: fa2ecf7 e558ada
Author: Brad King 
AuthorDate: Mon Aug 27 18:01:51 2018 +
Commit: Kitware Robot 
CommitDate: Mon Aug 27 14:01:57 2018 -0400

Merge topic 'doc-include_directories-alternative'

e558ada977 Help: Document alternative to include_directories

Acked-by: Kitware Robot 
Merge-request: !2304


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fa2ecf7fceacc135df5c898d70eeafdcc21afb19
commit fa2ecf7fceacc135df5c898d70eeafdcc21afb19
Merge: 9903ec1 e4ba1f5
Author: Brad King 
AuthorDate: Mon Aug 27 18:00:54 2018 +
Commit: Kitware Robot 
CommitDate: Mon Aug 27 14:01:01 2018 -0400

Merge topic 'ProjectReference'

e4ba1f5a94 VS: Disallow ReferenceOutputAssembly in ProjectReference if not 
possible

Acked-by: Kitware Robot 
Merge-request: !2285


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9903ec167795d35129c5656b89a56683e4c0fd60
commit 9903ec167795d35129c5656b89a56683e4c0fd60
Merge: 92de93b 180c2f8
Author: Brad King 
AuthorDate: Mon Aug 27 17:56:58 2018 +
Commit: Kitware Robot 
CommitDate: Mon Aug 27 13:57:05 2018 -0400

Merge topic 
'ninja-generator-do-not-add-alias-matching-custom-command-output'

180c2f8de8 Ninja: Fix dupbuild error skipping alias with conflicting custom 
command

Acked-by: Kitware Robot 
Acked-by: Isaiah 
Merge-request: !2276


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fbbc6e2eef37bd3630b6c3a7571533f81070725d
commit fbbc6e2eef37bd3630b6c3a7571533f81070725d
Author: Andreas Schneider 
AuthorDate: Mon Aug 13 21:53:17 2018 +0200
Commit: Andreas Schneider 
CommitDate: Fri Aug 24 07:24:00 2018 +0200

FindZLIB: Fix path detection via ProgramFiles env variables

diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index a5c04ac..1a4635a 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -58,10 +58,12 @@ if(ZLIB_ROOT)
 endif()
 
 # Normal search.
+set(_ZLIB_x86 "(x86)")
 set(_ZLIB_SEARCH_NORMAL
-  PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
-"$ENV{PROGRAMFILES}/zlib"
-  )
+PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
+  "$ENV{ProgramFiles}/zlib"
+  "$ENV{ProgramFiles${_ZLIB_x86}}/zlib")
+unset(_ZLIB_x86)
 list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
 
 set(ZLIB_NAMES z zlib zdll zlib1)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e558ada9774e0b47214d6cf395a7a926a8583ad6
commit e558ada9774e0b47214d6cf395a7a926a8583ad6
Author: David Demelier 
AuthorDate: Tue Aug 21 22:47:04 2018 +0200
Commit: Brad King 
CommitDate: Thu Aug 23 16:00:02 2018 -0400

Help: Document alternative to include_directories

Many existing tutorials suggest 

[Cmake-commits] CMake branch, master, updated. v3.12.1-470-g92de93b

2018-08-27 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  92de93b97486ae93fd73829c8d69e6401858acd3 (commit)
   via  74b9538c2661f406e25dad364faf0cf7a7dbda84 (commit)
   via  9e3aee952dacc52c94e34a8d76b60c1e797f0533 (commit)
   via  c68b358ce3c4eb132e7c6dd24effa83ce58a0bb9 (commit)
   via  e4e6b63ec96dc4a51fc336efd28e5f2b3f8d455f (commit)
   via  1bd768174a848b9bc12eeff73786407631c533cf (commit)
  from  363fffc736f723fc4a7bb3c8cd69e462eb9f937e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92de93b97486ae93fd73829c8d69e6401858acd3
commit 92de93b97486ae93fd73829c8d69e6401858acd3
Merge: 74b9538 c68b358
Author: Brad King 
AuthorDate: Mon Aug 27 17:54:36 2018 +
Commit: Kitware Robot 
CommitDate: Mon Aug 27 13:54:44 2018 -0400

Merge topic 'xcode-compiler-id-sign-identity'

c68b358ce3 Xcode: Set CODE_SIGN_IDENTITY during compiler identification

Acked-by: Kitware Robot 
Acked-by: Gregor Jasny 
Merge-request: !2299


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=74b9538c2661f406e25dad364faf0cf7a7dbda84
commit 74b9538c2661f406e25dad364faf0cf7a7dbda84
Merge: 9e3aee9 e4e6b63
Author: Brad King 
AuthorDate: Mon Aug 27 17:53:19 2018 +
Commit: Kitware Robot 
CommitDate: Mon Aug 27 13:53:28 2018 -0400

Merge topic 'extra-gen-fix-0'

e4e6b63ec9 Extra Generator: Fix extraction of macros with value 0

Acked-by: Kitware Robot 
Merge-request: !2308


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e3aee952dacc52c94e34a8d76b60c1e797f0533
commit 9e3aee952dacc52c94e34a8d76b60c1e797f0533
Merge: 363fffc 1bd7681
Author: Brad King 
AuthorDate: Mon Aug 27 17:51:56 2018 +
Commit: Kitware Robot 
CommitDate: Mon Aug 27 13:52:02 2018 -0400

Merge topic 'vs2017-no-default-FC'

1bd768174a VS: Avoid VS 2017 toolset default use of /FC flag

Acked-by: Kitware Robot 
Acked-by: Alberto Garcia Illera 
Acked-by: Martin Hořeňovský 
Merge-request: !2306


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c68b358ce3c4eb132e7c6dd24effa83ce58a0bb9
commit c68b358ce3c4eb132e7c6dd24effa83ce58a0bb9
Author: Rafal Parzych 
AuthorDate: Thu Aug 16 20:49:16 2018 +0200
Commit: Brad King 
CommitDate: Fri Aug 24 13:58:51 2018 -0400

Xcode: Set CODE_SIGN_IDENTITY during compiler identification

If `CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY` is set then propagate
it to the compiler id test project too.

Fixes: #18292

diff --git a/Modules/CMakeDetermineCompilerId.cmake 
b/Modules/CMakeDetermineCompilerId.cmake
index 16dde65..dc4d9be 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -355,6 +355,12 @@ Id flags: ${testflags} 
${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
 else()
   set(id_development_team "")
 endif()
+if(DEFINED CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY)
+  set(id_code_sign_identity
+"CODE_SIGN_IDENTITY = 
\"${CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY}\";")
+else()
+  set(id_code_sign_identity "")
+endif()
 configure_file(${CMAKE_ROOT}/Modules/CompilerId/Xcode-3.pbxproj.in
   ${id_dir}/CompilerId${lang}.xcodeproj/project.pbxproj @ONLY)
 unset(_ENV_MACOSX_DEPLOYMENT_TARGET)
diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in 
b/Modules/CompilerId/Xcode-3.pbxproj.in
index 94bcbf8..4686b64 100644
--- a/Modules/CompilerId/Xcode-3.pbxproj.in
+++ b/Modules/CompilerId/Xcode-3.pbxproj.in
@@ -73,6 +73,7 @@
isa = XCBuildConfiguration;
buildSettings = {
@id_development_team@
+   @id_code_sign_identity@
PRODUCT_NAME = CompilerId@id_lang@;
};
name = Debug;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e4e6b63ec96dc4a51fc336efd28e5f2b3f8d455f
commit e4e6b63ec96dc4a51fc336efd28e5f2b3f8d455f
Author: ibisz 
AuthorDate: Fri Aug 24 06:45:30 2018 -0400
Commit: Brad King 
CommitDate: Fri Aug 24 13:51:30 2018 -0400

Extra Generator: Fix extraction of macros with value 0

Fix logic in CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs
to handle macros with value `0`.

diff --git 
a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake 
b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
index 3a72622..55e0373 100644
--- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
+++ 

Re: [CMake] Build flags not applied during compiler testing on Ubuntu

2018-08-27 Thread Brad King
On 08/25/2018 05:48 PM, Richard Shaw wrote:
> set(CMAKE_EXE_LINKER_FLAGS "-T${CMAKE_SOURCE_DIR}/stm32_flash.ld")
> 
> The build dir is the binary directory, not the source directory...

Toolchain files cannot reference variables like CMAKE_SOURCE_DIR
that depend on the source and build tree locations.  They are loaded
inside try_compile projects in addition to the main project, and those
have their own source and build trees.

-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [cmake-developers] OpenCL language support (was: Compiler dependencies with Unix Makefiles)

2018-08-27 Thread Brad King
On 08/25/2018 02:08 PM, jerry@web.de wrote:
> new Compiler to CMake which compiles and links OpenCL files (file ending .cl)

Will that be done via `enable_language(OpenCL)`?  How might it work
on VS and Xcode?

> What is the reason that CMake uses its own mechanism with Unix Makefiles
> instead of relying on the compiler?

We support compilers that don't have such options and have done so since
before many of today's compilers gained support.

> Is it possible to configure CMake to use -MMD -MF with Unix Makefiles?

I've long wanted to see the Makefile generators converted to that
approach when using compilers that support it, but have never found
time to do it.

> If not, is it possible to tell cmake_depends to understand .cl files?

In principle yes, but in the long run it would certainly be better
to use the depfile approach.

-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake-developers


Re: [CMake] CMake specify using either NVCC or host compilers with add_executable

2018-08-27 Thread Petr Kmoch
Hi Quang,

I believe this should be doable with setting the source file's LANGUAGE
property ( https://cmake.org/cmake/help/latest/prop_sf/LANGUAGE.html ):

add_executable(foo_cuda foo.cpp)
set_property(SOURCE foo.cpp PROPERTY LANGUAGE CUDA)

Petr

On Mon, 27 Aug 2018 at 17:40, Quang Ha  wrote:

> Hi all,
>
> With the new way CMake is treating CUDA codes, now we can do:
>
> project(foo LANGUAGES CXX CUDA)
>
> and can do:
>
> add_executable(foo_cuda foo.cu) # will use NVCC
> add_executable(foo_cpp foo.cpp) # will use host compilers
>
> Now since CUDA can take *.cpp files as extension (see
> https://stackoverflow.com/questions/26208784/cuda-cpp-files), is there a
> away to flip the compiler using one single source files? Something along
> the line of:
>
> if(CUDA_FOUND)
>   add_executable_with_nvcc(foo_cuda foo.cpp) # of course this doesn't exist
> else(CUDA_FOUND)
>   add_executable_with_cpp(foo_cpp foo.cpp) # neither does this
> endif(CUDA_FOUND)
>
> Or would anyone suggest a work-around? With the help of add_definitions, I
> can manually compile a host and device executable - just need to integrate
> this final step into the project.
>
> Thanks,
> Quang
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] CMake specify using either NVCC or host compilers with add_executable

2018-08-27 Thread Quang Ha
Hi all,

With the new way CMake is treating CUDA codes, now we can do:

project(foo LANGUAGES CXX CUDA)

and can do:

add_executable(foo_cuda foo.cu) # will use NVCC
add_executable(foo_cpp foo.cpp) # will use host compilers

Now since CUDA can take *.cpp files as extension (see
https://stackoverflow.com/questions/26208784/cuda-cpp-files), is there a
away to flip the compiler using one single source files? Something along
the line of:

if(CUDA_FOUND)
  add_executable_with_nvcc(foo_cuda foo.cpp) # of course this doesn't exist
else(CUDA_FOUND)
  add_executable_with_cpp(foo_cpp foo.cpp) # neither does this
endif(CUDA_FOUND)

Or would anyone suggest a work-around? With the help of add_definitions, I
can manually compile a host and device executable - just need to integrate
this final step into the project.

Thanks,
Quang
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake