[cmake-developers] [CMake 0012318]: typo on the tutorial page (v 2.6)
The following issue has been SUBMITTED. == http://public.kitware.com/Bug/view.php?id=12318 == Reported By:Jerry Assigned To: == Project:CMake Issue ID: 12318 Category: CMake Reproducibility:N/A Severity: text Priority: normal Status: new == Date Submitted: 2011-07-05 23:00 EDT Last Modified: 2011-07-05 23:00 EDT == Summary:typo on the tutorial page (v 2.6) Description: http://www.cmake.org/cmake/help/cmake_tutorial.html#s3 The title should be Installing and Testing (Step 3) == Issue History Date ModifiedUsername FieldChange == 2011-07-05 23:00 Jerry New Issue == ___ cmake-developers mailing list cmake-developers@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [CMake] Project with .NET Formular (Header with resx)
A .NET Forms -based, managed C++ project is certainly not the typical output of a CMake project. CMake is largely focused on cross-platform C++ projects. Believe it or not, you may be the first to attempt to do this and expect it to work... If this is just a piece of a larger project, you could certainly use Visual Studio to build an existing *.vcproj file, either via the include_external_msproject command or via CMake's ExternalProject module. http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:include_external_msproject http://www.cmake.org/cmake/help/cmake-2-8-docs.html#module:ExternalProject HTH, David On Sat, Jul 2, 2011 at 10:43 AM, Simon Adler cm...@cg-effects.de wrote: I tried some more. I changed the Headers in the VS2008 Project (generated by cmake) manually to type Header-Formula. I tried to enter the Form-Designer with a double-Click on a Form, but VS2008 showed me that the form is now corrupt. So i have to alter my question: Is it even possible to generate a cmake Projekt using .NET Forms? Greetings Simon On Sat, Jul 2, 2011 at 1:01 PM, Simon Adler cm...@cg-effects.de wrote: Hello Mailing List i am quite new to CMake. I have a project i originally build with visual studio 2008. I try to create a cmake Projekt so i can use cmake in the future. I am using .NET Forms which are Headers with associated resx files. In Visual-Studio the only difference between Headers and Forms are that the FileType differs (In the propierties) How can I change this for a header via cmake? # find header in current folder file (GLOB fhead *.h) foreach ( filename ${fhead} ) GET_FILENAME_COMPONENT( filepath ${filename} PATH ) GET_FILENAME_COMPONENT( filebase ${filename} NAME_WE ) SET(Source ${filepath}/${filebase}.cpp) SET(Res${filepath}/${filebase}.resx) if (EXISTS ${Res}) # a resx exists, so it IS a form SET(FormHeader ${FormHeader} ${filename}) if (EXISTS ${Source}) # there is an additional implementation file SET(FormSource ${FormSource} ${Source}) endif (EXISTS ${Source}) endif (EXISTS ${Res}) endforeach ( filename ) With this code i got the forms how i expect it, but every header is just a Header and not konwn as formular to visual studio Hope some may give me a hint. Thank you very much Simon ___ 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 ___ 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] problem with CMAKE_FIND_LIBRARY_SUFFIXES/FindBLAS/BLA_STATIC
Dear developers, I am having what looks like a problem with library suffixes which I am not able to figure out. Essentially, our project has an option which when turned on adds a -static to the compiler flags. This then obviously need any libraries to be static if one should use them. I then wanted to link against BLAS/LAPACK, but need to require that the suffix is e.g. .a when on a linux system. First I tried to set the BLA_STATIC. However, it seems that even though I have a libblas.a in my /usr/lib/, it does not find it. It should be noted that libblas.a is a symbolic link to libgoto2.a which is another symbolic link to libgoto2_penrynp-r1.13.a. Unsure if this causes any problems (?). Another user reported that instead of failing to find the libraries, it just went on using the dynamic libraries which he had on his system. Looking at how BLA_STATIC is defined, that makes sense if he didn't have the libblas.a in his system. Linking then failed obviously. I figured in our case it would be better to just set the CMAKE_FIND_LIBRARY_SUFFIXES ourselves, instead of using BLA_STATIC. However, I still have the problem that it does not find my libblas.a file. Anyone knows what I am doing wrong? I am using cmake version 2.8.4, and he is using Debian Sid (unsure which version of cmake, but I can check if it is important). Cheers, Yngve ___ 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] CMAKE_ROOT issue in scratchbox, N9(50)
Hi, I am trying to build a package in scratchbox on Harmattan, but I am having a small issue in the installation step (The compilation and build went just fine). Everything worked just fine previously on MeeGo and desktop system. This is the first place where I have such an issue. We have some our own internal cmake module files that we would like to install. This is the relevant CMakeLists.txt entry of our build system: https://projects.kde.org/projects/playground/games/gluon/repository/revisions/master/entry/CMakeLists.txt#L172 When I am trying to find the the FindOpenGLES2.cmake file for instance in our debian folder, it is like /debian/tmp/targets/maemo6-armv7/usr/share/cmake-2.8/Modules/FindOpenGLES2.cmake instead of /debian/tmp/usr/share/cmake-2.8/Modules/FindOpenGLES2.cmake. It somehow picks up the target. I am not sure whether or not it is expected, but the other file installations do not pick this targets/maemo6-armv7 folder up. Am I doing something wrong in our CMakeLists.txt file or is it the expected location and for non cmake files the expected location is /debian/tmp/usr/... ? As a simple and novice user, I would expect it should be the same in all case. Any help is welcome, thank you in advance! =) Best Regards, Laszlo Papp ___ 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] External_Project_Add() and custom build configurations ?
This had me stumped for a while until I came across the -P command line option to cmake. I have now added a build command to my external project like so: ExternalProject_Add(external_proj PREFIX${CMAKE_BINARY_DIR}/external_proj SOURCE_DIR${CMAKE_SOURCE_DIR}/external_proj CMAKE_ARGS-DCMAKE_BUILD_TYPE:STRING=Release -DMETAGS_DIR=${METASIM_INSTALL_DIR} BUILD_COMMAND${CMAKE_COMMAND} -DBUILD_TARGET:STRING=external_proj -DBUILD_CONFIG:STRING=${CMAKE_CFG_INTDIR} -P ${CMAKE_SOURCE_DIR}/ExProjectBuild.cmake INSTALL_COMMAND ) And then the ExProjectBuild.cmake file invokes cmake --build with the build config changed appropriately when necessary: message(In ExternalProjectBuild:) message(BUILD_TARGET=${BUILD_TARGET}) message(BUILD_CONFIG=${BUILD_CONFIG}) message(CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}) set (standardConfigsRelease Debug RelWithDebInfo MinSizeRel) # map each build config in extraConfigs to the item in the same position in extraConfigsMap set (extraConfigsReleaseNoHidebugDebugPthreads DebugOptimised) set (extraConfigsMapReleaseDebugDebug) list(FIND standardConfigs ${BUILD_CONFIG} pos) if (pos LESS 0) list(FIND extraConfigs ${BUILD_CONFIG} pos) if (pos LESS 0) message(FATAL_ERROR Unknown build config: ${BUILD_CONFIG}) endif() list(GET extraConfigsMap ${pos} BUILD_CONFIG) message( MAPPED CONFIG: ${BUILD_CONFIG}) endif() execute_process( COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --config ${BUILD_CONFIG} ) Is that what you meant when you suggested using a custom BUILD_COMMAND ? Or was there a simpler way to do it ? Also, I note that when I clean the external project in Visual Studio it doesn't really clean it (i.e. after the clean a build still thinks there is nothing to do). And the clean doesn't invoke my ExProjectBuild script. If I manually run cmake --build externalProjectDir --target clean from the command line then it does clean the project properly. Is ExternalProject_Add() missing some functionality here, or have I misunderstood something ? -- Glenn On 1 July 2011 18:01, David Cole david.c...@kitware.com wrote: On Fri, Jul 1, 2011 at 7:23 AM, Glenn Coombs glenn.coo...@gmail.comwrote: I have just started using some externally supplied cmake projects in my cmake project. To do this I added these lines to my top level CMakeLists.txt file: include(ExternalProject) ExternalProject_Add(external_proj PREFIX${CMAKE_BINARY_DIR}/external_proj SOURCE_DIR${CMAKE_SOURCE_DIR}/external/proj/dir CMAKE_ARGS-DCMAKE_BUILD_TYPE:STRING=Release -DMETAGS_DIR=${CMAKE_BINARY_DIR}/meta_install INSTALL_COMMAND ) And that worked very well. Inside Visual Studio when I build my project it automatically runs the cmake configure step for the external projects and builds them as well. The problem I have just discovered is when using a build configuration other than the default ones. I can build Debug and Release configurations fine. My project also has a DebugOptimised configuration but the external projects don't. When I try to build my project it fails to build the external projects. I used build_command() to see what commands would be used to build each configuration and I can see the cause of the problem: Debug: VCExpress.exe myProj.sln /build Debug /project external_proj DebugOptimised: VCExpress.exe myProj.sln /build DebugOptimised /project external_proj Is there a way to tell cmake how to map my build configurations onto those that an external project has ? In this case I would like to build the external project as Debug when I am building my project as DebugOptimised. -- Glenn ___ 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 With Visual Studio builds, external projects get built (by default) with the same configuration as the outer project. If you want a different configuration built, then you will have to customize the BUILD_COMMAND. You can look in the source for ExternalProject.cmake to see how the default BUILD_COMMAND is constructed and go from there. HTH, David ___ 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
Re: [CMake] External_Project_Add() and custom build configurations ?
On Tue, Jul 5, 2011 at 12:02 PM, Glenn Coombs glenn.coo...@gmail.comwrote: This had me stumped for a while until I came across the -P command line option to cmake. I have now added a build command to my external project like so: ExternalProject_Add(external_proj PREFIX${CMAKE_BINARY_DIR}/external_proj SOURCE_DIR${CMAKE_SOURCE_DIR}/external_proj CMAKE_ARGS-DCMAKE_BUILD_TYPE:STRING=Release -DMETAGS_DIR=${METASIM_INSTALL_DIR} BUILD_COMMAND${CMAKE_COMMAND} -DBUILD_TARGET:STRING=external_proj -DBUILD_CONFIG:STRING=${CMAKE_CFG_INTDIR} -P ${CMAKE_SOURCE_DIR}/ExProjectBuild.cmake INSTALL_COMMAND ) And then the ExProjectBuild.cmake file invokes cmake --build with the build config changed appropriately when necessary: message(In ExternalProjectBuild:) message(BUILD_TARGET=${BUILD_TARGET}) message(BUILD_CONFIG=${BUILD_CONFIG}) message(CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}) set (standardConfigsRelease Debug RelWithDebInfo MinSizeRel) # map each build config in extraConfigs to the item in the same position in extraConfigsMap set (extraConfigsReleaseNoHidebugDebugPthreads DebugOptimised) set (extraConfigsMapReleaseDebugDebug) list(FIND standardConfigs ${BUILD_CONFIG} pos) if (pos LESS 0) list(FIND extraConfigs ${BUILD_CONFIG} pos) if (pos LESS 0) message(FATAL_ERROR Unknown build config: ${BUILD_CONFIG}) endif() list(GET extraConfigsMap ${pos} BUILD_CONFIG) message( MAPPED CONFIG: ${BUILD_CONFIG}) endif() execute_process( COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --config ${BUILD_CONFIG} ) Is that what you meant when you suggested using a custom BUILD_COMMAND ? Or was there a simpler way to do it ? Yes, that's what I meant. No, I can't think of a simpler/generic way to do this. Only you can know the relationship between your customized configs and the well-known configs... Also, I note that when I clean the external project in Visual Studio it doesn't really clean it (i.e. after the clean a build still thinks there is nothing to do). And the clean doesn't invoke my ExProjectBuild script. If I manually run cmake --build externalProjectDir --target clean from the command line then it does clean the project properly. Is ExternalProject_Add() missing some functionality here, or have I misunderstood something ? It is (intentionally) missing some functionality. You have not misunderstood. The general case of ExternalProject is completely arbitrary, although we do use reasonable default commands for cmake projects and configure/make projects as they are conventionally used... Since it's completely arbitrary, we do not know if there is a 'clean' target at each level. The best 'clean' is starting with an absolutely empty build tree, and running CMake and your build system from there. Since the best 'clean' is always going to be better than any target-based clean we could come up with, I wouldn't even attempt to add this functionality unless nearly everybody unanimously agreed that we should have it. And only then if somebody writes a patch to provide it. HTH, David -- Glenn On 1 July 2011 18:01, David Cole david.c...@kitware.com wrote: On Fri, Jul 1, 2011 at 7:23 AM, Glenn Coombs glenn.coo...@gmail.comwrote: I have just started using some externally supplied cmake projects in my cmake project. To do this I added these lines to my top level CMakeLists.txt file: include(ExternalProject) ExternalProject_Add(external_proj PREFIX${CMAKE_BINARY_DIR}/external_proj SOURCE_DIR${CMAKE_SOURCE_DIR}/external/proj/dir CMAKE_ARGS-DCMAKE_BUILD_TYPE:STRING=Release -DMETAGS_DIR=${CMAKE_BINARY_DIR}/meta_install INSTALL_COMMAND ) And that worked very well. Inside Visual Studio when I build my project it automatically runs the cmake configure step for the external projects and builds them as well. The problem I have just discovered is when using a build configuration other than the default ones. I can build Debug and Release configurations fine. My project also has a DebugOptimised configuration but the external projects don't. When I try to build my project it fails to build the external projects. I used build_command() to see what commands would be used to build each configuration and I can see the cause of the problem: Debug: VCExpress.exe myProj.sln /build Debug /project external_proj DebugOptimised: VCExpress.exe myProj.sln /build DebugOptimised /project external_proj Is there a way to tell cmake how to map my build configurations onto those that an external project has ? In this case I would like to build the external project as Debug