[Cmake-commits] CMake branch, master, updated. v3.11.1-773-g653eb6e

2018-05-13 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  653eb6ebdcd37b0f8178a1932f1fd00f7da581f1 (commit)
  from  9388d13f6058ce54505fead826f69dccb9b5c7e3 (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=653eb6ebdcd37b0f8178a1932f1fd00f7da581f1
commit 653eb6ebdcd37b0f8178a1932f1fd00f7da581f1
Author: Kitware Robot <kwro...@kitware.com>
AuthorDate: Mon May 14 00:01:03 2018 -0400
Commit: Kitware Robot <kwro...@kitware.com>
CommitDate: Mon May 14 00:01:03 2018 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index f2554fa..bc45d57 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 11)
-set(CMake_VERSION_PATCH 20180513)
+set(CMake_VERSION_PATCH 20180514)
 #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] /W1 and resource.rc files

2018-05-13 Thread Gonzalo Garramuño
I have a VC++ project which compiles with ninja.  I add all the sources 
and a rc file into a single executable by placing them in a variable.

I am running into trouble specifying the /W1 flag in add_definitions.
The flag gets passed onto RC and it fails its compilation.
Also, I get warnings of:
cl : Command line warning D9025 : overriding '/W3' with '/W1'
I am unsure what sets /W3.

Does anyone have a suggestion on how to work around the above, with the 
little fuss possible?


--
Gonzalo Garramuño

--

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] /W1 and resource.rc files

2018-05-13 Thread Gonzalo Garramuño
I have a VC++ project which compiles with ninja.  I add all the sources 
and a rc file into a single executable by placing them in a variable.

I am running into trouble specifying the /W1 flag in add_definitions.
The flag gets passed onto RC and it fails its compilation.
Also, I get warnings of:
cl : Command line warning D9025 : overriding '/W3' with '/W1'
I am unsure what sets /W3.

--
Gonzalo Garramuño

--

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] Link against exe on Windows fails - .a file not found

2018-05-13 Thread Jano Svitok
On Mon, May 14, 2018 at 1:34 AM, Jano Svitok  wrote:

> ENABLE_EXPORTS does #2.
>

Note: for dlls (aka shared libraries) symbols are enabled automatically.
You need ENABLE_EXPORTS 1 only for exes.
Note2: I use MSVC, I have little experience with clang.

Jano
-- 

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] Link against exe on Windows fails - .a file not found

2018-05-13 Thread Jano Svitok
On Sun, May 13, 2018 at 1:41 PM, Michael Ho  wrote:
>
> Hey there.
>
> I'm trying to make a plugin system for my application, and thus each
plugin will need to link with my main application. This is fine on Linux
and macOS, as I can just set the ENABLE_EXPORTS property of my executable
target (set_target_properties(${PROJECT_NAME} PROPERTIES ENABLE_EXPORTS 1),
and plugins will link just fine. On Windows however, clang++ yells at me
that it can't find libws2editor.dll.a.
>
> clang++.exe: error: no such file or directory:
'ws2editor/libws2editor.dll.a'
>
> Upon looking over the CMake docs, it says "For DLL platforms an import
library will be created for the exported symbols and then used for
linking." - This import library file (presumably the .dll.a) never seems to
be created though.
>
>
> After a bit more digging around I came across
https://github.com/Kitware/CMake/blob/master/Tests/Plugin/CMakeLists.txt -
When I clone the CMake repo and try and compile that test myself, it also
fails with the same error when using clang + ninja! When building with
MSVC/msbuild however it compiles just fine (My project fails to configure
when generating files for MSVC however, and ideally I'd like to use the
same build config across Win/Mac/Linux).
>
> So how can I get the CMake build on Windows to create this file, or
otherwise link with an executable?

You need to 1. mark some/all symbols to export 2. actually export them
ENABLE_EXPORTS does #2. For #1, you need to either mark each symbol to
export as __declspec(dllexport) or mark all symbols with
WINDOWS_EXPORT_ALL_SYMBOLS (see
https://blog.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/,
check also comments for possible drawbacks).

https://github.com/Kitware/CMake/blob/master/Tests/Plugin/include/example.h
shows how to use __declspec(dllexport): for each dll you define a macro (
EXAMPLE_EXPORT here) that becomes either export (when #included from dll)
or import (when #included from code linked to dll). Every
class/function/variable you want to use from the plugin must be marked this
way (example_exe_function). For class members, it's enough to mark the
class.
Finally there's a #define (example_exe_EXPORTS here) that controls how is
the macro defined. See
https://cmake.org/cmake/help/git-master/prop_tgt/DEFINE_SYMBOL.html (I
didn't know this until now, we used to manually define the symbol!)

Jano
-- 

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] WIN32_EXECUTABLE property with generator expression

2018-05-13 Thread Petr Kmoch
Hi Surya.

Generator expressions are not supported universally in CMake; only some
properties support them, and they are all documented as doing so.
WIN32_EXECUTABLE does not support genexes.

As for a workaround, you could create two executable targets, one which
would only be built in Release and one which would be built in other
configurations. Properties such as EXCLUDE_FROM_ALL and
EXCLUDE_FROM_DEFAULT_BUILD_ might come in handy.

However, I find the whole concept somewhat strange. Why is your executable
so fundamentally different between Release and other configurations?
Perhaps there is a different way of achieving your actual goal, without a
need for this.

Petr

On 13 May 2018 at 13:12, Surya Kiran Gullapalli <
suryakiran.gullapa...@gmail.com> wrote:

> With Cmake-3.11.1 and Visual Studio 2017 generator, I'm trying to set
> WIN32_EXECUTABLE property on executable only for release mode with
> generator expression like this
>
> set_target_properties(target PROPERTIES WIN32_EXECUTABLE $)
>
> The generator expression doesn't seem to be working as I see
> /SUBSYSTEM:CONSOLE link flag for both Debug and Release configurations.
>
> set_target_properties(target PROPERTIES WIN32_EXECUTABLE 1)  is working
> though.
>
> Please help.
> Thanks,
> Surya
>
> --
>
> 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] Link against exe on Windows fails - .a file not found

2018-05-13 Thread Michael Ho
Hey there.

I'm trying to make a plugin system for my application, and thus each plugin 
will need to link with my main application. This is fine on Linux and macOS, as 
I can just set the ENABLE_EXPORTS property of my executable target 
(set_target_properties(${PROJECT_NAME} PROPERTIES ENABLE_EXPORTS 1), and 
plugins will link just fine. On Windows however, clang++ yells at me that it 
can't find libws2editor.dll.a.

clang++.exe: error: no such file or directory: 'ws2editor/libws2editor.dll.a'

Upon looking over the CMake docs, it says "For DLL platforms an import library 
will be created for the exported symbols and then used for linking." - This 
import library file (presumably the .dll.a) never seems to be created though.


After a bit more digging around I came across 
 
https://github.com/Kitware/CMake/blob/master/Tests/Plugin/CMakeLists.txt - When 
I clone the CMake repo and try and compile that test myself, it also fails with 
the same error when using clang + ninja! When building with MSVC/msbuild 
however it compiles just fine (My project fails to configure when generating 
files for MSVC however, and ideally I'd like to use the same build config 
across Win/Mac/Linux).

So how can I get the CMake build on Windows to create this file, or otherwise 
link with an executable?
Thanks.

If you want the full CMake scripts, they're available on GitHub.
The main executable: 

 
https://github.com/CraftedCart/smblevelworkshop2/blob/e85c2a0f6f9eb9a00f22b94aa79426b0874ca8e1/ws2editor/CMakeLists.txt
The plugin: 
https://github.com/CraftedCart/smblevelworkshop2/blob/e85c2a0f6f9eb9a00f22b94aa79426b0874ca8e1/ws2editorplugins/ws2editorexampleplugin/CMakeLists.txt


-- 

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] FindODBC: Add module to search for ODBC library (MR #2069)

2018-05-13 Thread Mateusz Loskot
Hi,

I've proposed FindODBC.cmake module:
https://gitlab.kitware.com/cmake/cmake/merge_requests/2069

I'll welcome any critique and review.

The module does not set any public variables, but targets only.
it still uses find_package_handle_standard_args and
attempts to hide private variables.
I posted related question earlier in
https://cmake.org/pipermail/cmake/2018-May/067504.html
I'd be interested to know if the technique used in the module is sound
or if there is a better one recommended.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
-- 

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] WIN32_EXECUTABLE property with generator expression

2018-05-13 Thread Surya Kiran Gullapalli
With Cmake-3.11.1 and Visual Studio 2017 generator, I'm trying to set
WIN32_EXECUTABLE property on executable only for release mode with
generator expression like this

set_target_properties(target PROPERTIES WIN32_EXECUTABLE $)

The generator expression doesn't seem to be working as I see
/SUBSYSTEM:CONSOLE link flag for both Debug and Release configurations.

set_target_properties(target PROPERTIES WIN32_EXECUTABLE 1)  is working
though.

Please help.
Thanks,
Surya
-- 

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