Re: [CMake] Development Workflow with CMake and VS2017

2018-07-15 Thread Dvir Yitzchaki
I recommend using Hunter package manager:

https://docs.hunter.sh/en/latest/quick-start/boost-components.html



It has support for FreeType as well:

https://docs.hunter.sh/en/latest/packages/pkg/freetype.html



Regards,

Dvir



-Original Message-
From: CMake  On Behalf Of Innokentiy Alaytsev
Sent: Thursday, July 12, 2018 21:44
To: cmake@cmake.org
Subject: Re: [CMake] Development Workflow with CMake and VS2017



Hello!



I usually just download prebuild binaries if they are available or build the 
required dependency from sources. There are some libraries (and other

software) that are not Windows-friendly (These products are still considered 
cross-platform and usually are free in the way fanatics from FSF understand 
freedom, i.e. freedom is the thing that should be enforced). In the case where 
it is impossible or hard to build something on Windows with MSVC, I try to find 
some alternative.



The reason for trying to build everything with MSVC is simple - unfortunately, 
it is the official compiler for the platform and some things can only be built 
with it for Windows.



Sticking to Cygwin or MSYS2 may be fine unless you need some things like Qt 
with WebEngine support or, probably, CUDA (I am not sure if it officially works 
with anything else but MSVC).







--

Sent from: http://cmake.3232098.n2.nabble.com/

--



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


Re: [CMake] Boost + CMake + Windows + Sanity -> Possible?

2018-07-15 Thread Dvir Yitzchaki
I recommend using Hunter package manager:

https://docs.hunter.sh/en/latest/quick-start/boost-components.html



Regards,

Dvir



-Original Message-
From: CMake  On Behalf Of Innokentiy Alaytsev
Sent: Thursday, July 12, 2018 13:29
To: cmake@cmake.org
Subject: Re: [CMake] Boost + CMake + Windows + Sanity -> Possible?



Hello!



First of all, I suggest you use Boost imported targets instead of 
Boost_INCLUDE_DIRS and Boost_LIBRARY_DIRS and the

target_include_directories() and target_link_libraries() functions. Al this is 
to better support exporting CMake package if you need it. If you do not produce 
CMake package for use in some other projects, then just ignore this advice.



Second, just use  pre-built Boost binaries 
  . They are just 
fine. If your Windows Defender finds something in them then it's the problem in 
Windows Defender.



Best regards,

Innokentiy Alaytsev







--

Sent from: http://cmake.3232098.n2.nabble.com/

--



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


Re: [CMake] [Digital Signature Failure] FetchContent and multiple CMake projects

2018-04-15 Thread Dvir Yitzchaki
Check out Hunter package manager: https://github.com/ruslo/hunter

Regards,
Dvir

From: CMake  On Behalf Of Saad Khattak
Sent: Friday, April 13, 2018 02:06
To: Cmake Mailing List 
Subject: [Digital Signature Failure] [CMake] FetchContent and multiple CMake 
projects

Hi,

I have many independent CMake projects and most projects have external 
dependencies. Most of the projects have the same dependency e.g. Catch testing 
library.

Each library uses FetchContent so that it can be built independently by simply 
cloning its github repository, configuring and generating through CMake and 
then building. However, I would also like the ability for these projects to 
share the same dependency to save disk space (and compile time) if they detect 
that another project already has done FetchContent on a particular dependency.

Again, note that all projects are independent where their own repositories.

-- EXAMPLE 
--
To illustrate the setup: I have LibA, LibB, LibC, LibD, LibE etc. where each 
may have a dependency that is found to be the same. So, when LibA is the only 
one that is cloned, it uses FetchContent to clone the dependencies, build them, 
install them and the test executable linked to the dependencies properly.

Now LibB is cloned and it has some dependencies that LibA doesn't have but 
other dependencies that LibA 'does' use. Assuming LibA is already built 
successfully, I would like LibB to rely on LibA's dependencies, if found, 
otherwise LibB clones, generates and builds its own dependencies.

It is also possible that LibA was never cloned/built and thus LibB must 
clone/generate/build all dependencies.
-- END EXAMPLE 
--

To solve this issue, I am using a combination of find_package(...) and 
FetchContent, however the whole setup is starting to show cracks, is fragile 
and difficult to test and maintain. So now I am wondering whether there is a 
better way to about solving the issue.

Thank you,
Saad
-- 

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] Install sub project from Visual Studio

2018-03-18 Thread Dvir Yitzchaki
You can add a custom target which runs
cmake -P /cmake_install.cmake

Regards,
Dvir

From: CMake  On Behalf Of Scott Bloom
Sent: Friday, March 16, 2018 21:59
To: cmake@cmake.org
Subject: [Digital Signature Failure] [CMake] Install sub project from Visual 
Studio

I know from the command line on a make based system, I can simply make install 
on an individual project, and it will only install that executable.

Is there any way to do the same from visual studio?

Scott
-- 

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] [Digital Signature Failure] Re: Hard to do if in Macro

2018-01-31 Thread Dvir Yitzchaki
You can add PARENT_SCOPE to set command to set the value on the calling code.

Regards,
Dvir

From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of J Decker
Sent: Tuesday, January 30, 2018 18:07
To: Petr Kmoch 
Cc: CMake Mail List 
Subject: [Digital Signature Failure] Re: [CMake] Hard to do if in Macro

Okay... but then with function I can't set external variables; but if( 
__ANDROID__ ) works.

`result` never changes.

---

set( __ANDROID__ 1 )

function( test __ANDROID__ RETVAL )

  if( ${__ANDROID__} EQUAL 1 OR ${__ANDROID__} STREQUAL "ON")
set( ${RETVAL} ${${RETVAL}} qwer2 )
message( "Included. " )
  endif( ${__ANDROID__} EQUAL 1 OR ${__ANDROID__} STREQUAL "ON")

  if( __ANDROID__ )
set( ${RETVAL} ${${RETVAL}} asdf )
message( "ALWAYS Included ${__ANDROID__}" )
  endif( __ANDROID__ )

endfunction( test )


set( result "default" )

test( __ANDROID__ "result" )
message( "REsult:${result}" )

test( ${__ANDROID__} "result" )
message( "REsult:${result}" )

test( OFF  "result")
message( "REsult:${result}" )

---




On Tue, Jan 30, 2018 at 12:35 AM, Petr Kmoch 
> wrote:
Macros aren't functions, and macro parameters aren't CMake variables. Expanding 
a macro parameter is effectively *textual* substitution, whereas dereferencing 
a CMake variable is a semantic one.
In other words, inside your macro, the text __ANDROID__ (when not expanded) 
never refers to the macro parameter. Macro parameters "don't exist" outside of 
expansion context. The `if(__ANDROID__)` bit therefore always refers to the 
variable __ANDROID__, never to the macro parameter __ANDROID__.
You still don't have to spell out the conditional as explicitly as you're doing 
it now, but you have to expand the parameter:
macro(test __ANDROID__)
  if(${__ANDROID__})
message( "Included. " )
  endif()
endmacro()
This is what the evaluation will look like based on how you call it:
test(__ANDROID__)   -> if(__ANDROID__) -> refers to the variable
set(__ANDROID__ 1)
test(${__ANDROID__})   -> if(1)
set(__ANDROID__ 0)
test(${__ANDROID__})   -> if(0)
test(OFF)   -> if(OFF)
CMake macros have a lot of specific and potentially weird/counterintuitive 
behaviour. In general, you should always write your commands as functions and 
only resort to macros if you explicitly need their specific behaviour.
Petr



On 30 January 2018 at 09:11, J Decker 
> wrote:
Why do I have to do

if( ${M__ANDROID__} EQUAL 1 OR ${M__ANDROID__} STREQUAL "ON")
endif( ${M__ANDROID__} EQUAL 1 OR ${M__ANDROID__} STREQUAL "ON")

in a macro like...
--

set( __ANDROID__ 1 )

macro( test __ANDROID__ )

  if( ${__ANDROID__} EQUAL 1 OR ${__ANDROID__} STREQUAL "ON")
message( "Included. " )
  endif( ${__ANDROID__} EQUAL 1 OR ${__ANDROID__} STREQUAL "ON")

  if( __ANDROID__ )
message( "ALWAYS Included ${__ANDROID__}" )
  endif( __ANDROID__ )

endmacro( test )

test( __ANDROID__ )
test( ${__ANDROID__} )
test( OFF )

--
Output

Included.
ALWAYS Included __ANDROID__
Included.
ALWAYS Included 1
ALWAYS Included OFF

--

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


Re: [CMake] Adding compile and build type tests to CMake/CTest

2017-09-05 Thread Dvir Yitzchaki
There's already CheckCXXSourceCompiles and friends. 
The only problem is that try_compile is not scriptable otherwise you could let 
the test invoke 
${CMAKE_COMMAND} -P check_source_compiles.cmake.

-Original Message-
From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Roger Leigh
Sent: Monday, September 4, 2017 16:51
To: cmake@cmake.org
Subject: Re: [CMake] Adding compile and build type tests to CMake/CTest

On 04/09/17 14:40, Edward Diener wrote:
> Boost Build has tests for running an application successfully or not, 
> for compiling one or more source files successfully or not, and for 
> building one or more source files into an exe or not. These tests in 
> Boost Build are the run/run-fail, compile/compile-fail, and 
> link/link-fail rules.
> 
> CMake/CTest has the exact equivalent to the run/run-fail rule in its 
> add_test framework, but there is not add_test equivalent to the other 
> two sets of rules. It sure would be nice, when Boost transitions to 
> using CMake/CTest instead of Boost Build, if CMake/CTest had the 
> equivalent of the other two sets of types of test in its add_test 
> framework.
> 
> Is there any consensus that these other two types of tests might be 
> valuable for CMake/CTest, or any way to make this happen ?

I've certainly wished for them.  Particularly when testing templated code where 
you want to test that certain things fail correctly, e.g. via static_assert or 
simply being invalid.

I understand it's possible to make this work partially, by creating targets 
which aren't built by default, and then add tests which invoke the targets.  
But this appears to have some caveats, such as potential misbehaviour with 
parallel testing.  Or you can have a separate CMake build for each individual 
target, but it's extra complexity.  Having a proper means of registering such 
tests would be very, very nice.


Regards,
Roger
-- 

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:
http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Transitive include and link libraries on imported targets ?

2017-04-05 Thread Dvir Yitzchaki
target_link_libraries(B INTERFACE A)

Regards,
Dvir

From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of David Jobet
Sent: Wednesday, April 5, 2017 18:34
To: cmake@cmake.org
Subject: [CMake] Transitive include and link libraries on imported targets ?

Hello,

Let's say I build some external libs A and B with B depending on A.
B and A do not use cmake, so I build them and install them in a 3rdparty 
directory. I now have access to includes and libs.
I then create some cmake file to describe those libs so I can use them in my 
project :
Add_library(A_imported STATIC imported)
Set_property(TARGET A_imported APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES 
3rdparty/include/A)
Set_property(TARGET A_imported APPEND PROPERTY IMPORTED_LOCATION 
3rdparty/libs/libA.a)
Add_library(A INTERFACE)
Target_link_library(A INTERFACE A_imported)

Same thing for B

Now let's say I create a top-level target T that depends on B. Compilation 
might fail because B might include files from A and A is currently not a 
dependency of T.

I can fix it in 2 ways :
1- add A as a dependency of T, but I will need to do it on all my Ts
2- somehow make B have transitive dependencies for include and link on A. That 
would be my prefered choice... But I don't know how to do it.

Is it possible ? How ?

Tx for your help.

David
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Is it possible to run ctest outside build tree?

2017-03-26 Thread Dvir Yitzchaki
How about

cmake --build /my/build/tree --target test

Regards,
Dvir

From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Eric Noulard
Sent: Friday, March 24, 2017 13:04
To: CMake Mailinglist 
Subject: [CMake] Is it possible to run ctest outside build tree?

Is possible to run ctest outside the builld tree and how?
typical use is when I have an out of source build I may be in the source tree
and want to run tests without manually going to build tree.

i.e. I currently do:

ninja -C /my/build/tree

is there a similar way to do that with ctest (other than creating my own 
script, shell alias etc...)?

--
Eric
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] cpack multiple packages

2017-01-05 Thread Dvir Yitzchaki
Hi Domen.

That works perfectly. This is my code if anyone’s interested:

function(install_common)
foreach(component ${ALL_COMPONENTS})
 install(${ARGV} COMPONENT ${component})
endforeach()
endfunction()

where ALL_COMPONENTS is a global variable holding all components.

Thanks,
Dvir

From: Domen Vrankar [mailto:domen.vran...@gmail.com]
Sent: Thursday, December 22, 2016 20:43
To: Dvir Yitzchaki <dvir.yitzch...@ceva-dsp.com>
Cc: Eric Noulard <eric.noul...@gmail.com>; cmake@cmake.org
Subject: Re: [CMake] cpack multiple packages

2016-12-21 12:29 GMT+01:00 Dvir Yitzchaki 
<dvir.yitzch...@ceva-dsp.com<mailto:dvir.yitzch...@ceva-dsp.com>>:
Thanks, but as I understand a component can only belong to one group.
How can I get the same component/target on multiple packages?

Usually you wouldn't want to package same file on same location with same 
filename since during unpackaging they would override each other so this is not 
supported out of the box.

Usually in such cases I would split packages even further so that one package 
would be base package of others (but automatic dependency tracking between them 
would require something more sophisticated than zip - RPM, Deb or some other 
CPack supported packager perhaps).
However if you really need to do something like that you could write a function 
that you would call instead of install(...) command which would just forward to 
it and the first parameter would have a list of components to which the file 
should belong. For e.g. some pseudo code:
function(my_install my_list other_params_that_get_forwarded...)
foreach(component_name_ IN LISTS my_list)
install(other_params_that_get_forwarded... COMPONENT ${component_name_})
endforeach()
endfunction()

my_install("first;second;and_anotherone" "TARGETS target_name" "DESTINATION 
some_dir")
Hope this helps.
Regards,
Domen
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] cpack multiple packages

2016-12-21 Thread Dvir Yitzchaki
Thanks, but as I understand a component can only belong to one group.
How can I get the same component/target on multiple packages?

From: Eric Noulard [mailto:eric.noul...@gmail.com]
Sent: Wednesday, December 21, 2016 10:42 AM
To: Dvir Yitzchaki <dvir.yitzch...@ceva-dsp.com>
Cc: cmake@cmake.org
Subject: Re: [CMake] cpack multiple packages

When playing with component you have 3 major way to package which are governed 
by the value
of CPACK_COMPONENTS_GROUPING:


1 package per component -> set(CPACK_COMPONENTS_GROUPING IGNORE)
1 package for all -> set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)
1 package per component group the default behavior.

In order to get 1 package per group you have to specify group when specifying 
component, more information
here:
https://cmake.org/cmake/help/v3.7/module/CPackComponent.html
https://cmake.org/Wiki/CMake:Component_Install_With_CPack#Principles_of_CPack_Component_Packaging

2016-12-21 9:14 GMT+01:00 Dvir Yitzchaki 
<dvir.yitzch...@ceva-dsp.com<mailto:dvir.yitzch...@ceva-dsp.com>>:
Hi.

I have a big project which produces several zip packages.
Some files are common to all packages while others are unique per package.

Is there a way to create these packages using cpack?

I tried to use components but it seems that either it puts all components in 
one package or makes one package per component.

Thanks,

Dvir

--

Powered by www.kitware.com<http://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:
http://public.kitware.com/mailman/listinfo/cmake



--
Eric
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] cpack multiple packages

2016-12-21 Thread Dvir Yitzchaki
Hi.

I have a big project which produces several zip packages.
Some files are common to all packages while others are unique per package.

Is there a way to create these packages using cpack?

I tried to use components but it seems that either it puts all components in 
one package or makes one package per component.

Thanks,

Dvir
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] checking for cmake predefined targets

2016-12-13 Thread Dvir Yitzchaki
Hi list.

With Visual Studio generator, is there a way, at configuration time, to check 
for the existence of INSTALL, PACKAGE and RUN_TESTS targets?
Seems they only present when the configuration files have an install(), 
enable_testing() or include(CPack) commands somewhere.

I need this information to make TFS not trying to add these projects to source 
control.

Thanks,

Dvir
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Replacing Compile Options for a Target

2016-12-06 Thread Dvir Yitzchaki
There's no problem as the compiler will just use the last flag value.
See an example at http://coliru.stacked-crooked.com/a/738fff0fcc2eb3c4.

Regards,

Dvir Yitzchaki
Debugger Software Engineer, SDT


-Original Message-
From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Jayesh Badwaik
Sent: Wednesday, December 07, 2016 6:48 AM
To: CMake <cmake@cmake.org>
Subject: [CMake] Replacing Compile Options for a Target

Hi,

My global compile flags are specified with "std=c++14" in them. However, there 
is a third party header file which I want to compile in my code wherein I need 
to use a completely different set of compile flags starting with "-std=c++98". 

I have seen target_compile_options() but that seems to just add options to the 
already available global options.  What command should I use to assign a 
completely new set of flags from the scratch. 

--
Cheers
Jayesh Badwaik
https://www.jayeshbadwaik.in
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Adding Cmake version in online documentation

2016-11-08 Thread Dvir Yitzchaki
But how do you know which version to declare on cmake_minimum_required?
If this feature will be added it won't be far from writing a script that scans 
the commands you use and outputs the first appropriate version.

Regards,

Dvir

-Original Message-
From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Nils Gladitz
Sent: Tuesday, November 08, 2016 3:37 PM
To: Louis-Paul CORDIER ; Cmake Mailing List 

Subject: Re: [CMake] Adding Cmake version in online documentation

On 11/08/2016 10:57 AM, Louis-Paul CORDIER wrote:

> Hi,
>
> This is a feature proposal for the documentation. Cmake is making use 
> of cmake_minimum_required() command, that is very useful.
> Unfortunately it is very hard to identify commands that will work 
> without browsing all version of cmake documentation for a given command.
>

This has been brought up for discussion more than once e.g.:
 https://public.kitware.com/Bug/view.php?id=15517
 https://public.kitware.com/Bug/view.php?id=15222
 http://public.kitware.com/pipermail/cmake/2016-April/063306.html

Personally I still don't think this needs change.
You don't have to browse all versions of the documentation ... you only 
have to work with the documentation that matches the version you 
declared in cmake_minimum_required().

Nils
-- 

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:
http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] How to configure CMake to add current path to include directive.

2016-10-20 Thread Dvir Yitzchaki
What about 
CMAKE_INCLUDE_CURRENT_DIR?

Regards,

Dvir
From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Steve Lorimer
Sent: Monday, October 17, 2016 5:04 AM
To: Craig Scott 
Cc: CMake Mailing List 
Subject: Re: [CMake] How to configure CMake to add current path to include 
directive.

Thanks Craig

Looks like it did what you intended, but cmake won't allow it

CMake Error in foo/CMakeLists.txt:
  Found relative path while evaluating include directories of "foo":

"."

Bummer! :(



On 16 October 2016 at 18:35, Craig Scott 
> wrote:
Something like the following was what I had in mind (untested):

get_target_property(incDirs someTarget INCLUDE_DIRECTORIES)
list(APPEND incDirs .)
set_target_properties(someTarget PROPERTIES INCLUDE_DIRECTORIES "${incDirs}")


On Mon, Oct 17, 2016 at 10:31 AM, Steve Lorimer 
> wrote:
Thanks Craig

Not sure if I'm doing it right, but I couldn't get that to work.

Would you be able to give me an example please?

Thanks
Steve



On 16 October 2016 at 17:51, Craig Scott 
> wrote:
I think if you manipulate the target property 
INCLUDE_DIRECTORIES
 directly, you should be able to force a "." in there without having it 
substituted for an absolute path. By this I mean use set_property() or 
set_target_properties() rather than target_include_directories() or 
include_directories(). Note, however, that the documentation for the 
INCLUDE_DIRECTORIES property explicitly recommends against adding relative 
paths to the property like this (but in your case it sounds like you really 
want a relative path, so maybe this is a valid exception to that advice).



On Mon, Oct 17, 2016 at 9:46 AM, Steve Lorimer 
> wrote:
In makefile parlance, I'm trying to add -I. (ie: the current directory) to my 
include paths

I tried the following:

include_directories(".")

This doesn't work unfortunately, as relative paths are interpreted as relative 
to the current source 
directory

That is, if this statement is in my top level CMakeLists.txt, located in 
~/src/project, the include directive added will be "-I ~/src/project/.", 
whereas I'm trying to add "-I ."

The reason for my wanting this is that we have sources for a single library in 
several subdirs.

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

add_library(
foo
STATIC
foo.cpp
bar/bar.cpp
)

In bar/bar.cpp, I have a relative include

#include "../foo.h"

With the above setup, this will fail to compile as only ~/src/project/foo will 
be added to the include paths.

I'm aware that if I explicitly added the path it would work

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/bar)

However, if there is a way to get -I. added to my include path, that's what I'm 
after.

TIA
Steve


--

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:
http://public.kitware.com/mailman/listinfo/cmake



--
Craig Scott
Melbourne, Australia
https://crascit.com




--
Craig Scott
Melbourne, Australia
https://crascit.com

-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Visual Studios platform choice

2016-09-08 Thread Dvir Yitzchaki
We’re generating both 32 bit and 64 bit solutions and the drop down only shows 
one architecture on each solution.
Checked on VS 2013 and 2015.

Regards,

Dvir Yitzchaki
Debugger Software Engineer, SDT
[cid:image001.png@01D209C3.2089CC20]<http://www.ceva-dsp.com/> 
[cid:image002.png@01D209C3.2089CC20] 
<http://www.ceva-dsp.com/CEVA-Software-Development-Tools>  
[https://g.twimg.com/twitter-bird-16x16.png] <http://twitter.com/cevadsp>  
[http://img2.wikia.nocookie.net/__cb20100109182754/half-life/en/images/e/ec/YouTube_favicon.png]
 <http://www.youtube.com/cevadsp>  
[http://developer.linkedin.com/sites/default/files/LinkedIn_Logo16px.png] 
<http://www.linkedin.com/company/ceva/>

From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Jack Stalnaker
Sent: Wednesday, September 07, 2016 7:31 PM
To: cmake@cmake.org
Subject: [CMake] Visual Studios platform choice

Hi,

I understand from reading this newgroup (e.g. 
https://cmake.org/pipermail/cmake/2013-March/053775.html) that the only way to 
support multiple platforms in Visual Studio is to run CMake multiple times, 
once for each platform.

I'm porting some linux based code to the Windows world, and the Windows dev 
showed me that in Visual Studio, platform choice is a pulldown menu at the top 
of the screen. This pulldown appears even if we run CMake without specifying a 
64 bit platform. This is a bit confusing, because we've only generated a 
solution and project file for 32 bit. So what happens when someone selects 64 
bit on the pulldown menu? What's being built?

Thanks
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Interface targets with their own project in Visual Studio

2016-07-28 Thread Dvir Yitzchaki
You can use add_library(STATIC) and add 

set_target_properties( PROPERTIES LINKER_LANGUAGE CXX)

You won't be able to link to the target but you can use 
INTERFACE_INCLUDE_DIRECTORIES etc.

Regards,

Dvir Yitzchaki
Debugger Software Engineer, SDT



-Original Message-
From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Robert Dailey
Sent: Thursday, July 28, 2016 7:05 PM
To: CMake <cmake@cmake.org>
Subject: Re: [CMake] Interface targets with their own project in Visual Studio

On Tue, Jul 19, 2016 at 9:38 AM, Robert Dailey <rcdailey.li...@gmail.com> wrote:
> Hello,
>
> I'd like to define an INTERFACE library that has header files only but 
> still generates its own project in Visual Studio. The only way to add 
> headers to an interface target that I'm aware of is 
> target_source_files(), which instead of creating a project it will 
> cause the header files themselves to propagate to the actual targets 
> that specify the interface target as a link dependency.
>
> Is there a way to change this behavior?
>
> If not, the only workaround I can think of is pretty old-school:
> add_custom_target(), but if I use that I'm not sure I can specify 
> include directories and preprocessor definitions that will be 
> inherited by dependencies. So it seems like I'm forced to choose one 
> or the other.

Anyone have any thoughts on this please?
-- 

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:
http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] CMAKE_C++_CREATE_SHARED_LIBRARY missing

2016-07-11 Thread Dvir Yitzchaki
You were close.
I searched for 'C++' in all our CMakeLists.txt and found the line 

set_target_properties(foo PROPERTIES LINKER_LANGUAGE C++)

changed that to CXX and now the error is gone.

Thanks,

Dvir


-Original Message-
From: Andreas Mohr [mailto:a...@lisas.de] 
Sent: Sunday, July 10, 2016 7:12 PM
To: cmake@cmake.org
Cc: Dvir Yitzchaki
Subject: Re: [CMake] CMAKE_C++_CREATE_SHARED_LIBRARY missing

Hi,

On Sun, Jul 10, 2016 at 12:00:02PM -0400, cmake-requ...@cmake.org wrote:
> Message: 1
> Date: Sun, 10 Jul 2016 05:04:35 +
> From: Dvir Yitzchaki <dvir.yitzch...@ceva-dsp.com>
> To: "'cmake@cmake.org'" <cmake@cmake.org>
> Subject: [CMake] CMAKE_C++_CREATE_SHARED_LIBRARY missing
> Message-ID:
>   <71350f7ed6ebb54aa2d182b26086a1b60114ac5...@ilmail1.corp.local>
> Content-Type: text/plain; charset="us-ascii"
> 
> Hi.
> 
> I use cmake 3.3.1 on Red-Hat 5 and 6.
> When I generate a project I get the following error:
> 
> CMake Error: Error required internal CMake variable not set, cmake may be not 
> be built correctly.
> Missing variable is:
> CMAKE_C++_CREATE_SHARED_LIBRARY
> 
> However, after the error the generation succeeds and I can build the project 
> successfully.
> The same project is generated without errors on Windows 7 with Visual Studio 
> generators and other projects are also generated without errors on the same 
> Linux machine.
> 
> Does anyone knows the source of that error?

Rimshot idea:

Quite possibly someone did a
project(foo C C++)
rather than using the (IIRC - no docs here ATM) correct CXX.

HTH,

Andreas Mohr
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake


[CMake] CMAKE_C++_CREATE_SHARED_LIBRARY missing

2016-07-09 Thread Dvir Yitzchaki
Hi.

I use cmake 3.3.1 on Red-Hat 5 and 6.
When I generate a project I get the following error:

CMake Error: Error required internal CMake variable not set, cmake may be not 
be built correctly.
Missing variable is:
CMAKE_C++_CREATE_SHARED_LIBRARY

However, after the error the generation succeeds and I can build the project 
successfully.
The same project is generated without errors on Windows 7 with Visual Studio 
generators and other projects are also generated without errors on the same 
Linux machine.

Does anyone knows the source of that error?

Thanks,

Dvir
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] Target has dependency information when it shouldn't

2016-06-16 Thread Dvir Yitzchaki
Hi group.

I use CMake 3.3.1 with Visual Studio 2013.
I've changed a target from a static library to an INTERFACE library and now I 
get the following message from CMake:

CUSTOMBUILD : CMake error : Target <...> has dependency information when it 
shouldn't.
  Your cache is probably stale. Please remove the entry
<...>_LIB_DEPENDS

If I remove this entry from CMakeCache.txt manually everything works.
My question is why can't CMake do it for me as it obviously knows what to do.

Thanks,

Dvir
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake