Posts

Showing posts with the label Cmake

CMake Custom Command Copy Multiple Files

Answer : I did it with a loop # create a list of files to copy set( THIRD_PARTY_DLLS C:/DLLFOLDER/my_dll_1.dll C:/DLLFOLDER/my_dll_2.dll ) # do the copying foreach( file_i ${THIRD_PARTY_DLLS}) add_custom_command( TARGET ${VIEWER_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy ${file_i} "C:/TargetDirectory" ) endforeach( file_i ) Copying multiple files is available from CMake 3.5 cmake -E copy <file>... <destination> "cmake -E copy" support for multiple files Command-Line Tool Mode A relatively simple workaround would be to use ${CMAKE_COMMAND} -E tar to bundle the sources, move the tarball and extract it in the destination directory. This could be more trouble than it's worth if your sources are scattered across many different directories, since extracting would retain the original directory structure (unlike using cp ). If all the files are in one directory however, you could achieve the copy in jus...

CMake Zlib Build On Windows

Answer : According to https://wiki.apache.org/httpd/Win64Compilation a very similar error means: This means you have a typo in either -DASMV -DASMINF or your OBJ="inffasx64.obj gvmat64.obj inffas8664.obj" since inflate_fast is defined in inffas8664.c. I was able to successfully build with a simple: mkdir C:\Builds\zlib; cd C:\Builds\zlib cmake -G "Visual Studio 12 2013" -A x64 D:\Downloads\zlib-1.2.8\ cmake --build . I looked at my cmake cache and I see that AMD64 is set to false, unlike what your cmake-gui window shows. Setting it to true it results all kinds of build errors for me, though not the ones you show. CMakeLists.txt says this option is to enable an AMD64 assembly implementation. Just doing without this seems to be the easiest solution. You need contrib\masmx64\inffas8664.c included in visual studio project file. This file contains inflate_fast function which calls corresponding asm functions. Date: 20180804 ( Aug 4 th 2018 ) W...

Cmake Executable Name

Answer : A bit more explicit: set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "your name") Have you tried using SET_TARGET_PROPERTIES and using the OUTPUT_NAME property?

CMake Support "make Uninstall"?

Answer : If you want to add an uninstall target you can take a look to the official CMake FAQ at: https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake If you just want a quick way to uninstall all files, just run: xargs rm < install_manifest.txt install_manifest.txt file is created when you run make install . No there is not. See in the FAQ from CMake wiki: By default, CMake does not provide the "make uninstall" target, so you cannot do this. We do not want "make uninstall" to remove useful files from the system. If you want an "uninstall" target in your project, then nobody prevents you from providing one. You need to delete the files listed in install_manifest.txt file. [followed by some example code] Remove files and folders (empty only) added by make install from a cmake project: cat install_manifest.txt | sudo xargs rm cat install_manifest.txt | xargs -L1 dirname | sudo xargs rmdir -p ...