[CMake] Failed to build C++ source with CMakeLists.txt
Hi, I have built many open sources with gcc 4.9.1 on CentOS 6.8 platform, but I could not build this one and I have no idea what was wrong with this CMakeLists.txt, I have attached both CMakeLists.txt and CMakeError.log, appreciate any clues what was missing. Thank you. $ ls /usr/local/cppcms/1.1.0/include booster cppcms cmake_minimum_required(VERSION 2.6) project(cppcms) include_directories(${CMAKE_SOURCE_DIR}) # Options option(STATIC_VIEW "Build Static View instead of dynamically loaded one" OFF) if(WIN32 OR CYGWIN) add_definitions(-DDLL_EXPORT) endif() # Dependencies find_library(LIB_BOOSTER booster) find_library(LIB_CPPCMS cppcms) find_library(LIB_CPPDB cppdb) find_program(EXE_TMPL_CC cppcms_tmpl_cc) find_program(EXE_MSGFMT msgfmt) find_program(EXE_SQLITE3 sqlite3) find_path(INC_BOOSTER booster/config.h) find_path(INC_CPPCMS cppcms/config.h) find_path(INC_CPPDB cppdb/frontend.h) # Sources set(VIEW_NAME simple) set(VIEW_TEMPLATES view/master.tmpl view/forums.tmpl view/thread.tmpl) set(MB_SRC apps/master.cpp apps/thread.cpp apps/forums.cpp apps/mb.cpp apps/main.cpp) set(MB_LANG he) # Actual Build include_directories(${INC_BOOSTER}) include_directories(${INC_CPPCMS}) include_directories(${INC_CPPDB}) set(VIEW_SRC "${CMAKE_CURRENT_BINARY_DIR}/${VIEW_NAME}.cpp") add_custom_command( OUTPUT ${VIEW_SRC} COMMAND ${EXE_TMPL_CC} -s "${VIEW_NAME}" ${TMPL_CC_PARAMS} -o ${VIEW_SRC} ${VIEW_TEMPLATES} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${VIEW_TEMPLATES}) if(STATIC_VIEW) set(MB_SRC ${MB_SRC} ${VIEW_SRC}) else() add_library(${VIEW_NAME} SHARED ${VIEW_SRC}) target_link_libraries(${VIEW_NAME} ${LIB_CPPCMS}) target_link_libraries(${VIEW_NAME} ${LIB_BOOSTER}) endif() add_executable(mb ${MB_SRC}) target_link_libraries(mb ${LIB_CPPCMS}) target_link_libraries(mb ${LIB_BOOSTER}) target_link_libraries(mb ${LIB_CPPDB}) if(EXE_MSGFMT) set(MO_FILES) foreach(LANG ${MB_LANG}) set(PO locale/${LANG}/LC_MESSAGES/mb.po) set(MO ${CMAKE_CURRENT_BINARY_DIR}/locale/${LANG}/LC_MESSAGES/mb.mo) file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/locale/${LANG}/LC_MESSAGES") set(MO_FILES ${MO_FILES} ${MO}) add_custom_command( OUTPUT ${MO} COMMAND ${EXE_MSGFMT} ${PO} -o ${MO} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${PO}) endforeach() add_custom_target(create-mo ALL DEPENDS ${MO_FILES}) else() message("-- msgfmt not found, translations not generatied") endif() if(EXE_SQLITE3) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mb.db COMMAND ${EXE_SQLITE3} < ${CMAKE_CURRENT_SOURCE_DIR}/model/sqlite3.sql ${CMAKE_CURRENT_BINARY_DIR}/mb.db) add_custom_target(sqlitedb ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/mb.db) endif() Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /usr/local/gcc/4.9.1/bin/gcc Build flags: /usr/local/cppcms/1.1.0/include Id flags: The output was: 1 /usr/local/cppcms/1.1.0/include: file not recognized: Is a directory collect2: error: ld returned 1 exit status Determining if the C compiler works failed with the following output: Change Dir: /home/bjh/data/Workspace/Prototype/CppCms/MessageBoard/Build/CMakeFiles/CMakeTmp Run Build Command:/usr/bin/gmake "cmTryCompileExec3403506855/fast" /usr/bin/gmake -f CMakeFiles/cmTryCompileExec3403506855.dir/build.make CMakeFiles/cmTryCompileExec3403506855.dir/build gmake[1]: Entering directory `/sharestorage/data/Workspace/Prototype/CppCms/MessageBoard/Build/CMakeFiles/CMakeTmp' /home/bjh/data/local/cmake/2.8.12/bin/cmake -E cmake_progress_report /home/bjh/data/Workspace/Prototype/CppCms/MessageBoard/Build/CMakeFiles/CMakeTmp/CMakeFiles 1 Building C object CMakeFiles/cmTryCompileExec3403506855.dir/testCCompiler.c.o /usr/local/gcc/4.9.1/bin/gcc /usr/local/cppcms/1.1.0/include -o CMakeFiles/cmTryCompileExec3403506855.dir/testCCompiler.c.o -c /home/bjh/data/Workspace/Prototype/CppCms/MessageBoard/Build/CMakeFiles/CMakeTmp/testCCompiler.c gcc: warning: /usr/local/cppcms/1.1.0/include: linker input file unused because linking not done Linking C executable cmTryCompileExec3403506855 /home/bjh/data/local/cmake/2.8.12/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3403506855.dir/link.txt --verbose=1 /usr/local/gcc/4.9.1/bin/gcc /usr/local/cppcms/1.1.0/include -L/usr/local/boost/1.62.0/lib -L/usr/local/mpc/1.0.2/lib -L/usr/local/mpfr/3.1.2/lib -L/usr/local/gmp/6.0.0a/lib -L/usr/local/cppcms/1.1.0/lib CMakeFiles/cmTryCompileExec3403506855.dir/testCCompiler.c.o -o cmTryCompileExec3403506855 -rdynamic
Re: [CMake] The C compiler "/usr/bin/cc" is not able to compile a simple test program.
Thanks Micha and Nils. Cheers. On Sun, Jul 30, 2017 at 6:54 PM, Micha Hergarden <micha.hergar...@gmail.com> wrote: > On 30-07-17 04:36, jupiter wrote: > > I thought if I add -DCMAKE_CC_COMPILER=gcc that error should go, no, it > still compile with the specific default cc: > > /usr/bin/cc > > How could I fix it? > > Thank you. > > On Sun, Jul 30, 2017 at 11:51 AM, jupiter <jupiter@gmail.com> wrote: > >> Hi, >> >> How can I set up the cmake not to check /usr/bin/cc but to check $CC >> (which link to gcc without hard corded path in the environment)? >> >> Thank you. >> >> Regards >> >> >> > > > Hello Jupiter, > > Running the following sets the compiler to gcov: > > CC=/usr/bin/gcov cmake ../ > > This outputs: > > -- The C compiler identification is unknown > -- The CXX compiler identification is GNU 7.1.1 > -- Check for working C compiler: /usr/bin/gcov > -- Check for working C compiler: /usr/bin/gcov -- works > -- Detecting C compiler ABI info > -- Detecting C compiler ABI info - failed > -- Check for working CXX compiler: /usr/bin/c++ > -- Check for working CXX compiler: /usr/bin/c++ -- works > -- Detecting CXX compiler ABI info > -- Detecting CXX compiler ABI info - done > -- Detecting CXX compile features > -- Detecting CXX compile features - done > -- Configuring done > -- Generating done > > > As you can see cmake definitely uses the CC environment variable. What is > your OS? What do you set $CC to? What is the full commandline you use to > call cmake? > What happens if you set it the way I did? > > Regards, > Micha > -- 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
Re: [CMake] The C compiler "/usr/bin/cc" is not able to compile a simple test program.
I thought if I add -DCMAKE_CC_COMPILER=gcc that error should go, no, it still compile with the specific default cc: /usr/bin/cc How could I fix it? Thank you. On Sun, Jul 30, 2017 at 11:51 AM, jupiter <jupiter@gmail.com> wrote: > Hi, > > How can I set up the cmake not to check /usr/bin/cc but to check $CC > (which link to gcc without hard corded path in the environment)? > > Thank you. > > Regards > > > -- 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] The C compiler "/usr/bin/cc" is not able to compile a simple test program.
Hi, How can I set up the cmake not to check /usr/bin/cc but to check $CC (which link to gcc without hard corded path in the environment)? Thank you. Regards -- 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] Cpack generated RPM and changed binary file size in 2.8.10
Hi, I have a wired situation, I have a binary file (ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped) in bin directory, I then I run cpack -G RPM to generate an RPM package. After install the RPM package in another machine, the size of the binary file (82576 KB) is different from original binary file (106228 KB). Some functions in that packaged binary file did not run correctly. Could anyone help to explain me why the size of binary file changes? And how to fix it? Thank you. Kind regards. j -- 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 set Overwrite or no over write in install(FILES ....)?
Thanks Eric. That clarifies lots of things. Kind regards, Jupiter On 3/11/13, Eric Noulard eric.noul...@gmail.com wrote: 2013/3/11 hce jupiter@gmail.com: Andreas Stahl wrote Hello Jupiter, can you post the error message here? I wasn't aware that install(FILES ...) did any checking besides comparing the dates and overwriting if the file to be installed is newer. Also, you misunderstood what Petr meant. You need to escape the quotes in the install(CODE ...) call, because you're effectively writing a string to a file, i.e.: install(CODE if (NOT EXISTS \${destination}/myfile.txt\) install(FILES \${source}/myfile.txt\ DESTINATION ${destination}) endif() ) BUT: using install inside an install command smells like problems, so you better use the file(INSTALL...) directive, anyway: install(CODE if (NOT EXISTS \${destination}/myfile.txt\) file(INSTALL \${source}/myfile.txt\ DESTINATION \${destination}\) endif() ) using the SCRIPT signature expects a cmake script file that will be included in the cmake_install.cmake script file. This means you would need to configure your paths in your cmakelists file configure_file(myfile_install.cmake.in myfile_install.cmake) install(SCRIPT myfile_install.cmake) and in myfile_install.cmake.in you'd put if(NOT EXISTS ${destination}/myfile.txt) file(INSTALL ${source}/myfile.txt DESTINATION ${destination}) endif() Hope that helps, Andreas Ahh, that's tricky, the file(INSTALL ) works. Thank you so much Andreas, and thanks Petr for your kind helps. You should keep in mind that actions takes place at different time: CMake/Configure time - when cmake runs and configure your source (when the CMakeLists.txt are read) Build time - when you compile Install time - when you use the make install or build the install target with your favorite build tool CPack time - when CPack runs, during this step the CPack generator is running and CPack itself is running a CPack install time step which install things in a CPack-private location buildtree/_CPack_Packages/... Package Install time - when the package itself (RPM, DEB, ZIP, NSIS) is installed. have a look at slides 15 and 16 here: https://github.com/TheErk/CMake-tutorial/blob/master/CMake-tutorial-8feb2012.pdf install(...) command found in CMakeLists.txt is processed at CMake-time which creates a set of cmake_install.cmake files which get used at Install time or CPack time::CPack install time. The [CMake] command you can use without trouble in install(SCRIPT or install(CODE are scriptable commands, the one you use when using cmake -P. That why you find file(INSTALL ...) in cmake_install.cmake and no install(TARGET ...), install is not scriptable. At Package Install time you have what your packaging system offers and usually you dont expect to have CMake running at this point. I hope this clarifies the process. Depending on when you expect action to take place drive how you can do it. -- Erk Le gouvernement représentatif n'est pas la démocratie -- http://www.le-message.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
Re: [CMake] License agreement in package installation
Thanks Eric and Andreas. On 9/18/12, Eric Noulard eric.noul...@gmail.com wrote: 2012/9/17 hce jupiter@gmail.com: Hi, I need to add an interfactive license agreement to an RPM package when it is installed in Linux terminal (not GUI), it should display the license and asked whether the user agree or not. I noticed from cmake 2.8.8 document there is CPACK_RESOURCE_FILE_LICENSE may produce such process, am I right? This is the right way to do it but... If I am wrong, how can I make it work with cmake / cpack? This is not supported by CPack RPM, we could include the license text file as a %doc file but.. ..it is usually a bad idea to include interactivity (i.e. install time question) in an RPM, because most of the time no-one will be there to answer it: http://stackoverflow.com/questions/2132828/adding-license-agreement-in-rpm-package (see licensing guidelines of RPM based distros as well: http://fedoraproject.org/wiki/Packaging/LicensingGuidelines http://wiki.mandriva.com/en/Policies/Licensing) On Debian dpkg sometimes ask question but there is a mean to avoid them of provide default answers in a 'non-interactive' way: http://serverfault.com/questions/84521/automate-dpkg-reconfigure-tzdata That said, with CPackRPM you may use CPACK_RPM_PRE_INSTALL_SCRIPT_FILE see: cpack --help-variable CPACK_RPM_PRE_INSTALL_SCRIPT_FILE in order to launch a pre-install script that may ask a question. An appropriate alternative would be to pop-up the license agreement at some other point: - Before downloading the RPM - On the first run of the installed software - ... -- Erk Le gouvernement représentatif n'est pas la démocratie -- http://www.le-message.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
Re: [CMake] RPM package %config noreplace causes conflict
Thanks Eric. Please see following embedded comments. On 8/24/12, Eric Noulard eric.noul...@gmail.com wrote: 2012/8/24 hce jupiter@gmail.com: Hi, i use install(FILE ..) to install a configuration file config.txt by both RPM packages A.rpm and B.rpm, due to the name and version in config.txt, the config.txt is not exactly the same in A.rpm and B.rpm. Now I've got an file conflict error when A.rpm was installed, B.rpm failed the installation. I actually don't mind if the config.txt can be overriten or not as long as it is there. The install(FILE ...) actually generates %config config.txt in the spec for not overwriting the file if the file exists. It generates such %config directive because the file is installed with an absolute destination like: install(FILE config.txt DESTINATION /etc/mysoftware) if it was installed with relative path you don't (automatically) get the %config, anyway the %config is not really the issue here. If the file without %config can automatically override the file, the problem is resolved. What did you mean the relative path for DESTINATION? If I use install(FILE config.txt DESTINATION mysoftware), what will be the prefix for mysoftware in the destination? I guess it will be the installation directory, right? I guess because those two config.txt are different which causing conflic error. Nope, probably not. The conflict is because two differents packages (A and B) wan't to install a file at the very same place in the filesystem. RPM don't care about the content. But I actually don't mind if the config.txt can be overriten or not as long as it is there. I know I can use --force in rpm command to force installation, but don't want to tell every body to use extra parameter to install packages. Is there any function in cmake I can use to force overwriting the configuration file if it exists? The problem is not really with CMake but with RPM. I can see 2 solutions to this problem: 1) Create 3 packages A,B and common-config. common-config containing the shared config file and make A and B depends on common-config. see cpack --help-variable CPACK_RPM_PACKAGE_REQUIRES for specifying the dependency. 2) Install the config file in a separate location for each package install(FILE config.txt config/A) for package A install(FILE config.txt config/B) for package B then use a post-install script that put the config file at the wanted shared location. The post-install script shall do appropriate action if another file is already there (replace, do nothing , merge ) see: cpack --help-variable CPACK_RPM_POST_INSTALL_SCRIPT_FILE Hope this helps. -- Erk Le gouvernement représentatif n'est pas la démocratie -- http://www.le-message.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
Re: [CMake] How to run bash shell script during rpm installation?
Thank you so much Eric, yes I'll use rpm post/pre install script for rpm package and put the generic solution worry aside for the time being. Cheers. Jupiter On 7/10/12, Eric Noulard eric.noul...@gmail.com wrote: 2012/7/10 jupiter jupiter@gmail.com: Hi, I need to run shell script to do following check and to install configure files during RPM installation: if config files installed in /etc/myconfig, rename files in /etc/myconfig and copy new config files to /etc/myconfig; else copy config files to /etc/myconfig Is there a simple way to do it? If you flag your config file with %config, then RPM should do just that. If you use %config,(noreplace) then the old config file will be kept and the new installed with extra .rpmnew extension. for that you can do: set(CPACK_RPM_USER_FILELIST %config /etc/myconfig) if you use component packaging then set(CPACK_RPM_COMPONENT_USER_FILELIST %config /etc/myconfig) see: cpack --help-variable CPACK_RPM_USER_FILELIST I am not clear if the install(SCRIPT ...) can be used, I guess the cmake script can be invoked during installation to call execute_process() for bash shell commands, but where I can copy my configuration source files from? Invoking cmake at package install time (when rpm runs) may fail because cmake is not there. Usually rpm post/pre [un]install script are bare shell script. You can insert such scripts with CPackRPM using CPACK_RPM_POST_INSTALL_SCRIPT_FILE CPACK_RPM_PRE_INSTALL_SCRIPT_FILE cpack --help-variable CPACK_RPM_POST_INSTALL_SCRIPT_FILE cpack --help-variable CPACK_RPM_PRE_INSTALL_SCRIPT_FILE The general solution for portable pre/post install script is an open issue: http://www.cmake.org/pipermail/cmake/2012-April/050045.html -- Erk Le gouvernement représentatif n'est pas la démocratie -- http://www.le-message.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 run bash shell script during rpm installation?
Hi, I need to run shell script to do following check and to install configure files during RPM installation: if config files installed in /etc/myconfig, rename files in /etc/myconfig and copy new config files to /etc/myconfig; else copy config files to /etc/myconfig Is there a simple way to do it? I am not clear if the install(SCRIPT ...) can be used, I guess the cmake script can be invoked during installation to call execute_process() for bash shell commands, but where I can copy my configuration source files from? Thank you. Kind regards, Jupiter -- 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] Can we control component package name in 2.8.8?
On Thu, Jun 28, 2012 at 9:05 PM, Eric Noulard eric.noul...@gmail.comwrote: 2012/6/28 hce jupiter@gmail.com: m.hergarden wrote The unspecified may come from an Install statement that does not have a component specified. Micha I actually double checked, there are only two install statements which all have component specified. Could it be the bug? Yes it could but did you start over from a pristine build tree? Could you try: $ find . -name cmake_install.cmake -exec grep -Hn Unspecified {} \;vi ./Source/kwsys/cmake_install.cmake and see if any cmake_install.cmake file is containing teh handling of Unspecified ? Whatever the result you can always specify the CPACK_COMPONENTS_ALL yourself in the CMakeListst.txt (before including CPack) and not let CPack set it on his own: So you can: set(CPACK_COMPONENTS_ALL yourcomp1 yourcomp2) ... include(CPack) Thanks Eric, that did the trick. and CPack (when used in component mode) will only install the specified components -- Erk Le gouvernement représentatif n'est pas la démocratie -- http://www.le-message.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
Re: [CMake] Can we control component package name in 2.8.8?
Thanks Eric and Micha for the clarification. Jupiter On Thu, Jun 28, 2012 at 12:54 AM, Eric Noulard eric.noul...@gmail.comwrote: 2012/6/27 hce jupiter@gmail.com: Hi, I've read some discussions posted ten months ago on http://cmake.3232098.n2.nabble.com/Component-Package-Name-td6976896.html where Eric Noulard pointed out that we could not control component package name for the reason of unique package name. I am currently running on 2.8.8 and generated very funny component package name: foo-1.1-1.0.el6.x86_64-FooComponent.rpm, it basically set by following format: ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}-${COMPONENT_NAME}.rpm That is not a good format of rpm package name. Can we take control the component package name in 2.8.8? Not yet see: http://public.kitware.com/Bug/view.php?id=12997 Won't probably be in 2.8.9 either. I know it will be useful for many of us, I just lack time to go through it. The work is not that difficult but it has many potential impact so that we shall take time to do it carefully. BTW, when I build two packages foo-1.1 and , the bin-1.2, the CPack generates an extra Unspecified package, theCPackConfig.cmake set: SET(CPACK_COMPONENTS_ALL foo-1.1-1.0.el6.x86_64;bin-1.2-1.el6.x86_6;Unspecified) Where the Unspecified come from and now can I fix it? As Micha said, this comes from an INSTALL statement which does not contains COMPONENT. see http://www.vtk.org/Wiki/CMake:Component_Install_With_CPack#Specificying_components_and_groups or this recent discussion: http://www.cmake.org/pipermail/cmake/2012-June/050855.html -- Erk Le gouvernement représentatif n'est pas la démocratie -- http://www.le-message.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
Re: [cmake-developers] [CMake] What is the current situation for adding %config (no replace)?
Thanks Eric, please see following embedded comments. On Thu, Jun 21, 2012 at 10:32 PM, Eric Noulard eric.noul...@gmail.comwrote: 2012/6/21 hce jupiter@gmail.com: Hi, There were some discussions to fix %config at http://public.kitware.com/Bug/view.php?id=10294. But I tried to use CPACK_RPM_SPEC_IGNORE_FILES in 2.8.8, it does not seem work. What is current situation to use %config? This should definitely work in 2.8.8 for RPM, however the variable you must use is, CPACK_RPM_USER_FILELIST. CPACK_RPM_SPEC_IGNORE_FILES was a too specific name. cpack --help-variable CPACK_RPM_USER_FILELIST cpack version 2.8.8.20120619-g5443 CPACK_RPM_USER_FILELIST CPACK_RPM_COMPONENT_USER_FILELIST Mandatory : NO Default : - May be used to explicitly specify %(directive) file line in the spec file. Like %config(noreplace) or any other directive that be found in the %files section. Since CPackRPM is generating the list of files (and directories) the user specified files of the CPACK_RPM_COMPONENT_USER_FILELIST list will be removed from the generated list. so set(CPACK_RPM_USER_FILELIST %config(noreplace)/etc/myconf) will make /etc/myconf a config + noreplace file in the RPM and remove that file from the automatic handling machinery of CPackRPM. Even if the RPM variable works for %config, how can the no replace files work for other package such as debian? Is there a generic solution for no replace files? Currently there is no generic solution. At least some CPack generators like Archive Generators (ZIP, TGZ, ...) won't be able to support such feature but we can try to design a generic interface (may be extending CMake install command) knowing that not all CPack generators will be able to support the feature. It will be great if CMake install command can be extended to support no replace files as it will not just beneficial for supporting different packages at least for Linux packages, but it can also be used by running installation as well. We can try to discuss the need and the possible solutions on cmake-developer mailing list if you want. -- Erk Le gouvernement représentatif n'est pas la démocratie -- http://www.le-message.org Cheers. Jupiter -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [CMake] Create a binary package
Thanks Eric, that helps. Kind regards. hce On 2012-05-31 09:20+0200, Eric Noulard wrote: 2012/5/31 jupiter jupiter@gmail.com: Hi, Sorry for an FAQ, I am new to cpack. I am going to use cpack to generate an rpm package to contain all binary files, bin, lib etc under CMAKE_BINARY_DIR/myApplicationBinaryDir. Which cpack variable I can use to define the package content to include the binary directory? With you don't include a binary directory. CPack is using the INSTALL(... DESTINATION) to build the package, basically each targets, file etc... which appear in INSTALL(...) rules in your CMakeLists.txt files. You can find more informations on CPack there: http://www.cmake.org/Wiki/CMake#CPack or there: https://github.com/TheErk/CMake-tutorial/blob/master/CMake-tutorial-8feb2012.pdf?raw=true -- Erk Le gouvernement représentatif n'est pas la démocratie -- http://www.le-message.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] Select subproject packages
Hi, I have a top root project and many subprojects under it. I am using cpack to package some subprojects, but I don't want to package the root project. When I run the cpack on root build directory, it also tried to package the root project. Is there any way to disable package the root project? Thank you. Kind regards, hce -- 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] Create a binary package
Hi, Sorry for an FAQ, I am new to cpack. I am going to use cpack to generate an rpm package to contain all binary files, bin, lib etc under CMAKE_BINARY_DIR/myApplicationBinaryDir. Which cpack variable I can use to define the package content to include the binary directory? Thank you. Kind regards, hce -- 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