Re: [CMake] Copy dlls to release and debug folder

2013-04-18 Thread Lloyd
Thankyou Thomas, it works now... Another issue I was faced with the first
script is, it assumes that the dlls are in the lib folder of Qt (I think
you build qt from source). I have downloaded the prebuilt Qt library, in
that the dlls are in the bin folder. I modified the macro you have given,
as below...

MACRO(GetDLLs DEBUG_NAME RELEASE_NAME)

#Copy Debug dlls
LIST(APPEND ${DEBUG_NAME} "${QT_BINARY_DIR}/QtGuid4.dll")
...


On Thu, Apr 18, 2013 at 6:51 PM, Thomas Richard
wrote:

> Normally when you find the Qt4 package it selects some defaults libraries
> (and the QT_USE_FILE). But you have to specify some extra modules you may
> need before including the QT_USE_FILE. The QT_USE_FILE defines the
> dependencies and includes the folders you need.
>
> For example I have:
>
> find_package(Qt4 REQUIRED)
>
> # loads of crap about my libraries
>
> set (QT_USE_QTGUI TRUE)
> include(${QT_USE_FILE})
>
> set (SOURCES #with my sources)
> set (HEADERS # with my headers)
> set(HEADERS_MOC) # to define an empty variable
> QT4_WRAP_CPP(HEADERS_MOC ${HEADERS})
>
> add_executable(ParamGui ${SOURCES} ${HEADERS_MOC} ${HEADERS})
> set_source_files_properties(${HEADERS_MOC} PROPERTIES GENERATED TRUE)
> target_link_libraries(ParamGui ${QT_LIBRARIES})
>
> From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf
> Of Lloyd
> Sent: 18 April 2013 12:40
> To: Thomas Richard
> Cc: CMake ML
> Subject: Re: [CMake] Copy dlls to release and debug folder
>
> I assume that this is the recommended approach.
>
> I tried to use the script you have provided, the call GetQtDLLs(DEBUG_DLLS
> RELEASE_DLLS) is not populating any of the variables (DEBUG_DLLS or
> RELEASE_DLLS) with qt dll names. I am new to cmake, Am I missing something?
>
>
> Thanks,
>   Lloyd
>
> On Thu, Apr 18, 2013 at 4:21 PM, Thomas Richard 
> wrote:
> Hi Lloyd,
>
> Personally I copy the DLLs to the VS folder (so that the program can be
> run from visual studio) using the following script.
> It looks more complicated than it is.
>
> A macro is available to several of my projects to select which Qt module
> they use and create a list of dlls to copy.
> Then I simply choose where to copy the DLLs according to the generator.
> I also add them to the list of files to install.
> Finally the last line is to remove the command prompt opening.
>
>
>
> MACRO(GetQtDLLs DEBUG_NAME RELEASE_NAME)
>
> FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF
> QTNSPLUGIN
>QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG
> QTUITOOLS QTHELP
>QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTGUI QTTEST
> QTDBUS QTXML QTSQL
>QTXMLPATTERNS QTNETWORK QTCORE)
>
> if (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
>
> string(REPLACE ".lib" ".dll" QT_${module}_DLL
> "${QT_${module}_LIBRARY_DEBUG}")
> set (${DEBUG_NAME} ${${DEBUG_NAME}} ${QT_${module}_DLL})
>
> string(REPLACE ".lib" ".dll" QT_${module}_DLL
> "${QT_${module}_LIBRARY_RELEASE}")
> set (${RELEASE_NAME} ${${RELEASE_NAME}}
> ${QT_${module}_DLL})
>
> endif()
>
> ENDFOREACH(module)
>
> ENDMACRO()
>
> if (WIN32)
> GetQtDLLs(DEBUG_DLLS RELEASE_DLLS)
>
> if (${CMAKE_GENERATOR} MATCHES "Visual Studio 11")
> # visual studio 12 expects the DLLs in the executable
> folder.
> # but not the resources!
> # can be changed into the environment property of the
> project to include the project's directory
> set (DLL_TO_DBG ${CMAKE_CURRENT_BINARY_DIR}/Debug)
> set (DLL_TO_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/Release)
> else()
> # for other version of visual studio the DLLs are expected
> into the project folder
> set (DLL_TO_DBG ${CMAKE_CURRENT_BINARY_DIR})
> set (DLL_TO_RELEASE ${CMAKE_CURRENT_BINARY_DIR})
> endif()
>
> foreach(dll ${DEBUG_DLLS})
> file(COPY ${dll} DESTINATION ${DLL_TO_DBG})
> endforeach()
>
> foreach(dll ${RELEASE_DLLS})
> file(COPY ${dll} DESTINATION ${DLL_TO_RELEASE})
> endforeach()
>
> install(FILES ${RELEASE_DLLS} DESTINATION
> ${INSTALL_FELIXPARAMGUI_PATH} CONFIGURATIONS Release)
>
> #
> # this is disabled for debug only (so signal/slots connect
> failures are seen)!
> #
> # this property is used to remove the prompt window when running
> the GUI from the explorer on WIN32
> # doesn't have effect on linux
> #
> set_target_properties(FelixParamGui PROPERTIES WIN32_EXECUTABLE
> ${FELIXPARAMGUI_WIN32EXE})
> endif()
>
> From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf
> Of Lloyd
> Sent: 18 April 2013 11:33
> To: CMake ML
> Subject: [CMake] Copy dlls to release and debug folder
>
> Hi,
>
> I was successful in creating and building a project using CMake on Windows
> (Visual Studio). After

[CMake] Building cmake: ccmake not built

2013-04-18 Thread Paul Smith
Hi all; I'm tring to build cmake using a cross-compiler environment so
cmake itself will run on a different platform.

It's working well, except that ccmake is not getting compiled (neither
is cmake-gui but that's OK).  I do have curses libraries installed and
other curses programs are built and run OK with these libraries.  So,
it's something in particular that cmake is looking for in the
cross-environment that it can't find.

In the cmake bootstrap.sh output I see this:

  -- Check if the system is big endian - little endian
  Curses libraries were not found. Curses GUI for CMake will not be built.
  -- Looking for elf.h

So that's obviously the problem but I don't know how to move forward.
I've looked in CMakeFiles/CMakeError.log and CMakeFiles/CMakeOutput.log
but there's nothing related to curses in them that I can find.


Is there some other place I can look to figure out what went wrong?

--

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] Superbuild subprojects and find_package()

2013-04-18 Thread Romain LEGUAY

Hello John,

I made some generic scripts to answer has those kind of problem. There 
is an example in the folder Examples/FrameworkTest.


You can find the scripts on GitHub: 
https://github.com/Athius/FrameworkCMakeToolkit


I hope this is helpful.

Best regards,

Romain

Le 18/04/13 05:38, John Gallagher a écrit :

Hello all,

Some Googling has led me to questions that have been asked that are 
similar to this one but I haven't seen a definitive answer. I'm trying 
to set up a CMake "superbuild" where there are dependencies between 
the subprojects, and some of the subprojects use find_package() to 
import targets from their dependencies (other subprojects, from the 
superbuild's point of view). For a stripped down example, suppose I 
have proj1 and proj2. proj1 can be built and installed on its own, and 
it writes out a Proj1Config.cmake file (with targets and such). proj2 uses


find_package(Proj1 REQUIRED)

to import those targets. So independent of a CMake superbuild, things 
work just fine if I configure, build, and install proj1, *then* 
configure, build, and install proj2. Is there a way to do this using a 
CMake superbuild? Some ideas (mostly gleaned from the aforementioned 
googling):


1. Use add_subdirectory() from the superproject. I think the REQUIRED 
on find_package() would fail though? In my case I can modify the 
subprojects, but I would like for them to continue to build correctly 
standalone (not inside the superbuild), as they really are separate 
projects. Is there a way to make add_subdirectory() work without 
exploding on find_package?


2. Don't use CMake for the "superbuild" - a shell script or plain 
Makefile could accomplish this pretty easily, but that seems a little 
hokey.


3. (This one is unclear.) Somehow build proj1 before configuring 
proj2, and point proj2 at proj1's build directory so it can find 
Proj1Config.cmake. This seems fragile at best (prefix, RPATH, etc issues).


Appreciate any advice!

John


--

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] Copy dlls to release and debug folder

2013-04-18 Thread Thomas Richard
Normally when you find the Qt4 package it selects some defaults libraries (and 
the QT_USE_FILE). But you have to specify some extra modules you may need 
before including the QT_USE_FILE. The QT_USE_FILE defines the dependencies and 
includes the folders you need.

For example I have:

find_package(Qt4 REQUIRED)

# loads of crap about my libraries

set (QT_USE_QTGUI TRUE)
include(${QT_USE_FILE})

set (SOURCES #with my sources)
set (HEADERS # with my headers)
set(HEADERS_MOC) # to define an empty variable
QT4_WRAP_CPP(HEADERS_MOC ${HEADERS})

add_executable(ParamGui ${SOURCES} ${HEADERS_MOC} ${HEADERS})
set_source_files_properties(${HEADERS_MOC} PROPERTIES GENERATED TRUE)
target_link_libraries(ParamGui ${QT_LIBRARIES})

From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
Lloyd
Sent: 18 April 2013 12:40
To: Thomas Richard
Cc: CMake ML
Subject: Re: [CMake] Copy dlls to release and debug folder

I assume that this is the recommended approach.

I tried to use the script you have provided, the call GetQtDLLs(DEBUG_DLLS 
RELEASE_DLLS) is not populating any of the variables (DEBUG_DLLS or 
RELEASE_DLLS) with qt dll names. I am new to cmake, Am I missing something?


Thanks,
  Lloyd

On Thu, Apr 18, 2013 at 4:21 PM, Thomas Richard  
wrote:
Hi Lloyd,

Personally I copy the DLLs to the VS folder (so that the program can be run 
from visual studio) using the following script.
It looks more complicated than it is.

A macro is available to several of my projects to select which Qt module they 
use and create a list of dlls to copy.
Then I simply choose where to copy the DLLs according to the generator.
I also add them to the list of files to install.
Finally the last line is to remove the command prompt opening.



MACRO(GetQtDLLs DEBUG_NAME RELEASE_NAME)

FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
               QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG QTUITOOLS 
QTHELP
               QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTGUI QTTEST QTDBUS 
QTXML QTSQL
               QTXMLPATTERNS QTNETWORK QTCORE)

        if (QT_USE_${module} OR QT_USE_${module}_DEPENDS)

                string(REPLACE ".lib" ".dll" QT_${module}_DLL 
"${QT_${module}_LIBRARY_DEBUG}")
                set (${DEBUG_NAME} ${${DEBUG_NAME}} ${QT_${module}_DLL})

                string(REPLACE ".lib" ".dll" QT_${module}_DLL 
"${QT_${module}_LIBRARY_RELEASE}")
                set (${RELEASE_NAME} ${${RELEASE_NAME}} ${QT_${module}_DLL})

        endif()

ENDFOREACH(module)

ENDMACRO()

if (WIN32)
        GetQtDLLs(DEBUG_DLLS RELEASE_DLLS)

        if (${CMAKE_GENERATOR} MATCHES "Visual Studio 11")
                # visual studio 12 expects the DLLs in the executable folder.
                # but not the resources!
                # can be changed into the environment property of the project 
to include the project's directory
                set (DLL_TO_DBG ${CMAKE_CURRENT_BINARY_DIR}/Debug)
                set (DLL_TO_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/Release)
        else()
                # for other version of visual studio the DLLs are expected into 
the project folder
                set (DLL_TO_DBG ${CMAKE_CURRENT_BINARY_DIR})
                set (DLL_TO_RELEASE ${CMAKE_CURRENT_BINARY_DIR})
        endif()

        foreach(dll ${DEBUG_DLLS})
                file(COPY ${dll} DESTINATION ${DLL_TO_DBG})
        endforeach()

        foreach(dll ${RELEASE_DLLS})
                file(COPY ${dll} DESTINATION ${DLL_TO_RELEASE})
        endforeach()

        install(FILES ${RELEASE_DLLS} DESTINATION ${INSTALL_FELIXPARAMGUI_PATH} 
CONFIGURATIONS Release)

        #
        # this is disabled for debug only (so signal/slots connect failures are 
seen)!
        #
        # this property is used to remove the prompt window when running the 
