Re: [CMake] visual studio tries to link to non-existent static version of lib

2016-08-23 Thread Nils Gladitz
On 23.08.2016 21:36, Jack Stalnaker wrote: The following works on Linux, for both GNU and Intel compilers: add_library(mylib SHARED ${mylib_sources}) target_link_libraries(mylib ${mylib_libraries}) ... add_executable(test_mylib test_mylib.c) target_link_libraries(test_mylib mylib ${test_mylib_li

[CMake] visual studio tries to link to non-existent static version of lib

2016-08-23 Thread Jack Stalnaker
The following works on Linux, for both GNU and Intel compilers: add_library(mylib SHARED ${mylib_sources}) target_link_libraries(mylib ${mylib_libraries}) ... add_executable(test_mylib test_mylib.c) target_link_libraries(test_mylib mylib ${test_mylib_libraries}) add_test (TestMylib test_mylib) H

Re: [CMake] [EXTERNAL]: Re: Xcode generator problems

2016-08-23 Thread Parag Chandra
Hi Robert, We have a similar requirement, so I basically run “ar -x” to explode all of the static libraries into their constituent pieces, and then run “ar cr" to recombine them into one monolithic static library. This is done via Gradle, after it runs CMake to build the static libraries in the

Re: [CMake] Custom target for running tests as part of the build

2016-08-23 Thread Steve Lorimer
Thanks Matt, that works great! As a note for if someone wants to repeat this in the future... One of the things I initially tried was bash stdout and stderr redirection (using &>) &>${TEST_NAME}.output This doesn't work. I guess it causes the test to run in the background? It also results in t

Re: [CMake] Custom target for running tests as part of the build

2016-08-23 Thread Matthew Keeler
One thing I see immediately is this line: $ > ${TEST_NAME}.output || cat ${TEST_NAME}.output Unless ${TEST_NAME}.output doesn’t exist cat is going to have a successful exit status and cause the whole COMMAND to be successful. Something like “|| (cat ${TEST_NAME}.output && false)” should work in b

[CMake] [CTest] Set BuildName through command line

2016-08-23 Thread Kim Kryger
I'm trying to simply set the name of the build to be sent to CDash to something on the command line. I've tried a few different avenues, but no options seem to affect the build name, other than reconfiguring CMake. I am using Visual Studio, which of course is multi-configuration, which means that a

[CMake] Custom target for running tests as part of the build

2016-08-23 Thread Steve Lorimer
We have several unit tests which we would like to be run as part of our build process. To achieve this I have a helper script which creates a custom command that runs the test, and if successful, creates a file "test_name.passed". I then add a custom target "test_name.run" which depends on "test_

Re: [CMake] Xcode generator problems

2016-08-23 Thread Robert Bielik
I just realized this is in error, issue is closed. But I still have the need to combine several static libraries into ONE static library. There seems to be descriptions of solutions to this, but they are rather convoluted, so is there an "easy" way of doing: add_library(foo STATIC ) add_librar