[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: c

[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: c

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

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_

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

[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_EXPO

[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 post

[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 /SUBSYST