GUI from the explorer on WIN32
        # doesn't have effect on linux
        #
        set_target_properties(FelixParamGui PROPERTIES WIN32_EXECUTABLE 
${FELIXPARAMGUI_WIN32EXE})
endif()

From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
Lloyd
Sent: 18 April 2013 11:33
To: CMake ML
Subject: [CMake] Copy dlls to release and debug folder

Hi,

I was successful in creating and building a project using CMake on Windows 
(Visual Studio). After the build when I try to run the application it throws an 
error asking for the dlls of Qt (I know it is a common case in Windows, usually 
we do copy the dlls to debug/release folder where the exe resides). When I 
searched the mailing list, I have seen an advise to use 
"add_custom_command(TARGET ...)". Is this the right approach? Wont it be 
executed after each build, thus causing repeated dll copies? 

Can you please suggest me the right way?

Thanks,
  Lloyd


--

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

Foll

[CMake] CMake/CTest/CDash Training Course (Lyon, France)

2013-04-18 Thread Julien Jomier
Kitware will be holding a developers training course on May 27, 2013 in 
Lyon, France. This one-day course will cover CMake, CTest, CPack and CDash


Please visit our website for more information and registration details 
(early registration ends May 6) at:


  http://www.kitware.com/products/protraining.php?course=05/27/2013

This course is open to beginner and intermediate CMake users who want to 
learn about best practices, how to efficiently write CMake scripts, and 
put in place a continuous integration system.


Note that the course will be taught in English. If you have any 
questions, please contact us at formations at kitware.fr


We are looking forward to seeing you in Lyon,
Julien

--

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] Copy dlls to release and debug folder

2013-04-18 Thread Lloyd
I assume that this is the recommended approach.

I tried to use the script you have provided, the call GetQtDLLs(DEBUG_DLLS
RELEASE_DLLS) is not populating any of the variables (DEBUG_DLLS or
RELEASE_DLLS) with qt dll names. I am new to cmake, Am I missing something?


Thanks,
  Lloyd


On Thu, Apr 18, 2013 at 4:21 PM, Thomas Richard
wrote:

> Hi Lloyd,
>
> Personally I copy the DLLs to the VS folder (so that the program can be
> run from visual studio) using the following script.
> It looks more complicated than it is.
>
> A macro is available to several of my projects to select which Qt module
> they use and create a list of dlls to copy.
> Then I simply choose where to copy the DLLs according to the generator.
> I also add them to the list of files to install.
> Finally the last line is to remove the command prompt opening.
>
>
>
> MACRO(GetQtDLLs DEBUG_NAME RELEASE_NAME)
>
> FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF
> QTNSPLUGIN
>QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG
> QTUITOOLS QTHELP
>QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTGUI QTTEST
> QTDBUS QTXML QTSQL
>QTXMLPATTERNS QTNETWORK QTCORE)
>
> if (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
>
> string(REPLACE ".lib" ".dll" QT_${module}_DLL
> "${QT_${module}_LIBRARY_DEBUG}")
> set (${DEBUG_NAME} ${${DEBUG_NAME}} ${QT_${module}_DLL})
>
> string(REPLACE ".lib" ".dll" QT_${module}_DLL
> "${QT_${module}_LIBRARY_RELEASE}")
> set (${RELEASE_NAME} ${${RELEASE_NAME}}
> ${QT_${module}_DLL})
>
> endif()
>
> ENDFOREACH(module)
>
> ENDMACRO()
>
> if (WIN32)
> GetQtDLLs(DEBUG_DLLS RELEASE_DLLS)
>
> if (${CMAKE_GENERATOR} MATCHES "Visual Studio 11")
> # visual studio 12 expects the DLLs in the executable
> folder.
> # but not the resources!
> # can be changed into the environment property of the
> project to include the project's directory
> set (DLL_TO_DBG ${CMAKE_CURRENT_BINARY_DIR}/Debug)
> set (DLL_TO_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/Release)
> else()
> # for other version of visual studio the DLLs are expected
> into the project folder
> set (DLL_TO_DBG ${CMAKE_CURRENT_BINARY_DIR})
> set (DLL_TO_RELEASE ${CMAKE_CURRENT_BINARY_DIR})
> endif()
>
> foreach(dll ${DEBUG_DLLS})
> file(COPY ${dll} DESTINATION ${DLL_TO_DBG})
> endforeach()
>
> foreach(dll ${RELEASE_DLLS})
> file(COPY ${dll} DESTINATION ${DLL_TO_RELEASE})
> endforeach()
>
> install(FILES ${RELEASE_DLLS} DESTINATION
> ${INSTALL_FELIXPARAMGUI_PATH} CONFIGURATIONS Release)
>
> #
> # this is disabled for debug only (so signal/slots connect
> failures are seen)!
> #
> # this property is used to remove the prompt window when running
> the GUI from the explorer on WIN32
> # doesn't have effect on linux
> #
> set_target_properties(FelixParamGui PROPERTIES WIN32_EXECUTABLE
> ${FELIXPARAMGUI_WIN32EXE})
> endif()
>
> From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf
> Of Lloyd
> Sent: 18 April 2013 11:33
> To: CMake ML
> Subject: [CMake] Copy dlls to release and debug folder
>
> Hi,
>
> I was successful in creating and building a project using CMake on Windows
> (Visual Studio). After the build when I try to run the application it
> throws an error asking for the dlls of Qt (I know it is a common case in
> Windows, usually we do copy the dlls to debug/release folder where the exe
> resides). When I searched the mailing list, I have seen an advise to use
> "add_custom_command(TARGET ...)". Is this the right approach? Wont it be
> executed after each build, thus causing repeated dll copies?
>
> Can you please suggest me the right way?
>
> Thanks,
>   Lloyd
>
>
--

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] Copy dlls to release and debug folder

2013-04-18 Thread Thomas Richard
Hi Lloyd,

Personally I copy the DLLs to the VS folder (so that the program can be run 
from visual studio) using the following script.
It looks more complicated than it is.

A macro is available to several of my projects to select which Qt module they 
use and create a list of dlls to copy.
Then I simply choose where to copy the DLLs according to the generator.
I also add them to the list of files to install.
Finally the last line is to remove the command prompt opening.



MACRO(GetQtDLLs DEBUG_NAME RELEASE_NAME)

FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
   QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG QTUITOOLS 
QTHELP
   QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTGUI QTTEST QTDBUS 
QTXML QTSQL
   QTXMLPATTERNS QTNETWORK QTCORE)

if (QT_USE_${module} OR QT_USE_${module}_DEPENDS)

string(REPLACE ".lib" ".dll" QT_${module}_DLL 
"${QT_${module}_LIBRARY_DEBUG}")
set (${DEBUG_NAME} ${${DEBUG_NAME}} ${QT_${module}_DLL})

string(REPLACE ".lib" ".dll" QT_${module}_DLL 
"${QT_${module}_LIBRARY_RELEASE}")
set (${RELEASE_NAME} ${${RELEASE_NAME}} ${QT_${module}_DLL})

endif()
  
ENDFOREACH(module)

ENDMACRO()

if (WIN32)
GetQtDLLs(DEBUG_DLLS RELEASE_DLLS)

if (${CMAKE_GENERATOR} MATCHES "Visual Studio 11")
# visual studio 12 expects the DLLs in the executable folder.
# but not the resources!
# can be changed into the environment property of the project 
to include the project's directory
set (DLL_TO_DBG ${CMAKE_CURRENT_BINARY_DIR}/Debug)
set (DLL_TO_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/Release)
else()
# for other version of visual studio the DLLs are expected into 
the project folder
set (DLL_TO_DBG ${CMAKE_CURRENT_BINARY_DIR})
set (DLL_TO_RELEASE ${CMAKE_CURRENT_BINARY_DIR})
endif()

foreach(dll ${DEBUG_DLLS})
file(COPY ${dll} DESTINATION ${DLL_TO_DBG})
endforeach()

foreach(dll ${RELEASE_DLLS})
file(COPY ${dll} DESTINATION ${DLL_TO_RELEASE})
endforeach()

install(FILES ${RELEASE_DLLS} DESTINATION ${INSTALL_FELIXPARAMGUI_PATH} 
CONFIGURATIONS Release)

#
# this is disabled for debug only (so signal/slots connect failures are 
seen)!
#
# this property is used to remove the prompt window when running the 
GUI from the explorer on WIN32
# doesn't have effect on linux 
#
set_target_properties(FelixParamGui PROPERTIES WIN32_EXECUTABLE 
${FELIXPARAMGUI_WIN32EXE})
endif()

From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
Lloyd
Sent: 18 April 2013 11:33
To: CMake ML
Subject: [CMake] Copy dlls to release and debug folder

Hi,

I was successful in creating and building a project using CMake on Windows 
(Visual Studio). After the build when I try to run the application it throws an 
error asking for the dlls of Qt (I know it is a common case in Windows, usually 
we do copy the dlls to debug/release folder where the exe resides). When I 
searched the mailing list, I have seen an advise to use 
"add_custom_command(TARGET ...)". Is this the right approach? Wont it be 
executed after each build, thus causing repeated dll copies? 

Can you please suggest me the right way?

Thanks,
  Lloyd

--

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] The source directory

2013-04-18 Thread Johannes Zarl
Hi,

On Thursday, 18. April 2013, 09:02:13, 中野佑香 wrote:
> $ tar -xvzf gromacs-4.6.1.tar.gz
> $ cd gromacs-4.6.1
> $ mkdir build
> $ cd build
> $ cmake ..
> 
> However, I got an error.
> ---
> CMake Error: The source directory
> "/home/okayuka/Gromacs" does not appear to contain CMakeLists.txt.
> Specify --help for usage, or press the help button on the CMake GUI.
> ---
> Inside gromacs-4.6.1 directory,
> there is certainly CMakeLists.txt.
> 
> For this, I think cmake mistaking  /home/okayuka/Gromacs for
> /home/okayuka/Gromacs/gromacs-4.6.1 as ' the source directory'.

Looks pretty strange to me. To me this sounds just like what you would get if 
you had made a symlink:
$ tar -xvzf gromacs-4.6.1.tar.gz
$ mkdir build
$ cd gromacs-4.6.1
$ ln -s ../build .
$ cd build
$ cmake ..

> 
> Would you please tell me how correct this mismatch of the source directory?

Do you get the same error if you point cmake to the absolute path of the 
source directory instead of ".."?

Cheers,
  Johannes
--

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] Copy dlls to release and debug folder

2013-04-18 Thread Lloyd
Hi,

I was successful in creating and building a project using CMake on Windows
(Visual Studio). After the build when I try to run the application it
throws an error asking for the dlls of Qt (I know it is a common case in
Windows, usually we do copy the dlls to debug/release folder where the exe
resides). When I searched the mailing list, I have seen an advise to
use "add_custom_command(TARGET
...)". Is this the right approach? Wont it be executed after each build,
thus causing repeated dll copies?

Can you please suggest me the right way?

Thanks,
  Lloyd
--

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] Superbuild subprojects and find_package()

2013-04-18 Thread Benjamin Eikel
Hello John,

On Wednesday 17 April 2013 23:38:36 John Gallagher wrote:
> 3. (This one is unclear.) Somehow build proj1 before configuring proj2, and
> point proj2 at proj1's build directory so it can find Proj1Config.cmake.
> This seems fragile at best (prefix, RPATH, etc issues).

when using ExternalProject, dependencies between projects can look like this 
(small excerpt from a superbuild project that I wrote):

…

include(ExternalProject)

# Build ZLIB first
ExternalProject_Add(EP_ZLIB
URL 
http://download.sourceforge.net/project/libpng/zlib/1.2.7/zlib-1.2.7.tar.gz
URL_MD5 "60df6a37c56e7c1366cca812414f7b85"
PATCH_COMMAND patch -p0 < 
${CMAKE_CURRENT_LIST_DIR}/zlib-CMakeLists.txt-OUTPUT_NAME.patch && patch -p0 < 
${CMAKE_CURRENT_LIST_DIR}/zlib-CMakeLists.txt-version-script.patch
INSTALL_DIR ${INSTALL_DIR}
CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${TOOLCHAIN_FILE} 
-DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_BUILD_TYPE:STRING=Release
)

…

# For building CURL, use ZLIB that has been built before
ExternalProject_Add(EP_LIBCURL
DEPENDS EP_ZLIB
URL http://curl.haxx.se/download/curl-7.27.0.tar.gz
URL_MD5 "f0e48fdb635b5939e02a9291b89e5336"
CONFIGURE_COMMAND /configure --prefix= 
--host=${ARCH_TRIPLET} --disable-static --disable-manual 
--with-zlib= CC=${CMAKE_C_COMPILER} LD=${CMAKE_LINKER}
INSTALL_DIR ${INSTALL_DIR}
)


Kind regards
Benjamin
--

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] Superbuild subprojects and find_package()

2013-04-18 Thread markus israelsson
Hello John,

Maybe I am missing something but can't you do something like this in proj2s 
cmakelists.txt?
if( TARGET proj1 )
  list_of_libraries_to_link_against( ${ list_of_libraries_to_link_against} 
proj1 )
else( TARGET proj1 )
  find( proj1 required )
list_of_libraries_to_link_against( ${ list_of_libraries_to_link_against} 
proj1_libraries or whatever)
endif(TARGET proj1 )

Message: 2
Date: Wed, 17 Apr 2013 23:38:36 -0400
From: John Gallagher 
Subject: [CMake] Superbuild subprojects and find_package()
To: cmake 
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

Hello all,

Some Googling has led me to questions that have been asked that are similar to 
this one but I haven't seen a definitive answer. I'm trying to set up a CMake 
"superbuild" where there are dependencies between the subprojects, and some of 
the subprojects use find_package() to import targets from their dependencies 
(other subprojects, from the superbuild's point of view). For a stripped down 
example, suppose I have proj1 and proj2. proj1 can be built and installed on 
its own, and it writes out a Proj1Config.cmake file (with targets and such). 
proj2 uses

find_package(Proj1 REQUIRED)

to import those targets. So independent of a CMake superbuild, things work just 
fine if I configure, build, and install proj1, *then* configure, build, and 
install proj2. Is there a way to do this using a CMake superbuild? Some ideas 
(mostly gleaned from the aforementioned googling):

1. Use add_subdirectory() from the superproject. I think the REQUIRED on
find_package() would fail though? In my case I can modify the subprojects, but 
I would like for them to continue to build correctly standalone (not inside the 
superbuild), as they really are separate projects. Is there a way to make 
add_subdirectory() work without exploding on find_package?

2. Don't use CMake for the "superbuild" - a shell script or plain Makefile 
could accomplish this pretty easily, but that seems a little hokey.

3. (This one is unclear.) Somehow build proj1 before configuring proj2, and 
point proj2 at proj1's build directory so it can find Proj1Config.cmake.
This seems fragile at best (prefix, RPATH, etc issues).

Appreciate any advice!

John
-- next part --
An HTML attachment was scrubbed...
URL: 


--


--

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] The source directory

2013-04-18 Thread 中野佑香
Hi. I'm trying to build a build with cmake-2.8.10.2-linux for
'gromacs-4.6.1' as the build target.

First,
I extracted gromacs-4.6.1.tar.gz  and, create a new folder; build inside
the extracted folder.
Then, inside build folder, I configured using CMake.

$ tar -xvzf gromacs-4.6.1.tar.gz
$ cd gromacs-4.6.1
$ mkdir build
$ cd build
$ cmake ..

However, I got an error.
-
CMake Error: The source directory "/home/okayuka/Gromacs" does not appear
to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
-
Inside gromacs-4.6.1 directory, there is certainly CMakeLists.txt.

For this, I think cmake mistaking  /home/okayuka/Gromacs for
/home/okayuka/Gromacs/gromacs-4.6.1 as ' the source directory'.

Would you please tell me how correct this mismatch of the source directory?

-Yuka

-- 
*
中野佑香
立教大学 理学研究科化学専攻
博士前期課程 1年
理論創薬・分子設計 常盤研究室
〒171-8501 東京都豊島区西池袋3-34-1
4号館4230教室
Email: yuk...@rikkyo.ac.jp <09cc0...@rikkyo.ac.jp>
*
--

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