[CMake] Howto define build order
Hi, I am writing my masterthesis with LaTeX and I use here cmake to do the comilation for me. Today I added gnuplot to my LaTeX document. But I have now the problem that cmake first build the LaTeX document and then the gnuplot file. How can I say cmake to first build my gnuplot files? The struture is maindir (include the main latex file) maindir/vorlage (includes some latex templates and libs) maindir/gnuplot (includes the gnuplot files) maindir/images (includes images) I created now two CMakeLists.txt, one in maindir and one in gnuplot: ---cut--- PROJECT(MASTERTHESIS NONE) # debug output #CMAKE_VERBOSE_MAKEFILE(ON) SET(LATEX_OUTPUT_PATH build) INCLUDE(UseLATEX.cmake) INCLUDE(FindGnuplot) ADD_SUBDIRECTORY(gnuplot) ADD_LATEX_DOCUMENT(masterthesis.tex INPUTS vorlage/standard_eng.sty vorlage/standard.tex vorlage/trennhilfen.sty vorlage/owntitlepage.sty erklaerung.tex IMAGE_DIRS images/ DEFAULT_PDF) # MANGLE_TARGET_NAMES) ---cut--- ---cut--- # files to plot must have the extension .plot # A pdf file is generated in the same directory ADD_CUSTOM_TARGET(GNUPLOTs ALL) IF(GNUPLOT) SET(files count) SET(results) FOREACH(file ${files}) SET(src ${file}.plot) SET(dst ${file}.pdf) ADD_CUSTOM_COMMAND( SOURCE ${src} TARGET GNUPLOTs COMMAND ${GNUPLOT} ${src} OUTPUTS ${dst} ) SET(results ${results} ${dst}) ENDFOREACH(file) ADD_CUSTOM_COMMAND(SOURCE GNUPLOTs TARGET GNUPLOTs DEPENDS ${results} ) ENDIF(GNUPLOT) ---cut--- Thx a lot for help, Matthias -- "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] symbolic linking at install
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi folks, I know there are already a few posts on this subject - I've tried to take what has been said to achieve my goal: for the install target, I would like to link my libraries as follows (clearly, this is for unix only): libabc.so -> libabc.so.1 libabc.so -> libabc.so.1.0 libabc.so -> libabc.so.1.0.0 And so forth. The current code seems not to work :( Install ( TARGETS abc LIBRARY DESTINATION ${PROJECT_INSTALL_LIBRARY_PATH} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE ) Install ( CODE "MESSAGE(\"Linking libabc.so\")" CODE "EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_INSTALL_LIBRARY_PATH}/libabc.so ${PROJECT_INSTALL_LIBRARY_PATH}/libabc.so.1 )" ) Have I completely misunderstood the usage of the Install(CODE ..) command ? Also, placing the linking code _after_ the initial install should guarantee the linking is run after the library is installed, yes ? I also tried printing out a result variable from the link command, but it was empty 0_0 Thanks for any help! Kind regards, Tim -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGy/zBChPkLPgrpHQRAkOiAJ9EmGtvRF02G3dvl+LEI8+oiQUsRACcCHxu Q5OEGMU+aXZgWoxqBvScsxw= =PPXJ -END PGP SIGNATURE- ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] symbolic linking at install
On 22.08.07 10:07:13, Tim Schooley wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi folks, > > I know there are already a few posts on this subject - I've tried to > take what has been said to achieve my goal: for the install target, I > would like to link my libraries as follows (clearly, this is for unix only): > > libabc.so -> libabc.so.1 > libabc.so -> libabc.so.1.0 > libabc.so -> libabc.so.1.0.0 Except the 1.0 you can achieve similar thing with set_target_properties(abc VERSION 1.0.0 SOVERSION 1) That creates libabc.so.1.0.0 as real file and libabc.so and libabc.so.1 as symlinks to the former. And thats what you usually see for shared libs on unix. Andreas -- You had some happiness once, but your parents moved away, and you had to leave it behind. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] string replacement without external commands help (ex. sed)
On Tuesday 21 August 2007 19:23:09 Alan W. Irwin wrote: > Seconded. CONFIGURE_FILE() properly handles the dependency of project.conf > on the template file project.conf.in configure_file() which addresses your > above dependency concern. Try CONFIGURE_FILE(), and you will like it. Thank you Alan and Alexander. I am using configure_file() and it's fine now except that I have trouble to get the Makefile.am sed based rules to do replacement from something that looks like a variabile name but that's an issue for [EMAIL PROTECTED] :) -- Mihai RUSU Email: [EMAIL PROTECTED] "Linux is obsolete" -- AST ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Howto define build order
Matthias Fechner wrote: Hi, I am writing my masterthesis with LaTeX and I use here cmake to do the comilation for me. Today I added gnuplot to my LaTeX document. But I have now the problem that cmake first build the LaTeX document and then the gnuplot file. How can I say cmake to first build my gnuplot files? Hi, You might be able to make some use out of this: INCLUDE(AddFileDependencies) and then ADD_FILE_DEPENDENCIES(${CMAKE_BINARY_DIR}/path/to/your/pdf ${CMAKE_BINARY_DIR}/path/to/your/gnuplot/output) http://cmake.org/HTML/Documentation.html says that signature for ADD_FILE_DEPENDENCIES is > ADD_FILE_DEPENDENCIES(source_file depend_files...) > Adds the given files as dependencies to source_file -- Jack ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Howto define build order
Hi Jack, Jack Kelly wrote: > INCLUDE(AddFileDependencies) > and then > ADD_FILE_DEPENDENCIES(${CMAKE_BINARY_DIR}/path/to/your/pdf > ${CMAKE_BINARY_DIR}/path/to/your/gnuplot/output) thx for your answer. I tried now several combinations but none of them worked. cmake always compiles at first the latex document and then the gnuplot stuff. Maybe that is only possible if I can define a dependency at the ADD_LATEX_DOCUMENT but there it is not possible :( Best regards, Matthias -- "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] CPack targets
Hi all, Just looking into using CPack for generating our installation scripts. On Windows I can see only NSIS, are there any efforts towards generating an XML for WiX (so that a .msi file can be created)? Thanks /Robert ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] How to get rid of Debug / Release VisualStudio folders?
Probably dumb question, but was not able to found hints on docs: Visual Studio projects generated do append Debug / Release to the EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH paths. Is there a way to avoid this and force them to generate straight inside EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH paths ? Thanks in advance ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] change of CMAKE_BINARY_DIR in CMakeLists.txt
Hello! I'd like to create a (build-)directory which name depends on the compiler I am going to use. Let's assume my binary directory and my source directory are the same. For MS Windows Visual Studio I tried to do something like the following: IF(MSVC) FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/MSVC) ENDIF(MSVC) SET(CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR}/MSVC) SET(PROJECT_BINARY_DIR ${CMAKE_BINARY_DIR}) I expect that the Visual Studio Solution-file will be created in the MSVC-directory but I does not happen. These files are still created in the CMAKE_SOURCE_DIR-directory. Is there anything I am doing wrong? Thanx, Mick -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] change of CMAKE_BINARY_DIR in CMakeLists.txt
On Wednesday 22 August 2007 10:57, Maik Keller wrote: > Hello! > > I'd like to create a (build-)directory which name depends on the compiler I > am going to use. Let's assume my binary directory and my source directory > are the same. For MS Windows Visual Studio I tried to do something like the > following: > > IF(MSVC) > FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/MSVC) > ENDIF(MSVC) > > SET(CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR}/MSVC) > SET(PROJECT_BINARY_DIR ${CMAKE_BINARY_DIR}) > > I expect that the Visual Studio Solution-file will be created in the > MSVC-directory but I does not happen. These files are still created in the > CMAKE_SOURCE_DIR-directory. > > Is there anything I am doing wrong? You can't change CMAKE_BINARY_DIRECTORY. Once you run cmake, these variables are set implicitely. If you need special names for the build directories, write a script which creates these build dirs and then runs cmake with the appropriate options in it. Alex ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to get rid of Debug / Release VisualStudio folders?
On Wednesday 22 August 2007 10:53, Luigi Calori wrote: > Probably dumb question, but was not able to found hints on docs: > Visual Studio projects generated do append Debug / Release to the > EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH paths. > Is there a way to avoid this and force them to generate straight inside > EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH paths ? AFAIK no. Alex ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to get rid of Debug / Release VisualStudio folders?
Luigi Calori wrote: Probably dumb question, but was not able to found hints on docs: Visual Studio projects generated do append Debug / Release to the EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH paths. Is there a way to avoid this and force them to generate straight inside EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH paths ? I use the following: IF (CMAKE_GENERATOR MATCHES "Visual Studio") SET_TARGET_PROPERTIES(${TargetName} PROPERTIES PREFIX "../") SET_TARGET_PROPERTIES(${TargetName} PROPERTIES DEBUG_POSTFIX ".debug") ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") It's not perfect, but it backs the executable out a directory. Josh ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Bug in SOURCE_GROUP command?
When I execute the following MACRO with a list of files I get a strange behavior creating a MSVS solution. # create hierarchical source groups MACRO ( GENERATE_PROJECT ProjectDir ProjectSources ) SET ( DirSources ${ProjectSources} ) FOREACH ( Source ${DirSources} ) STRING ( REGEX REPLACE "${ProjectDir}" "" RelativePath "${Source}" ) STRING ( REGEX REPLACE "[/][^/]*$" "" RelativePath "${RelativePath}" ) STRING ( REGEX REPLACE "^[/]" "" RelativePath "${RelativePath}" ) STRING ( REGEX REPLACE "/" "" RelativePath "${RelativePath}" ) SOURCE_GROUP ( "${RelativePath}" FILES ${Source} ) ENDFOREACH ( Source ) ENDMACRO ( GENERATE_PROJECT ) When the list of files is: aaa/reader/file1.cpp bbb/reader/file2.cpp The bug is that both files are mapped into the same directory in the MSVS project (bbb/reader). When I change one of the directories into a different name (e.g. reader2) it works fine and the files are mapped into 2 different directories. Is this a bug or am I doing something wrong? If so, when can it be fixed? Thanks, Tal ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] change of CMAKE_BINARY_DIR in CMakeLists.txt
Original-Nachricht > Datum: Wed, 22 Aug 2007 11:33:20 -0400 > Von: Alexander Neundorf <[EMAIL PROTECTED]> > An: cmake@cmake.org > Betreff: Re: [CMake] change of CMAKE_BINARY_DIR in CMakeLists.txt > You can't change CMAKE_BINARY_DIRECTORY. > Once you run cmake, these variables are set implicitely. > If you need special names for the build directories, write a script which > creates these build dirs and then runs cmake with the appropriate options > in > it. > > Alex OK - thank you! Best, Mick -- GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS. Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake