Re: [CMake] How to install external project
If it builds with CMake, then just give it these arguments: INSTALL_DIR ${CMAKE_BINARY_DIR}/install CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= and leave off the INSTALL_COMMAND, accepting the default install command that ExternalProject already uses. That should work everywhere. The thing you're trying to do would work if you did it like this, without the double quotes: INSTALL_COMMAND cp ${CMAKE_SOURCE_DIR}/contrib/blas/blas_LINUX.a ${CMAKE_BINARY_DIR}/ But obviously, that will only work where there's a "cp" command, and on Linux, since the blas_LINUX.a file probably only works on Linux. (And it generally doesn't work to simply copy library files around as an install step...) HTH, David On Fri, Jul 13, 2012 at 8:21 PM, Martin Vymazal wrote: > Hello, > > I would like to add blas as external project to my code (which already > uses > cmake), and I'm playing with ExternalProject_Add > > I downloaded blas and extracted its sources to the directory > ${CMAKE_SOURCE_DIR}/contrib/blas > > The compilation runs fine and generates blas_LINUX.a, but I cannot install > the > library. For testing purposes, I would like to move it to the build tree. I > tried: > > ExternalProject_Add(BlasTest > ... > INSTALL_COMMAND "cp ${CMAKE_SOURCE_DIR}/contrib/blas/blas_LINUX.a > ${CMAKE_BINARY_DIR}/" > ) > > Unfortunately, this fails: > > /bin/sh: cp /home/martin/BlasExtProject/contrib/blas/blas_LINUX.a > /home/martin/BlasExtProject/build/: No such file or directory > > This happens after running: > cd /home/martin/BlasExtProject/build > cmake .. > make > > Could you please help me to get this right? > I'm not sure that this approach as a whole is a good practice. If it's not, > please suggest a better one. > > Thank you. > > Best regards, > > Martin Vymazal > > -- > > 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] How to install external project
Hello, I would like to add blas as external project to my code (which already uses cmake), and I'm playing with ExternalProject_Add I downloaded blas and extracted its sources to the directory ${CMAKE_SOURCE_DIR}/contrib/blas The compilation runs fine and generates blas_LINUX.a, but I cannot install the library. For testing purposes, I would like to move it to the build tree. I tried: ExternalProject_Add(BlasTest ... INSTALL_COMMAND "cp ${CMAKE_SOURCE_DIR}/contrib/blas/blas_LINUX.a ${CMAKE_BINARY_DIR}/" ) Unfortunately, this fails: /bin/sh: cp /home/martin/BlasExtProject/contrib/blas/blas_LINUX.a /home/martin/BlasExtProject/build/: No such file or directory This happens after running: cd /home/martin/BlasExtProject/build cmake .. make Could you please help me to get this right? I'm not sure that this approach as a whole is a good practice. If it's not, please suggest a better one. Thank you. Best regards, Martin Vymazal -- 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] Cross-compilation for windows on Darwin with nighlty build fails
Can anyone please help? Thanks in advance Best Regards Claus With this CMAKE_TOOLCHAIN_FILE it just works, but there is always an error the first time cmake configure step is started from GUI: # # CMAKE_TOOLCHAIN_FILE # # the name of the target operating system set(CMAKE_SYSTEM_NAME Windows) # Choose an appropriate compiler prefix # for classical mingw32 # see http://www.mingw.org/ set(COMPILER_PREFIX "i386-mingw32") ### set(COMPILER_PREFIX "i586-mingw32msvc") # for 32 or 64 bits mingw-w64 # see http://mingw-w64.sourceforge.net/ ## set(COMPILER_PREFIX "i686-w64-mingw32") ## set(COMPILER_PREFIX "x86_64-w64-mingw32" # here is the target environment located set(USER_ROOT_PATH /opt/local/bin) set(CMAKE_INSTALL_PREFIX /opt/local/${COMPILER_PREFIX} CACHE PATH "" FORCE ) set(CMAKE_FIND_ROOT_PATH ${DCMAKE_INSTALL_PREFIX} ${USER_ROOT_PATH} ) # which compilers to use for C and C++ (with path!) ## find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc) set(CMAKE_C_COMPILER ${USER_ROOT_PATH}/${COMPILER_PREFIX}-gcc) ## find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++) set(CMAKE_CXX_COMPILER ${USER_ROOT_PATH}/${COMPILER_PREFIX}-g++) # FIXME for Windows, windres is needed too! (with path!) ## find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres) set(CMAKE_RC_COMPILER ${USER_ROOT_PATH}/${COMPILER_PREFIX}-windres) # FIXME on APPLE this is needed too? (CmakeFindBinUtils.cmke) set(CMAKE_INSTALL_NAME_TOOL ${USER_ROOT_PATH}/install_name_tool) # CMake Error at /Applications/CMake 2.8-8.app/Contents/share/ cmake-2.8/Modules/CMakeFindBinUtils.cmake:71 (MESSAGE): # Could not find install_name_tool, please check your installation. < # Call Stack (most recent call first): # /Applications/CMake 2.8-8.app/Contents/share/cmake-2.8/Modules/ CMakeDetermineCXXCompiler.cmake:177 (INCLUDE) # CMakeLists.txt:3 (project) # adjust the default behaviour of the FIND_XXX() commands: # search NEVER for programs in the build host directories! set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # search headers and libraries in the target environment only. set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) On 12.07.2012, at 23:05, Claus Klein wrote: I found a way, but now the CMAKE_EXECUTABLE_SUFFIX is not empty? -- 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] Paired values in an iterable data structure like map or tuple
Hi, I have a series of tests I would like to perform, some of which are serial and some of which are mpi and should use np processors. I would further prefer to be able to process this as a list of paired values. The following is nothing but pseudocode, but it attempts to convey the idea. The ability to pair attributes (either as tuples or as some sort of map or dictionary) is something I would love to learn to emulate. Am I missing an easy way to do this? Thanks -E foreach(testname (test_serial_1,serial,na), test_mpi_1,mpi,4), test_mpi_2,mpi,2) ) maketest(${testname}[0], ${testname}[1],${testname}[2]) endforeach() -- 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] Xcode without 'command line tools' & xcrun & CMake
On 7/13/2012 10:49 AM, Sean McBride wrote: $ xcrun -find make /Applications/Xcode.app/Contents/Developer/usr/bin/make >Most of this is just a rant Much of Apple's recent behaviour is very rant worthy, IMNSHO. I am guessing some of the tools will not run without proper environments set. So, running the command line compilers will not work by doing lots of calls to xcrun -find Think, ld, ar, gcc, g++, cfront, and all the other stuff you need to run a compiler and cmake on the mac. I think we will have to take the stance that we do on windows, you have to run cmake from a shell that is setup to run the compiler. Is there an xcvars? -Bill -- Bill Hoffman Kitware, Inc. 28 Corporate Drive Clifton Park, NY 12065 bill.hoff...@kitware.com http://www.kitware.com 518 881-4905 (Direct) 518 371-3971 x105 Fax (518) 371-4573 -- 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] Xcode without 'command line tools' & xcrun & CMake
On Fri, 13 Jul 2012 10:18:38 -0400, Bill Hoffman said: >> xcrun make --version > >That is so totally stupid > >What were they thinking at Apple... I'm not privy to their thinking but... one advantage to this approach is the ability to have multiple versions of Xcode installed. I have the current 4.3.3 and the latest betas of 4.4 and 4.5. I can invoke 'xcode-select -switch' to redirect 'xcrun' to any Xcode.app. Then 'xcrun clang' will use the clang embedded in the chosen Xcode.app. It's pretty useful really. CMake wouldn't *need* to invoke 'xcrun make' to invoke make, though that's one way. The other way is to ask xcrun to give you the path to make, ex: $ xcrun -find make /Applications/Xcode.app/Contents/Developer/usr/bin/make >Most of this is just a rant Much of Apple's recent behaviour is very rant worthy, IMNSHO. -- Sean McBride, B. Eng s...@rogue-research.com Rogue Researchwww.rogue-research.com Mac Software Developer Montréal, Québec, Canada -- 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] Xcode without 'command line tools' & xcrun & CMake
On 7/12/2012 5:13 PM, David Cole wrote: xcrun make --version That is so totally stupid What were they thinking at Apple... Are you going to have to type "osrun ls" to get ls in the future? Maybe it is more like MS VS studio now. You have to run xcvars to be able to compile from the command line. I am guessing autotools and other unix type build systems do not work with this either. Most of this is just a rant, I suppose we will try to adapt. However, I am not sure we can. I think there will be other problems like not finding the compiler, and putting xcrun in front of every tool used is not going to work... -Bill -- 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