[CMake] Problems building a MODULE library (OpenFX plugin) with correct cuda object linking
Hello, after hours and hours of searching and trying to get it to work I hope someone here can help me as I'm now out of ideas. I'm trying to build an OpenFX plugin for DaVinci Resolve (a movie color grading software, https://www.blackmagicdesign.com/products) via CMake. Resolve is delivered with a developer sample plugin using a standard Makefile (Mac) and project files for Apple XCode/VisualStudio. But for a better structure I wanted to build a CMake build framework for this plugin. Notes for better understanding: The CUDA implementation is a proprietary Add On to the OpenSource OpenFX interfaces as far as I understand it. Stock OpenFX would pass memory references only to host memory address space while the Resolve extension passed CUDA/OpenCL addresses to reduce memory transfer overhead for better real time processing. OpenFX plugins are build as bundles of objects(?) (MODULE library build in CMake). The basic structure is a plugin that offers processing with CPU, OpenCL or CUDA depending on the processing mode the host application is using. This plugin is bundled into a single module library which is loaded by Resolve. For the plugin a few helper classes are used to handle the Plugin metadata (user interface, host communication) while CUDA/OpenCL control code is also seperated into two separate files (OpenCLKernel.cpp and CudaKernel.cu). Both contain the GPU Kernel itselt and a host function which is included in the main Plugin just via extern declaration. Sample: extern void RunCudaKernel(int p_Width, int p_Height, float* p_Gain, const float* p_Input, float* p_Output); The Makefile then just compiles all cpp files with the standard $(CXX) compiler and the CudaKernel.cu with $(NVCC) which is defined before. Then a simple $(CXX) -bundle $^ -o $@ -L${CUDAPATH}/lib -lcuda -lcudart -F/Library/Frameworks -framework CUDA -framework OpenCL does the linking and works fine. I tried to replicate this structure of linking in CMake and it works as long as I keep CUDA deactivated (One of the reasons of building a flexible CMake infrastructure is making a few parts configurable via CMake/Compiler options). Most stuff is working now, but I have a problem integrating the CUDA part. For OpenCL I just build an object library from the OpenCLKernel.cpp and add it as a target object: add_library(GainLibOpenCL OBJECT OpenCLKernel.cpp) ... add_library(${PLUGIN_NAME} MODULE src/${PLUGIN_NAME}.cpp $) I tried to replicate this for the CUDA code but cuda_add_library doesn't seem to support generating object files and a combination of cuda_compile + add_library also doesn't allow to generate object files so how do I replicate the Makefile result. Here are two examples how I tried different methods. Did a few more tests based on many results of questions on the net but non solved my problem. Variant 1: cuda_add_library(GainLibCUDA CudaKernel.cu) set(LIBS ${LIBS} GainLibCUDA PARENT_SCOPE) Will compile but result in a crash of Resolve, with STATIC as an option for cuda_add_library it builds and Resolve stays open, but processing isn't working. And it links to the CUDA static libraries which isn't intended as the host cuda lib should be used. cuda_compile(cuda_exec_obj CudaKernel.cu) add_library(GainLibCUDA OBJECT CudaKernel.h ${cuda_exec_obj}) set(TARGET_OBJECTS ${TARGET_OBJECTS} $ PARENT_SCOPE) Results in the error: CMake Error at src/CUDA/CMakeLists.txt:21 (add_library): OBJECT library "GainLibCUDA" contains: cuda_compile_1_generated_CudaKernel.cu.o but may contain only sources that compile, header files, and other files that would not affect linking of a normal library. Also just adding "cuda_compile(cuda_exec_obj CudaKernel.cu)" and then ${cuda_exec_obj} as a file to the "add_library(${PLUGIN_NAME} MODULE ..." line results in and error: "Cannot find source file". So this mail got pretty long but I hope this helps someone to help me and then also help others if they reach a similar problem. Kind regards, Ingmar -- 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] (no subject)
Hello guys, I use multi-configuration generator (MSVC 2008) and I need to create one solution containing two configurations for one library target N: For build type Debug target N is compiled as static library For build type Release target N is compiled as shared library Something like this, but I know that I can't use CMAKE_BUILD_TYPE variable when I use multi-configuration generator: cmake_minimum_required (VERSION 2.8.11) project (hello) if(${CMAKE_BUILD_TYPE} STREQUAL Debug) add_library(hello STATIC main.cpp) elseif(${CMAKE_BUILD_TYPE} STREQUAL Release) add_library(hello SHARED main.cpp) endif() I already used CMAKE_CXX_FLAGS_DEBUG and CMAKE_CXX_FLAGS_RELEASE to distinguish some attributes between Debug and Release, but I can't figure it out in case of the library type (SHARED vs STATIC). Any ideas how to achieve it? Thanks Lukas -- 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-developers] Fwd: Re: How to get a nightly build process going.
Please see last comment at http://public.kitware.com/Bug/view.php?id=15166 -- Original Message -- Date: September 1, 2014 at 2:35 PM Subject: Re: [cmake-developers] How to get a nightly build process going. Back on topic... Solaris 10 + SolarisStudio http://open.cdash.org/buildSummary.php?buildid=3470493 No build failures, 4 test failures Solaris 10 + GCC (from OpenCSW) http://open.cdash.org/buildSummary.php?buildid=3470687 No build failures, 5 test failures I dug more into the test failures. 3 of the failures were due to a borked mercurial install on the machine, i.e. not a cmake problem but a system problem, which has since been fixed. Another was a FindGTK2 bug, which I just pushed a fix to next for. Given the _Bool fix and GTK2 fix, all tests should pass for nightly next on Solaris + suncc, and 1 failure for Solaris + GCC. So once you get your nightly submissions set up, I would expect a clean Solaris Studio build and test and a clean GCC build with 1 test failure. -- 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-developers
[cmake-developers] cc: acomp failed forSource/CursesDialog/form/fld_arg.c
Ran into what looks like a small issue : [ 48%] Building C object Source/CursesDialog/form/CMakeFiles/cmForm.dir/fld_arg.c.o /usr/local/build/cmake-3.0.2/Source/CursesDialog/form/form.h, line 46: cannot find include file: ncurses/ncurses.h which is odd because I do have /usr/local/include/ncurses/curses.h which says inside it : /* $Id: curses.h.in,v 1.220 2011/01/22 19:47:20 tom Exp $ */ So I am thinking somehow that the -I/usr/local/include was ignored or some other such nuisance. Any hints ? dev documented to death here : http://public.kitware.com/Bug/view.php?id=15166 -- 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-developers
Re: [cmake-developers] [CMake 0015131]: trace.c, line 219: error: identifier redeclared: trace_strbuf
well this is a new one on me ... totally wrong mantis site .. nice bug report however. someone delete this and taser me :-( On September 6, 2014 at 3:19 PM Mantis Bug Tracker man...@public.kitware.com wrote: The following issue has been SUBMITTED. == http://public.kitware.com/Bug/view.php?id=15131 == -- 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-developers
[cmake-developers] [CMake 0015131] DELETED.
thank you ... I clearly have too many software tasks going on here -- Original Message -- From: Mantis Bug Tracker man...@public.kitware.com To: cmake-developers@cmake.org Date: September 6, 2014 at 4:12 PM Subject: [cmake-developers] [CMake 0015131]: trace.c, line 219: error: identifier redeclared: trace_strbuf The following issue has been DELETED. -- 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-developers
[cmake-developers] How to get a nightly build process going.
So some time ago I tried, over and over, to get cmake to build on a Solaris server and needless to say it was a fairly frustrating experience. There seems to be GNIisms and GCCisms built in as well as other non-portable problems. Therefore I want to get a nightly build going and perhaps work on some of these issues to clean up portability. So then, what would be the first step in this process? dev -- 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-developers
Re: [cmake-developers] How to get a nightly build process going.
On August 30, 2014 at 1:04 PM Nils Gladitz nilsglad...@gmail.com wrote: On 30.08.2014 17:20, dev wrote: So some time ago I tried, over and over, to get cmake to build on a Solaris server and needless to say it was a fairly frustrating experience. There seems to be GNIisms and GCCisms built in as well as other non-portable problems. Therefore I want to get a nightly build going and perhaps work on some of these issues to clean up portability. So then, what would be the first step in this process? There are instructions on setting up a dashboard here: http://www.cmake.org/cmake/resources/testing.html Since setting up a dashboard itself requires a cmake installation the first step might require getting it to build some way. hold it. I need cmake to build cmake ? You mean there is no way to bootstrap cmake with just a compiler and a good solid basic UNIX system ? really ? dev -- 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-developers
Re: [cmake-developers] How to get a nightly build process going.
I need cmake to build cmake ? You mean there is no way to bootstrap cmake with just a compiler and a good solid basic UNIX system ? really ? No, you need CMake to run the dashboard. There is a bootstrap script, but you can't submit dashboard results with that. OKay, so the nightly process is on hold and I need to flail forwards and try to get cmake to just build and pass its own tests. That brings me back full circle to : 1 - it does not build and pass its own tests 2 - no one really does work on Solaris with cmake 3 - no one has a nightly process running such that work can get done So I am essentially caught in a catch 22 loop here. I may as well take a stab at step (1) again. Just to see what I get from a checkout/clone of the git repo. dev -- 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-developers
Re: [cmake-developers] How to get a nightly build process going.
On August 30, 2014 at 4:02 PM Rolf Eike Beer e...@sf-mail.de wrote: Am Samstag, 30. August 2014, 16:00:34 schrieben Sie: I need cmake to build cmake ? You mean there is no way to bootstrap cmake with just a compiler and a good solid basic UNIX system ? really ? No, you need CMake to run the dashboard. There is a bootstrap script, but you can't submit dashboard results with that. OKay, so the nightly process is on hold and I need to flail forwards and try to get cmake to just build and pass its own tests. That brings me back full circle to : 1 - it does not build and pass its own tests 2 - no one really does work on Solaris with cmake 3 - no one has a nightly process running such that work can get done So I am essentially caught in a catch 22 loop here. I may as well take a stab at step (1) again. Just to see what I get from a checkout/clone of the git repo. Well, it only needs to work, which you should have basically reached once it compiles. Then you can set up a dashboard and fix the tests. The problem is probably in my own head because I tend to define work as the ability to completely compile AND pass a testsuite. Which means that by that definition GCC never works but it gets pretty close. Perhaps close is good enough for now however I won't actually install whatever I have into a production system until it passes all the tests. So for the moment I have : $ /usr/local/bin/git clone --verbose git://cmake.org/cmake.git Cloning into 'cmake'... remote: Counting objects: 162805, done. remote: Compressing objects: 100% (41649/41649), done. remote: Total 162805 (delta 124692), reused 157825 (delta 119979) Receiving objects: 100% (162805/162805), 37.37 MiB | 953.00 KiB/s, done. Resolving deltas: 100% (124692/124692), done. Checking connectivity... done. Checking out files: 100% (7410/7410), done. What I need to do now is figure out a simple sequence of steps. I figure I'll need to tar up that result and move it to a build area, then use autoconf tools to generate a configure script or some such set of magic. dev -- 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-developers
Re: [cmake-developers] How to get a nightly build process going.
On August 30, 2014 at 5:10 PM Chuck Atkins chuck.atk...@kitware.com wrote: Hi dev, I've got a UltraSPARC III machine with Solaris 10 that I just checked. Still chugging along I bet. From what I can tell, gcc has no build errors and currently the only Solaris Studio build error is in liblzma. Try applying the attached patch if you're using SolarisStudio to fix the build problem. In the mean time I'll get it merged in and take a look at the tests. Ah yes .. that chestnut. I have seen this in gettext also : https://lists.gnu.org/archive/html/bug-gnulib/2014-05/msg1.html Therefore the same problem rears its ugly head within gettext 0.19.2 : po-lex.c, line 604: error: identifier redeclared: pass_obsolete_entries current : signed char previous: _Bool : po-lex.h, line 63 po-lex.c, line 1139: error: identifier redeclared: po_lex_pass_comments current : function(signed char) returning void previous: function(_Bool) returning void : po-lex.h, line 78 po-lex.c, line 1148: error: identifier redeclared: po_lex_pass_obsolete_entries current : function(signed char) returning void previous: function(_Bool) returning void : po-lex.h, line 82 cc: acomp failed for po-lex.c gmake[5]: *** [libgettextsrc_la-po-lex.lo] Error 1 Unfortunately my Solaris system is very old and flaky and is known to have hardware die on a regular basis so we can't rely on it for a nightly build. I have tons, literally, of weird hardware around me. Including a few from the late 90's that are still running and that includes a DEC AlphaServer 4100 series. Not sure what to do with that. However Sparc servers both old and new I have. Well, newish anyways. If you can get a nightly dashboard set up it would be very helpful so we can know right away when issues come up. Well it is pretty clear that cmake is a critical piece. Must have it and therefore, here I am trying to do something. I will say that I do have a cmake binary however its test results are not pretty : $ cd $HOME/bin/ $ file cmake cmake: ELF 64-bit MSB executable, SPARC V9, total store ordering, version 1, dynamically linked (uses shared libs), not stripped $ ldd cmake libCstd.so.1 = /usr/lib/64/libCstd.so.1 libCrun.so.1 = /usr/lib/64/libCrun.so.1 libm.so.2 = /lib/64/libm.so.2 libc.so.1 = /lib/64/libc.so.1 /platform/SUNW,T5240/lib/sparcv9/libc_psr.so.1 A big fat binary over 146MB in size. Staggering. I have no idea how to check version. dev -- 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-developers
[CMake] Generating Visual Studio 2008 solution with specified toolset in command-line
Hello, I partially ported our project from Visual Studio vcproj files to cmake. I'm successful when I use cmake-gui and I select generator Visual Studio 9 2008 Windows Mobile 5.0 Smartphone SDK (ARMV4I). Correct solution file is generated and I can compile. Now I'm trying to generate solution file using command line for our intergeration server and right now running: mkdir build cd build cmake .. -G Visual Studio 9 2008 generates Visual Studio 9 2008 solution and I would like to specify somehow, not sure if toolset, but that Windows Mobile 5.0 Smartphone SDK (ARMV4I) part. I'm able to select it in the list of generators in cmake-gui. How can I do that in console? I see that there is toolset -T,but it is supported by Visual Studio 2010 generator and later, but then how cmake-gui is doing the trick? Regards, Lukas -- 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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Using CMake with SWIG and Ruby
Bumping to the top, still looking for some help. On Tue, Apr 10, 2012 at 9:52 PM, Dev Guy devguy...@gmail.com wrote: Hi Guy, with all my searching and reading I've have not been able to find a way to build a Ruby extension using SWIG with CMake. Here is my CMakeLists.txt CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(RUBY_WRAPPER) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) FIND_PACKAGE(Ruby) INCLUDE_DIRECTORIES(${RUBY_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(CMAKE_SWIG_FLAGS -c++) SET_SOURCE_FILES_PROPERTIES(person.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(person.i PROPERTIES SWIG_FLAGS -includeall) SWIG_ADD_MODULE(person ruby person.i person.cpp) SWIG_LINK_LIBRARIES(person ${RUBY_LIBRARY}) When I type make, I get the following error: [ 33%] Swig source /home/yadav/dev/cpp/swig_example/person.h:19: Error: Unable to find 'string' make[2]: *** [personRUBY_wrap.cxx] Error 1 make[1]: *** [CMakeFiles/person.dir/all] Error 2 make: *** [all] Error 2 -- Kind Regards, Rajinder Yadav SafetyNet Test Driven Development http://safetynet.devmentor.org -- Kind Regards, Rajinder Yadav SafetyNet Test Driven Development http://safetynet.devmentor.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Using CMake with SWIG and Ruby
Hi Guy, with all my searching and reading I've have not been able to find a way to build a Ruby extension using SWIG with CMake. Here is my CMakeLists.txt CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(RUBY_WRAPPER) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) FIND_PACKAGE(Ruby) INCLUDE_DIRECTORIES(${RUBY_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(CMAKE_SWIG_FLAGS -c++) SET_SOURCE_FILES_PROPERTIES(person.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(person.i PROPERTIES SWIG_FLAGS -includeall) SWIG_ADD_MODULE(person ruby person.i person.cpp) SWIG_LINK_LIBRARIES(person ${RUBY_LIBRARY}) When I type make, I get the following error: [ 33%] Swig source /home/yadav/dev/cpp/swig_example/person.h:19: Error: Unable to find 'string' make[2]: *** [personRUBY_wrap.cxx] Error 1 make[1]: *** [CMakeFiles/person.dir/all] Error 2 make: *** [all] Error 2 -- Kind Regards, Rajinder Yadav SafetyNet Test Driven Development http://safetynet.devmentor.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] how to specify a different source directory
I have a project file and within it I have created a test folder and placed some testing code there. From my test CMakelist, I need to access a .cpp file from the parent folder but I am not sure how to do this? Thus the call to add_executable fails because it can't locate the source file. -- Kind Regards, Rajinder Yadav -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] how to specify a different source directory
On Thu, Feb 2, 2012 at 7:46 PM, Dev Guy devguy...@gmail.com wrote: I have a project file and within it I have created a test folder and placed some testing code there. From my test CMakelist, I need to access a .cpp file from the parent folder but I am not sure how to do this? Thus the call to add_executable fails because it can't locate the source file. OK I figured out when I pass in the source file to add_executable, I just need to prefix the source file with ../ Is this the proper way to do it, or should I be using another cmake command to declare a source folder? Thanks, Rajinder -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] syntax error on Win7 x64
I am seeing an error from CMake on Win7 x64 that I don't see in WinXP. The following 2 statements seems to be causing the errors below (I've double checked that the environment var MSSDK_ROOT exists and is defined). include_directories(${ENV[MSSDK_ROOT]}\\Include) link_directories(${ENV[MSSDK_ROOT]}\\Lib) CMake Error === CMake Warning (dev) at CMakeLists.txt:9 (include_directories): Syntax error in cmake code at C:/dev/cpp/Project/safetynet/MonitorTestClient/CMakeLists.txt:9 when parsing string ${ENV[MSSDK_ROOT]}\\Include syntax error, unexpected cal_SYMBOL, expecting } (18) Policy CMP0010 is not set: Bad variable reference syntax is an error. Run cmake --help-policy CMP0010 for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at CMakeLists.txt:10 (link_directories): Syntax error in cmake code at C:/dev/cpp/Project/safetynet/MonitorTestClient/CMakeLists.txt:10 when parsing string ${ENV[MSSDK_ROOT]}\\Lib syntax error, unexpected cal_SYMBOL, expecting } (18) -- Kind Regards, Rajinder Yadav -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] syntax error on Win7 x64
OK I realized my error, I should be using $ENV{MSSDK_ROOT} On Wed, Feb 1, 2012 at 12:02 AM, Dev Guy devguy...@gmail.com wrote: I am seeing an error from CMake on Win7 x64 that I don't see in WinXP. The following 2 statements seems to be causing the errors below (I've double checked that the environment var MSSDK_ROOT exists and is defined). include_directories(${ENV[MSSDK_ROOT]}\\Include) link_directories(${ENV[MSSDK_ROOT]}\\Lib) CMake Error === CMake Warning (dev) at CMakeLists.txt:9 (include_directories): Syntax error in cmake code at C:/dev/cpp/Project/safetynet/MonitorTestClient/CMakeLists.txt:9 when parsing string ${ENV[MSSDK_ROOT]}\\Include syntax error, unexpected cal_SYMBOL, expecting } (18) Policy CMP0010 is not set: Bad variable reference syntax is an error. Run cmake --help-policy CMP0010 for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at CMakeLists.txt:10 (link_directories): Syntax error in cmake code at C:/dev/cpp/Project/safetynet/MonitorTestClient/CMakeLists.txt:10 when parsing string ${ENV[MSSDK_ROOT]}\\Lib syntax error, unexpected cal_SYMBOL, expecting } (18) -- Kind Regards, Rajinder Yadav -- Kind Regards, Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely GNU/Linux: 2.6.35-22-generic Kubuntu x86_64 10.10 | KDE 4.5.1 Ruby 1.9.2p0 | Rails 3.0.1 -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] building libs and specifying addition folders
Hi, I am relatively new to CMake and I've read the tutorial. However I have a few questions. 1. How can I declare a CMakeLists file to create a project to build a DLL or static lib ? I assume if I build a DLL on windows, it will build as a shared lib on Linux 2. If my main source folder has 2 sub-folders, one that only includes header files call is Include and another folder that contains source files call it Utils. How do I add declare them to my CMakeLists files so that both the header and addition source files are found and and compiled in the main source folder to build the final binary. Thanks, -- Kind Regards, Rajinder Yadav -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Fwd: building libs and specifying addition folders
On Thu, Jan 19, 2012 at 1:01 AM, John Drescher dresche...@gmail.com wrote: -- Forwarded message -- From: John Drescher dresche...@gmail.com Date: Thu, Jan 19, 2012 at 1:00 AM Subject: Re: [CMake] building libs and specifying addition folders To: Dev Guy devguy...@gmail.com On Wed, Jan 18, 2012 at 10:57 PM, Dev Guy devguy...@gmail.com wrote: Hi, I am relatively new to CMake and I've read the tutorial. However I have a few questions. 1. How can I declare a CMakeLists file to create a project to build a DLL or static lib ? I assume if I build a DLL on windows, it will build as a shared lib on Linux put SHARED in the add_library statement For more info than that type the following from a command prompt or shell: cmake --help-command add_library 2. If my main source folder has 2 sub-folders, one that only includes header files call is Include and another folder that contains source files call it Utils. How do I add declare them to my CMakeLists files so that both the header and addition source files are found and and compiled in the main source folder to build the final binary. add_subdirectory Again for help: cmake --help-command add_subdirectory John -- John M. Drescher -- John thanks, I was able to get a DLL built, now I have a program that want to link against the lib and use the DLL. What I've done is create a Lib folder under the source folder wanting to use the lib, I copied over the lib find and header file. I added the following to CMakeLists.txt add_subdirectory(Lib) target_link_libraries (SimpleTester UnitTest) However I am seeing 2 errors: Error 1, when I run CMake I see: CMake Warning (dev) at CMakeLists.txt:6 (add_subdirectory): The source directory C:/dev/Project/UnitTestSample/Lib does not contain a CMakeLists.txt file. CMake does not support this case but it used to work accidentally and is being allowed for compatibility. Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run cmake --help-policy CMP0014 for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. -- Configuring done -- Generating done -- Build files have been written to: C:/dev/Project/UnitTestSample/build == Error 2 When I build I get a link error, which I fix by copying over the lib file into the build folder. How can I tell the linker from CMake where to find the lib? LINK : fatal error LNK1104: cannot open file 'UnitTest.lib' LINK Pass 1 failed. with 2 NMAKE : fatal error U1077: 'C:\Program Files\CMake 2.8\bin\cmake.exe' : return code '0x' Stop. NMAKE : fatal error U1077: 'C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe' : retu rn code '0x2' Stop. NMAKE : fatal error U1077: 'C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe' : retu rn code '0x2' Stop. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Copying some files using CMake
Dear List, I've got a question on copying some files from one directory to another using CMake. Let's say, I got some libraries collected in a special directory. I want CMake to copy these libs to the distribution directory of my project. Using add_custom_command, I managed to have CMake copy my .exe to the distribution directory, but when I try to do this for my libraries something goes terribly wrong. add_custom_command( TARGET MagicRPG POST_BUILD COMMAND copy \$(TargetPath)\ .\\dist\\bin ) is what I did to copy my exe. When I use this add_custom_command( TARGET MagicRPG POST_BUILD COMMAND copy \$(TargetPath)\ \${SDKS_BASE_DIR}/SDL/lib/SDL.dll\ .\\dist\\bin) to get SDL.dll copied to dist/bin Visual Studio fails with message Fehler1error MSB3073: Der Befehl copy D:\Projekte\cpp\games\Magic\bin\Debug\MagicRPG.exe D:/SDKs/SDL/lib/SDL.dll .\dist\bin if errorlevel 1 goto VCReportError :VCEnd wurde mit dem Code 1 beendet.C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets113 6MagicRPG Can anybody please help me with the right syntax for copying multiple files at POST_BUILD? Best Michael ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Copying some files using CMake
Thanks for your reply John. There is one question left about your GetRuntime module. The files you copy are located within the CMake directory in your root source dir, right? Best Michael Am 23.12.2010 17:28, schrieb John Drescher: On Thu, Dec 23, 2010 at 11:18 AM, Stormwind Dev stormwind@googlemail.com wrote: Dear List, I've got a question on copying some files from one directory to another using CMake. Let's say, I got some libraries collected in a special directory. I want CMake to copy these libs to the distribution directory of my project. Using add_custom_command, I managed to have CMake copy my .exe to the distribution directory, but when I try to do this for my libraries something goes terribly wrong. add_custom_command( TARGET MagicRPG POST_BUILD COMMAND copy \$(TargetPath)\ .\\dist\\bin ) is what I did to copy my exe. When I use this add_custom_command( TARGET MagicRPG POST_BUILD COMMAND copy \$(TargetPath)\ \${SDKS_BASE_DIR}/SDL/lib/SDL.dll\ .\\dist\\bin) to get SDL.dll copied to dist/bin Visual Studio fails with message Fehler1error MSB3073: Der Befehl copy D:\Projekte\cpp\games\Magic\bin\Debug\MagicRPG.exe D:/SDKs/SDL/lib/SDL.dll .\dist\bin if errorlevel 1 goto VCReportError :VCEnd wurde mit dem Code 1 beendet.C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets1136 MagicRPG Can anybody please help me with the right syntax for copying multiple files at POST_BUILD? Attached are 3 CMake modules I use for this. One is a macro that builds a batch file that ends up being a target in visual studio. I put them in a CMake folder inside my root source folder and have the following line in my main CMakeLists.txt include(${PROJECT_SOURCE_DIR}/CMake/GetRuntime.cmake) this brings in the macro with support for generating the batch file and GetRuntime target. Then later in the main CMakeLists.txt file I use the other two modules. FIND_PACKAGE( Qt4 REQUIRED ) set(QT_USE_QTNETWORK true) set(QT_USE_QTSQL true) set(QT_USE_QTXML true) INCLUDE( ${QT_USE_FILE} ) include(${PROJECT_SOURCE_DIR}/CMake/GetQtRuntime.cmake) IF(USE_QWT) FIND_PACKAGE(Qwt REQUIRED) INCLUDE_DIRECTORIES(${QWT_INCLUDE_DIR}) include(${PROJECT_SOURCE_DIR}/CMake/GetQwtRuntime.cmake) set (UPMC_EXTERNAL_LIBS ${UPMC_EXTERNAL_LIBS} ${QWT_LIBRARIES}) ENDIF(USE_QWT) John ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] add_test command in a sub-directory
Selon Nathaniel Waisbrot (Cont ARL/CISD) nathaniel.waisb...@arl.army.mil: Try moving the ENABLE_TESTING() call to the top-level CMakeLists.txt, before any calls to add_subdirectory(). Add_test() can stay where it is. Thanks it works perfectly. But the behavior of ENABLE_TESTING() is disturbing. I think it will be great if this issue was present in the documentation (i.e. cmake --help ENABLE_TESTING). Thanks for all. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] CTest failed to find the correct drop site
Hi everybody, I'm currently having a problem using cmake and ctest. I have a project with test. The basic work cycle (cmake make make install make test) is fine. But when I run ctest -D Experimental the test is launch but the files are submitting to the wrong dashboard (public.kitware.com instead of my own cdash). In my top-level CMakeLists.txt I have include the CTestConfig.cmake generated by the CDash site. [...] include(CTestConfig) [...] The generated CTestConfig is: [...] ENABLE_TESTING() INCLUDE(CTest) set(CTEST_PROJECT_NAME Qb_test_compile) set(CTEST_NIGHTLY_START_TIME 00:00:00 EST) set(CTEST_DROP_METHOD http) set(CTEST_DROP_SITE 172.21.101.61) set(CTEST_DROP_LOCATION /cdash/submit.php?project=Qb_test_compile) set(CTEST_DROP_SITE_CDASH TRUE) At the end of my top-level CMakeLists.txt, the CTEST_DROP_SITE has the correct value. But the DartConfigurationFile.tcl seems not to be correct: $ grep -i dropsite DartConfiguration.tcl DropSite: public.kitware.com DropSiteUser: DropSitePassword: DropSiteMode: And ctest submit to the wrong dashboard: Site: VE3878 Build name: Linux-c++ Create new tag: 20091002-1636 - Experimental Start processing tests Configure project Each . represents 1024 bytes of output . Size of output: 0K Error(s) when updating the project Build project Each symbol represents 1024 bytes of output. '!' represents an error and '*' a warning. . Size of output: 0K 1 Compiler errors 0 Compiler warnings Test project /home/rjacquet/work/qbee/Development/tmp 1/ 1 Testing TestProject Passed 100% tests passed, 0 tests failed out of 1 Performing coverage Cannot find any coverage files. Ignoring Coverage request. Use HTTP Proxy: http://lucluc:xxx...@192.168.162.142:8080 Submit files (using http) Using HTTP submit method Drop site: http://public.kitware.com/cgi-bin/HTTPUploadDartFile.cgi Uploaded: /home/rjacquet/work/qbee/Development/tmp/Testing/20091002-1636/Build.xml Uploaded: /home/rjacquet/work/qbee/Development/tmp/Testing/20091002-1636/Configure.xml Uploaded: /home/rjacquet/work/qbee/Development/tmp/Testing/20091002-1636/Test.xml Using HTTP trigger method Trigger site: http://public.kitware.com/cgi-bin/Submit-Random-TestingResults.cgi Dart server triggered... Submission successful Errors while running CTest Thanks in advance for any help. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] add_test command in a sub-directory
Hi everybody, I have found a strange behavior with CTest. I had a very simple projet with one test, which works perfectly. I have changed the architecture of my project. I have now a subdirectory. Now: CMakeLists.txt -myDir/ -myDir/*cpp -myDir/*h -myDir/CMakeLists.txt The idea behind is the top-level CMakeLists.txt just call the other CMakeLists.txt with the add_subdirectory command. Everything works except that the target make test. $make test make: *** No rule to make target `test'. Stop. I have found some workaround, moving the add_test command in the level directory. But it's not very easy to use. Is there a reason for the add_test command to not work in a subdirectory? Thanks in advance for any help. -- The top-level CMakeLists.txt: project(ROMAIN_CTEST) cmake_minimum_required(VERSION 2.6) SET(QT_DIR /data/qt-x11-opensource-src-4.5.2/install_dir/) SET(CMAKE_MODULE_PATH /data/Development/Scripts/CMakeModules) INCLUDE(Qt) add_subdirectory(messagelib) -- The inner CMakeLists.txt: include_directories(/data/qt-x11-opensource-src-4.5.2/install_dir/include/QtCore/) include_directories(/data/qt-x11-opensource-src-4.5.2/install_dir/include/) link_directories(/data/qt-x11-opensource-src-4.5.2/install_dir/lib/) QT4_AUTOMOC(mocGenList /data/messagelib/qb/message.h) #add_library (message message.cpp ${mocGenList}) message(mocGenList ${mocGenList}) add_executable (montest test.cpp message.cpp ${mocGenList}) target_link_libraries(montest QtCore) ENABLE_TESTING() ADD_TEST(SimpleTest montest) ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] [CPACK:rpm] Add library?
Thanks for your answer. I thought CPACK_PACKAGE_EXECUTABLES was for NSIS installer for adding start menu entry: http://www.vtk.org/Wiki/CMake:CPackConfiguration Is it used for something else? After reading the source code, I think you are right. It not used by the rpm generator. - CPACK_INSTALL_DIRECTORIES seems not to do nothing with the rpm generator. Is there any workaround? This is a bug/missing feature, could you please file a bug report for CPackRPM? You may off course provide a patch too :-) Could you tell me which other CPack generator honors the CPACK_INSTALL_DIRECTORIES ? I really don't know. I haven't found any clues in the source code. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] [CPACK:rpm] Add library?
Hello everybody, I'm using cmake 2.6.4. I want to add externals libraries to aa rpm build with cmake/cpack. I have several questions: - Is there any library equivalent for CPACK_PACKAGE_EXECUTABLES? I expect that CPACK_PACKAGE_LIBRARY work, but it does not. - CPACK_INSTALL_DIRECTORIES seems not to do nothing with the rpm generator. Is there any workaround? - Why we could not change the prefix in the spec files? The line %define prefix ${CMAKE_INSTALL_PREFIX} is commented in the file CPackRPM.cmake. Best regards. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] FindPkgConfig module on Windows
Hello, I understand that the Findxxx() module (like FindBoost) is better than use of pkg-config file (particularly with cross compiling context), but pkg-config can be convenient. I've installed the pkg-config port on windows (from gnome.org) and it seems to work at a first glance. but I've got a problem with the prefix path variable in the *.pc file. On windows, by default, pkg-config tries to guess the prefix (not in Linux). So on my machine, it always defines prefix variable as c:\usr\local. One of the goal of pkg-config is parameterization, so if prefix is ignored, it does not do the good job, .imho. In fact, we can use the --dont-define-prefix command line parameter of pkg-config. With this, pkg-config acts as attended. I think the FindPkgConfig module could have an option/variable for --dont-define-prefix use with windows variant. I statically write code if(WIN32) set(PKG_CONFIG_EXECUTABLE ${PKG_CONFIG_EXECUTABLE} --dont-define-prefix endif(WIN32) /code Manfred ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] ADD_CUSTOM_TARGET options
Hello, I am new to cmake. I am working on a new project which includes integrating multiple projects and also develop couple of new software modules. Projects to be integrated say xyz, has its own makefile and can take multiple options not just clean. I would like to develop a common cmake build environment for all the projects (including those being imported and ones which are new). Can some help me in writing a rule for integrating project xyz. I wrote the rule, ADD_CUSTOM_TARGET(xyz ALL COMMAND make WORKING_DIRECTORY ../${SRC_ROOT}/xyz-src COMMENT Building project XYZ VERBATIM ) This rule effectively builds make xyz. But, if I want to do make xyz clean or make xyz buildx results in performing make operation all over again. How can I write a rule to be able to do make xyz clean or make xyz buildx. Thanks, -Vasu Have a burning question? Go to www.Answers.yahoo.com and get answers from real people who know. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake