[CMake] FIND_LIBRARY using registry entries
Hello Folks! I was having some troubles with FindPythonLibs, then I decided to debug it. I've found out that the CMake wasn't translating the registry string to a valid path: FIND_LIBRARY(PYTHON_LIBRARY NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION} PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs # Avoid finding the .dll in the PATH. We want the .lib. NO_SYSTEM_ENVIRONMENT_PATH ) I did make the following changes and now it's working fine. GET_FILENAME_COMPONENT(PYTHON_REGISTER_HLM [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath] ABSOLUTE) GET_FILENAME_COMPONENT(PYTHON_REGISTER_HCU [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath] ABSOLUTE) FIND_LIBRARY(PYTHON_LIBRARY NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION} PATHS ${PYTHON_REGISTER_HLM}/libs ${PYTHON_REGISTER_HCU}/libs # Avoid finding the .dll in the PATH. We want the .lib. NO_SYSTEM_ENVIRONMENT_PATH ) Questions: Are my changes right? Why the original FindPythonLibs wasn't working for me? Thanks, Hugo. -- 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] Visual Studio rebuilding ZERO_CHECK
On 6/13/2012 5:14 PM, J Decker wrote: On Wed, Jun 13, 2012 at 7:29 AM, Jonathan Romero wrote: On Wed, Jun 13, 2012 at 10:04 AM, Micha Renner wrote: Am Mittwoch, den 13.06.2012, 14:51 +0200 schrieb Robert Carnecky: Hello, My Visual Studio 2010 is constantly prompting me to build ZERO_CHECK every time I try to run my program, even though nothing has changed. Is there a workaround for this? No, that is the current situation. This problem and some others belong to a complex of problems which CMake has with Visual Studio since 2008. May be it becomes better with VS 2012. Micha How to reproduce: 1. Set up the simplest project possible (see below). 2. Configure and generate using the CMake GUI. 3. Open the project file and build the project. Project successfully builds. 4. Start the application from within Visual Studio (press F5). A message box appears, saying "This project is out of date: ZERO_CHECK. Would you like to build it?". 5. Click on yes. ZERO_CHECK is built, no actual code gets compiled. The application starts and exits. 6. Go to step 4 (message box appears again). I do not want to enable automatic rebuilds without prompts, since I have other projects where a build can take very long and I do not want to start it when not necessary. Starting a build immediately deletes the executable file and I would not be able to run the last version while making changes to the code. Thanks in advance, Robert CMakeLists.txt: project(test) cmake_minimum_required (VERSION 2.8.8) add_executable(main main.cpp) main.cpp: int main() {return 0;} System: CMake 2.8.8 Visual Studio 2010, 64bit compiler Windows 7 64bit Did you set your startup project? ZERO_CHECK will be the default but you can override it by right clicking on the actual project you wish to run and choosing "Set as Startup Project" in visual studio. I believe this is a user specific setting in visual studio (not a project setting) so you always have to do this through the GUI. I dont think there is anything in your CMakeLists.txt you can do to work around it. It doesn't matter what project is startup, it's got an always-build sort of condition. (but that's what catches changes if you modify cmakelists.txt and rebuild) Thanks for the explanation! I had the startup project set up correctly, but every project within a solution has a non-removable dependency on ZERO_CHECK, so it always gets built (I can see that this is required for proper handling of changed cmakelists.txt). I guess I just have to learn to live with the auto-build before run option. I'm still hoping one day Visual Studio will support CMake without the additional projects like ZERO_CHECK and ALL_BUILD. Out of curiosity, does anyone have link to a discussion of all the related problems of CMake with Visual Studio? -- 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] What's the plan for 2.8.9?
We try to keep the list of bugs under consideration for the next version available on our bug tracker's roadmap page: http://public.kitware.com/Bug/roadmap_page.php That said, though, we are going to be cutting release candidate 1 for 2.8.9 very soon (like today or one of the next few days...) So, it's essentially too late to do anything other than trivial bug fixes for 2.8.9. Whatever you do today *might* make it into rc2 or the final release of 2.8.9 depending on how big the change is and our view of its riskiness. If you're serious about contributing to CMake regularly, you should also join/monitor the CMake developer's mailing list as well. We discussed getting ready for 2.8.9-rc1 on there a little over a week ago. Cheers, David On Wed, Jun 13, 2012 at 11:11 AM, Robert Dailey wrote: > Is there a roadmap for version 2.8.9? I'm asking so I can see if there are > any issues/features I can pick up on my free time and help with, plus I'd > be interested in learning what features are planned. > -- > > 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
Re: [CMake] Visual Studio rebuilding ZERO_CHECK
For Visual Studio, I always disable the zero check project by setting CMAKE_SUPPRESS_REGENERATION to true in my CMake cache. The downside is that you have to run CMake by hand to regenerate project files. But the experience of CMake running while Visual Studio has the project loaded is quite terrible in VS2010, so it's not a big loss for me. On Wed, Jun 13, 2012 at 8:14 AM, J Decker wrote: > On Wed, Jun 13, 2012 at 7:29 AM, Jonathan Romero wrote: >> >> >> On Wed, Jun 13, 2012 at 10:04 AM, Micha Renner >> wrote: >>> >>> Am Mittwoch, den 13.06.2012, 14:51 +0200 schrieb Robert Carnecky: >>> > Hello, >>> > >>> > My Visual Studio 2010 is constantly prompting me to build ZERO_CHECK >>> > every time I try to run my program, even though nothing has changed. Is >>> > there a workaround for this? >>> >>> No, that is the current situation. This problem and some others belong >>> to a complex of problems which CMake has with Visual Studio since 2008. >>> May be it becomes better with VS 2012. >>> >>> Micha >>> >>> >>> > >>> > How to reproduce: >>> > 1. Set up the simplest project possible (see below). >>> > 2. Configure and generate using the CMake GUI. >>> > 3. Open the project file and build the project. Project successfully >>> > builds. >>> > 4. Start the application from within Visual Studio (press F5). A message >>> > box appears, saying "This project is out of date: ZERO_CHECK. Would you >>> > like to build it?". >>> > 5. Click on yes. ZERO_CHECK is built, no actual code gets compiled. The >>> > application starts and exits. >>> > 6. Go to step 4 (message box appears again). >>> > >>> > I do not want to enable automatic rebuilds without prompts, since I have >>> > other projects where a build can take very long and I do not want to >>> > start it when not necessary. Starting a build immediately deletes the >>> > executable file and I would not be able to run the last version while >>> > making changes to the code. >>> > >>> > Thanks in advance, >>> > Robert >>> > >>> > >>> > CMakeLists.txt: >>> > project(test) >>> > cmake_minimum_required (VERSION 2.8.8) >>> > add_executable(main main.cpp) >>> > >>> > main.cpp: >>> > int main() {return 0;} >>> > >>> > System: >>> > CMake 2.8.8 >>> > Visual Studio 2010, 64bit compiler >>> > Windows 7 64bit >>> > -- >>> > >>> > 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 >> >> >> Did you set your startup project? ZERO_CHECK will be the default but you >> can override it by right clicking on the actual project you wish to run and >> choosing "Set as Startup Project" in visual studio. I believe this is a >> user specific setting in visual studio (not a project setting) so you always >> have to do this through the GUI. I dont think there is anything in your >> CMakeLists.txt you can do to work around it. >> > > It doesn't matter what project is startup, it's got an always-build > sort of condition. (but that's what catches changes if you modify > cmakelists.txt and rebuild) > >> -- >> Jonathan S. Romero >> >> -- >> >> 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 -- 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] Visual Studio rebuilding ZERO_CHECK
This might help. Anyway worth a try. http://stackoverflow.com/questions/10972324/vs2010-c-solution-last-built-state -- 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] Visual Studio rebuilding ZERO_CHECK
On Wed, Jun 13, 2012 at 7:29 AM, Jonathan Romero wrote: > > > On Wed, Jun 13, 2012 at 10:04 AM, Micha Renner > wrote: >> >> Am Mittwoch, den 13.06.2012, 14:51 +0200 schrieb Robert Carnecky: >> > Hello, >> > >> > My Visual Studio 2010 is constantly prompting me to build ZERO_CHECK >> > every time I try to run my program, even though nothing has changed. Is >> > there a workaround for this? >> >> No, that is the current situation. This problem and some others belong >> to a complex of problems which CMake has with Visual Studio since 2008. >> May be it becomes better with VS 2012. >> >> Micha >> >> >> > >> > How to reproduce: >> > 1. Set up the simplest project possible (see below). >> > 2. Configure and generate using the CMake GUI. >> > 3. Open the project file and build the project. Project successfully >> > builds. >> > 4. Start the application from within Visual Studio (press F5). A message >> > box appears, saying "This project is out of date: ZERO_CHECK. Would you >> > like to build it?". >> > 5. Click on yes. ZERO_CHECK is built, no actual code gets compiled. The >> > application starts and exits. >> > 6. Go to step 4 (message box appears again). >> > >> > I do not want to enable automatic rebuilds without prompts, since I have >> > other projects where a build can take very long and I do not want to >> > start it when not necessary. Starting a build immediately deletes the >> > executable file and I would not be able to run the last version while >> > making changes to the code. >> > >> > Thanks in advance, >> > Robert >> > >> > >> > CMakeLists.txt: >> > project(test) >> > cmake_minimum_required (VERSION 2.8.8) >> > add_executable(main main.cpp) >> > >> > main.cpp: >> > int main() {return 0;} >> > >> > System: >> > CMake 2.8.8 >> > Visual Studio 2010, 64bit compiler >> > Windows 7 64bit >> > -- >> > >> > 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 > > > Did you set your startup project? ZERO_CHECK will be the default but you > can override it by right clicking on the actual project you wish to run and > choosing "Set as Startup Project" in visual studio. I believe this is a > user specific setting in visual studio (not a project setting) so you always > have to do this through the GUI. I dont think there is anything in your > CMakeLists.txt you can do to work around it. > It doesn't matter what project is startup, it's got an always-build sort of condition. (but that's what catches changes if you modify cmakelists.txt and rebuild) > -- > Jonathan S. Romero > > -- > > 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] What's the plan for 2.8.9?
Is there a roadmap for version 2.8.9? I'm asking so I can see if there are any issues/features I can pick up on my free time and help with, plus I'd be interested in learning what features are planned. -- 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] Adding "*.obj" geometry files...
Sorry to keep bothering you guys... Our problem now is that resource files could have the same names in different folders. The ADD_CUSTOM_COMMAND seems to create a rule "identifier" based on the name of the resource file relative to the CMakeFiles directory. But we have a "saveloadicon.png" in /images and a "saveloadicon.png" in /textures, both trying to add a rule resulting in a conflict: CMake Error: Attempt to add a custom rule to output "C:/development/build/DEBUGBULLET/StyleClash//CMakeFiles/saveloadicon.png.ru le" which already has a custom rule. Is there a way to influence this rule identifier? This is the ADD_CUSTOM_COMMAND we're using: ADD_CUSTOM_COMMAND(OUTPUT "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}" COMMAND ${CMAKE_COMMAND} -E copy_if_different ${RSRC_FILE} ${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH} DEPENDS "${RSRC_FILE}" ) Thanks, Daniel -Oorspronkelijk bericht- Van: Petr Kmoch [mailto:petr.km...@gmail.com] Verzonden: woensdag 13 juni 2012 14:36 Aan: Daniel Dekkers CC: Tim Hutton; J; cmake@cmake.org Onderwerp: Re: [CMake] Adding "*.obj" geometry files... You could use solution filters to put all the copy targets into one folder: set_property(GLOBAL PROPERTY USE_FOLDERS TRUE) set_property(TARGET ${RESOURCESCOPYTARGET} PROPERTY FOLDER "Copy Projects") #for each resource copy target Petr On Wed, Jun 13, 2012 at 2:26 PM, Daniel Dekkers wrote: > Hi Tim, > > That works. In our case we get: > > # Additional dedicated "copy-the-resource-files-for-this-app"-target > strategy. > # Copies resource files to the build directory, triggered by a file > change in one of them. > IF( RT_ALL_RSRC_FILES ) > SET( RESOURCESCOPYTARGET "Copy${RT_APP_NAME}Resources" ) > FOREACH( RSRC_FILE ${RT_ALL_RSRC_FILES} ) > GET_FILENAME_COMPONENT(RSRC_FILE_NO_PATH ${RSRC_FILE} > NAME) > ADD_CUSTOM_COMMAND( > OUTPUT > "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}" > COMMAND ${CMAKE_COMMAND} -E copy_if_different > ${RSRC_FILE} > ${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH} > DEPENDS "${RSRC_FILE}" > ) > LIST( APPEND DEPENDENT_RSRC_FILES > "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}" ) > ENDFOREACH() > ADD_CUSTOM_TARGET( ${RESOURCESCOPYTARGET} ALL DEPENDS > ${DEPENDENT_RSRC_FILES} ) > ADD_DEPENDENCIES(${RT_APP_NAME} ${RESOURCESCOPYTARGET}) > ENDIF() > > Only "problem" are the extra targets shown in the IDE. A bit "cluttery". > We have anywhere between 1 or 10 executables in a single solution and > they all get their own additional CopyResources target. > But, ok... > > Thanks! > Daniel > > > > -Oorspronkelijk bericht- > Van: Tim Hutton [mailto:tim.hut...@gmail.com] > Verzonden: woensdag 13 juni 2012 12:42 > Aan: Daniel Dekkers > CC: Petr Kmoch; cmake@cmake.org; Bill Hoffman > Onderwerp: Re: [CMake] Adding "*.obj" geometry files... > > You can group all the files to be copied into a single subproject. > > We do this here: > http://reaction-diffusion.googlecode.com/svn/trunk/Ready/CMakeLists.tx > t (see the section "copy installation files to build folder") > > On 13 June 2012 11:13, Daniel Dekkers wrote: >> Somewhat related... >> >> We now have the resources excluded from the build but visible in the >> IDE. So far so good. >> But we also want to copy them (all) to the build directory. >> We have a post build command that does that. >> But if you only change the contents of one of the resource files, a >> rebuild is not invoked (exclude from build) and so the files are not > copied. >> For another project we made specific targets (ADD_CUSTOM_TARGET) just >> to handle the copying but that gives a lot of extra subprojects in >> the > IDE. >> Is there another way to achieve this? >> >> Thanks, >> Daniel >> >> -Oorspronkelijk bericht- >> Van: Petr Kmoch [mailto:petr.km...@gmail.com] >> Verzonden: woensdag 13 juni 2012 8:10 >> Aan: Daniel Dekkers >> CC: Bill Hoffman; cmake@cmake.org >> Onderwerp: Re: [CMake] Adding "*.obj" geometry files... >> >> Hi Daniel. >> >> Yes, that's how Visual Studio shows excluded files. If you exclude a >> file by setting its "Excluded from build" property manually, you get >> the > same. >> >> Petr >> >> On Tue, Jun 12, 2012 at 8:31 PM, Daniel Dekkers >> >> wrote: >>> Ok, great, works. >>> So I guess the little red stop-sign icons shown by Visual Studio >>> denote that these files are excluded from the build? >>> >>> Thanks, >>> Daniel >>> >>> >>> -Oorspronkelijk bericht- >>> Van: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] Namens >>> Bill Hoffman >>> Verzonden: dinsdag 12 juni 2012 19:41 >>> Aan: cmake@cmake.org >>> Onderwerp: Re: [CMake] Adding "*.obj" geometry files... >>> >>> On 6/12/2012 1:10
Re: [CMake] Visual Studio rebuilding ZERO_CHECK
On Wed, Jun 13, 2012 at 10:04 AM, Micha Renner wrote: > Am Mittwoch, den 13.06.2012, 14:51 +0200 schrieb Robert Carnecky: > > Hello, > > > > My Visual Studio 2010 is constantly prompting me to build ZERO_CHECK > > every time I try to run my program, even though nothing has changed. Is > > there a workaround for this? > > No, that is the current situation. This problem and some others belong > to a complex of problems which CMake has with Visual Studio since 2008. > May be it becomes better with VS 2012. > > Micha > > > > > > How to reproduce: > > 1. Set up the simplest project possible (see below). > > 2. Configure and generate using the CMake GUI. > > 3. Open the project file and build the project. Project successfully > builds. > > 4. Start the application from within Visual Studio (press F5). A message > > box appears, saying "This project is out of date: ZERO_CHECK. Would you > > like to build it?". > > 5. Click on yes. ZERO_CHECK is built, no actual code gets compiled. The > > application starts and exits. > > 6. Go to step 4 (message box appears again). > > > > I do not want to enable automatic rebuilds without prompts, since I have > > other projects where a build can take very long and I do not want to > > start it when not necessary. Starting a build immediately deletes the > > executable file and I would not be able to run the last version while > > making changes to the code. > > > > Thanks in advance, > > Robert > > > > > > CMakeLists.txt: > > project(test) > > cmake_minimum_required (VERSION 2.8.8) > > add_executable(main main.cpp) > > > > main.cpp: > > int main() {return 0;} > > > > System: > > CMake 2.8.8 > > Visual Studio 2010, 64bit compiler > > Windows 7 64bit > > -- > > > > 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 > Did you set your startup project? ZERO_CHECK will be the default but you can override it by right clicking on the actual project you wish to run and choosing "Set as Startup Project" in visual studio. I believe this is a user specific setting in visual studio (not a project setting) so you always have to do this through the GUI. I dont think there is anything in your CMakeLists.txt you can do to work around it. -- Jonathan S. Romero -- 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] Visual Studio rebuilding ZERO_CHECK
Am Mittwoch, den 13.06.2012, 14:51 +0200 schrieb Robert Carnecky: > Hello, > > My Visual Studio 2010 is constantly prompting me to build ZERO_CHECK > every time I try to run my program, even though nothing has changed. Is > there a workaround for this? No, that is the current situation. This problem and some others belong to a complex of problems which CMake has with Visual Studio since 2008. May be it becomes better with VS 2012. Micha > > How to reproduce: > 1. Set up the simplest project possible (see below). > 2. Configure and generate using the CMake GUI. > 3. Open the project file and build the project. Project successfully builds. > 4. Start the application from within Visual Studio (press F5). A message > box appears, saying "This project is out of date: ZERO_CHECK. Would you > like to build it?". > 5. Click on yes. ZERO_CHECK is built, no actual code gets compiled. The > application starts and exits. > 6. Go to step 4 (message box appears again). > > I do not want to enable automatic rebuilds without prompts, since I have > other projects where a build can take very long and I do not want to > start it when not necessary. Starting a build immediately deletes the > executable file and I would not be able to run the last version while > making changes to the code. > > Thanks in advance, > Robert > > > CMakeLists.txt: > project(test) > cmake_minimum_required (VERSION 2.8.8) > add_executable(main main.cpp) > > main.cpp: > int main() {return 0;} > > System: > CMake 2.8.8 > Visual Studio 2010, 64bit compiler > Windows 7 64bit > -- > > 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] Visual Studio rebuilding ZERO_CHECK
Hello, My Visual Studio 2010 is constantly prompting me to build ZERO_CHECK every time I try to run my program, even though nothing has changed. Is there a workaround for this? How to reproduce: 1. Set up the simplest project possible (see below). 2. Configure and generate using the CMake GUI. 3. Open the project file and build the project. Project successfully builds. 4. Start the application from within Visual Studio (press F5). A message box appears, saying "This project is out of date: ZERO_CHECK. Would you like to build it?". 5. Click on yes. ZERO_CHECK is built, no actual code gets compiled. The application starts and exits. 6. Go to step 4 (message box appears again). I do not want to enable automatic rebuilds without prompts, since I have other projects where a build can take very long and I do not want to start it when not necessary. Starting a build immediately deletes the executable file and I would not be able to run the last version while making changes to the code. Thanks in advance, Robert CMakeLists.txt: project(test) cmake_minimum_required (VERSION 2.8.8) add_executable(main main.cpp) main.cpp: int main() {return 0;} System: CMake 2.8.8 Visual Studio 2010, 64bit compiler Windows 7 64bit -- 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] Adding "*.obj" geometry files...
You could use solution filters to put all the copy targets into one folder: set_property(GLOBAL PROPERTY USE_FOLDERS TRUE) set_property(TARGET ${RESOURCESCOPYTARGET} PROPERTY FOLDER "Copy Projects") #for each resource copy target Petr On Wed, Jun 13, 2012 at 2:26 PM, Daniel Dekkers wrote: > Hi Tim, > > That works. In our case we get: > > # Additional dedicated "copy-the-resource-files-for-this-app"-target > strategy. > # Copies resource files to the build directory, triggered by a file change > in one of them. > IF( RT_ALL_RSRC_FILES ) > SET( RESOURCESCOPYTARGET "Copy${RT_APP_NAME}Resources" ) > FOREACH( RSRC_FILE ${RT_ALL_RSRC_FILES} ) > GET_FILENAME_COMPONENT(RSRC_FILE_NO_PATH ${RSRC_FILE} NAME) > ADD_CUSTOM_COMMAND( > OUTPUT > "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}" > COMMAND ${CMAKE_COMMAND} -E copy_if_different > ${RSRC_FILE} ${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH} > DEPENDS "${RSRC_FILE}" > ) > LIST( APPEND DEPENDENT_RSRC_FILES > "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}" ) > ENDFOREACH() > ADD_CUSTOM_TARGET( ${RESOURCESCOPYTARGET} ALL DEPENDS > ${DEPENDENT_RSRC_FILES} ) > ADD_DEPENDENCIES(${RT_APP_NAME} ${RESOURCESCOPYTARGET}) > ENDIF() > > Only "problem" are the extra targets shown in the IDE. A bit "cluttery". > We have anywhere between 1 or 10 executables in a single solution and they > all get their own additional CopyResources target. > But, ok... > > Thanks! > Daniel > > > > -Oorspronkelijk bericht- > Van: Tim Hutton [mailto:tim.hut...@gmail.com] > Verzonden: woensdag 13 juni 2012 12:42 > Aan: Daniel Dekkers > CC: Petr Kmoch; cmake@cmake.org; Bill Hoffman > Onderwerp: Re: [CMake] Adding "*.obj" geometry files... > > You can group all the files to be copied into a single subproject. > > We do this here: > http://reaction-diffusion.googlecode.com/svn/trunk/Ready/CMakeLists.txt > (see the section "copy installation files to build folder") > > On 13 June 2012 11:13, Daniel Dekkers wrote: >> Somewhat related... >> >> We now have the resources excluded from the build but visible in the >> IDE. So far so good. >> But we also want to copy them (all) to the build directory. >> We have a post build command that does that. >> But if you only change the contents of one of the resource files, a >> rebuild is not invoked (exclude from build) and so the files are not > copied. >> For another project we made specific targets (ADD_CUSTOM_TARGET) just >> to handle the copying but that gives a lot of extra subprojects in the > IDE. >> Is there another way to achieve this? >> >> Thanks, >> Daniel >> >> -Oorspronkelijk bericht- >> Van: Petr Kmoch [mailto:petr.km...@gmail.com] >> Verzonden: woensdag 13 juni 2012 8:10 >> Aan: Daniel Dekkers >> CC: Bill Hoffman; cmake@cmake.org >> Onderwerp: Re: [CMake] Adding "*.obj" geometry files... >> >> Hi Daniel. >> >> Yes, that's how Visual Studio shows excluded files. If you exclude a >> file by setting its "Excluded from build" property manually, you get the > same. >> >> Petr >> >> On Tue, Jun 12, 2012 at 8:31 PM, Daniel Dekkers >> >> wrote: >>> Ok, great, works. >>> So I guess the little red stop-sign icons shown by Visual Studio >>> denote that these files are excluded from the build? >>> >>> Thanks, >>> Daniel >>> >>> >>> -Oorspronkelijk bericht- >>> Van: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] Namens >>> Bill Hoffman >>> Verzonden: dinsdag 12 juni 2012 19:41 >>> Aan: cmake@cmake.org >>> Onderwerp: Re: [CMake] Adding "*.obj" geometry files... >>> >>> On 6/12/2012 1:10 PM, Daniel Dekkers wrote: Hi, We are adding some resource files (XML files, shaders, etc.) to a Visual Studio project just to make them visible and accessible in the >> IDE. We also add geometry files with the extension "obj". Visual Studio treats these as regular object files and starts using them during the >>> build. Is there a way that we can "label" these obj files so Visual Studio leaves them alone? Kind Regards, Daniel Dekkers >>> Mark them as HEADER_FILE_ONLY . >>> >>> >>> http://www.cmake.org/cmake/help/v2.8.8/cmake.html#prop_sf:HEADER_FILE >>> _ >>> ONLY >>> >>> -- >>> >>> 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://w
Re: [CMake] Adding "*.obj" geometry files...
Hi Tim, That works. In our case we get: # Additional dedicated "copy-the-resource-files-for-this-app"-target strategy. # Copies resource files to the build directory, triggered by a file change in one of them. IF( RT_ALL_RSRC_FILES ) SET( RESOURCESCOPYTARGET "Copy${RT_APP_NAME}Resources" ) FOREACH( RSRC_FILE ${RT_ALL_RSRC_FILES} ) GET_FILENAME_COMPONENT(RSRC_FILE_NO_PATH ${RSRC_FILE} NAME) ADD_CUSTOM_COMMAND( OUTPUT "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}" COMMAND ${CMAKE_COMMAND} -E copy_if_different ${RSRC_FILE} ${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH} DEPENDS "${RSRC_FILE}" ) LIST( APPEND DEPENDENT_RSRC_FILES "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}" ) ENDFOREACH() ADD_CUSTOM_TARGET( ${RESOURCESCOPYTARGET} ALL DEPENDS ${DEPENDENT_RSRC_FILES} ) ADD_DEPENDENCIES(${RT_APP_NAME} ${RESOURCESCOPYTARGET}) ENDIF() Only "problem" are the extra targets shown in the IDE. A bit "cluttery". We have anywhere between 1 or 10 executables in a single solution and they all get their own additional CopyResources target. But, ok... Thanks! Daniel -Oorspronkelijk bericht- Van: Tim Hutton [mailto:tim.hut...@gmail.com] Verzonden: woensdag 13 juni 2012 12:42 Aan: Daniel Dekkers CC: Petr Kmoch; cmake@cmake.org; Bill Hoffman Onderwerp: Re: [CMake] Adding "*.obj" geometry files... You can group all the files to be copied into a single subproject. We do this here: http://reaction-diffusion.googlecode.com/svn/trunk/Ready/CMakeLists.txt (see the section "copy installation files to build folder") On 13 June 2012 11:13, Daniel Dekkers wrote: > Somewhat related... > > We now have the resources excluded from the build but visible in the > IDE. So far so good. > But we also want to copy them (all) to the build directory. > We have a post build command that does that. > But if you only change the contents of one of the resource files, a > rebuild is not invoked (exclude from build) and so the files are not copied. > For another project we made specific targets (ADD_CUSTOM_TARGET) just > to handle the copying but that gives a lot of extra subprojects in the IDE. > Is there another way to achieve this? > > Thanks, > Daniel > > -Oorspronkelijk bericht- > Van: Petr Kmoch [mailto:petr.km...@gmail.com] > Verzonden: woensdag 13 juni 2012 8:10 > Aan: Daniel Dekkers > CC: Bill Hoffman; cmake@cmake.org > Onderwerp: Re: [CMake] Adding "*.obj" geometry files... > > Hi Daniel. > > Yes, that's how Visual Studio shows excluded files. If you exclude a > file by setting its "Excluded from build" property manually, you get the same. > > Petr > > On Tue, Jun 12, 2012 at 8:31 PM, Daniel Dekkers > > wrote: >> Ok, great, works. >> So I guess the little red stop-sign icons shown by Visual Studio >> denote that these files are excluded from the build? >> >> Thanks, >> Daniel >> >> >> -Oorspronkelijk bericht- >> Van: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] Namens >> Bill Hoffman >> Verzonden: dinsdag 12 juni 2012 19:41 >> Aan: cmake@cmake.org >> Onderwerp: Re: [CMake] Adding "*.obj" geometry files... >> >> On 6/12/2012 1:10 PM, Daniel Dekkers wrote: >>> Hi, >>> >>> We are adding some resource files (XML files, shaders, etc.) to a >>> Visual Studio project just to make them visible and accessible in >>> the > IDE. >>> >>> We also add geometry files with the extension "obj". Visual Studio >>> treats these as regular object files and starts using them during >>> the >> build. >>> >>> Is there a way that we can "label" these obj files so Visual Studio >>> leaves them alone? >>> >>> Kind Regards, >>> >>> Daniel Dekkers >>> >> Mark them as HEADER_FILE_ONLY . >> >> >> http://www.cmake.org/cmake/help/v2.8.8/cmake.html#prop_sf:HEADER_FILE >> _ >> ONLY >> >> -- >> >> 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 > > -- > > 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] Adding "*.obj" geometry files...
You can group all the files to be copied into a single subproject. We do this here: http://reaction-diffusion.googlecode.com/svn/trunk/Ready/CMakeLists.txt (see the section "copy installation files to build folder") On 13 June 2012 11:13, Daniel Dekkers wrote: > Somewhat related... > > We now have the resources excluded from the build but visible in the IDE. So > far so good. > But we also want to copy them (all) to the build directory. > We have a post build command that does that. > But if you only change the contents of one of the resource files, a rebuild > is not invoked (exclude from build) and so the files are not copied. > For another project we made specific targets (ADD_CUSTOM_TARGET) just to > handle the copying but that gives a lot of extra subprojects in the IDE. > Is there another way to achieve this? > > Thanks, > Daniel > > -Oorspronkelijk bericht- > Van: Petr Kmoch [mailto:petr.km...@gmail.com] > Verzonden: woensdag 13 juni 2012 8:10 > Aan: Daniel Dekkers > CC: Bill Hoffman; cmake@cmake.org > Onderwerp: Re: [CMake] Adding "*.obj" geometry files... > > Hi Daniel. > > Yes, that's how Visual Studio shows excluded files. If you exclude a file by > setting its "Excluded from build" property manually, you get the same. > > Petr > > On Tue, Jun 12, 2012 at 8:31 PM, Daniel Dekkers > wrote: >> Ok, great, works. >> So I guess the little red stop-sign icons shown by Visual Studio >> denote that these files are excluded from the build? >> >> Thanks, >> Daniel >> >> >> -Oorspronkelijk bericht- >> Van: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] Namens >> Bill Hoffman >> Verzonden: dinsdag 12 juni 2012 19:41 >> Aan: cmake@cmake.org >> Onderwerp: Re: [CMake] Adding "*.obj" geometry files... >> >> On 6/12/2012 1:10 PM, Daniel Dekkers wrote: >>> Hi, >>> >>> We are adding some resource files (XML files, shaders, etc.) to a >>> Visual Studio project just to make them visible and accessible in the > IDE. >>> >>> We also add geometry files with the extension "obj". Visual Studio >>> treats these as regular object files and starts using them during the >> build. >>> >>> Is there a way that we can "label" these obj files so Visual Studio >>> leaves them alone? >>> >>> Kind Regards, >>> >>> Daniel Dekkers >>> >> Mark them as HEADER_FILE_ONLY . >> >> >> http://www.cmake.org/cmake/help/v2.8.8/cmake.html#prop_sf:HEADER_FILE_ >> ONLY >> >> -- >> >> 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 > > -- > > 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 -- Tim Hutton - http://www.sq3.org.uk - http://profiles.google.com/tim.hutton/ -- 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] Adding "*.obj" geometry files...
On 06/13/2012 12:13 PM, Daniel Dekkers wrote: > Somewhat related... > > We now have the resources excluded from the build but visible in the IDE. So > far so good. > But we also want to copy them (all) to the build directory. > We have a post build command that does that. > But if you only change the contents of one of the resource files, a rebuild > is not invoked (exclude from build) and so the files are not copied. > For another project we made specific targets (ADD_CUSTOM_TARGET) just to > handle the copying but that gives a lot of extra subprojects in the IDE. > Is there another way to achieve this? > > Thanks, > Daniel You can use configure_file with COPYONLY in the CMakeLists.txt files, but then, you'll have to reconfigure every time one of them changes. 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] Adding "*.obj" geometry files...
Somewhat related... We now have the resources excluded from the build but visible in the IDE. So far so good. But we also want to copy them (all) to the build directory. We have a post build command that does that. But if you only change the contents of one of the resource files, a rebuild is not invoked (exclude from build) and so the files are not copied. For another project we made specific targets (ADD_CUSTOM_TARGET) just to handle the copying but that gives a lot of extra subprojects in the IDE. Is there another way to achieve this? Thanks, Daniel -Oorspronkelijk bericht- Van: Petr Kmoch [mailto:petr.km...@gmail.com] Verzonden: woensdag 13 juni 2012 8:10 Aan: Daniel Dekkers CC: Bill Hoffman; cmake@cmake.org Onderwerp: Re: [CMake] Adding "*.obj" geometry files... Hi Daniel. Yes, that's how Visual Studio shows excluded files. If you exclude a file by setting its "Excluded from build" property manually, you get the same. Petr On Tue, Jun 12, 2012 at 8:31 PM, Daniel Dekkers wrote: > Ok, great, works. > So I guess the little red stop-sign icons shown by Visual Studio > denote that these files are excluded from the build? > > Thanks, > Daniel > > > -Oorspronkelijk bericht- > Van: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] Namens > Bill Hoffman > Verzonden: dinsdag 12 juni 2012 19:41 > Aan: cmake@cmake.org > Onderwerp: Re: [CMake] Adding "*.obj" geometry files... > > On 6/12/2012 1:10 PM, Daniel Dekkers wrote: >> Hi, >> >> We are adding some resource files (XML files, shaders, etc.) to a >> Visual Studio project just to make them visible and accessible in the IDE. >> >> We also add geometry files with the extension "obj". Visual Studio >> treats these as regular object files and starts using them during the > build. >> >> Is there a way that we can "label" these obj files so Visual Studio >> leaves them alone? >> >> Kind Regards, >> >> Daniel Dekkers >> > Mark them as HEADER_FILE_ONLY . > > > http://www.cmake.org/cmake/help/v2.8.8/cmake.html#prop_sf:HEADER_FILE_ > ONLY > > -- > > 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 -- 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