Re: [CMake] ExternalProject_Add Visual Studio build Install Target

2019-10-20 Thread J Decker
On Sat, Aug 31, 2019 at 9:56 PM J Decker  wrote:

> Why does it seem I'm the only one with this problem?
>

This is an external CMakeLists.txt that fails.

cmake_minimum_required(VERSION 3.15)

set_property(GLOBAL PROPERTY USE_FOLDERS On)

project( B )
include( ExternalProject )

add_executable( b b.c )

## Specifically this line causes the fails #
SET_TARGET_PROPERTIES(b PROPERTIES FOLDER "install" )

install( TARGETS b )
-





A full Test  ...
--- CMakeLists.txt---
cmake_minimum_required(VERSION 3.15)

if( NOT EXISTS b )
file(MAKE_DIRECTORY b)
file( WRITE b/b.c "#include \nint main(void) { printf(
\"Program.\\n\" ); }" )
file( WRITE b/CMakeLists.txt  "cmake_minimum_required(VERSION
3.15)\n\nset_property(GLOBAL PROPERTY USE_FOLDERS On)\n\nproject( B
)\ninclude( ExternalProject )\n\nadd_executable( b b.c
)\nSET_TARGET_PROPERTIES(b PROPERTIES\n  FOLDER \"install\"
)\n\ninstall( TARGETS b )\n" )

endif( NOT EXISTS b )

set_property(GLOBAL PROPERTY USE_FOLDERS On)

project( Test )

include( ExternalProject )

ExternalProject_Add( b
PREFIX b-src
SOURCE_DIR ${CMAKE_SOURCE_DIR}/b
BINARY_DIR b_exe
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
BUILD_ALWAYS 1
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=
-DCMAKE_BUILD_TYPE:PATH=${CMAKE_BUILD_TYPE}
)

--- End CMakeLists.txt---

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=output
cmake --build . --target install

Error Output:
 MSBUILD : error MSB1009: Project file does not exist.
[M:\tmp\cmake_vs_install\build\b.vcxproj]
  Switch: install


---

  SET_TARGET_PROPERTIES(b PROPERTIES FOLDER "Install" ) # capitalize I
bypasses the issue
  SET_TARGET_PROPERTIES(b PROPERTIES FOLDER "Install and Deploy" ) # make
it really log also bypasses the issue...

otherwise capitalizing --target INSTALL in the ExternalProject.cmake, for
visual studio, also fixed the problem, since the real target is 'INSTALL'
and not 'install'
-- 

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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add Visual Studio build Install Target

2019-08-31 Thread J Decker
Why does it seem I'm the only one with this problem?
I've recently updated this other portable system while I'm on the road, and
the latest version of course fails the same way.

 The Current build output

1>-- Build started: Project: intershell
(ExternalProjectTargets\intershell\intershell), Configuration:
RelWithDebInfo x64 --
1>  Performing install step for 'intershell'
1>  Microsoft (R) Build Engine version 14.0.23107.0
1>  Copyright (C) Microsoft Corporation. All rights reserved.
1>
1>MSBUILD : error MSB1009: Project file does not exist.
1>  Switch: install
== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==

-
share\cmake-3.15\Modules\ExternalProject.cmake
line 1853

  if(step STREQUAL "INSTALL")
list(APPEND args --target install)
  endif()


Change to
  if(step STREQUAL "INSTALL")
list(APPEND args --target INSTALL)
  endif()

 ---

And then the output looks like
 --
1>-- Build started: Project: intershell
(ExternalProjectTargets\intershell\intershell), Configuration:
RelWithDebInfo x64 --
1>  Performing install step for 'intershell'
1>  Microsoft (R) Build Engine version 14.0.23107.0
1>  Copyright (C) Microsoft Corporation. All rights reserved.
1>
1>InterShell.Service.vcxproj ->
M:\javascript\sack-gui\build\sack-src\src\intershell-build\service.shell\RelWithDebInfo\InterShell.Service.exe
..
(completes successfully )



On Thu, Apr 25, 2019 at 1:27 AM J Decker  wrote:

> I've had to make this modification the last few versions...
>
> cmake/share/cmake-3.14/Modules/ExternalProject.cmake
>
> line 1870 from
>
>   if(step STREQUAL "INSTALL")
> list(APPEND args --target install)
>   endif()
>
> to
>
>   if(step STREQUAL "INSTALL")
> list(APPEND args --target INSTALL)
>   endif()
>
> Otherwise, when building with visual studio, and trying to run the
> -install.rule  rule, it says 'no such project'
>
> I don't think the same issue happens when building from the command line.
>
-- 

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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add() setting build command to run external project's makefile

2019-05-31 Thread Michael Ellery
It seems like the error might be related to the download/extract step. I think 
the fact that you are using the same dir for PREFIX, SOURCE_DIR and 
DOWNLOAD_DIR might be confusing things. I would try commenting out those three 
properties and see if it makes any difference, and then you can fine-tune those 
properties as needed once you get it working (maybe but just setting PREFIX).

-Mike

> On May 31, 2019, at 7:41 AM, David Starkweather  wrote:
> 
> Hello
> First off, much thanks to all the contributors of cmake. A truly invaluable 
> build utility. Your efforts
> are greatly appreciated.
> 
> I've been successfully using cmake to build an external project (the client 
> library for redis, hiredis) 
> that has already been downloaded. I was able to do this with BUILD_IN_SOURCE 
> set to true, like so:
> 
> ExternalProject_Add(hiredis  
> PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/hiredis
> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hiredis
> BUILD_IN_SOURCE 1
> CONFIGURE_COMMAND echo configure
> BUILD_COMMAND make static
> INSTALL_COMMAND echo install)
> 
> 
> However, now i'd like to automatically download the source from github.  So, 
> I switch to 
> the following:
> 
> set(HIREDIS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hiredis)
> set(HIREDIS_INCLUDE_DIRS ${HIREDIS_DIR}/include)
> ExternalProject_Add(hiredis
>   URL https://github.com/redis/hiredis/archive/v0.9.0.tar.gz
>   PREFIX ${CMAKE_CURRENT_BINARY_DIR}/hiredis
>   SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/hiredis
>   DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/hiredis
>   BUILD_IN_SOURCE 1
>   CONFIGURE_COMMAND ""
>   BUILD_COMMAND make static
>   INSTALL_COMMAND "")
> 
> And I get the following error:
> 
> [  3%] Creating directories for 'hiredis'
> [  6%] Performing download step (download, verify and extract) for 'hiredis'
> -- Downloading...
>dst='/home/david/projects/clipseekr/hiredis/v0.9.0.tar.gz'
>timeout='none'
> -- Using src='https://github.com/redis/hiredis/archive/v0.9.0.tar.gz'
> -- Downloading... done
> -- extracting...
>  src='/home/david/projects/clipseekr/hiredis/v0.9.0.tar.gz'
>  dst='/home/david/projects/clipseekr/hiredis'
> -- extracting... [tar xfz]
> -- extracting... [analysis]
> -- extracting... [rename]
> -- extracting... [clean up]
> -- extracting... done
> make[2]: *** [CMakeFiles/hiredis.dir/build.make:93: 
> hiredis/src/hiredis-stamp/hiredis-download] Error 1
> make[1]: *** [CMakeFiles/Makefile2:147: CMakeFiles/hiredis.dir/all] Error 2
> make: *** [Makefile:163: all] Error 2
> 
> It seems cmake is trying to invoke its internal cmake make files, rather than 
> just run the "make static"
> build command.  How do I just run the the "make static" command directly? 
> 
> Once again, thanks.
> starkdg
>  
>   
> -- 
> 
> 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:
> https://cmake.org/mailman/listinfo/cmake

-- 

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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add and Git Update? How do I make these work?

2017-12-23 Thread Kris Thielemans
Hi

The strange thing here is

Cannot rebase: You have unstaged changes.
Please commit or stash them.
No rebase in progress?

Why would it be rebasing? Maybe a local config setting that a pull is always
pull --rebase? In any case, my guess is that your discount/Source is in a
funny state compare to the github version. Try a "git pull" there manually
to see what happens then.

HTH
kris

-Original Message-
From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Michael Jackson
Sent: 22 December 2017 19:51
To: CMake Mail List 
Subject: [CMake] ExternalProject_Add and Git Update? How do I make these
work?

ExternalProject_Add(${extProjectName}
  GIT_REPOSITORY "g
it://github.com/BlueQuartzSoftware/discount.git"
  GIT_PROGRESS 1
  #GIT_TAG master

  TMP_DIR
"${DREAM3D_SDK}/superbuild/${extProjectName}/tmp/${CMAKE_BUILD_TYPE}"
  STAMP_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/Stamp"
  DOWNLOAD_DIR ${DREAM3D_SDK}/superbuild/${extProjectName}/Download
  SOURCE_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/Source"
  BINARY_DIR
"${DREAM3D_SDK}/superbuild/${extProjectName}/Build/${CMAKE_BUILD_TYPE}"
  INSTALL_DIR
"${DREAM3D_SDK}/${extProjectName}-${discount_VERSION}-${CMAKE_BUILD_TYPE}"

  #UPDATE_COMMAND "${GIT_EXECUTABLE} pull --rebase origin master"
  PATCH_COMMAND ""

  CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=

  LOG_DOWNLOAD 1
  LOG_UPDATE 1
  LOG_CONFIGURE 1
  LOG_BUILD 1
  LOG_TEST 1
  LOG_INSTALL 1
)

The above is my cmake code. This worked great the first time through. Then I
discovered an issue in the project that I was cloning (discount) and fixed
it and pushed it. Now the repository at GitHub is a few commits ahead of
what I have. So I rerun CMake and then "ninja" and I get an error when the
"update" command is run:

Cannot rebase: You have unstaged changes.
Please commit or stash them.
No rebase in progress?
CMake Error at
/Users/Shared/DREAM3D_SDK/superbuild/discount/tmp/Debug/discount-gitupdate.c
make:105 (message):
  

  Failed to rebase in:
  '/Users/Shared/DREAM3D_SDK/superbuild/discount/Source/'.

  You will have to resolve the conflicts manually


Doing a "git status" in the "Source" directory gives this:

[mjackson@ferb:Source]$ git status
On branch master
Your branch is behind 'origin/master' by 2 commits, and can be
fast-forwarded.
  (use "git pull" to update your local branch) Untracked files:
  (use "git add ..." to include in what will be committed)

"tests/mu\303\261oz.t"

nothing added to commit but untracked files present (use "git add" to track)


There was something funning with the file that is untracked. Not sure if
this is causing the issues? 
--
Michael Jackson | Owner, President
  BlueQuartz Software
[e] mike.jack...@bluequartz.net
[w] www.bluequartz.net


-- 

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:
https://cmake.org/mailman/listinfo/cmake

-- 

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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add and Git Update? How do I make these work?

2017-12-22 Thread Konstantin Tokarev


> ExternalProject_Add(${extProjectName}
> GIT_REPOSITORY "git://github.com/BlueQuartzSoftware/discount.git"
> GIT_PROGRESS 1
> #GIT_TAG master
> 
> TMP_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/tmp/${CMAKE_BUILD_TYPE}"
> STAMP_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/Stamp"
> DOWNLOAD_DIR ${DREAM3D_SDK}/superbuild/${extProjectName}/Download
> SOURCE_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/Source"
> BINARY_DIR 
> "${DREAM3D_SDK}/superbuild/${extProjectName}/Build/${CMAKE_BUILD_TYPE}"
> INSTALL_DIR 
> "${DREAM3D_SDK}/${extProjectName}-${discount_VERSION}-${CMAKE_BUILD_TYPE}"
> 
> #UPDATE_COMMAND "${GIT_EXECUTABLE} pull --rebase origin master"
> PATCH_COMMAND ""
> 
> CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=
> 
> LOG_DOWNLOAD 1
> LOG_UPDATE 1
> LOG_CONFIGURE 1
> LOG_BUILD 1
> LOG_TEST 1
> LOG_INSTALL 1
> )
> 
> The above is my cmake code. This worked great the first time through. Then I 
> discovered an issue in the project that I was cloning (discount) and fixed it 
> and pushed it. Now the repository at GitHub is a few commits ahead of what I 
> have. 

If you want to make modifications in projects that you build with 
ExternalProject, you might want to use
git submodules instead of specifying GIT_REPOSITORY in ExternalProject_Add

>So I rerun CMake and then "ninja" and I get an error when the "update" command 
>is run:
> 
> Cannot rebase: You have unstaged changes.
> Please commit or stash them.
> No rebase in progress?
> CMake Error at 
> /Users/Shared/DREAM3D_SDK/superbuild/discount/tmp/Debug/discount-gitupdate.cmake:105
>  (message):
> 
> Failed to rebase in:
> '/Users/Shared/DREAM3D_SDK/superbuild/discount/Source/'.
> 
> You will have to resolve the conflicts manually
> 
> Doing a "git status" in the "Source" directory gives this:
> 
> [mjackson@ferb:Source]$ git status
> On branch master
> Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
> (use "git pull" to update your local branch)
> Untracked files:
> (use "git add ..." to include in what will be committed)
> 
> "tests/mu\303\261oz.t"
> 
> nothing added to commit but untracked files present (use "git add" to track)
> 
> There was something funning with the file that is untracked. Not sure if this 
> is causing the issues?
> 
> --
> Michael Jackson | Owner, President
> BlueQuartz Software
> [e] mike.jack...@bluequartz.net
> [w] www.bluequartz.net
> 
> --
> 
> 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:
> https://cmake.org/mailman/listinfo/cmake
-- 
Regards,
Konstantin
-- 

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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add and include_external_msproject dynamic duo... but what if their powers combined?

2017-04-08 Thread Brian Davis
crickets crickets... crickets...

That's the response I get from the internet?

Here are some other interesting bits:

https://cmake.org/cmake/help/v3.8/manual/cmake-packages.7.html

Does not make any reference to

configure_package_config_file

in

https://cmake.org/cmake/help/v3.8/module/CMakePackageConfigHelpers.html

But happily goes about telling pkg maintainers to go about and do with
config_file what doc on
configure_package_config_file says not to do... and that is NOT to use
configure_file in the first place at:

https://cmake.org/cmake/help/v3.8/manual/cmake-packages.7.html#id16

And then there is INSTALL_DESTINATION in:

configure_package_config_file( 
  INSTALL_DESTINATION 

which gives the pkg maintainer just enough rope to hang themselves with.

I mean hey they could (and have) put it just about anywhere like

${CMAKE_INSTALL_PREFIX}/CMake  or
${CMAKE_INSTALL_PREFIX}/lib/cmake or
${CMAKE_INSTALL_PREFIX}/lib/cmake/pkgname or
${CMAKE_INSTALL_PREFIX}/lib/cmake/pkgname- or
${CMAKE_INSTALL_PREFIX}/share/pkgname or
${CMAKE_INSTALL_PREFIX}/share/cmake/pkgname or

... well you get the idea.  With or without version info. Where IMO
configure_package_config_file should require version info and put in
"standard directory" whatever that may be.

Please someone in internet land tell me I am wrong.

I'll await the crickets.
-- 

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] ExternalProject_Add ... output directy (sln file directory)

2017-03-31 Thread Christophe Demez

Also,

I have try with a sample, just a main and a lib. But it seems that the 
lib CMakeLists.txt file is not called !


The project is created, but it does not point to the source code by 
example and the "message" are not displayed in the console too !


The download link :

https://www.dropbox.com/s/eto84gwtw2rx8oe/CMakeTest.zip?dl=0



On 30/03/2017 17:11, Christophe Demez wrote:


BTW,

I notice this too, if I use the following command line with an empty 
cmakelists.txt file : cmake -G "Visual Studio 15 2017 Win64"


And it also generate the .sln (and other files) in the same folder, 
but I don't request to build such a solution ! right ?


In reality, I only need a cmakelists.txt file that will build an 
external library for Android (Ninja generator, directly from 
AndroidStudio).

For now I use the wrong generator for test.


On 30/03/2017 16:20, David Cole wrote:

Do give it a BINARY_DIR, but do NOT give it a BUILD_COMMAND. Giving it
an empty BUILD_COMMAND means "do nothing" for the build step and using
"cmake --build ./LibraryBuild" does not work unless cmake is in your
PATH, and with a Visual Studio solution, you also need to specify
"--config Release" or "--config Debug"

Also posted on SO.


HTH,
David C.



On Thu, Mar 30, 2017 at 10:10 AM, Christophe Demez
  wrote:

Hi,

I'm currently using one CMakeLists.txt file that will execute an external
CMakeLists.txt (and dependency).

For this I use the ExternalProject_Add command, but I can't find a way to
specify where the ".sln" file will be generated.

I have also created StackOverflow question here with more information, if
someone have an idea for a solution ?

http://stackoverflow.com/questions/43117117/cmake-use-externalproject-add-and-specify-the-output-folder

Thanks
--

Powered bywww.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


--
Luciad Email Signature *Christophe Demez *
PROJECT LEADER

*LUCIAD*  CONNECT •  VISUALIZE •  ANALYZE •  ACT

christophe.de...@luciad.com  •  T 
+32 16 23 95 91
Follow us on LinkedIn or 
@LUCIADconnect 


Luciad




--
Luciad Email Signature *Christophe Demez *
PROJECT LEADER

*LUCIAD*  CONNECT •  VISUALIZE •  ANALYZE •  ACT

christophe.de...@luciad.com  •  T 
+32 16 23 95 91
Follow us on LinkedIn or 
@LUCIADconnect 


Luciad
-- 

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] ExternalProject_Add ... output directy (sln file directory)

2017-03-30 Thread Christophe Demez

BTW,

I notice this too, if I use the following command line with an empty 
cmakelists.txt file : cmake -G "Visual Studio 15 2017 Win64"


And it also generate the .sln (and other files) in the same folder, but 
I don't request to build such a solution ! right ?


In reality, I only need a cmakelists.txt file that will build an 
external library for Android (Ninja generator, directly from AndroidStudio).

For now I use the wrong generator for test.


On 30/03/2017 16:20, David Cole wrote:

Do give it a BINARY_DIR, but do NOT give it a BUILD_COMMAND. Giving it
an empty BUILD_COMMAND means "do nothing" for the build step and using
"cmake --build ./LibraryBuild" does not work unless cmake is in your
PATH, and with a Visual Studio solution, you also need to specify
"--config Release" or "--config Debug"

Also posted on SO.


HTH,
David C.



On Thu, Mar 30, 2017 at 10:10 AM, Christophe Demez
 wrote:

Hi,

I'm currently using one CMakeLists.txt file that will execute an external
CMakeLists.txt (and dependency).

For this I use the ExternalProject_Add command, but I can't find a way to
specify where the ".sln" file will be generated.

I have also created StackOverflow question here with more information, if
someone have an idea for a solution ?

http://stackoverflow.com/questions/43117117/cmake-use-externalproject-add-and-specify-the-output-folder

Thanks
--

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


--
Luciad Email Signature *Christophe Demez *
PROJECT LEADER

*LUCIAD*  CONNECT •  VISUALIZE •  ANALYZE •  ACT

christophe.de...@luciad.com  •  T 
+32 16 23 95 91
Follow us on LinkedIn or 
@LUCIADconnect 


Luciad
-- 

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] ExternalProject_Add and include_external_msproject dynamic duo... but what if their powers combined?

2017-03-30 Thread Brian Davis
Apologies for not responding sooner... this fell off my radar and I found
it in my email.

On Thu, Jan 12, 2017 at 6:29 AM, David Cole  wrote:

> Why not just use a BUILD_COMMAND which builds the VS project using the
> msbuild command line directly?


Do you have an example of this?

Even if this is an option it would not seem to allow adding the vcxproj
project files to VS solution, but may be a better option for the way
ExternalProject_Add wraps the underlying project and hides all sub-project
goop in a single target.  With what I am proposing the vcxproj files would
be added to VS solution as individual targets.


I have used BUILD_COMMAND in the past for *attempting* build of boost in
CMake, but due to complaints on command line argument length in VS had to
resort to using BUILD_COMMAND to call bjam/b2 in bat file generated using
configure_file then called from ExternalProject_add.  I then went on to
write and configure_file the roll my own boost CMake package support and
install.  Ultimately I was able to get it to work.  I can now build any
version of boost from within CMake simply by selecting version in CMake gui.

I have been working on a superbuild of superbuilds [Super-E-Duper-Builder
SEDB / SeeDeb See Dependency downloaded, built and installed) which in
theory could download, build, and install any C++ code in the Ether that
ExternalProject_Add supports though zip, git, svn, hg etc.  It's goes where
ExternalProject add and find_package left the dev community... with a
finite quantum of tools, but no abilty to get any software  downloaded,
built and installed though say an "ultimate package manager".

This is where a programmer comes to the realization of the "wild west" of
3rd Party lib developers use of CMake package.  Some are new to it like
fltk and do not version files or there cmake package directory nor do they
put package files in lib/cmake/flltk-/ as itk and vmtk
do and instead put it in ${CMAKE_INSTALL_PREFIX}/CMake/.  Others
like dcmtk put it in share\dcmtk (again without version info as itk and
vmtk do \lib\cmake\ITK-4.8\).  But ITK is no great example either
as on windows has a limit due to path length limiting on where ITK can be
build (build dir) I think it's something like 56 characters (resulting in
build paths outside the project like C:\itk\src\ITK-4.8.1)  and I have
stated my aggravation regarding this on ITK's user forum.   I must be
joking right?  well from ITK root CMakeLists.txt file:

if( CMAKE_HOST_WIN32 )

  string( LENGTH "${CMAKE_CURRENT_SOURCE_DIR}" n )
  if( n GREATER 50 )
message(
  FATAL_ERROR
  "ITK source code directory path length is too long (${n} > 50)."
  "Please move the ITK source code directory to a directory with a
shorter path."
  )
  endif()

Sadly no and .. ok so it's 50.

VMTK puts stuff in build dir minus needed libs like tet.lib and nl.lib and
pkgfiles point back to get this... the build dir and not install dir for
include files.  I feel like a CMake package marshal trying to herd cats on
the internet... lost cause for sure.  Then there are 3rdParty libs that use
superbuild themselves to checkout and build various libs (vmtk usign vtk
and itk).  VMTK allows user to use installed version.  But lets say two 3rd
party libs use super build to build two different versions of packages such
as  fltk or dcmtk and install into a single directory
${CMAKE_PACKAGE_PREFIX} = C:\projects\proj1\install... what happens to the
package files... yep the last build blast away the installed package files
as no versioning was used.  Also 3rdparty lib devs expand vars in installed
package files and do not use configure_file( ... @ONLY) to keep things
relative.

Then there is the "roll their own" use of CMAKE__PREFIX where they
don't use (or don't know it exists) it but instead postfix ('d') it
themselves (fltk) based on build config so if developer comes along and
sets it as it do ends up with dd.lib... I mean that's a double d
lib... and must be for super debugging.  And what is it about CMake not
supporting CMAKE__PREFIX automatically for executables as though
they are second class targets.  Leaving devs to use

SET_TARGET_PROPERTIES(
${APP_NAME} PROPERTIES
COMPILE_DEFINITIONS "${DEFINITIONS_STRING}"
DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX} )

The guide at https://cmake.org/cmake/help/v3.8/manual/cmake-packages.7.html
is certainly a great start though

include(CMakePackageConfigHelpers)

Could do a great deal more to aid in creating some sort of standards and
aid 3rdPart lib devs in putting bits in the right place and correctly
versioning.  Not to mention... er wait I'll mention it ... 3rd party dev's
use of project(thirdPartyProjName)  where version info is not used so by
default on windows CMAKE_INSTALL_PREFIX defaults to C:\Program
Files\thirdPartyProjName and not thirdPartyProjName- where again
things can get blasted away.  One could say it's the 3rd party lib devs
fault for not adhering to CMake standard/best practices... but 

Re: [CMake] ExternalProject_Add ... output directy (sln file directory)

2017-03-30 Thread David Cole via CMake
Do give it a BINARY_DIR, but do NOT give it a BUILD_COMMAND. Giving it
an empty BUILD_COMMAND means "do nothing" for the build step and using
"cmake --build ./LibraryBuild" does not work unless cmake is in your
PATH, and with a Visual Studio solution, you also need to specify
"--config Release" or "--config Debug"

Also posted on SO.


HTH,
David C.



On Thu, Mar 30, 2017 at 10:10 AM, Christophe Demez
 wrote:
> Hi,
>
> I'm currently using one CMakeLists.txt file that will execute an external
> CMakeLists.txt (and dependency).
>
> For this I use the ExternalProject_Add command, but I can't find a way to
> specify where the ".sln" file will be generated.
>
> I have also created StackOverflow question here with more information, if
> someone have an idea for a solution ?
>
> http://stackoverflow.com/questions/43117117/cmake-use-externalproject-add-and-specify-the-output-folder
>
> Thanks
> --
>
> 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
-- 

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] externalproject_add and generating sources

2017-01-29 Thread David Jobet
Oh ok, I see how it works, it makes sense, but I'm somehow disappointed : in 
order to use it, I'm going to have to change my own project while I originally 
thought it was going to be a kind of FindXXX on steroid...
I'll give it a try though, tx for pointing it out.

David

Le 26 janvier 2017 13:02:43 GMT+00:00, Nicholas Braden 
 a écrit :
>You'll also want to build your own project with ExternalProject, and
>use
>the DEPENDS option to control build order. This ensures that all
>dependencies are fully installed before your own project is even
>configured. The project with all the ExternalProject calls is typically
>called a superbuild, and effectively becomes an optional convenience to
>building your own project.
>
>On Thu, Jan 26, 2017 at 3:23 AM, David Jobet 
>wrote:
>
>> Hello,
>>
>> suppose I want to use protobuf and integrate it in my project with
>> externalproject_add. (actually, I just have precompiled binaries and
>libs +
>> header files, I don't have the full sources)
>> Once the project has been 'built' (actually, installed by a custom
>> rpm-like tool to a shared path), I can use the protoc compiler to
>generate
>> protobuf c++ files (.pb.h and .pb.cpp files) from a .proto
>description file.
>> I can add_dependencies so that the external project is built before
>> projects depending on libprotobuf.a.
>>
>> However, I don't know how to do the same thing with .pb.h and .pb.cpp
>> files which use a .proto file and the protoc compiler.
>>
>> make is fine with it, but ninja complains with an error like this :
>> ninja: error:
>'/path_to_external_projects/protobuf/2.6.0.4/bin/protoc',
>> needed by 'some_project/SomeFile.pb.h', missing and no known rule to
>make it
>>
>> how can I tell ninja that protoc is going to be provided by
>> externalproject ?
>> If I use byproducts, ninja is happy, but "ninja clean" deletes
>> /path_to_external_projects/protobuf/2.6.0.4/bin/protoc.
>> I don't want that to happen since
>/path_to_external_projects/protobuf/
>> 2.6.0.4/bin/protoc is shared with other users.
>>
>> With regards
>>
>> David
>> --
>>
>> 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
>>

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma 
brièveté.-- 

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] externalproject_add and generating sources

2017-01-29 Thread David Jobet
Hello,

Yes, main reason is I had to hack FindProtobuf.cmake to make our existing 
project compile.
Also since I need to make it "installable", I had to add some stuff to have the 
binaries and header installed automatically when referenced.
The latter reason led me to experiment with ExternalProject.

David

Le 26 janvier 2017 16:05:47 GMT+00:00, Michael Ellery  a 
écrit :
>
>> On Jan 26, 2017, at 1:23 AM, David Jobet  wrote:
>> 
>> Hello,
>> 
>> suppose I want to use protobuf and integrate it in my project with
>externalproject_add. (actually, I just have precompiled binaries and
>libs + header files, I don't have the full sources)
>> Once the project has been 'built' (actually, installed by a custom
>rpm-like tool to a shared path), I can use the protoc compiler to
>generate protobuf c++ files (.pb.h and .pb.cpp files) from a .proto
>description file.
>> I can add_dependencies so that the external project is built before
>projects depending on libprotobuf.a.
>> 
>> However, I don't know how to do the same thing with .pb.h and .pb.cpp
>files which use a .proto file and the protoc compiler.
>> 
>> make is fine with it, but ninja complains with an error like this :
>> ninja: error:
>'/path_to_external_projects/protobuf/2.6.0.4/bin/protoc', needed by
>'some_project/SomeFile.pb.h', missing and no known rule to make it
>> 
>> how can I tell ninja that protoc is going to be provided by
>externalproject ?
>> If I use byproducts, ninja is happy, but "ninja clean" deletes
>/path_to_external_projects/protobuf/2.6.0.4/bin/protoc.
>> I don't want that to happen since
>/path_to_external_projects/protobuf/2.6.0.4/bin/protoc is shared with
>other users.
>> 
>
>I’ve never used protobufs as an external project (I’ve always just done
>a one-time setup/install)…but is there a reason you can’t just use the
>standard finder to locate it? 
>https://github.com/Kitware/CMake/blob/master/Modules/FindProtobuf.cmake
>
>-Mike

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma 
brièveté.-- 

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] externalproject_add and generating sources

2017-01-26 Thread Michael Ellery

> On Jan 26, 2017, at 1:23 AM, David Jobet  wrote:
> 
> Hello,
> 
> suppose I want to use protobuf and integrate it in my project with 
> externalproject_add. (actually, I just have precompiled binaries and libs + 
> header files, I don't have the full sources)
> Once the project has been 'built' (actually, installed by a custom rpm-like 
> tool to a shared path), I can use the protoc compiler to generate protobuf 
> c++ files (.pb.h and .pb.cpp files) from a .proto description file.
> I can add_dependencies so that the external project is built before projects 
> depending on libprotobuf.a.
> 
> However, I don't know how to do the same thing with .pb.h and .pb.cpp files 
> which use a .proto file and the protoc compiler.
> 
> make is fine with it, but ninja complains with an error like this :
> ninja: error: '/path_to_external_projects/protobuf/2.6.0.4/bin/protoc', 
> needed by 'some_project/SomeFile.pb.h', missing and no known rule to make it
> 
> how can I tell ninja that protoc is going to be provided by externalproject ?
> If I use byproducts, ninja is happy, but "ninja clean" deletes 
> /path_to_external_projects/protobuf/2.6.0.4/bin/protoc.
> I don't want that to happen since 
> /path_to_external_projects/protobuf/2.6.0.4/bin/protoc is shared with other 
> users.
> 

I’ve never used protobufs as an external project (I’ve always just done a 
one-time setup/install)…but is there a reason you can’t just use the standard 
finder to locate it?  
https://github.com/Kitware/CMake/blob/master/Modules/FindProtobuf.cmake

-Mike

-- 

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] externalproject_add and generating sources

2017-01-26 Thread Nicholas Braden
You'll also want to build your own project with ExternalProject, and use
the DEPENDS option to control build order. This ensures that all
dependencies are fully installed before your own project is even
configured. The project with all the ExternalProject calls is typically
called a superbuild, and effectively becomes an optional convenience to
building your own project.

On Thu, Jan 26, 2017 at 3:23 AM, David Jobet  wrote:

> Hello,
>
> suppose I want to use protobuf and integrate it in my project with
> externalproject_add. (actually, I just have precompiled binaries and libs +
> header files, I don't have the full sources)
> Once the project has been 'built' (actually, installed by a custom
> rpm-like tool to a shared path), I can use the protoc compiler to generate
> protobuf c++ files (.pb.h and .pb.cpp files) from a .proto description file.
> I can add_dependencies so that the external project is built before
> projects depending on libprotobuf.a.
>
> However, I don't know how to do the same thing with .pb.h and .pb.cpp
> files which use a .proto file and the protoc compiler.
>
> make is fine with it, but ninja complains with an error like this :
> ninja: error: '/path_to_external_projects/protobuf/2.6.0.4/bin/protoc',
> needed by 'some_project/SomeFile.pb.h', missing and no known rule to make it
>
> how can I tell ninja that protoc is going to be provided by
> externalproject ?
> If I use byproducts, ninja is happy, but "ninja clean" deletes
> /path_to_external_projects/protobuf/2.6.0.4/bin/protoc.
> I don't want that to happen since /path_to_external_projects/protobuf/
> 2.6.0.4/bin/protoc is shared with other users.
>
> With regards
>
> David
> --
>
> 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
>
-- 

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] ExternalProject_Add

2017-01-22 Thread Saad Khattak
That is a good point. I found that a side effect of the superbuild is that
my project can be built independently and I can distribute it without the
superbuild parent project. Thanks Nicholas!

On Sun, Jan 22, 2017 at 10:33 PM Nicholas Braden 
wrote:

> Yes, that is what I do in my superbuilds. Generally I make is such that my
> project could be built without the superbuild, and the superbuild is just a
> convenience.
>
> On Sat, Jan 21, 2017 at 12:17 PM, Saad Khattak 
> wrote:
>
> >> One possibility is the often mentioned superbuild
>
> That is a tempting and I started to go down that route - however, I ran
> into a problem where my project (which is now also built using
> ExternalProject_Add) does not have access to the CMake variables. Is the
> only solution to pass them through the CMAKE_ARGS variable in
> ExternalProject_Add?
>
> On Mon, Jan 9, 2017 at 12:07 AM Hendrik Sattler 
> wrote:
>
> One possibility is the often mentioned superbuild, another is not using
> find_library() but setting the variables with the library file paths
> manually (that's static info anyway).
>
>
> Am 8. Januar 2017 22:49:52 MEZ schrieb Saad Khattak  >:
> >Hello,
> >
> >I have an external project glfw that I added to my project like this:
> >
> >==
> >include(ExternalProject)
> >ExternalProject_Add(glfw
> >  GIT_REPOSITORY "https://github.com/glfw/glfw.git;
> >  GIT_TAG "master"
> >
> >  SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/glfw"
> >  CMAKE_ARGS -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_TESTS=OFF
> >-DGLFW_BUILD_EXAMPLES=OFF
> >-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/install/glfw/
> >-DCMAKE_DEBUG_POSTFIX=_d
> >
> >  TEST_COMMAND ""
> >  )
> >set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/install/glfw/include/")
> >set(GLFW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/install/glfw/lib/")
> >==
> >
> >Then I include it in my project like so:
> >
> >==
> >find_library(GLFW_LIB_D  glfw3_d ${GLFW_LIBRARY_DIR})
> >find_library(GLFW_LIBglfw3   ${GLFW_LIBRARY_DIR})
> >
> >include_directories(${GLFW_INCLUDE_DIR})
> >
> >add_executable(vk_test
> >  src/vulkan_test.cpp
> >  )
> >target_link_libraries(vk_test debug ${GLFW_LIB_D} optimized
> >${GLFW_LIB})
> >add_dependencies(vk_test glfw)
> >==
> >
> >As you can see, I depend on the libraries compiled by the external
> >project
> >glfw. Unfortunately, when I first configure the project, CMake
> >complains
> >that it cannot find the libraries specified by ${GLFW_LIB_D} and
> >${GLFW_LIB} variables.
> >
> >Of course, this is because CMake did not begin cloning, configuring and
> >building the glfw project. That only happens AFTER my project has been
> >configured and starts building. This becomes a chicken and the egg
> >problem.
> >
> >Currently, my solution is to add dummy .lib files so that I can at
> >least
> >configure and generate my project. My question is, am I approaching
> >this
> >problem in the wrong way? If yes, what is the correct way to add a
> >dependency to an external project and have it clone/configure/build
> >BEFORE
> >the "find_library" call?
>
> --
> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
> gesendet.
>
>
> --
>
> 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
>
>
-- 

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] ExternalProject_Add

2017-01-22 Thread Nicholas Braden
Yes, that is what I do in my superbuilds. Generally I make is such that my
project could be built without the superbuild, and the superbuild is just a
convenience.

On Sat, Jan 21, 2017 at 12:17 PM, Saad Khattak  wrote:

> >> One possibility is the often mentioned superbuild
>
> That is a tempting and I started to go down that route - however, I ran
> into a problem where my project (which is now also built using
> ExternalProject_Add) does not have access to the CMake variables. Is the
> only solution to pass them through the CMAKE_ARGS variable in
> ExternalProject_Add?
>
> On Mon, Jan 9, 2017 at 12:07 AM Hendrik Sattler 
> wrote:
>
> One possibility is the often mentioned superbuild, another is not using
> find_library() but setting the variables with the library file paths
> manually (that's static info anyway).
>
>
> Am 8. Januar 2017 22:49:52 MEZ schrieb Saad Khattak  >:
> >Hello,
> >
> >I have an external project glfw that I added to my project like this:
> >
> >==
> >include(ExternalProject)
> >ExternalProject_Add(glfw
> >  GIT_REPOSITORY "https://github.com/glfw/glfw.git;
> >  GIT_TAG "master"
> >
> >  SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/glfw"
> >  CMAKE_ARGS -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_TESTS=OFF
> >-DGLFW_BUILD_EXAMPLES=OFF
> >-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/install/glfw/
> >-DCMAKE_DEBUG_POSTFIX=_d
> >
> >  TEST_COMMAND ""
> >  )
> >set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/install/glfw/include/")
> >set(GLFW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/install/glfw/lib/")
> >==
> >
> >Then I include it in my project like so:
> >
> >==
> >find_library(GLFW_LIB_D  glfw3_d ${GLFW_LIBRARY_DIR})
> >find_library(GLFW_LIBglfw3   ${GLFW_LIBRARY_DIR})
> >
> >include_directories(${GLFW_INCLUDE_DIR})
> >
> >add_executable(vk_test
> >  src/vulkan_test.cpp
> >  )
> >target_link_libraries(vk_test debug ${GLFW_LIB_D} optimized
> >${GLFW_LIB})
> >add_dependencies(vk_test glfw)
> >==
> >
> >As you can see, I depend on the libraries compiled by the external
> >project
> >glfw. Unfortunately, when I first configure the project, CMake
> >complains
> >that it cannot find the libraries specified by ${GLFW_LIB_D} and
> >${GLFW_LIB} variables.
> >
> >Of course, this is because CMake did not begin cloning, configuring and
> >building the glfw project. That only happens AFTER my project has been
> >configured and starts building. This becomes a chicken and the egg
> >problem.
> >
> >Currently, my solution is to add dummy .lib files so that I can at
> >least
> >configure and generate my project. My question is, am I approaching
> >this
> >problem in the wrong way? If yes, what is the correct way to add a
> >dependency to an external project and have it clone/configure/build
> >BEFORE
> >the "find_library" call?
>
> --
> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
> gesendet.
>
>
> --
>
> 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
>
-- 

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] ExternalProject_Add

2017-01-21 Thread Saad Khattak
>> One possibility is the often mentioned superbuild

That is a tempting and I started to go down that route - however, I ran
into a problem where my project (which is now also built using
ExternalProject_Add) does not have access to the CMake variables. Is the
only solution to pass them through the CMAKE_ARGS variable in
ExternalProject_Add?

On Mon, Jan 9, 2017 at 12:07 AM Hendrik Sattler 
wrote:

One possibility is the often mentioned superbuild, another is not using
find_library() but setting the variables with the library file paths
manually (that's static info anyway).


Am 8. Januar 2017 22:49:52 MEZ schrieb Saad Khattak :
>Hello,
>
>I have an external project glfw that I added to my project like this:
>
>==
>include(ExternalProject)
>ExternalProject_Add(glfw
>  GIT_REPOSITORY "https://github.com/glfw/glfw.git;
>  GIT_TAG "master"
>
>  SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/glfw"
>  CMAKE_ARGS -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_TESTS=OFF
>-DGLFW_BUILD_EXAMPLES=OFF
>-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/install/glfw/
>-DCMAKE_DEBUG_POSTFIX=_d
>
>  TEST_COMMAND ""
>  )
>set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/install/glfw/include/")
>set(GLFW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/install/glfw/lib/")
>==
>
>Then I include it in my project like so:
>
>==
>find_library(GLFW_LIB_D  glfw3_d ${GLFW_LIBRARY_DIR})
>find_library(GLFW_LIBglfw3   ${GLFW_LIBRARY_DIR})
>
>include_directories(${GLFW_INCLUDE_DIR})
>
>add_executable(vk_test
>  src/vulkan_test.cpp
>  )
>target_link_libraries(vk_test debug ${GLFW_LIB_D} optimized
>${GLFW_LIB})
>add_dependencies(vk_test glfw)
>==
>
>As you can see, I depend on the libraries compiled by the external
>project
>glfw. Unfortunately, when I first configure the project, CMake
>complains
>that it cannot find the libraries specified by ${GLFW_LIB_D} and
>${GLFW_LIB} variables.
>
>Of course, this is because CMake did not begin cloning, configuring and
>building the glfw project. That only happens AFTER my project has been
>configured and starts building. This becomes a chicken and the egg
>problem.
>
>Currently, my solution is to add dummy .lib files so that I can at
>least
>configure and generate my project. My question is, am I approaching
>this
>problem in the wrong way? If yes, what is the correct way to add a
>dependency to an external project and have it clone/configure/build
>BEFORE
>the "find_library" call?

--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
-- 

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] ExternalProject_Add

2017-01-13 Thread James Sutherland
I found this solution helpful:
  https://crascit.com/2015/07/25/cmake-gtest
It is unfortunate that CMake doesn't have a proper way to accomplish this.
--James


On Sun, Jan 8, 2017 at 10:07 PM, Hendrik Sattler 
wrote:

> One possibility is the often mentioned superbuild, another is not using
> find_library() but setting the variables with the library file paths
> manually (that's static info anyway).
>
>
> Am 8. Januar 2017 22:49:52 MEZ schrieb Saad Khattak  >:
> >Hello,
> >
> >I have an external project glfw that I added to my project like this:
> >
> >==
> >include(ExternalProject)
> >ExternalProject_Add(glfw
> >  GIT_REPOSITORY "https://github.com/glfw/glfw.git;
> >  GIT_TAG "master"
> >
> >  SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/glfw"
> >  CMAKE_ARGS -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_TESTS=OFF
> >-DGLFW_BUILD_EXAMPLES=OFF
> >-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/install/glfw/
> >-DCMAKE_DEBUG_POSTFIX=_d
> >
> >  TEST_COMMAND ""
> >  )
> >set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/install/glfw/include/")
> >set(GLFW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/install/glfw/lib/")
> >==
> >
> >Then I include it in my project like so:
> >
> >==
> >find_library(GLFW_LIB_D  glfw3_d ${GLFW_LIBRARY_DIR})
> >find_library(GLFW_LIBglfw3   ${GLFW_LIBRARY_DIR})
> >
> >include_directories(${GLFW_INCLUDE_DIR})
> >
> >add_executable(vk_test
> >  src/vulkan_test.cpp
> >  )
> >target_link_libraries(vk_test debug ${GLFW_LIB_D} optimized
> >${GLFW_LIB})
> >add_dependencies(vk_test glfw)
> >==
> >
> >As you can see, I depend on the libraries compiled by the external
> >project
> >glfw. Unfortunately, when I first configure the project, CMake
> >complains
> >that it cannot find the libraries specified by ${GLFW_LIB_D} and
> >${GLFW_LIB} variables.
> >
> >Of course, this is because CMake did not begin cloning, configuring and
> >building the glfw project. That only happens AFTER my project has been
> >configured and starts building. This becomes a chicken and the egg
> >problem.
> >
> >Currently, my solution is to add dummy .lib files so that I can at
> >least
> >configure and generate my project. My question is, am I approaching
> >this
> >problem in the wrong way? If yes, what is the correct way to add a
> >dependency to an external project and have it clone/configure/build
> >BEFORE
> >the "find_library" call?
>
> --
> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
> gesendet.
> --
>
> 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
>
-- 

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] ExternalProject_Add

2017-01-08 Thread Hendrik Sattler
One possibility is the often mentioned superbuild, another is not using 
find_library() but setting the variables with the library file paths manually 
(that's static info anyway).


Am 8. Januar 2017 22:49:52 MEZ schrieb Saad Khattak :
>Hello,
>
>I have an external project glfw that I added to my project like this:
>
>==
>include(ExternalProject)
>ExternalProject_Add(glfw
>  GIT_REPOSITORY "https://github.com/glfw/glfw.git;
>  GIT_TAG "master"
>
>  SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/glfw"
>  CMAKE_ARGS -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_TESTS=OFF
>-DGLFW_BUILD_EXAMPLES=OFF
>-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/install/glfw/
>-DCMAKE_DEBUG_POSTFIX=_d
>
>  TEST_COMMAND ""
>  )
>set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/install/glfw/include/")
>set(GLFW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/install/glfw/lib/")
>==
>
>Then I include it in my project like so:
>
>==
>find_library(GLFW_LIB_D  glfw3_d ${GLFW_LIBRARY_DIR})
>find_library(GLFW_LIBglfw3   ${GLFW_LIBRARY_DIR})
>
>include_directories(${GLFW_INCLUDE_DIR})
>
>add_executable(vk_test
>  src/vulkan_test.cpp
>  )
>target_link_libraries(vk_test debug ${GLFW_LIB_D} optimized
>${GLFW_LIB})
>add_dependencies(vk_test glfw)
>==
>
>As you can see, I depend on the libraries compiled by the external
>project
>glfw. Unfortunately, when I first configure the project, CMake
>complains
>that it cannot find the libraries specified by ${GLFW_LIB_D} and
>${GLFW_LIB} variables.
>
>Of course, this is because CMake did not begin cloning, configuring and
>building the glfw project. That only happens AFTER my project has been
>configured and starts building. This becomes a chicken and the egg
>problem.
>
>Currently, my solution is to add dummy .lib files so that I can at
>least
>configure and generate my project. My question is, am I approaching
>this
>problem in the wrong way? If yes, what is the correct way to add a
>dependency to an external project and have it clone/configure/build
>BEFORE
>the "find_library" call?

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
-- 

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] ExternalProject_Add

2017-01-08 Thread Nicholas Braden
The way to solve this is to use a superbuild project layout - you use
ExternalProject_Add to build your dependencies AND your own project, using
the DEPENDS option to control build order. Thus by the time it gets around
to configuring your project, the dependencies have already been built and
installed fully.

On Sun, Jan 8, 2017 at 3:49 PM, Saad Khattak  wrote:

> Hello,
>
> I have an external project glfw that I added to my project like this:
>
> ==
> include(ExternalProject)
> ExternalProject_Add(glfw
>   GIT_REPOSITORY "https://github.com/glfw/glfw.git;
>   GIT_TAG "master"
>
>   SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/glfw"
>   CMAKE_ARGS -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_TESTS=OFF
> -DGLFW_BUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX=${
> CMAKE_SOURCE_DIR}/install/glfw/ -DCMAKE_DEBUG_POSTFIX=_d
>
>   TEST_COMMAND ""
>   )
> set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/install/glfw/include/")
> set(GLFW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/install/glfw/lib/")
> ==
>
> Then I include it in my project like so:
>
> ==
> find_library(GLFW_LIB_D  glfw3_d ${GLFW_LIBRARY_DIR})
> find_library(GLFW_LIBglfw3   ${GLFW_LIBRARY_DIR})
>
> include_directories(${GLFW_INCLUDE_DIR})
>
> add_executable(vk_test
>   src/vulkan_test.cpp
>   )
> target_link_libraries(vk_test debug ${GLFW_LIB_D} optimized ${GLFW_LIB})
> add_dependencies(vk_test glfw)
> ==
>
> As you can see, I depend on the libraries compiled by the external project
> glfw. Unfortunately, when I first configure the project, CMake complains
> that it cannot find the libraries specified by ${GLFW_LIB_D} and
> ${GLFW_LIB} variables.
>
> Of course, this is because CMake did not begin cloning, configuring and
> building the glfw project. That only happens AFTER my project has been
> configured and starts building. This becomes a chicken and the egg problem.
>
> Currently, my solution is to add dummy .lib files so that I can at least
> configure and generate my project. My question is, am I approaching this
> problem in the wrong way? If yes, what is the correct way to add a
> dependency to an external project and have it clone/configure/build BEFORE
> the "find_library" call?
>
>
> --
>
> 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
>
-- 

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] ExternalProject_Add : set the location of CMakeLists.txt

2016-10-26 Thread Benjamin Ballet via CMake
It's not listed in changelog though :
https://cmake.org/cmake/help/v3.7/release/3.7.html

2016-10-26 11:34 GMT+02:00 Benjamin Ballet :

> Ok I'm quiet lucky : There is what I need in CMake 3.7 (SOURCE_SUBDIR)
>
> 2016-10-25 19:54 GMT+02:00 Konstantin Podsvirov 
> :
>
>> Hello again.
>>
>> 25.10.2016, 20:31, "Konstantin Podsvirov" :
>> > Hello, Benjamin.
>> >
>> > 25.10.2016, 19:41, "Benjamin Ballet via CMake" :
>> >>  Hi,
>> >>
>> >>  I'm trying to get GLEW (https://github.com/nigels-com/glew) with
>> ExternalProject_Add
>> >>  It's buildable with cmake but the CMakeLists.txt is in build/cmake
>> directory.
>> >>
>> >>  Is there a way to specify the directory of the CMakeLists.txt file ?
>> >>
>> >>  If I change SOURCE_DIR it will only clone the repo in SOURCE_DIR and
>> still run the cmake command in repo root.
>> >>
>> >>  --
>> >>  Benjamin BALLET
>> >>  Ingénieur R
>> >>
>> >>  ACTIVISU
>> >>  19, rue Klock - 92110 Clichy
>> >>>  Standard Tél :  01 44 69 37 37
>> >>>  www.activisu.com
>> >>  ,--
>> >
>> > Try it:
>> >
>> > ExternalProject_Add(
>> >   ...
>> >   SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
>> >   ...
>> >   CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...]
>> ${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
>> >   ...)
>>
>>
>> Or try it:
>>
>> ExternalProject_Add(
>>   ...
>>   SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
>>   ...
>>   CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...]
>>-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
>>-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
>>-DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET}
>> ${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
>>   ...)
>>
>> --
>> Regards,
>> Konstantin Podsvirov
>>
>
>
>
> --
> *Benjamin BALLET*
> Ingénieur R
>
> *ACTIVISU*
> 19, rue Klock - 92110 Clichy
> *> Standard Tél* :  01 44 69 37 37
> *>* www.activisu.com
>



-- 
*Benjamin BALLET*
Ingénieur R

*ACTIVISU*
19, rue Klock - 92110 Clichy
*> Standard Tél* :  01 44 69 37 37
*>* www.activisu.com
-- 

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] ExternalProject_Add : set the location of CMakeLists.txt

2016-10-26 Thread Benjamin Ballet via CMake
Ok I'm quiet lucky : There is what I need in CMake 3.7 (SOURCE_SUBDIR)

2016-10-25 19:54 GMT+02:00 Konstantin Podsvirov :

> Hello again.
>
> 25.10.2016, 20:31, "Konstantin Podsvirov" :
> > Hello, Benjamin.
> >
> > 25.10.2016, 19:41, "Benjamin Ballet via CMake" :
> >>  Hi,
> >>
> >>  I'm trying to get GLEW (https://github.com/nigels-com/glew) with
> ExternalProject_Add
> >>  It's buildable with cmake but the CMakeLists.txt is in build/cmake
> directory.
> >>
> >>  Is there a way to specify the directory of the CMakeLists.txt file ?
> >>
> >>  If I change SOURCE_DIR it will only clone the repo in SOURCE_DIR and
> still run the cmake command in repo root.
> >>
> >>  --
> >>  Benjamin BALLET
> >>  Ingénieur R
> >>
> >>  ACTIVISU
> >>  19, rue Klock - 92110 Clichy
> >>>  Standard Tél :  01 44 69 37 37
> >>>  www.activisu.com
> >>  ,--
> >
> > Try it:
> >
> > ExternalProject_Add(
> >   ...
> >   SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
> >   ...
> >   CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...]
> ${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
> >   ...)
>
>
> Or try it:
>
> ExternalProject_Add(
>   ...
>   SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
>   ...
>   CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...]
>-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
>-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
>-DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET}
> ${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
>   ...)
>
> --
> Regards,
> Konstantin Podsvirov
>



-- 
*Benjamin BALLET*
Ingénieur R

*ACTIVISU*
19, rue Klock - 92110 Clichy
*> Standard Tél* :  01 44 69 37 37
*>* www.activisu.com
-- 

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] ExternalProject_Add : set the location of CMakeLists.txt

2016-10-25 Thread Konstantin Podsvirov
Hello again.

25.10.2016, 20:31, "Konstantin Podsvirov" :
> Hello, Benjamin.
>
> 25.10.2016, 19:41, "Benjamin Ballet via CMake" :
>>  Hi,
>>
>>  I'm trying to get GLEW (https://github.com/nigels-com/glew) with 
>> ExternalProject_Add
>>  It's buildable with cmake but the CMakeLists.txt is in build/cmake 
>> directory.
>>
>>  Is there a way to specify the directory of the CMakeLists.txt file ?
>>
>>  If I change SOURCE_DIR it will only clone the repo in SOURCE_DIR and still 
>> run the cmake command in repo root.
>>
>>  --
>>  Benjamin BALLET
>>  Ingénieur R
>>
>>  ACTIVISU
>>  19, rue Klock - 92110 Clichy
>>>  Standard Tél :  01 44 69 37 37
>>>  www.activisu.com
>>  ,--
>
> Try it:
>
> ExternalProject_Add(
>   ...
>   SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
>   ...
>   CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...] 
> ${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
>   ...)


Or try it:

ExternalProject_Add(
  ...
  SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
  ...
  CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...]
   -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
   -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
   -DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET}
${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
  ...)

--
Regards,
Konstantin Podsvirov
-- 

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] ExternalProject_Add : set the location of CMakeLists.txt

2016-10-25 Thread Konstantin Podsvirov
Hello, Benjamin.

25.10.2016, 19:41, "Benjamin Ballet via CMake" :
> Hi,
>
> I'm trying to get GLEW (https://github.com/nigels-com/glew) with 
> ExternalProject_Add
> It's buildable with cmake but the CMakeLists.txt is in build/cmake directory.
>
> Is there a way to specify the directory of the CMakeLists.txt file ?
>
> If I change SOURCE_DIR it will only clone the repo in SOURCE_DIR and still 
> run the cmake command in repo root.
>
> --
> Benjamin BALLET
> Ingénieur R
>
> ACTIVISU
> 19, rue Klock - 92110 Clichy
>> Standard Tél :  01 44 69 37 37
>> www.activisu.com
> ,--

Try it:

ExternalProject_Add(
  ...
  SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
  ...
  CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...] 
${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
  ...)

---
Regards,
Konstantin Podsvirov
-- 

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] ExternalProject_Add not honoring the INSTALL_DIR argument.

2016-08-29 Thread Nicholas Braden
Hmm, you're right, I just tested and it seems the INSTALL_DIR is
ignored or not handled properly, I'm not sure why. But if you use the
CMAKE_ARGS option to manually set
"-DCMAKE_INSTALL_PREFIX=/tmp/Fusion/qhull-2015.2" it works, so at
least there's an easy workaround. Maybe someone else knows how the
INSTALL_DIR option is meant to be used?

On Mon, Aug 29, 2016 at 11:00 AM, Michael Jackson
 wrote:
> So that was a typo on my part but changing it had no effect after deleting
> every build/download/tmp/stamp directory and trying again.
>
> --
> Michael A. Jackson
> BlueQuartz Software, LLC
> [e]: mike.jack...@bluequartz.net
>
>
> Nicholas Braden wrote:
>>
>> Have you tried changing the = to a space, as with the other parameters?
>>
>> On Mon, Aug 29, 2016 at 10:52 AM, Michael Jackson
>>   wrote:
>>>
>>> I have the following CMake file:
>>>
>>> set(QHull_GIT_REPO "git://github.com/qhull/qhull")
>>> set(QHull_GIT_TAG "")
>>> set(QHull_INSTALL_NAME "qhull")
>>> set(QHull_INSTALL_NAME "qhull-2015.2")
>>>
>>>
>>> ExternalProject_Add(${QHull_INSTALL_NAME}
>>>PREFIX ${Fusion_SDK_ROOT}
>>>URL "http://www.qhull.org/download/qhull-2015-src-7.2.0.tgz;
>>>INSTALL_DIR=/tmp/Fusion/qhull-2015.2
>>>  LOG_DOWNLOAD 1
>>>  LOG_UPDATE 1
>>>  LOG_CONFIGURE 1
>>>  LOG_BUILD 1
>>>  LOG_INSTALL 1
>>>
>>> )
>>>
>>>   and when I invoke the initial cmake with this:
>>>
>>>   cmake -G Ninja -DBUILD_SHARED_LIBS=ON  -DCMAKE_BUILD_TYPE=Release
>>> -DFusion_SDK_ROOT=/tmp/Fusion_SDK ../
>>>
>>> I get a valid "configure" step. Then I run "ninja" and I get errors on
>>> installation. The errors are because CMake is attempting to install QHull
>>> in
>>> /usr/local/lib.
>>>
>>> Why is that? I am not sure what I am doing wrong as this seems like a
>>> pretty
>>> trivial case. I have cmake 3.5.1 and read the docs at
>>> https://cmake.org/cmake/help/v3.5/module/ExternalProject.html but somehow
>>> cmake is messing up.
>>>
>>> Thoughts?
>>>
>>>
>>> --
>>> Michael A. Jackson
>>> BlueQuartz Software, LLC
>>> [e]: mike.jack...@bluequartz.net
>>> --
>>>
>>> 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
>
> --
>
> 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
-- 

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] ExternalProject_Add not honoring the INSTALL_DIR argument.

2016-08-29 Thread Michael Jackson
So that was a typo on my part but changing it had no effect after 
deleting every build/download/tmp/stamp directory and trying again.


--
Michael A. Jackson
BlueQuartz Software, LLC
[e]: mike.jack...@bluequartz.net


Nicholas Braden wrote:

Have you tried changing the = to a space, as with the other parameters?

On Mon, Aug 29, 2016 at 10:52 AM, Michael Jackson
  wrote:

I have the following CMake file:

set(QHull_GIT_REPO "git://github.com/qhull/qhull")
set(QHull_GIT_TAG "")
set(QHull_INSTALL_NAME "qhull")
set(QHull_INSTALL_NAME "qhull-2015.2")


ExternalProject_Add(${QHull_INSTALL_NAME}
   PREFIX ${Fusion_SDK_ROOT}
   URL "http://www.qhull.org/download/qhull-2015-src-7.2.0.tgz;
   INSTALL_DIR=/tmp/Fusion/qhull-2015.2
 LOG_DOWNLOAD 1
 LOG_UPDATE 1
 LOG_CONFIGURE 1
 LOG_BUILD 1
 LOG_INSTALL 1

)

  and when I invoke the initial cmake with this:

  cmake -G Ninja -DBUILD_SHARED_LIBS=ON  -DCMAKE_BUILD_TYPE=Release
-DFusion_SDK_ROOT=/tmp/Fusion_SDK ../

I get a valid "configure" step. Then I run "ninja" and I get errors on
installation. The errors are because CMake is attempting to install QHull in
/usr/local/lib.

Why is that? I am not sure what I am doing wrong as this seems like a pretty
trivial case. I have cmake 3.5.1 and read the docs at
https://cmake.org/cmake/help/v3.5/module/ExternalProject.html but somehow
cmake is messing up.

Thoughts?


--
Michael A. Jackson
BlueQuartz Software, LLC
[e]: mike.jack...@bluequartz.net
--

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

--

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] ExternalProject_Add not honoring the INSTALL_DIR argument.

2016-08-29 Thread Nicholas Braden
Have you tried changing the = to a space, as with the other parameters?

On Mon, Aug 29, 2016 at 10:52 AM, Michael Jackson
 wrote:
> I have the following CMake file:
>
> set(QHull_GIT_REPO "git://github.com/qhull/qhull")
> set(QHull_GIT_TAG "")
> set(QHull_INSTALL_NAME "qhull")
> set(QHull_INSTALL_NAME "qhull-2015.2")
>
>
> ExternalProject_Add(${QHull_INSTALL_NAME}
>   PREFIX ${Fusion_SDK_ROOT}
>   URL "http://www.qhull.org/download/qhull-2015-src-7.2.0.tgz;
>   INSTALL_DIR=/tmp/Fusion/qhull-2015.2
> LOG_DOWNLOAD 1
> LOG_UPDATE 1
> LOG_CONFIGURE 1
> LOG_BUILD 1
> LOG_INSTALL 1
>
> )
>
>  and when I invoke the initial cmake with this:
>
>  cmake -G Ninja -DBUILD_SHARED_LIBS=ON  -DCMAKE_BUILD_TYPE=Release
> -DFusion_SDK_ROOT=/tmp/Fusion_SDK ../
>
> I get a valid "configure" step. Then I run "ninja" and I get errors on
> installation. The errors are because CMake is attempting to install QHull in
> /usr/local/lib.
>
> Why is that? I am not sure what I am doing wrong as this seems like a pretty
> trivial case. I have cmake 3.5.1 and read the docs at
> https://cmake.org/cmake/help/v3.5/module/ExternalProject.html but somehow
> cmake is messing up.
>
> Thoughts?
>
>
> --
> Michael A. Jackson
> BlueQuartz Software, LLC
> [e]: mike.jack...@bluequartz.net
> --
>
> 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
-- 

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] ExternalProject_Add + imported targets: no rule to make yourlibrary.so

2016-05-03 Thread Bill Hoffman

On 4/28/2016 4:31 PM, SnakE wrote:

set_target_properties(foo PROPERTIES IMPORTED_LOCATION foo.so)

https://cmake.org/cmake/help/v3.0/prop_tgt/IMPORTED_LOCATION.html?highlight=imported_location

"Full path to the main file on disk for an IMPORTED target."

You need to use a full path to foo.so, works by luck with make.

-Bill


--

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] ExternalProject_Add with flexible install commands

2016-02-25 Thread Knox, Kent
I don't need to use indirection, but the reason I decided to try was to 
simplify my code.  I could either wrap the ExternalProject_Add() call in a 
branch/switch or a single set() call.  

I am using your 'hack' thusly:
set( libxxx_inst_comm INSTALL_COMMAND ${CMAKE_COMMAND} -E echo_append )

and it's working great for me.  I have no problem documenting what i'm doing in 
my code.

Thank you for your input!

K

From: David Cole <dlrd...@aol.com>
Sent: Thursday, February 25, 2016 10:57 AM
To: Knox, Kent
Cc: Petr Kmoch; cmake@cmake.org
Subject: Re: [CMake] ExternalProject_Add with flexible install commands

Do you need to do it indirectly through a variable like this?

If you just use:
  INSTALL_COMMAND ""

directly in the ExternalProject_Add call, it will work.

If you really need to do it indirectly, there's probably a way, but it
will also probably be more confusing for people reading the code in
the future. Not sure it's worth that trade-off. You could always
"cheat" and execute a no-op command for the install step rather than
"skipping" it. i.e. INSTALL_COMMAND ${CMAKE_COMMAND} -E echo
NoInstallStep ...


HTH,
David C.




On Thu, Feb 25, 2016 at 11:03 AM, Knox, Kent <kent.k...@amd.com> wrote:
> Hi Petr~
>
> Thanks for your reply.
>
>
> These set statements do not appear to work.  Either the command 'installs'
> the dependency, or an error pops up.
>
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND "" )
> --> this installs the dependency
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND " " )
> --> /bin/sh: 1:  : not found
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND """" )
> --> CMake Warning (dev) in CMakeLists.txt
> --> Argument not separated from preceding token by whitespace.
>
> Kent
>
> ____________
> From: Petr Kmoch <petr.km...@gmail.com>
> Sent: Thursday, February 25, 2016 2:46 AM
> To: Knox, Kent
> Cc: cmake@cmake.org
> Subject: Re: [CMake] ExternalProject_Add with flexible install commands
>
> Hi Kent,
>
> I believe it's not "empty quotes" that disables the install command, it's
> the empty string. So you should not escape the quotes:
>
> ###
>
> # Default behavior is to NOT install library, empty quotes should disable
> install
> set( libxxx_inst_comm INSTALL_COMMAND "" )
>
> # Build the library as an external project
>   ExternalProject_Add( libxxx
> SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
> ${libxxx_inst_comm}
>   )
> ###
>
> Petr
>
>
> --
>
> 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
-- 

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] ExternalProject_Add with flexible install commands

2016-02-25 Thread David Cole via CMake
Do you need to do it indirectly through a variable like this?

If you just use:
  INSTALL_COMMAND ""

directly in the ExternalProject_Add call, it will work.

If you really need to do it indirectly, there's probably a way, but it
will also probably be more confusing for people reading the code in
the future. Not sure it's worth that trade-off. You could always
"cheat" and execute a no-op command for the install step rather than
"skipping" it. i.e. INSTALL_COMMAND ${CMAKE_COMMAND} -E echo
NoInstallStep ...


HTH,
David C.




On Thu, Feb 25, 2016 at 11:03 AM, Knox, Kent <kent.k...@amd.com> wrote:
> Hi Petr~
>
> Thanks for your reply.
>
>
> These set statements do not appear to work.  Either the command 'installs'
> the dependency, or an error pops up.
>
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND "" )
> --> this installs the dependency
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND " " )
> --> /bin/sh: 1:  : not found
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND """" )
> --> CMake Warning (dev) in CMakeLists.txt
> --> Argument not separated from preceding token by whitespace.
>
> Kent
>
> ____________
> From: Petr Kmoch <petr.km...@gmail.com>
> Sent: Thursday, February 25, 2016 2:46 AM
> To: Knox, Kent
> Cc: cmake@cmake.org
> Subject: Re: [CMake] ExternalProject_Add with flexible install commands
>
> Hi Kent,
>
> I believe it's not "empty quotes" that disables the install command, it's
> the empty string. So you should not escape the quotes:
>
> ###
>
> # Default behavior is to NOT install library, empty quotes should disable
> install
> set( libxxx_inst_comm INSTALL_COMMAND "" )
>
> # Build the library as an external project
>   ExternalProject_Add( libxxx
> SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
> ${libxxx_inst_comm}
>   )
> ###
>
> Petr
>
>
> --
>
> 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
-- 

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] ExternalProject_Add with flexible install commands

2016-02-25 Thread Knox, Kent
Hi Petr~

Thanks for your reply.


These set statements do not appear to work.  Either the command 'installs' the 
dependency, or an error pops up.


set( rocblas_INSTALL_COMMAND INSTALL_COMMAND "" )
--> this installs the dependency

set( rocblas_INSTALL_COMMAND INSTALL_COMMAND " " )
--> /bin/sh: 1:  : not found

set( rocblas_INSTALL_COMMAND INSTALL_COMMAND """" )
--> CMake Warning (dev) in CMakeLists.txt
--> Argument not separated from preceding token by whitespace.

Kent


From: Petr Kmoch <petr.km...@gmail.com>
Sent: Thursday, February 25, 2016 2:46 AM
To: Knox, Kent
Cc: cmake@cmake.org
Subject: Re: [CMake] ExternalProject_Add with flexible install commands

Hi Kent,

I believe it's not "empty quotes" that disables the install command, it's the 
empty string. So you should not escape the quotes:


###

# Default behavior is to NOT install library, empty quotes should disable 
install
set( libxxx_inst_comm INSTALL_COMMAND "" )

# Build the library as an external project
  ExternalProject_Add( libxxx
SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
${libxxx_inst_comm}
  )
###

Petr

-- 

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] ExternalProject_Add with flexible install commands

2016-02-25 Thread Petr Kmoch
Hi Kent,

I believe it's not "empty quotes" that disables the install command, it's
the empty string. So you should not escape the quotes:

###
# Default behavior is to NOT install library, empty quotes should disable
install
set( libxxx_inst_comm INSTALL_COMMAND "" )

# Build the library as an external project
  ExternalProject_Add( libxxx
SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
${libxxx_inst_comm}
  )
###

Petr


On Thu, Feb 25, 2016 at 7:04 AM, Knox, Kent  wrote:

> I am having a problem passing parameters as a variable into
> ExternalProject_Add(). I seem to be fighting syntax, i've tried many
> different variants with the set() statement
>
>
> ###
>
> # Default behavior is to NOT install library, empty quotes should disable
> install
> set( libxxx_inst_comm INSTALL_COMMAND "\"\"" )
>
> # Build the library as an external project
>   ExternalProject_Add( libxxx
> SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
> ${libxxx_inst_comm}
>   )
> ###
>
> I get this message, which appears to be within ExternalProject_add()
> using add_custom_command.  Is there a way around this?
>
> CMake Error at
> /opt/homebrew-cask/Caskroom/cmake/3.2.2/CMake.app/Contents/share/cmake-3.2/Modules/ExternalProject.cmake:1487
> (add_custom_command):
>
>   COMMAND may not contain literal quotes:
>
>
> ""
>
>
> --
>
> 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
>
-- 

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] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-21 Thread Nicholas Braden
Ah, I ran into this quirk too - the issue is that you have the quotes incorrect:

-DCMAKE_CXX_FLAGS="-march=native"

Should be like this instead:

"-DCMAKE_CXX_FLAGS=-march=native"

Try that and see if it helps, I am pretty sure I ran into the exact
same problem.

On Thu, Jan 21, 2016 at 8:27 AM, fkillus  wrote:
> Thanks for clarifying that external projects are not aware of the project
> they are embedded in.
> The CMAKE_COMPILER_IS_GNUCXX variable should be set automatically by CMake
> as far
> as I understand it (see https://cmake.org/Wiki/CMake_Useful_Variables).
>
> I narrowed down the problem by creating a minimal setup which still
> reproduces the issue.
> In this case the super project is simply a wrapper around an external dummy
> project.
>
> external/CMakeLists.txt:
>
>   cmake_minimum_required( VERSION 3.4 )
>   project( external )
>   message( "External - CMAKE_COMPILER_IS_GNUCXX: "
> ${CMAKE_COMPILER_IS_GNUCXX} )
>   message( "External - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
>   message( "External - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
>
> super/CMakeLists.txt:
>
>   cmake_minimum_required( VERSION 3.4 )
>   project( super )
>   message( "Super - CMAKE_COMPILER_IS_GNUCXX: " ${CMAKE_COMPILER_IS_GNUCXX}
> )
>   message( "Super - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
>   message( "Super - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
>   include( ExternalProject )
>   ExternalProject_Add(
> external
> DOWNLOAD_COMMAND ""
> SOURCE_DIR ${CMAKE_SOURCE_DIR}/../external
> CMAKE_ARGS
>   -DCMAKE_CXX_FLAGS="-march=native"
> INSTALL_COMMAND  ""
>   )
>
> The problem occurs when the CMAKE_CXX_FLAGS variable is set inside the
> ExternalProject_Add
> command using quotes (i.e. "-march=native" in this example). The output
> obtained when configuring
> the super project with 'cmake ../super' is:
>
> -- The C compiler identification is GNU 5.2.0
> -- The CXX compiler identification is GNU 5.2.0
> -- Check for working C compiler: /usr/bin/cc
> -- Check for working C compiler: /usr/bin/cc -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- 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
> Super - CMAKE_COMPILER_IS_GNUCXX: 1
> Super - CMAKE_CXX_COMPILER_ID: GNU
> Super - CMAKE_CXX_FLAGS:
> -- Configuring done
> -- Generating done
>
> Afterwards building with 'make' results in:
>
> [ 12%] Creating directories for 'external'
> [ 25%] No download step for 'external'
> [ 37%] No patch step for 'external'
> [ 50%] No update step for 'external'
> [ 62%] Performing configure step for 'external'
> -- The C compiler identification is GNU 5.2.0
> -- The CXX compiler identification is unknown
> -- Check for working C compiler: /usr/bin/cc
> -- Check for working C compiler: /usr/bin/cc -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- 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
> External - CMAKE_COMPILER_IS_GNUCXX:
> External - CMAKE_CXX_COMPILER_ID:
> External - CMAKE_CXX_FLAGS: "-march=native"
> -- Configuring done
> -- Generating done
>
> This shows the compiler is not correctly identified for the external
> project. Directly configuring
> the external project with 'cmake -DCMAKE_CXX_FLAGS="-march=native"
> ../external' works though:
>
> -- The C compiler identification is GNU 5.2.0
> -- The CXX compiler identification is GNU 5.2.0
> -- Check for working C compiler: /usr/bin/cc
> -- Check for working C compiler: /usr/bin/cc -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- 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
> External - CMAKE_COMPILER_IS_GNUCXX: 1
> External - CMAKE_CXX_COMPILER_ID: GNU
> External - CMAKE_CXX_FLAGS: -march=native
> -- Configuring done
> -- Generating done
>
>
> It also works if the quotations marks in the super project listfile are
> removed. I.e. changing
>   CMAKE_ARGS
>-DCMAKE_CXX_FLAGS="-march=native"
> to
>   CMAKE_ARGS
>-DCMAKE_CXX_FLAGS=-march=native
>
> The question is now, is it still possible to add mutiple compile flags if
> one cannot use quotation marks?
>
>
> On Wed, Jan 20, 2016 at 6:58 PM, 

Re: [CMake] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-21 Thread fkillus via CMake
Thanks for clarifying that external projects are not aware of the project
they are embedded in.
The CMAKE_COMPILER_IS_GNUCXX variable should be set automatically by CMake
as far
as I understand it (see https://cmake.org/Wiki/CMake_Useful_Variables).

I narrowed down the problem by creating a minimal setup which still
reproduces the issue.
In this case the super project is simply a wrapper around an external dummy
project.

external/CMakeLists.txt:

  cmake_minimum_required( VERSION 3.4 )
  project( external )
  message( "External - CMAKE_COMPILER_IS_GNUCXX: "
${CMAKE_COMPILER_IS_GNUCXX} )
  message( "External - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
  message( "External - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )

super/CMakeLists.txt:

  cmake_minimum_required( VERSION 3.4 )
  project( super )
  message( "Super - CMAKE_COMPILER_IS_GNUCXX: " ${CMAKE_COMPILER_IS_GNUCXX}
)
  message( "Super - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
  message( "Super - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
  include( ExternalProject )
  ExternalProject_Add(
external
DOWNLOAD_COMMAND ""
SOURCE_DIR ${CMAKE_SOURCE_DIR}/../external
CMAKE_ARGS
  -DCMAKE_CXX_FLAGS="-march=native"
INSTALL_COMMAND  ""
  )

The problem occurs when the CMAKE_CXX_FLAGS variable is set inside the
ExternalProject_Add
command using quotes (i.e. "-march=native" in this example). The output
obtained when configuring
the super project with 'cmake ../super' is:

-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is GNU 5.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- 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
Super - CMAKE_COMPILER_IS_GNUCXX: 1
Super - CMAKE_CXX_COMPILER_ID: GNU
Super - CMAKE_CXX_FLAGS:
-- Configuring done
-- Generating done

Afterwards building with 'make' results in:

[ 12%] Creating directories for 'external'
[ 25%] No download step for 'external'
[ 37%] No patch step for 'external'
[ 50%] No update step for 'external'
[ 62%] Performing configure step for 'external'
-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- 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
External - CMAKE_COMPILER_IS_GNUCXX:
External - CMAKE_CXX_COMPILER_ID:
External - CMAKE_CXX_FLAGS: "-march=native"
-- Configuring done
-- Generating done

This shows the compiler is not correctly identified for the external
project. Directly configuring
the external project with 'cmake -DCMAKE_CXX_FLAGS="-march=native"
../external' works though:

-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is GNU 5.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- 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
External - CMAKE_COMPILER_IS_GNUCXX: 1
External - CMAKE_CXX_COMPILER_ID: GNU
External - CMAKE_CXX_FLAGS: -march=native
-- Configuring done
-- Generating done


It also works if the quotations marks in the super project listfile are
removed. I.e. changing
  CMAKE_ARGS
   -DCMAKE_CXX_FLAGS="-march=native"
to
  CMAKE_ARGS
   -DCMAKE_CXX_FLAGS=-march=native

The question is now, is it still possible to add mutiple compile flags if
one cannot use quotation marks?


On Wed, Jan 20, 2016 at 6:58 PM, Nicholas Braden  wrote:

> Where/how is that variable normally set? External projects have no
> awareness of the project they are in, they just run CMake as usual the
> same way you would. If the variable is normally set by CMake itself,
> make sure that your containing project and the external project both
> find the same compiler. (They each do their own automatic search for
> compilers)
>
> On Wed, Jan 20, 2016 at 11:41 AM, fkillus via CMake 
> wrote:
> > I have been trying to compile Ogre [1] as external dependency with
> > 

Re: [CMake] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-21 Thread fkillus via CMake
Nice, thank you very much! This solves my problem.

On Thu, Jan 21, 2016 at 3:56 PM, Nicholas Braden  wrote:

> Ah, I ran into this quirk too - the issue is that you have the quotes
> incorrect:
>
> -DCMAKE_CXX_FLAGS="-march=native"
>
> Should be like this instead:
>
> "-DCMAKE_CXX_FLAGS=-march=native"
>
> Try that and see if it helps, I am pretty sure I ran into the exact
> same problem.
>
> On Thu, Jan 21, 2016 at 8:27 AM, fkillus  wrote:
> > Thanks for clarifying that external projects are not aware of the project
> > they are embedded in.
> > The CMAKE_COMPILER_IS_GNUCXX variable should be set automatically by
> CMake
> > as far
> > as I understand it (see https://cmake.org/Wiki/CMake_Useful_Variables).
> >
> > I narrowed down the problem by creating a minimal setup which still
> > reproduces the issue.
> > In this case the super project is simply a wrapper around an external
> dummy
> > project.
> >
> > external/CMakeLists.txt:
> >
> >   cmake_minimum_required( VERSION 3.4 )
> >   project( external )
> >   message( "External - CMAKE_COMPILER_IS_GNUCXX: "
> > ${CMAKE_COMPILER_IS_GNUCXX} )
> >   message( "External - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID}
> )
> >   message( "External - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
> >
> > super/CMakeLists.txt:
> >
> >   cmake_minimum_required( VERSION 3.4 )
> >   project( super )
> >   message( "Super - CMAKE_COMPILER_IS_GNUCXX: "
> ${CMAKE_COMPILER_IS_GNUCXX}
> > )
> >   message( "Super - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
> >   message( "Super - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
> >   include( ExternalProject )
> >   ExternalProject_Add(
> > external
> > DOWNLOAD_COMMAND ""
> > SOURCE_DIR ${CMAKE_SOURCE_DIR}/../external
> > CMAKE_ARGS
> >   -DCMAKE_CXX_FLAGS="-march=native"
> > INSTALL_COMMAND  ""
> >   )
> >
> > The problem occurs when the CMAKE_CXX_FLAGS variable is set inside the
> > ExternalProject_Add
> > command using quotes (i.e. "-march=native" in this example). The output
> > obtained when configuring
> > the super project with 'cmake ../super' is:
> >
> > -- The C compiler identification is GNU 5.2.0
> > -- The CXX compiler identification is GNU 5.2.0
> > -- Check for working C compiler: /usr/bin/cc
> > -- Check for working C compiler: /usr/bin/cc -- works
> > -- Detecting C compiler ABI info
> > -- Detecting C compiler ABI info - done
> > -- Detecting C compile features
> > -- Detecting C compile features - done
> > -- 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
> > Super - CMAKE_COMPILER_IS_GNUCXX: 1
> > Super - CMAKE_CXX_COMPILER_ID: GNU
> > Super - CMAKE_CXX_FLAGS:
> > -- Configuring done
> > -- Generating done
> >
> > Afterwards building with 'make' results in:
> >
> > [ 12%] Creating directories for 'external'
> > [ 25%] No download step for 'external'
> > [ 37%] No patch step for 'external'
> > [ 50%] No update step for 'external'
> > [ 62%] Performing configure step for 'external'
> > -- The C compiler identification is GNU 5.2.0
> > -- The CXX compiler identification is unknown
> > -- Check for working C compiler: /usr/bin/cc
> > -- Check for working C compiler: /usr/bin/cc -- works
> > -- Detecting C compiler ABI info
> > -- Detecting C compiler ABI info - done
> > -- Detecting C compile features
> > -- Detecting C compile features - done
> > -- 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
> > External - CMAKE_COMPILER_IS_GNUCXX:
> > External - CMAKE_CXX_COMPILER_ID:
> > External - CMAKE_CXX_FLAGS: "-march=native"
> > -- Configuring done
> > -- Generating done
> >
> > This shows the compiler is not correctly identified for the external
> > project. Directly configuring
> > the external project with 'cmake -DCMAKE_CXX_FLAGS="-march=native"
> > ../external' works though:
> >
> > -- The C compiler identification is GNU 5.2.0
> > -- The CXX compiler identification is GNU 5.2.0
> > -- Check for working C compiler: /usr/bin/cc
> > -- Check for working C compiler: /usr/bin/cc -- works
> > -- Detecting C compiler ABI info
> > -- Detecting C compiler ABI info - done
> > -- Detecting C compile features
> > -- Detecting C compile features - done
> > -- 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
> > External - CMAKE_COMPILER_IS_GNUCXX: 1
> > External - CMAKE_CXX_COMPILER_ID: GNU
> > External - CMAKE_CXX_FLAGS: -march=native
> > -- Configuring 

Re: [CMake] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-21 Thread fkillus via CMake
Thanks for your suggestion! I consider trying it soon.

On Wed, Jan 20, 2016 at 11:44 PM, Craig Scott 
wrote:

>
> From: fkillus 
>> To: cmake@cmake.org
>> Cc:
>> Date: Wed, 20 Jan 2016 18:41:26 +0100
>> Subject: [CMake] ExternalProject_Add() macro does not set
>> CMAKE_COMPILER_IS_GNUCXX
>> I have been trying to compile Ogre [1] as external dependency with
>> ExternalProject_Add(). In theory this should be straightforward since Ogre
>> itself also uses CMake as buildsystem. However, in the process I
>> encountered the following problem:
>>
>
>> Ogre checks the value of the CMAKE_COMPILER_IS_GNUCXX variable in some
>> places (e.g. [2]). I am running Linux and compiling with g++ and everything
>> works fine if I manually configure Ogre with cmake or cmake-gui.
>> Unfortunately, after wrapping everything inside ExternalProject_Add(), the
>> CMAK_COMPILER_IS_GNUCXX variable is no longer being set correctly.
>>
>> A simple workaround is to manually set this variable, i.e.:
>>
>>  ExternalProject_Add(
>> ogre
>> URL https://bitbucket.org/sinbad/ogre/get/v1-9-0.zip
>> CMAKE_ARGS
>>   -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_OUTPUT_DIR}
>>   -DCMAKE_COMPILER_IS_GNUCXX=${CMAKE_COMPILER_IS_GNUCXX}   # workaround
>>   )
>>
>> This works, but I'm uncertain if this should be necessary. Is this a bug
>> or a feature?
>>
>>
>> [1] https://bitbucket.org/sinbad/ogre
>> [2]
>> https://bitbucket.org/sinbad/ogre/src/0d580c7216abe27fafe41cb43e31d8ed86ded591/CMake/Utils/OgreConfigTargets.cmake?at=default=file-view-default#OgreConfigTargets.cmake-277
>>
>>
>
> Since Ogre is a CMake project, you may find the technique described at the
> following link useful. It uses GoogleTest as its example, but it should
> also apply to your situation. The approach uses ExternalProject only to
> download the source at CMake time. It then pulls it into your normal build
> via add_subdirectory(), so it gets all the same compiler details, etc. as
> your main build because it IS part of your main build.
>
> http://crascit.com/2015/07/25/cmake-gtest/
>
> I am not familiar with Ogre's build, so I can't comment on whether it will
> play nice if pulled into a parent build like this, but it's worth a try.
> The article links to a github repo which provides a fully generalised
> implementation you should be able to use out of the box.
>
>
> --
> Craig Scott
> Melbourne, Australia
> http://crascit.com
>
> --
>
> 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
>
-- 

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] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-20 Thread Nicholas Braden
Where/how is that variable normally set? External projects have no
awareness of the project they are in, they just run CMake as usual the
same way you would. If the variable is normally set by CMake itself,
make sure that your containing project and the external project both
find the same compiler. (They each do their own automatic search for
compilers)

On Wed, Jan 20, 2016 at 11:41 AM, fkillus via CMake  wrote:
> I have been trying to compile Ogre [1] as external dependency with
> ExternalProject_Add(). In theory this should be straightforward since Ogre
> itself also uses CMake as buildsystem. However, in the process I encountered
> the following problem:
>
> Ogre checks the value of the CMAKE_COMPILER_IS_GNUCXX variable in some
> places (e.g. [2]). I am running Linux and compiling with g++ and everything
> works fine if I manually configure Ogre with cmake or cmake-gui.
> Unfortunately, after wrapping everything inside ExternalProject_Add(), the
> CMAK_COMPILER_IS_GNUCXX variable is no longer being set correctly.
>
> A simple workaround is to manually set this variable, i.e.:
>
>  ExternalProject_Add(
> ogre
> URL https://bitbucket.org/sinbad/ogre/get/v1-9-0.zip
> CMAKE_ARGS
>   -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_OUTPUT_DIR}
>   -DCMAKE_COMPILER_IS_GNUCXX=${CMAKE_COMPILER_IS_GNUCXX}   # workaround
>   )
>
> This works, but I'm uncertain if this should be necessary. Is this a bug or
> a feature?
>
>
> [1] https://bitbucket.org/sinbad/ogre
> [2]
> https://bitbucket.org/sinbad/ogre/src/0d580c7216abe27fafe41cb43e31d8ed86ded591/CMake/Utils/OgreConfigTargets.cmake?at=default=file-view-default#OgreConfigTargets.cmake-277
>
> --
>
> 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
-- 

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] ExternalProject_Add support for git clone -o option

2016-01-15 Thread Nicholas Braden
Why would you like to have names other than origin? I am struggling to
think of a use case for this, seeing as you never directly interact
with the cloned repository. I don't even think it's safe to assume
that a git repository is involved at all, for all you know it could be
changed to just download the code and never even involve git. (Maybe
it is guaranteed somewhere but I don't see such a guarantee in the
documentation)

On Fri, Jan 15, 2016 at 10:03 AM, Adam Rankin  wrote:
> Hello all,
>
>
>
> I am reading through the ExternalProject source for 3.2 at the moment (if
> updating to 3.4 is the answer, great!) and trying to determine if there is
> support for the –o option when using a git repository.
>
>
>
> Has anyone accomplished this? I would like to have names other than “origin”
>
>
>
> Cheers,
>
> Adam
>
>
> --
>
> 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
-- 

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] ExternalProject_Add support for git clone -o option

2016-01-15 Thread Adam Rankin
To elaborate on my reply:

I do indeed interact with the repository after it's cloned (as per my previous 
email).

With regards to implementation, I have implemented it such that the git remote 
name is only involved if git is chosen as the source of choice, in much the 
same manner as the git_tag implementation. My implementation makes the git 
remote name completely optional and defaults to "origin".

Regards,
Adam

-Original Message-
From: Nicholas Braden [mailto:nicholas11bra...@gmail.com] 
Sent: Friday, January 15, 2016 12:02 PM
To: Adam Rankin <aran...@robarts.ca>
Cc: cmake@cmake.org
Subject: Re: [CMake] ExternalProject_Add support for git clone -o option

Why would you like to have names other than origin? I am struggling to think of 
a use case for this, seeing as you never directly interact with the cloned 
repository. I don't even think it's safe to assume that a git repository is 
involved at all, for all you know it could be changed to just download the code 
and never even involve git. (Maybe it is guaranteed somewhere but I don't see 
such a guarantee in the
documentation)

On Fri, Jan 15, 2016 at 10:03 AM, Adam Rankin <aran...@robarts.ca> wrote:
> Hello all,
>
>
>
> I am reading through the ExternalProject source for 3.2 at the moment 
> (if updating to 3.4 is the answer, great!) and trying to determine if 
> there is support for the –o option when using a git repository.
>
>
>
> Has anyone accomplished this? I would like to have names other than “origin”
>
>
>
> Cheers,
>
> Adam
>
>
> --
>
> 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
-- 

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] ExternalProject_Add support for git clone -o option

2016-01-15 Thread Adam Rankin
My use case is for forked repositories and sending pull requests upstream. In 
this case "origin" is ambiguous as manage both remotes and I would like to give 
the cloned repository a more accurate name.

Cheers,
Adam

-Original Message-
From: Nicholas Braden [mailto:nicholas11bra...@gmail.com] 
Sent: Friday, January 15, 2016 12:02 PM
To: Adam Rankin <aran...@robarts.ca>
Cc: cmake@cmake.org
Subject: Re: [CMake] ExternalProject_Add support for git clone -o option

Why would you like to have names other than origin? I am struggling to think of 
a use case for this, seeing as you never directly interact with the cloned 
repository. I don't even think it's safe to assume that a git repository is 
involved at all, for all you know it could be changed to just download the code 
and never even involve git. (Maybe it is guaranteed somewhere but I don't see 
such a guarantee in the
documentation)

On Fri, Jan 15, 2016 at 10:03 AM, Adam Rankin <aran...@robarts.ca> wrote:
> Hello all,
>
>
>
> I am reading through the ExternalProject source for 3.2 at the moment 
> (if updating to 3.4 is the answer, great!) and trying to determine if 
> there is support for the –o option when using a git repository.
>
>
>
> Has anyone accomplished this? I would like to have names other than “origin”
>
>
>
> Cheers,
>
> Adam
>
>
> --
>
> 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
-- 

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] ExternalProject_Add and inheritance

2015-12-15 Thread CHEVRIER, Marc
The problem is not a CMake one but a runtime environment one.
You built an executable with a specific environment (GCC 5) but try to execute 
it in a different environment (default platform): When an executable is built, 
system libraries paths are not stored as part of the executable so without 
specific env, wrong library is used. You can solve this problem using, as you 
already found, LD_LIBRARY_PATH or, may be (not tried), using various CMake 
related RPATH variables and properties to force storage of system library path.


From: Cedric Doucet <cedric.dou...@inria.fr<mailto:cedric.dou...@inria.fr>>
Date: Friday 11 December 2015 at 10:05
To: SAP SAP <marc.chevr...@sap.com<mailto:marc.chevr...@sap.com>>
Cc: "cmake@cmake.org<mailto:cmake@cmake.org>" 
<cmake@cmake.org<mailto:cmake@cmake.org>>
Subject: Re: [CMake] ExternalProject_Add and inheritance


Hello Marc,

thank you very much for your answer!

I am not sure to understand how to overcome my problem with these variables.
I can explain my problem further.

I have a toy example of the problem which contains:
- a call to ExternalProject_Add to install boost and yaml-ccp (the latter 
depends on the former)
- a main function which loads a file with yaml-cpp (just one line of code)

Everything compiles with GCC 5 and I obtain an executable file (called 
gcc_example).
However, when I run this executable file, I get the following error message :

./gcc_example: relocation error: ./gcc_example: symbol 
_ZTVNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE, version 
GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

And I can overcome this problem by setting LD_LIBRARY_PATH to the right value:

LD_LIBRARY_PATH=/home/libraries/gcc/5.2.0/lib64/ ./gcc_example

The origin of the problem is that the definition of strings is different since 
GCC 5.
Unfortunately, the default behavior is to call the C++ standard library of my 
Ubuntu system, and the version of this library is older than the version of GCC 
5.

I can check it with 'ldd ./gcc_example':

linux-vdso.so.1 =>  (0x7ffd02ef7000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 
(0x003a7140)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x003d03a0)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x003a7100)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x003d02e0)
/lib64/ld-linux-x86-64.so.2 (0x003d02a0)

But I don't understand why I have still this problem since I put these lines in 
my CMakeLists file (of course the right value of GCC_ROOT is passed to the 
cmake command at configuration step):

link_directories(${GCC_ROOT}/lib64)
target_link_libraries(gcc_example ${GCC_ROOT}/lib64/libstdc++.so)

I can provide my simple toy example if it helps to understand.
You just need to compile it with GCC 5 to see the problem (with older versions 
of GCC, everything works fine because strings are defined in the "classical" 
way).


Best,


Cédric






De: "Marc CHEVRIER" <marc.chevr...@sap.com<mailto:marc.chevr...@sap.com>>
À: "Cedric Doucet" <cedric.dou...@inria.fr<mailto:cedric.dou...@inria.fr>>, 
cmake@cmake.org<mailto:cmake@cmake.org>
Envoyé: Vendredi 11 Décembre 2015 08:44:38
Objet: Re: [CMake] ExternalProject_Add and inheritance

With CMake, you can control compilation and link flags with the following 
environment variables:

  *   CC: specify C compiler
  *   CFLAGS: C compiler flags
  *   CXX: specify C++ compiler
  *   CXXFLAGS: C++ compiler flags
  *   LDFLAGS: linker flags

And to finish you can overload make command for generation using CMAKE_COMMAND 
option of ExternalProject_Add:
CMAKE_CMMAND “${CMAKE_COMMAND}” -E env CXX=${CMAKE_CXX_COMPILER} LDFLAGS=“…” 
“${CMAKE_COMMAND}”




From: CMake <cmake-boun...@cmake.org<mailto:cmake-boun...@cmake.org>> on behalf 
of Cedric Doucet <cedric.dou...@inria.fr<mailto:cedric.dou...@inria.fr>>
Date: Thursday 10 December 2015 at 18:21
To: "cmake@cmake.org<mailto:cmake@cmake.org>" 
<cmake@cmake.org<mailto:cmake@cmake.org>>
Subject: [CMake] ExternalProject_Add and inheritance


Hello,

I use the ExternalProject_Add command to manage third-party libraries.
In the same time, I need to overcome some compatibility problems between GCC 4 
and GCC 5 (strings are not defined in the same way in the STL).
The solution I use is the one given here:
http://stackoverflow.com/questions/33500337/how-to-handle-dual-abi-in-gcc-5
It allows me to force to use the libstdc++.so given by the GCC repository given 
to the cmake command.

The problem is that trick does not work with the ExternalProject_Add command 
because configuration steps of third-party libraries are autonomous.
Do you know how to solve the problem?

For example, if I use the ExternalProject_Add comman

Re: [CMake] ExternalProject_Add and inheritance

2015-12-11 Thread Cedric Doucet
Hello Marc, 

thank you very much for your answer! 

I am not sure to understand how to overcome my problem with these variables. 
I can explain my problem further. 

I have a toy example of the problem which contains: 
- a call to ExternalProject_Add to install boost and yaml-ccp (the latter 
depends on the former) 
- a main function which loads a file with yaml-cpp (just one line of code) 

Everything compiles with GCC 5 and I obtain an executable file (called 
gcc_example). 
However, when I run this executable file, I get the following error message : 

./gcc_example: relocation error: ./gcc_example: symbol 
_ZTVNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE, version 
GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference 

And I can overcome this problem by setting LD_LIBRARY_PATH to the right value: 

LD_LIBRARY_PATH=/home/libraries/gcc/5.2.0/lib64/ ./gcc_example 

The origin of the problem is that the definition of strings is different since 
GCC 5. 
Unfortunately, the default behavior is to call the C++ standard library of my 
Ubuntu system, and the version of this library is older than the version of GCC 
5. 

I can check it with 'ldd ./gcc_example': 

linux-vdso.so.1 => (0x7ffd02ef7000) 
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x003a7140) 
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x003d03a0) 
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x003a7100) 
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x003d02e0) 
/lib64/ld-linux-x86-64.so.2 (0x003d02a0) 

But I don't understand why I have still this problem since I put these lines in 
my CMakeLists file (of course the right value of GCC_ROOT is passed to the 
cmake command at configuration step): 

link_directories(${GCC_ROOT}/lib64) 
target_link_libraries(gcc_example ${GCC_ROOT}/lib64/libstdc++.so) 

I can provide my simple toy example if it helps to understand. 
You just need to compile it with GCC 5 to see the problem (with older versions 
of GCC, everything works fine because strings are defined in the "classical" 
way). 

Best, 

Cédric 

- Mail original -

> De: "Marc CHEVRIER" <marc.chevr...@sap.com>
> À: "Cedric Doucet" <cedric.dou...@inria.fr>, cmake@cmake.org
> Envoyé: Vendredi 11 Décembre 2015 08:44:38
> Objet: Re: [CMake] ExternalProject_Add and inheritance

> With CMake, you can control compilation and link flags with the following
> environment variables:

> * CC: specify C compiler
> * CFLAGS: C compiler flags
> * CXX: specify C++ compiler
> * CXXFLAGS: C++ compiler flags
> * LDFLAGS: linker flags

> And to finish you can overload make command for generation using
> CMAKE_COMMAND option of ExternalProject_Add:
> CMAKE_CMMAND “${CMAKE_COMMAND}” -E env CXX=${CMAKE_CXX_COMPILER} LDFLAGS=“…”
> “${CMAKE_COMMAND}”

> From: CMake < cmake-boun...@cmake.org > on behalf of Cedric Doucet <
> cedric.dou...@inria.fr >
> Date: Thursday 10 December 2015 at 18:21
> To: " cmake@cmake.org " < cmake@cmake.org >
> Subject: [CMake] ExternalProject_Add and inheritance

> Hello,

> I use the ExternalProject_Add command to manage third-party libraries.
> In the same time, I need to overcome some compatibility problems between GCC
> 4 and GCC 5 (strings are not defined in the same way in the STL).
> The solution I use is the one given here:
> http://stackoverflow.com/questions/33500337/how-to-handle-dual-abi-in-gcc-5
> It allows me to force to use the libstdc++.so given by the GCC repository
> given to the cmake command.

> The problem is that trick does not work with the ExternalProject_Add command
> because configuration steps of third-party libraries are autonomous.
> Do you know how to solve the problem?

> For example, if I use the ExternalProject_Add command to manage a
> third-library whose configuration also depends on a cmake script, how could
> I tell this script to use the compilers and the libstdc++.so I provided to
> my own cmake script?

> Best,

> Cédric
-- 

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] ExternalProject_Add and inheritance

2015-12-10 Thread CHEVRIER, Marc
With CMake, you can control compilation and link flags with the following 
environment variables:

  *   CC: specify C compiler
  *   CFLAGS: C compiler flags
  *   CXX: specify C++ compiler
  *   CXXFLAGS: C++ compiler flags
  *   LDFLAGS: linker flags

And to finish you can overload make command for generation using CMAKE_COMMAND 
option of ExternalProject_Add:
CMAKE_CMMAND “${CMAKE_COMMAND}” -E env CXX=${CMAKE_CXX_COMPILER} LDFLAGS=“…” 
“${CMAKE_COMMAND}”



From: CMake > on behalf 
of Cedric Doucet >
Date: Thursday 10 December 2015 at 18:21
To: "cmake@cmake.org" 
>
Subject: [CMake] ExternalProject_Add and inheritance


Hello,

I use the ExternalProject_Add command to manage third-party libraries.
In the same time, I need to overcome some compatibility problems between GCC 4 
and GCC 5 (strings are not defined in the same way in the STL).
The solution I use is the one given here:
http://stackoverflow.com/questions/33500337/how-to-handle-dual-abi-in-gcc-5
It allows me to force to use the libstdc++.so given by the GCC repository given 
to the cmake command.

The problem is that trick does not work with the ExternalProject_Add command 
because configuration steps of third-party libraries are autonomous.
Do you know how to solve the problem?

For example, if I use the ExternalProject_Add command to manage a third-library 
whose configuration also depends on a cmake script, how could I tell this 
script to use the compilers and the libstdc++.so I provided to my own cmake 
script?

Best,

Cédric
-- 

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] ExternalProject_Add and proxy

2015-10-22 Thread D. Barbier
On 2015-10-21 18:07 GMT+02:00 Cedric Doucet wrote:
> Hello Denis!
>
> Thank you for your answer.
> Actually, there is no login and no password.
> It's an academic proxy.
> So the initial syntax of http_proxy should to be correct.

Hello,

CMake uses libcurl, so check your proxy settings with curl instead of wget.
As libcurl does not use any config file, pass -q flag, this should be
quite similar to libcurl and thus CMake.
For instance, if

  curl -q -I https://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz

works, CMake should work too.

Denis
-- 

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] ExternalProject_Add and proxy

2015-10-21 Thread Cedric Doucet



Hello Denis!

Thank you for your answer.
Actually, there is no login and no password.
It's an academic proxy.
So the initial syntax of http_proxy should to be correct.

Cédric

- Mail original -
> De: "D. Barbier" <bou...@gmail.com>
> À: "Cedric Doucet" <cedric.dou...@inria.fr>
> Cc: cmake@cmake.org
> Envoyé: Mercredi 21 Octobre 2015 17:35:47
> Objet: Re: [CMake] ExternalProject_Add and proxy
> 
> On 2015-10-21 14:58 GMT+02:00 Cedric Doucet wrote:
> >
> > Hello,
> >
> > I try to download a library with ExternalProject_Add.
> > The URL is correct and the CMake script works well, except when there is a
> > proxy to define.
> >
> > The URL is : http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz
> >
> > After having set
> >
> > http_proxy=http://proxy.name.fr:1234
> > https_proxy=https://proxy.name.fr:1234
> >
> > I can download the archive with: wget
> > http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz
> 
> Hello,
> 
> Since you do not provide login/password to your proxy, it is stored
> elsewhere, either in ~/.netrc or ~/.wgetrc.
> Delete these files and you will encounter the same problem.
> 
> > But when I type 'make' to use the ExternalProject_Add command, I get (after
> > some minutes):
> > ===
> > [ 44%] Performing download step (download, verify and extract) for 'eigen'
> > -- downloading...
> >  src='http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz'
> >
> > dst='/home/cdoucet/Documents/soutien/matherials/simol/build/third-party/eigen/download/3.2.4.tar.gz'
> >  timeout='none'
> > CMake Error at stamp/download-eigen.cmake:19 (message):
> >   error: downloading 'http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz'
> >   failed
> [...]
> 
> Try with
>   http_proxy=http://your_login:your_passw...@proxy.name.fr:1234
> 
> Denis
> 
-- 

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] ExternalProject_Add and proxy

2015-10-21 Thread D. Barbier
On 2015-10-21 14:58 GMT+02:00 Cedric Doucet wrote:
>
> Hello,
>
> I try to download a library with ExternalProject_Add.
> The URL is correct and the CMake script works well, except when there is a
> proxy to define.
>
> The URL is : http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz
>
> After having set
>
> http_proxy=http://proxy.name.fr:1234
> https_proxy=https://proxy.name.fr:1234
>
> I can download the archive with: wget
> http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz

Hello,

Since you do not provide login/password to your proxy, it is stored
elsewhere, either in ~/.netrc or ~/.wgetrc.
Delete these files and you will encounter the same problem.

> But when I type 'make' to use the ExternalProject_Add command, I get (after
> some minutes):
> ===
> [ 44%] Performing download step (download, verify and extract) for 'eigen'
> -- downloading...
>  src='http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz'
>
> dst='/home/cdoucet/Documents/soutien/matherials/simol/build/third-party/eigen/download/3.2.4.tar.gz'
>  timeout='none'
> CMake Error at stamp/download-eigen.cmake:19 (message):
>   error: downloading 'http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz'
>   failed
[...]

Try with
  http_proxy=http://your_login:your_passw...@proxy.name.fr:1234

Denis
-- 

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] ExternalProject_Add // git shallow clone

2015-05-05 Thread David Cole via CMake
It's possible to do anything you want if you provide your own custom 
DOWNLOAD_COMMAND.

I'm not aware of any depth options exposed via ExternalProject_Add, though.


HTH,
David C.


 On May 5, 2015, at 5:19 AM, Sergei Nikulov sergey.niku...@gmail.com wrote:
 
 Hello All,
 
 Is it possible to provide git depth option for ExternalProject_Add command?
 I see no such option for GIT_... parameters in documentation.
 
 
 Thank you.
 
 
 -- 
 Best Regards,
 Sergei Nikulov
 -- 
 
 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
-- 

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] ExternalProject_Add // git shallow clone

2015-05-05 Thread David Cole via CMake
It's possible to do anything you want if you provide your own custom 
DOWNLOAD_COMMAND.

I'm not aware of any depth options exposed via ExternalProject_Add, though.


HTH,
David


 On May 5, 2015, at 5:19 AM, Sergei Nikulov sergey.niku...@gmail.com wrote:
 
 Hello All,
 
 Is it possible to provide git depth option for ExternalProject_Add command?
 I see no such option for GIT_... parameters in documentation.
 
 
 Thank you.
 
 
 -- 
 Best Regards,
 Sergei Nikulov
 -- 
 
 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
-- 

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] ExternalProject_Add // git shallow clone

2015-05-05 Thread David Cole via CMake
Of course. It would be useful. Perhaps you could propose a patch to add it?


On Tuesday, May 5, 2015, Sergei Nikulov sergey.niku...@gmail.com wrote:

 Hello David,

 Thank you for answer.

 It could be useful feature for ExternalProject.cmake
 What do your think?


 2015-05-05 16:13 GMT+03:00 David Cole dlrd...@aol.com
 javascript:_e(%7B%7D,'cvml','dlrd...@aol.com');:

 It's possible to do anything you want if you provide your own custom
 DOWNLOAD_COMMAND.

 I'm not aware of any depth options exposed via ExternalProject_Add,
 though.


 HTH,
 David C.


  On May 5, 2015, at 5:19 AM, Sergei Nikulov sergey.niku...@gmail.com
 javascript:_e(%7B%7D,'cvml','sergey.niku...@gmail.com'); wrote:
 
  Hello All,
 
  Is it possible to provide git depth option for ExternalProject_Add
 command?
  I see no such option for GIT_... parameters in documentation.
 
 
  Thank you.
 
 
  --
  Best Regards,
  Sergei Nikulov
  --
 
  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




 --
 Best Regards,
 Sergei Nikulov

-- 

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] ExternalProject_Add // git shallow clone

2015-05-05 Thread Sergei Nikulov
Hello David,

Thank you for answer.

It could be useful feature for ExternalProject.cmake
What do your think?


2015-05-05 16:13 GMT+03:00 David Cole dlrd...@aol.com:

 It's possible to do anything you want if you provide your own custom
 DOWNLOAD_COMMAND.

 I'm not aware of any depth options exposed via ExternalProject_Add, though.


 HTH,
 David C.


  On May 5, 2015, at 5:19 AM, Sergei Nikulov sergey.niku...@gmail.com
 wrote:
 
  Hello All,
 
  Is it possible to provide git depth option for ExternalProject_Add
 command?
  I see no such option for GIT_... parameters in documentation.
 
 
  Thank you.
 
 
  --
  Best Regards,
  Sergei Nikulov
  --
 
  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




-- 
Best Regards,
Sergei Nikulov
-- 

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] ExternalProject_Add not re-building when source changes

2015-04-24 Thread Andrey Pokrovskiy
I don't like my current solution for such problem, but it works for me
well. Note file(GLOB_RECURSE ... and custom copy step in the end.
Also you can try to google cmake super build which probably will
provide you more ideas.

include(ExternalProject)

set(WEBSOCKETS_PATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/patch)
set(WEBSOCKETS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libwebsockets-1.4)
set(WEBSOCKETS_BUILD_SOURCE_DIR
${CMAKE_CURRENT_BINARY_DIR}/libwebsockets-1.4.source)
set(WEBSOCKETS_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/libwebsockets-1.4.build)
set(WEBSOCKETS_INSTALL_PREFIX
${CMAKE_CURRENT_BINARY_DIR}/libwebsockets-1.4.install)

ExternalProject_Add(websockets_ep
EXCLUDE_FROM_ALL 1
SOURCE_DIR ${WEBSOCKETS_BUILD_SOURCE_DIR}
BINARY_DIR ${WEBSOCKETS_BUILD_DIR}
DOWNLOAD_COMMAND 
PATCH_COMMAND find ${WEBSOCKETS_PATCH_DIR} -name *.patch -exec
patch -d ${WEBSOCKETS_BUILD_SOURCE_DIR} -p1 -i {} $SEMICOLON
INSTALL_DIR ${WEBSOCKETS_INSTALL_PREFIX}
CMAKE_ARGS
-DCMAKE_TOOLCHAIN_FILE:string=${CMAKE_TOOLCHAIN_FILE}
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:string=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX:string=INSTALL_DIR
-DCMAKE_PREFIX_PATH:string=${CMAKE_PREFIX_PATH})

file(GLOB_RECURSE WEBSOCKETS_SOURCES RELATIVE
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
ExternalProject_Add_Step(websockets_ep copy
COMMAND ${CMAKE_COMMAND} -E copy_directory
${WEBSOCKETS_SOURCE_DIR} ${WEBSOCKETS_BUILD_SOURCE_DIR}
DEPENDS ${WEBSOCKETS_SOURCES}
DEPENDEES download
DEPENDERS patch)

add_library(websockets INTERFACE)
target_include_directories(websockets INTERFACE
${WEBSOCKETS_INSTALL_PREFIX}/include)
target_link_libraries(websockets INTERFACE
${WEBSOCKETS_INSTALL_PREFIX}/lib/libwebsockets.a)
add_dependencies(websockets websockets_ep)

On Thu, Apr 23, 2015 at 4:54 PM, Rob McDonald rob.a.mcdon...@gmail.com wrote:
 I've used ExternalProject_Add to trick CMake into supporting two
 compilers to build my project.

 Part of my project needs OpenMP, but other parts do not.  So, on
 MacOS, I would prefer to build most of the project with CLang, but the
 OpenMP requiring part with gcc.

 I have CMake set up to detect whether the compiler supports OpenMP.
 If it does not, it checks for a user-supplied alternate compiler.

 If the user has supplied an alternate compiler, CMake treats the
 current directory as an ExternalProject , but passes the alternate
 OpenMP capable compiler.

 In general, this works well.  However, this arrangement does not
 notice when the source files have changed and cause the External
 Project to rebuild.

 I'm using ExternalProject_ForceBuild to try to make the EP build every
 time -- that works, but once inside the EP, make doesn't recognize
 that the source files have been updated.

 The meat of the situation is something like this

 ExternalProject_Add( MYPROJECT
 URL ${CMAKE_CURRENT_SOURCE_DIR}
 CMAKE_ARGS -DCMAKE_C_COMPILER=${C_ALTERNATE_COMPILER}
 -DCMAKE_CXX_COMPILER=${CXX_ALTERNATE_COMPILER}
 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
 -DEP_BUILD=TRUE
 INSTALL_COMMAND 
 )
 EP_ForceBuild( MYPROJECT )

 I use the -DEP_BUILD=TRUE as an extra safety to prevent infinite
 recursion -- if the user supplied a non OpenMP capable compiler as the
 ALTERNATE_COMPILER.

 So, I think the problem is with my use of 'URL
 ${CMAKE_CURRENT_SOURCE_DIR}'.  Is there a better way to achieve the
 same thing?

 Thanks in advance,

 Rob
 --

 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
-- 

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] ExternalProject_Add contributing to top-level Package

2015-04-05 Thread Rob McDonald
Ok, I think I've answered my own question...

I added the following after the ExternalProject_Add command...

ExternalProject_Get_Property( ALTBUILD BINARY_DIR )
INSTALL( PROGRAMS ${BINARY_DIR}/myprogram DESTINATION . )

Rob


On Sat, Apr 4, 2015 at 12:57 PM, Rob McDonald rob.a.mcdon...@gmail.com wrote:
 All,

 I have a project that is typically compiled with CLang/LLVM.  However,
 I'm now adding a component that is preferentially built with OpenMP.
 CLang doesn't support OpenMP, so I'd like to build that component with
 GCC while still building everything else with CLang.

 So far, I'm approaching the problem as shown in the below
 CMakeLists.txt.  The program understands -DUSE_OPENMP, so if OpenMP
 isn't found, it will build a uni-processor version.  The user can
 optionally pass -DC_OMP_COMPILER and -DCXX_OMP_COMPILER when CMake is
 run.  Those will specify alternate OpenMP capable compilers.  The
 EP_BUILD variable prevents infinite recursion.

 So, in the case where the primary compiler does not support OpenMP,
 and the user specifies an alternate compiler, this will use
 ExternalProject_Add to establish a new build environment with the
 alternate compiler, and build that.  So far, so good.

 The problem I have is that I would like the executable built by
 ExternalProject to be added to the top-level project's package.  So,
 instead of the recursion protected INSTALL at the bottom, I want a
 roughly equivalent INSTALL command that specifically works in the
 ExternalProject case.

 Best,

 Rob

 #
 FIND_PACKAGE( OpenMP )

 if(OPENMP_FOUND)
   set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} -DUSE_OPENMP)
   set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -DUSE_OPENMP)
   set(BUILD_IT true)
 else()

 if( CXX_OMP_COMPILER AND NOT EP_BUILD )

   INCLUDE( ExternalProject )

   set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake 
 ${CMAKE_MODULE_PATH})
   INCLUDE( ExternalProject_ForceBuild )

   ExternalProject_Add( ALTBUILD
 URL ${CMAKE_CURRENT_SOURCE_DIR}
 CMAKE_ARGS -DCMAKE_C_COMPILER=${C_OMP_COMPILER}
 -DCMAKE_CXX_COMPILER=${CXX_OMP_COMPILER}
 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
 -DEP_BUILD=TRUE
 INSTALL_COMMAND 
 )
 EP_ForceBuild( ALTBUILD )

   else()
 set(BUILD_IT true)
   endif()
 endif()

 if(BUILD_IT)

   ADD_EXECUTABLE( myprogram
   main.cpp
   )

   TARGET_LINK_LIBRARIES( myprogram
   )

   if ( NOT EP_BUILD )
 INSTALL( TARGETS myprogram RUNTIME DESTINATION . )
   endif()

 endif()
-- 

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] ExternalProject_Add, static library, Ninja generator

2015-04-02 Thread Nils Gladitz

On 04/02/2015 07:15 AM, Charles Nicholson wrote:


I'm assuming that I'm not correctly expressing the dependencies. Would
anyone mind taking a quick look? I'd really appreciate it!


Try adding the following to your ExternalProject_Add call:
  BUILD_BYPRODUCTS ${HIDAPI_ROOT}/bin/lib/libhidapi.a

This is required so that the ninja generator knows which target produces 
the named output.


Nils

--

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] ExternalProject_Add, static library, Ninja generator

2015-04-02 Thread Nils Gladitz

On 04/02/2015 04:05 PM, Charles Nicholson wrote:

Thanks for the quick response, Nils, that fixed it!

I'm curious, though, why wasn't simply marking my lib as depending on
the externalproject_add target enough? I like using the byproducts line
since it's more exact and descriptive, but shouldn't it work without that?


The target dependency takes care of order which is enough for the other 
generators.


Ninja in particular needs to account for the library file that you 
depend on in the beginning.


Without marking it a byproduct ninja does not know that it is a file 
that will be created later on by one of your targets and assumes it missing.


Nils
--

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] ExternalProject_Add, static library, Ninja generator

2015-04-02 Thread Charles Nicholson
I see now; thank you for the explanation.

Best,
Charles

On Thu, Apr 2, 2015, 7:17 AM Nils Gladitz nilsglad...@gmail.com wrote:

 On 04/02/2015 04:05 PM, Charles Nicholson wrote:
  Thanks for the quick response, Nils, that fixed it!
 
  I'm curious, though, why wasn't simply marking my lib as depending on
  the externalproject_add target enough? I like using the byproducts line
  since it's more exact and descriptive, but shouldn't it work without
 that?

 The target dependency takes care of order which is enough for the other
 generators.

 Ninja in particular needs to account for the library file that you
 depend on in the beginning.

 Without marking it a byproduct ninja does not know that it is a file
 that will be created later on by one of your targets and assumes it
 missing.

 Nils

-- 

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] ExternalProject_Add, static library, Ninja generator

2015-04-02 Thread Charles Nicholson
Thanks for the quick response, Nils, that fixed it!

I'm curious, though, why wasn't simply marking my lib as depending on the
externalproject_add target enough? I like using the byproducts line since
it's more exact and descriptive, but shouldn't it work without that?

Thanks again,
Charles

On Wed, Apr 1, 2015 at 11:42 PM, Nils Gladitz nilsglad...@gmail.com wrote:

 On 04/02/2015 07:15 AM, Charles Nicholson wrote:

  I'm assuming that I'm not correctly expressing the dependencies. Would
 anyone mind taking a quick look? I'd really appreciate it!


 Try adding the following to your ExternalProject_Add call:
   BUILD_BYPRODUCTS ${HIDAPI_ROOT}/bin/lib/libhidapi.a

 This is required so that the ninja generator knows which target produces
 the named output.

 Nils


-- 

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] ExternalProject_Add: directing cmake to a different path-to-source

2015-02-07 Thread Miklos Espak
Specify a patch command that creates a toplevel cmake list with one
'add_subdirectory(A)'  line.

On Sun, 8 Feb 2015 4:14 am Neil Carlson neil.n.carl...@gmail.com wrote:

 I'm trying to get ExternalProject_Add to build a TPL that doesn't have a
 CMakeLists.txt file in the top-level directory.  The TPL untars as
 foo/{A,B} where A and B each contain a CMakeLists.txt file and are
 independent of each other.  I only want to build A and would like to have
 cmake run with foo/A as the path-to-source.  Unfortunately I can't seem
 to manage it. The tar file is unpacked with ${SOURCE_DIR} as its root, and
 that same directory is used as the path-to-source for the cmake command
 -- I want ${SOURCE_DIR}/A.  Any suggestions on how to make ExternalProject
 do what I want?  Clearly I can just repackage the tar file, but I'd rather
 use the pristine tar file if I can.

 Thanks
 --

 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
-- 

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] ExternalProject_add and add_subdirectory in one step

2015-02-06 Thread Petr Kmoch
Hi Franz.

The canonical approach to ExternalProject is to use a superbuild setup.
Design your top-level CMakeList so that it *only* contains
ExternalProject_add() calls, treating your original project as just
another external project. Build the superbuild once, getting all the
dependencies downloaded, built, installed etc. as necessary. Then, switch
to working with only your original project subcomponent of the superbuild.

Petr

On Thu, Feb 5, 2015 at 5:32 PM, Franz Engel franz.en...@apworks.de wrote:

  Hi,



 I try to clone an repository from my bare-repository and to build my
 project tree. Therefore I use the following commands:



 ExternalProject_Add ( demoA

PREFIX ${MAIN_PATH}/demoA

GIT_REPOSITORY ${REPOSITORY_PATH}/demoA

GIT_TAG origin/master

UPDATE_COMMAND 

INSTALL_COMMAND  )



 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../demoA/src/DemoA
 ${CMAKE_CURRENT_SOURCE_DIR}/demoA)



 Know I have the following problem. I load the Cmake-file with QtCreator.
 If I run CMake I get the error message “does not contain a CMakeLists.txt
 file”. That message is clear for me, because the repository only get loaded
 when I compile the code. The question is, if it is possible to clone the
 repo in the step of CMake. Does somebody has an idea? Or is there another
 method to build the project tree?



 Br,

 Franz

 --


 Franz Engel

 AIRBUS APWORKS GmbH
 81663 Munich - Germany
 T: +49 (0) 89 607 29103
 M: +49 (0) 170 44 59 006
 franz.en...@apworks.de

 AIRBUS APWORKS GmbH
 Registered Office: Ottobrunn
 District Court of Munich: HRB 141734
 Managing Director: Joachim Zettler
 Internet: www.apworks.de

 --



 --

 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

-- 

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] ExternalProject_Add with custom build/make command for Boost

2014-09-25 Thread David Cole via CMake
INSTALL_COMMAND 

should work. (Assuming you're doing ./b2 install as the BUILD_COMMAND...?)

Check out how the open chemistry project builds boost as an
ExternalProject as a reference point:
https://github.com/OpenChemistry/openchemistry/blob/master/cmake/External_boost.cmake


HTH,
David C.


On Thu, Sep 25, 2014 at 5:40 PM, Nicholas Yue yue.nicho...@gmail.com wrote:
 Hi,

   I am trying to build Boost (1.47.0) using CMake's ExternalProject_Add()

   I got it to build and install via it's bjam ./b2 install

   However, there is an implicit make install generated by CMake which will
 fail because there is no Makefile so to speak with an install target.

   ExternalProject_Add() has many configuration parameter and I am wondering
 if there is one which I can use to tell it not to attempt to make install

 Cheers
 --
 Nicholas Yue
 Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5
 Custom Dev - C++ porting, OSX, Linux, Windows
 http://au.linkedin.com/in/nicholasyue
 https://vimeo.com/channels/naiadtools

 --

 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
-- 

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] ExternalProject_Add dependency graph (dot/graphviz?) ?

2014-09-23 Thread Micha Hergarden
On 09/22/2014 04:59 PM, Nicholas Yue wrote:
 Hi,

 CMake has graphviz output capability for dependency within a project.

 Is there a way to graph dependency at the ExternalProject_Add()
 level ?

 Cheers

Hello Nicholas,

Can you clarify your question a bit more? Do you mean 'show me the
external projects a target in my project depends on' or do you mean
'show me the dependencies the external project depens on', or something
different altogether?

With kind regards,
Micha Hergarden



signature.asc
Description: OpenPGP digital signature
-- 

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] ExternalProject_Add dependency graph (dot/graphviz?) ?

2014-09-23 Thread Nicholas Yue
Hi Micha,

  My interest is in show me the dependencies the external project depends
on

  I am considering migrating an in-house build system to build opensource
projects to using CMake.
  As there are many external packages and versions (close to 100), I'd like
to be able to visualize their dependency.
  Once the new system based on CMake is working, I need to build them for
different target OS to assist in migration from current OS to future OS
version.

  e.g.

ExternalProject_Add ( python264_static

  )

ExternalProject_Add ( python264
  DEPENDS
  python264_static

  )

ExternalProject_Add ( boost_1_47_0
  DEPENDS
  python264

  )

ExternalProject_Add ( alembic_1_5_5
  DEPENDS
  python264 boost_1_47_0

  )

Cheers


On 23 September 2014 11:58, Micha Hergarden micha.hergar...@gmail.com
wrote:

 On 09/22/2014 04:59 PM, Nicholas Yue wrote:
  Hi,
 
  CMake has graphviz output capability for dependency within a project.
 
  Is there a way to graph dependency at the ExternalProject_Add()
  level ?
 
  Cheers
 
 Hello Nicholas,

 Can you clarify your question a bit more? Do you mean 'show me the
 external projects a target in my project depends on' or do you mean
 'show me the dependencies the external project depens on', or something
 different altogether?

 With kind regards,
 Micha Hergarden




-- 
Nicholas Yue
Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5
Custom Dev - C++ porting, OSX, Linux, Windows
http://au.linkedin.com/in/nicholasyue
https://vimeo.com/channels/naiadtools
-- 

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] ExternalProject_Add always try to connect to SVN server

2014-09-15 Thread David Cole via CMake
If you are using SVN_REVISION with a specific revision number like 
that, you can do:


   UPDATE_COMMAND 

because there is never any need to update after the initial checkout at 
that revision.


If you then later change to another revision, the parameters to the svn 
checkout (dowload) step change when you change the revision number, 
and it should do another checkout on a subsequent build after that.



HTH,
David C.

--

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] ExternalProject_Add show sources in Visual Studio

2014-03-20 Thread NoRulez
Ok, thank you very much.

I will try your examples.

Best Regards

 Am 19.03.2014 um 15:40 schrieb David Cole dlrd...@aol.com:
 
 That's one workaround. Two more come to mind:
 
 (1) Another would be to force the configure/build steps of an external 
 project to run *always* rather than when the stamp file indicates they are 
 out of date. You could take a look at the open chemistry super build to see 
 an example.
 
 Specifically, check out the code here:
 

 https://github.com/OpenChemistry/openchemistry/blob/master/CMakeLists.txt#L32
 
 And here:
 

 https://github.com/OpenChemistry/openchemistry/blob/master/cmake/External_avogadrolibs.cmake#L20
 
 Then, when forced, a build of the outer project will always trigger the build 
 of the external project and make sure it's up to date with respect to its own 
 source tree.
 
 But, if you have a lot of these, it just slows your build down in the normal 
 case of not changing anything in the external projects. So use it sparingly, 
 not globally.
 
 (2) One more workaround worth mentioning: the manual one. ExternalProject_Add 
 will generate VS projects for the sub-projects if they are CMake-based and 
 your containing project is using a VS generator, and then open the generated 
 sub-projects directly to see the normal view of things. Make mods in there, 
 and build/install in there, then go back to your containing project, and it's 
 already up to date.
 
 To each his own... Good luck.
 
 
 HTH,
 David C.
 
 
 
 -Original Message-
 From: NoRulez noru...@me.com
 To: David Cole dlrd...@aol.com
 Cc: cmake cmake@cmake.org
 Sent: Wed, Mar 19, 2014 9:48 am
 Subject: Re: [CMake] ExternalProject_Add show sources in Visual Studio
 
 
 Ok, so the only workaround to archive this is to use file(GLOB_RECURS...)
 and rebuild the changed external project. Right?
 
 Best Regards
 
 Am 19.03.2014 um 12:44 schrieb David Cole dlrd...@aol.com:
 
 Well, that sounds like the perfect way to use ExternalProject.
 
 But why do you want to show the sources in Visual Studio? Just for
 ease of
 looking at them?
 
 As I said in my earlier reply... even if we showed the sources,
 editing them
 would not trigger a rebuild of the external project. The dependencies are
 tracked via custom commands and stamp files that indicate last successful run
 time of those custom commands. They are not tracked by Visual Studio on a
 per-source-file/per-obj-file basis as they are in a normal VS project.
 
 The main goal of ExternalProject is to provide an easy-to-use way of
 *building*, *installing* and depending on an external project... It is most
 definitely NOT to provide an easy way to do active development on a project.
 
 If you need to see the sources for something that you're building
 within
 Visual Studio, then to me, that's a big red flag that it should not be an
 external project.
 
 
 HTH,
 David C.
 
 
-- 

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add show sources in Visual Studio

2014-03-19 Thread NoRulez
Because the external projects depends on different library versions than the 
SuperProject. Maybe I misconfigured something, but i don't know an 
alternative.

E.g.: super project (AA) builds with version 9 of library X.

The external project B requires version 5 of library X and had some source 
files.

The external project C requires version 3 of library X and had some different 
sources.

The external projects are only shared libraries (which are also standalone 
projects with there own source tree) which are then used by the super project.

If I understand it correctly then ExternalProject_Add should be the solution 
for this, right?

Best Regards

 Am 17.03.2014 um 15:24 schrieb David Cole dlrd...@aol.com:
 
 Why do you want to do that?
 
 The ExternalProject will not rebuild correctly when you modify these source 
 files... Unless you are forcing the build step to run every single time.
 
 You are using ExternalProject as if it were NOT external. Why not just use 
 add_subdirectory instead and have an internal project?
 
 
 D
 
-- 

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add show sources in Visual Studio

2014-03-19 Thread David Cole

Well, that sounds like the perfect way to use ExternalProject.

But why do you want to show the sources in Visual Studio? Just for ease 
of looking at them?


As I said in my earlier reply... even if we showed the sources, editing 
them would not trigger a rebuild of the external project. The 
dependencies are tracked via custom commands and stamp files that 
indicate last successful run time of those custom commands. They are 
not tracked by Visual Studio on a per-source-file/per-obj-file basis as 
they are in a normal VS project.


The main goal of ExternalProject is to provide an easy-to-use way of 
*building*, *installing* and depending on an external project... It is 
most definitely NOT to provide an easy way to do active development on 
a project.


If you need to see the sources for something that you're building 
within Visual Studio, then to me, that's a big red flag that it should 
not be an external project.



HTH,
David C.

--

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add show sources in Visual Studio

2014-03-19 Thread NoRulez
Ok, so the only workaround to archive this is to use file(GLOB_RECURS...) 
and rebuild the changed external project. Right?

Best Regards

 Am 19.03.2014 um 12:44 schrieb David Cole dlrd...@aol.com:
 
 Well, that sounds like the perfect way to use ExternalProject.
 
 But why do you want to show the sources in Visual Studio? Just for ease of 
 looking at them?
 
 As I said in my earlier reply... even if we showed the sources, editing them 
 would not trigger a rebuild of the external project. The dependencies are 
 tracked via custom commands and stamp files that indicate last successful run 
 time of those custom commands. They are not tracked by Visual Studio on a 
 per-source-file/per-obj-file basis as they are in a normal VS project.
 
 The main goal of ExternalProject is to provide an easy-to-use way of 
 *building*, *installing* and depending on an external project... It is most 
 definitely NOT to provide an easy way to do active development on a project.
 
 If you need to see the sources for something that you're building within 
 Visual Studio, then to me, that's a big red flag that it should not be an 
 external project.
 
 
 HTH,
 David C.
 
-- 

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add show sources in Visual Studio

2014-03-19 Thread David Cole

That's one workaround. Two more come to mind:

(1) Another would be to force the configure/build steps of an external 
project to run *always* rather than when the stamp file indicates they 
are out of date. You could take a look at the open chemistry super 
build to see an example.


Specifically, check out the code here:


https://github.com/OpenChemistry/openchemistry/blob/master/CMakeLists.txt#L32


And here:


https://github.com/OpenChemistry/openchemistry/blob/master/cmake/External_avogadrolibs.cmake#L20


Then, when forced, a build of the outer project will always trigger the 
build of the external project and make sure it's up to date with 
respect to its own source tree.


But, if you have a lot of these, it just slows your build down in the 
normal case of not changing anything in the external projects. So use 
it sparingly, not globally.


(2) One more workaround worth mentioning: the manual one. 
ExternalProject_Add will generate VS projects for the sub-projects if 
they are CMake-based and your containing project is using a VS 
generator, and then open the generated sub-projects directly to see the 
normal view of things. Make mods in there, and build/install in 
there, then go back to your containing project, and it's already up to 
date.


To each his own... Good luck.


HTH,
David C.



-Original Message-
From: NoRulez noru...@me.com
To: David Cole dlrd...@aol.com
Cc: cmake cmake@cmake.org
Sent: Wed, Mar 19, 2014 9:48 am
Subject: Re: [CMake] ExternalProject_Add show sources in Visual Studio


Ok, so the only workaround to archive this is to use 
file(GLOB_RECURS...)

and rebuild the changed external project. Right?

Best Regards


Am 19.03.2014 um 12:44 schrieb David Cole dlrd...@aol.com:

Well, that sounds like the perfect way to use ExternalProject.

But why do you want to show the sources in Visual Studio? Just for 

ease of
looking at them?


As I said in my earlier reply... even if we showed the sources, 

editing them
would not trigger a rebuild of the external project. The dependencies 
are
tracked via custom commands and stamp files that indicate last 
successful run
time of those custom commands. They are not tracked by Visual Studio on 
a

per-source-file/per-obj-file basis as they are in a normal VS project.


The main goal of ExternalProject is to provide an easy-to-use way of
*building*, *installing* and depending on an external project... It is 
most
definitely NOT to provide an easy way to do active development on a 
project.


If you need to see the sources for something that you're building 

within
Visual Studio, then to me, that's a big red flag that it should not be 
an

external project.



HTH,
David C.



 
--


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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add show sources in Visual Studio

2014-03-17 Thread NoRulez
I've added the source files with file(GLOB_RECURSE... and set source file 
property for each of these files with HEADER_FILE_OLY to TRUE.

It seems to work, but I'm not sure if this is the right way.


 Am 17.03.2014 um 08:49 schrieb NoRulez noru...@me.com:
 
 Hello,
 
 if I add an external project with ExternalProject_Add, is it possible to show 
 the sources of that project in Visual Studio too?
 
 I don't know if this is the reason, but currently the projects type is set to 
 utility.
 
 Best 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://www.cmake.org/mailman/listinfo/cmake
-- 

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add show sources in Visual Studio

2014-03-17 Thread David Cole

Why do you want to do that?

The ExternalProject will not rebuild correctly when you modify these 
source files... Unless you are forcing the build step to run every 
single time.


You are using ExternalProject as if it were NOT external. Why not just 
use add_subdirectory instead and have an internal project?



D

--

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add ALWAYS, VisualStudo

2013-12-03 Thread James Turner

On 1 Dec 2013, at 10:53, James Turner james.tur...@kdab.com wrote:

 I am trying to force the BUILD step of an ExternalProject_Add target to be 
 run - always. I have found several wiki articles, and references in the 
 archives of this list, to setting an ALWAYS option for the stage I want to 
 force to run each time. The problem is I can’t find any documentation on the 
 exact syntax to use - can someone please enlighten me? (This is for a project 
 where the files are on the local disk when the build is run, but may change 
 due to external sync mechanisms - right now the build system never notices 
 this)

Following up on this: I was wrong, the problem is not needing to run the 
‘build’ step always. (I discovered this by adding the steps as Kevin suggested).

Instead, I’ve realised the problem is with the Visual Studio projects (I can 
only test 2010) - using the makefile generator on Linux, everything works as 
expected without any custom ExternalProject_Add_Step.

To make this clearer, here is the current superbuild file:


https://gitorious.org/fg/fgmeta/source/fe39e97c2ed376a081de8251e18bfd876621c617:CMakeLists.txt

(Containing the ExternalProject_Add_Step, but these make no difference)

When building, we have a structure as follows on Windows:

C:\FGFS\fgmeta
\flightgear
\simgear
\fgrun
(these subdirs being Git submodules, the whole of fgmeta being obtained 
via 'git clone —recursive’)

and:

C:\FGFS\metabuild

I run the CMake GUI, passing 'C:\FGFS\fgmeta’ as the source dir, and 
'C:\FGFS\metabuild’ as the binary dir. When using the VS2010 generator, this 
produces something like:


C:\FGFS\metabuild
\FlightGear-Meta.sln
… vcxproj for each ExternaProject_add in the 
superbuild CMakeList.txt …

\fgbuild\FlightGear.sln
\sgbuild\SimGear.sln

On an initial build, all is fine. The issue is that on successive builds, the 
top level -Meta.sln does not seem to descend into ‘fgbuild’, ’sgbuild' dirs at 
all; if I invoke the solutions inside those dirs manually (from the GUI or via 
msbuild.exe) they compile fine, but using msbuild or the GUI on the top-level 
solution simply says ‘nothing to be done’ for those steps.

Am I doing something wrong here that’s confusing the MSVC generator? This seems 
like a completely standard way to use External projects with MSVC, but equally 
I have no problem adjust the structure if it would simplify things. The only 
restriction is I need to keep each sub-project building cleanly outside of the 
superbuild - but I have control over them, including their Cmake files.

Kind regards,
James


--

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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] ExternalProject_Add ALWAYS

2013-12-01 Thread Kevin Funk
Am Sonntag, 1. Dezember 2013, 10:53:08 schrieb James Turner:
 Hi,
 
 I am trying to force the BUILD step of an ExternalProject_Add target to be
 run - always. I have found several wiki articles, and references in the
 archives of this list, to setting an ALWAYS option for the stage I want to
 force to run each time. The problem is I can’t find any documentation on
 the exact syntax to use - can someone please enlighten me? (This is for a
 project where the files are on the local disk when the build is run, but
 may change due to external sync mechanisms - right now the build system
 never notices this)
 
 I’m guessing it must be something like:
 
 ExternalProject_Add(Foo
PREFIX ${CMAKE_BINARY_DIR}
DOWNLOAD_COMMAND # no need to download
BUILD_ALWAYS #  but is this correct?
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/path/to/foo
   …...
 )
 
 Kind regards,
 James Turner

Heya,

Looks like you need to call ExternalProject_Add_Step() to create a custom step 
for this. This function accepts 'ALWAYS'.

Signature:
ExternalProject_Add_Step(name step
 [COMMAND cmd...]
 [COMMENT “text...”]
 [DEPENDEES steps...]
 [DEPENDERS steps...]
 [DEPENDS files...]
 [ALWAYS 1]
 [WORKING_DIRECTORY dir]
)

See section 'Adding Custom Steps' in:
http://www.kitware.com/media/html/BuildingExternalProjectsWithCMake2.8.html

And then just set the 'DEPENDEES' parameter to build, in order to have it run 
during the build phase.

Greets

-- 
Kevin Funk
--

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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] ExternalProject_Add examples

2013-10-28 Thread Yngve Inntjore Levinsen
Den 17. mars 2012 22:03, skrev Bill Lorensen:
 Folks,

 I've recently created a number of super builds using CMake's External
 Project mechanism. Each external project requires some sort of
 download, configuration, build and possibly install. The CMake defines
 needed to correctly access the results of the external project vary
 significantly. The trickiest part is find the proper download,
 configuration and CMake defines.

 For example, for the Point Cloud Library (http://pointclouds.org/) I
 created these external projects:
 VTK - git, cmake, make; VTK_DIR
 FLANN - zip, cmake, make install; FLANN_LIBRARY, FLANN_INCUDE_DIR
 Eigen - .tar.bz2,; EIGEN_INCLUDE_DIR
 Qhull - git, cmake, make;QHULL_LIBRARY,QHULL_INCLUDE_DIR
 Boost - .tar.gz, bootstrap.sh, b2; BOOST_ROOT
 GTest - .zip, cmake, make; GTEST_ROOT,GTEST_INCLUDE_DIR

 Slicer4 has many more.

 Should we start collecting sample ExternalProject_Add files for
 external projects?

 Bill

Hi,

For what it's worth, I would also mention a larger superbuild project at
CERN called LCGsoft:
http://svnweb.cern.ch/world/wsvn/lcgsoft/trunk/lcgcmake/

They built macros on top of ExternalProject_Add, see
cmake/modules/lcgsoft-macros.cmake. Maybe some parts of this design are
interesting to you. I have never used this myself, so I don't know the
details.

Cheers,
Yngve
--

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add examples

2013-10-28 Thread Aaron Nowack
https://github.com/OpenChemistry/openchemistry/tree/master/cmake

David Cole pointed me to the project he is developing. There are a lot of
ExternalProject_Add examples, and good practices for super-build projects
in general. It was/is very helpful for me!


On Mon, Oct 28, 2013 at 2:05 AM, Yngve Inntjore Levinsen 
yngve.levin...@gmail.com wrote:

 Den 17. mars 2012 22:03, skrev Bill Lorensen:
  Folks,
 
  I've recently created a number of super builds using CMake's External
  Project mechanism. Each external project requires some sort of
  download, configuration, build and possibly install. The CMake defines
  needed to correctly access the results of the external project vary
  significantly. The trickiest part is find the proper download,
  configuration and CMake defines.
 
  For example, for the Point Cloud Library (http://pointclouds.org/) I
  created these external projects:
  VTK - git, cmake, make; VTK_DIR
  FLANN - zip, cmake, make install; FLANN_LIBRARY, FLANN_INCUDE_DIR
  Eigen - .tar.bz2,; EIGEN_INCLUDE_DIR
  Qhull - git, cmake, make;QHULL_LIBRARY,QHULL_INCLUDE_DIR
  Boost - .tar.gz, bootstrap.sh, b2; BOOST_ROOT
  GTest - .zip, cmake, make; GTEST_ROOT,GTEST_INCLUDE_DIR
 
  Slicer4 has many more.
 
  Should we start collecting sample ExternalProject_Add files for
  external projects?
 
  Bill

 Hi,

 For what it's worth, I would also mention a larger superbuild project at
 CERN called LCGsoft:
 http://svnweb.cern.ch/world/wsvn/lcgsoft/trunk/lcgcmake/

 They built macros on top of ExternalProject_Add, see
 cmake/modules/lcgsoft-macros.cmake. Maybe some parts of this design are
 interesting to you. I have never used this myself, so I don't know the
 details.

 Cheers,
 Yngve
 --

 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://www.cmake.org/mailman/listinfo/cmake

--

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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] ExternalProject_Add examples

2013-10-27 Thread Witold E Wolski
Dear Kent,

Thank you for pointing me to this project.
I did some searching for an explanation of the superbuild cmake
pattern but didn't find any text resources.

I am wondering if the superbuild pattern can cover the following case:

I.e. given 3 projects A, B and C where B depends on A and C depends on
B ... that means B will not build without A... and C not without B.
Is this covered by the superbuild pattern for C? Or asked differently
how can the superbuild of C control the build of B so that B finds the
product of A?

I guess this is controlled by the order how the external projects are
added. Right? In which file is this done in the NamiceExternalProject?

Furthermore, What happens if B is an Superbuild patter project already?



regards
Witold



On 25 October 2013 17:18, Williams, Norman K
norman-k-willi...@uiowa.edu wrote:
 There is our project here:
 https://github.com/BRAINSia/NAMICExternalProjects

 This is set up using the CMake 'SuperBuild' pattern first used with Slicer.

 It might be more complicated a setup than you have in mind, but it builds
 a large number of interdependent packages.

 It's structured as a two-phase setup:  First, all prerequisite packages
 are built, and then the actual project is built.  As NamicExternalProjects
 is set up as a functioning prototype, the 'top-level' CMake project is
 empty.

 Adding a new external project is a matter of copying
 SuperBuild/External_Template.cmake to
 SuperBuild/External_your_project.cmake and editing it to make it
 specific to that project. This mostly amounts to  setting its
 dependencies, where to download the source from, and which version to
 download.

 --
 Kent Williams norman-k-willi...@uiowa.edu






 On 10/24/13 3:35 AM, Witold E Wolski wewol...@gmail.com wrote:

Would also like to start configuring external dependencies with

ExternalProject_Add

So some examples would be pretty useful to me. So did you ended up
collecting some examples?
Sure, you posted in this links to repositories, but finding the
ExternalProject_Add in these huge projects with hundreds of
CMakeLists.txt is not easy if they are not in the top-level
CMakeLists.txt and they are not there.

My dependencies are

gtest - Cmake
glog - Cmake
tbb - configure make
vigra - Cmkae based
soci - Cmake based
pwiz


regards



On 18 March 2012 00:24, Luigi Calori l.cal...@cineca.it wrote:
 On 17/03/2012 22.11, Marcus D. Hanwell wrote:

 On Sat, Mar 17, 2012 at 5:03 PM, Bill Lorensenbill.loren...@gmail.com
 wrote:

 Folks,

 I've recently created a number of super builds using CMake's External
 Project mechanism. Each external project requires some sort of
 download, configuration, build and possibly install. The CMake defines
 needed to correctly access the results of the external project vary
 significantly. The trickiest part is find the proper download,
 configuration and CMake defines.

 For example, for the Point Cloud Library (http://pointclouds.org/) I
 created these external projects:
 VTK - git, cmake, make; VTK_DIR
 FLANN - zip, cmake, make install; FLANN_LIBRARY, FLANN_INCUDE_DIR
 Eigen - .tar.bz2,; EIGEN_INCLUDE_DIR
 Qhull - git, cmake, make;QHULL_LIBRARY,QHULL_INCLUDE_DIR
 Boost - .tar.gz, bootstrap.sh, b2; BOOST_ROOT
 GTest - .zip, cmake, make; GTEST_ROOT,GTEST_INCLUDE_DIR

 Slicer4 has many more.

 Should we start collecting sample ExternalProject_Add files for
 external projects?

 We have talked about doing this too (I have Eigen, Boost, GTest and
 others for example). The standard CMake based projects hardly seem
 worth it, but it depends on what you want to do with them I suppose.
 For the work we are doing in chemistry we have been working on an
 experimental superbuild that uses a common prefix in the build tree to
 install to, and then all we need pass in is CMAKE_PREFIX_PATH - this
 can make the logic significantly easier for dependent CMake projects
 as it will always search within the prefix first.

 I did something similar, trying to collet all the build of stuff that I
had
 to do in a single place powered by cmake
 Used  CMAKE_PREFIX_PATH and a single source place where all the builds
 download  and expand

 you can have a look at

 https://hpc-forge.cineca.it/svn/CmakeBuilds/lib/

 It's just for my use only, so really dirty and not properly checked, I'
m
 also looking for good starting point for common stuff like Qt, boost and
 others
 (I' tried to collect in the folder  Packages the tricky part of building
 the components,) I' ve tried to define a dependency graph but it' still
 messy

 anyway I would really appreciate a place where to share good recipies
for
 CMake building packeges

 Thanks
   Luigi







 The Qt external project was pretty tricky too, and we are using that
 in several places along with smaller libraries like libxml2.

 Marcus
 --

 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 

Re: [CMake] ExternalProject_Add examples

2013-10-27 Thread Pau Garcia i Quiles
Hello,

ExternalProject_Add(A
...
)

ExternalProject_Add(B
DEPENDS A
...)

ExternalProject_Add(C
DEPENDS B
...
)

CMake will take care of the build order of those projects

Please check winstng for a complex project with a lot of interdependencies.
The documentation for ExternalProject and this article by David Cole also
help a lot:

http://www.kitware.com/media/html/BuildingExternalProjectsWithCMake2.8.html




On Sun, Oct 27, 2013 at 10:31 PM, Witold E Wolski wewol...@gmail.comwrote:

 Dear Kent,

 Thank you for pointing me to this project.
 I did some searching for an explanation of the superbuild cmake
 pattern but didn't find any text resources.

 I am wondering if the superbuild pattern can cover the following case:

 I.e. given 3 projects A, B and C where B depends on A and C depends on
 B ... that means B will not build without A... and C not without B.
 Is this covered by the superbuild pattern for C? Or asked differently
 how can the superbuild of C control the build of B so that B finds the
 product of A?

 I guess this is controlled by the order how the external projects are
 added. Right? In which file is this done in the NamiceExternalProject?

 Furthermore, What happens if B is an Superbuild patter project already?



 regards
 Witold



 On 25 October 2013 17:18, Williams, Norman K
 norman-k-willi...@uiowa.edu wrote:
  There is our project here:
  https://github.com/BRAINSia/NAMICExternalProjects
 
  This is set up using the CMake 'SuperBuild' pattern first used with
 Slicer.
 
  It might be more complicated a setup than you have in mind, but it builds
  a large number of interdependent packages.
 
  It's structured as a two-phase setup:  First, all prerequisite packages
  are built, and then the actual project is built.  As
 NamicExternalProjects
  is set up as a functioning prototype, the 'top-level' CMake project is
  empty.
 
  Adding a new external project is a matter of copying
  SuperBuild/External_Template.cmake to
  SuperBuild/External_your_project.cmake and editing it to make it
  specific to that project. This mostly amounts to  setting its
  dependencies, where to download the source from, and which version to
  download.
 
  --
  Kent Williams norman-k-willi...@uiowa.edu
 
 
 
 
 
 
  On 10/24/13 3:35 AM, Witold E Wolski wewol...@gmail.com wrote:
 
 Would also like to start configuring external dependencies with
 
 ExternalProject_Add
 
 So some examples would be pretty useful to me. So did you ended up
 collecting some examples?
 Sure, you posted in this links to repositories, but finding the
 ExternalProject_Add in these huge projects with hundreds of
 CMakeLists.txt is not easy if they are not in the top-level
 CMakeLists.txt and they are not there.
 
 My dependencies are
 
 gtest - Cmake
 glog - Cmake
 tbb - configure make
 vigra - Cmkae based
 soci - Cmake based
 pwiz
 
 
 regards
 
 
 
 On 18 March 2012 00:24, Luigi Calori l.cal...@cineca.it wrote:
  On 17/03/2012 22.11, Marcus D. Hanwell wrote:
 
  On Sat, Mar 17, 2012 at 5:03 PM, Bill Lorensen
 bill.loren...@gmail.com
  wrote:
 
  Folks,
 
  I've recently created a number of super builds using CMake's External
  Project mechanism. Each external project requires some sort of
  download, configuration, build and possibly install. The CMake
 defines
  needed to correctly access the results of the external project vary
  significantly. The trickiest part is find the proper download,
  configuration and CMake defines.
 
  For example, for the Point Cloud Library (http://pointclouds.org/) I
  created these external projects:
  VTK - git, cmake, make; VTK_DIR
  FLANN - zip, cmake, make install; FLANN_LIBRARY, FLANN_INCUDE_DIR
  Eigen - .tar.bz2,; EIGEN_INCLUDE_DIR
  Qhull - git, cmake, make;QHULL_LIBRARY,QHULL_INCLUDE_DIR
  Boost - .tar.gz, bootstrap.sh, b2; BOOST_ROOT
  GTest - .zip, cmake, make; GTEST_ROOT,GTEST_INCLUDE_DIR
 
  Slicer4 has many more.
 
  Should we start collecting sample ExternalProject_Add files for
  external projects?
 
  We have talked about doing this too (I have Eigen, Boost, GTest and
  others for example). The standard CMake based projects hardly seem
  worth it, but it depends on what you want to do with them I suppose.
  For the work we are doing in chemistry we have been working on an
  experimental superbuild that uses a common prefix in the build tree to
  install to, and then all we need pass in is CMAKE_PREFIX_PATH - this
  can make the logic significantly easier for dependent CMake projects
  as it will always search within the prefix first.
 
  I did something similar, trying to collet all the build of stuff that I
 had
  to do in a single place powered by cmake
  Used  CMAKE_PREFIX_PATH and a single source place where all the builds
  download  and expand
 
  you can have a look at
 
  https://hpc-forge.cineca.it/svn/CmakeBuilds/lib/
 
  It's just for my use only, so really dirty and not properly checked, I'
 m
  also looking for good starting point for common stuff like Qt, boost
 and
  

Re: [CMake] ExternalProject_Add examples

2013-10-25 Thread Williams, Norman K
There is our project here:
https://github.com/BRAINSia/NAMICExternalProjects

This is set up using the CMake 'SuperBuild' pattern first used with Slicer.

It might be more complicated a setup than you have in mind, but it builds
a large number of interdependent packages.

It's structured as a two-phase setup:  First, all prerequisite packages
are built, and then the actual project is built.  As NamicExternalProjects
is set up as a functioning prototype, the 'top-level' CMake project is
empty.

Adding a new external project is a matter of copying
SuperBuild/External_Template.cmake to
SuperBuild/External_your_project.cmake and editing it to make it
specific to that project. This mostly amounts to  setting its
dependencies, where to download the source from, and which version to
download.

--
Kent Williams norman-k-willi...@uiowa.edu






On 10/24/13 3:35 AM, Witold E Wolski wewol...@gmail.com wrote:

Would also like to start configuring external dependencies with

ExternalProject_Add

So some examples would be pretty useful to me. So did you ended up
collecting some examples?
Sure, you posted in this links to repositories, but finding the
ExternalProject_Add in these huge projects with hundreds of
CMakeLists.txt is not easy if they are not in the top-level
CMakeLists.txt and they are not there.

My dependencies are

gtest - Cmake
glog - Cmake
tbb - configure make
vigra - Cmkae based
soci - Cmake based
pwiz


regards



On 18 March 2012 00:24, Luigi Calori l.cal...@cineca.it wrote:
 On 17/03/2012 22.11, Marcus D. Hanwell wrote:

 On Sat, Mar 17, 2012 at 5:03 PM, Bill Lorensenbill.loren...@gmail.com
 wrote:

 Folks,

 I've recently created a number of super builds using CMake's External
 Project mechanism. Each external project requires some sort of
 download, configuration, build and possibly install. The CMake defines
 needed to correctly access the results of the external project vary
 significantly. The trickiest part is find the proper download,
 configuration and CMake defines.

 For example, for the Point Cloud Library (http://pointclouds.org/) I
 created these external projects:
 VTK - git, cmake, make; VTK_DIR
 FLANN - zip, cmake, make install; FLANN_LIBRARY, FLANN_INCUDE_DIR
 Eigen - .tar.bz2,; EIGEN_INCLUDE_DIR
 Qhull - git, cmake, make;QHULL_LIBRARY,QHULL_INCLUDE_DIR
 Boost - .tar.gz, bootstrap.sh, b2; BOOST_ROOT
 GTest - .zip, cmake, make; GTEST_ROOT,GTEST_INCLUDE_DIR

 Slicer4 has many more.

 Should we start collecting sample ExternalProject_Add files for
 external projects?

 We have talked about doing this too (I have Eigen, Boost, GTest and
 others for example). The standard CMake based projects hardly seem
 worth it, but it depends on what you want to do with them I suppose.
 For the work we are doing in chemistry we have been working on an
 experimental superbuild that uses a common prefix in the build tree to
 install to, and then all we need pass in is CMAKE_PREFIX_PATH - this
 can make the logic significantly easier for dependent CMake projects
 as it will always search within the prefix first.

 I did something similar, trying to collet all the build of stuff that I
had
 to do in a single place powered by cmake
 Used  CMAKE_PREFIX_PATH and a single source place where all the builds
 download  and expand

 you can have a look at

 https://hpc-forge.cineca.it/svn/CmakeBuilds/lib/

 It's just for my use only, so really dirty and not properly checked, I'
m
 also looking for good starting point for common stuff like Qt, boost and
 others
 (I' tried to collect in the folder  Packages the tricky part of building
 the components,) I' ve tried to define a dependency graph but it' still
 messy

 anyway I would really appreciate a place where to share good recipies
for
 CMake building packeges

 Thanks
   Luigi







 The Qt external project was pretty tricky too, and we are using that
 in several places along with smaller libraries like libxml2.

 Marcus
 --

 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



 --
 Luigi Calori
 SuperComputing Applications and Innovation Department
 CINECA - via Magnanelli, 6/3, 40033 Casalecchio di Reno (Bologna) -
ITALY
 Tel: +39 051 6171509  Fax: +39 051 6132198
 hpc.cineca.it


 --

 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



--
Witold Eryk Wolski
--

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 

Re: [CMake] ExternalProject_Add examples

2013-10-24 Thread Witold E Wolski
Would also like to start configuring external dependencies with

ExternalProject_Add

So some examples would be pretty useful to me. So did you ended up
collecting some examples?
Sure, you posted in this links to repositories, but finding the
ExternalProject_Add in these huge projects with hundreds of
CMakeLists.txt is not easy if they are not in the top-level
CMakeLists.txt and they are not there.

My dependencies are

gtest - Cmake
glog - Cmake
tbb - configure make
vigra - Cmkae based
soci - Cmake based
pwiz


regards



On 18 March 2012 00:24, Luigi Calori l.cal...@cineca.it wrote:
 On 17/03/2012 22.11, Marcus D. Hanwell wrote:

 On Sat, Mar 17, 2012 at 5:03 PM, Bill Lorensenbill.loren...@gmail.com
 wrote:

 Folks,

 I've recently created a number of super builds using CMake's External
 Project mechanism. Each external project requires some sort of
 download, configuration, build and possibly install. The CMake defines
 needed to correctly access the results of the external project vary
 significantly. The trickiest part is find the proper download,
 configuration and CMake defines.

 For example, for the Point Cloud Library (http://pointclouds.org/) I
 created these external projects:
 VTK - git, cmake, make; VTK_DIR
 FLANN - zip, cmake, make install; FLANN_LIBRARY, FLANN_INCUDE_DIR
 Eigen - .tar.bz2,; EIGEN_INCLUDE_DIR
 Qhull - git, cmake, make;QHULL_LIBRARY,QHULL_INCLUDE_DIR
 Boost - .tar.gz, bootstrap.sh, b2; BOOST_ROOT
 GTest - .zip, cmake, make; GTEST_ROOT,GTEST_INCLUDE_DIR

 Slicer4 has many more.

 Should we start collecting sample ExternalProject_Add files for
 external projects?

 We have talked about doing this too (I have Eigen, Boost, GTest and
 others for example). The standard CMake based projects hardly seem
 worth it, but it depends on what you want to do with them I suppose.
 For the work we are doing in chemistry we have been working on an
 experimental superbuild that uses a common prefix in the build tree to
 install to, and then all we need pass in is CMAKE_PREFIX_PATH - this
 can make the logic significantly easier for dependent CMake projects
 as it will always search within the prefix first.

 I did something similar, trying to collet all the build of stuff that I had
 to do in a single place powered by cmake
 Used  CMAKE_PREFIX_PATH and a single source place where all the builds
 download  and expand

 you can have a look at

 https://hpc-forge.cineca.it/svn/CmakeBuilds/lib/

 It's just for my use only, so really dirty and not properly checked, I' m
 also looking for good starting point for common stuff like Qt, boost and
 others
 (I' tried to collect in the folder  Packages the tricky part of building
 the components,) I' ve tried to define a dependency graph but it' still
 messy

 anyway I would really appreciate a place where to share good recipies for
 CMake building packeges

 Thanks
   Luigi







 The Qt external project was pretty tricky too, and we are using that
 in several places along with smaller libraries like libxml2.

 Marcus
 --

 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



 --
 Luigi Calori
 SuperComputing Applications and Innovation Department
 CINECA - via Magnanelli, 6/3, 40033 Casalecchio di Reno (Bologna) - ITALY
 Tel: +39 051 6171509  Fax: +39 051 6132198
 hpc.cineca.it


 --

 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



-- 
Witold Eryk Wolski
--

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add examples

2013-10-24 Thread Fraser Hutchison
There's a StackOverflow answer I did a while back which gives an example 
of ExternalProject_Add for GTest: http://stackoverflow.com/a/9695234/2556117


It maybe needs updated, and I don't think I ever tried it on OSX, but it 
should hopefully be an OK starting point.  (If not - hack away at my 
answer!)


Cheers,
Fraser.


On 24/10/2013 09:35, Witold E Wolski wrote:

Would also like to start configuring external dependencies with

ExternalProject_Add

So some examples would be pretty useful to me. So did you ended up
collecting some examples?
Sure, you posted in this links to repositories, but finding the
ExternalProject_Add in these huge projects with hundreds of
CMakeLists.txt is not easy if they are not in the top-level
CMakeLists.txt and they are not there.

My dependencies are

gtest - Cmake
glog - Cmake
tbb - configure make
vigra - Cmkae based
soci - Cmake based
pwiz


regards



On 18 March 2012 00:24, Luigi Calori l.cal...@cineca.it wrote:

On 17/03/2012 22.11, Marcus D. Hanwell wrote:

On Sat, Mar 17, 2012 at 5:03 PM, Bill Lorensenbill.loren...@gmail.com
wrote:

Folks,

I've recently created a number of super builds using CMake's External
Project mechanism. Each external project requires some sort of
download, configuration, build and possibly install. The CMake defines
needed to correctly access the results of the external project vary
significantly. The trickiest part is find the proper download,
configuration and CMake defines.

For example, for the Point Cloud Library (http://pointclouds.org/) I
created these external projects:
VTK - git, cmake, make; VTK_DIR
FLANN - zip, cmake, make install; FLANN_LIBRARY, FLANN_INCUDE_DIR
Eigen - .tar.bz2,; EIGEN_INCLUDE_DIR
Qhull - git, cmake, make;QHULL_LIBRARY,QHULL_INCLUDE_DIR
Boost - .tar.gz, bootstrap.sh, b2; BOOST_ROOT
GTest - .zip, cmake, make; GTEST_ROOT,GTEST_INCLUDE_DIR

Slicer4 has many more.

Should we start collecting sample ExternalProject_Add files for
external projects?

We have talked about doing this too (I have Eigen, Boost, GTest and
others for example). The standard CMake based projects hardly seem
worth it, but it depends on what you want to do with them I suppose.
For the work we are doing in chemistry we have been working on an
experimental superbuild that uses a common prefix in the build tree to
install to, and then all we need pass in is CMAKE_PREFIX_PATH - this
can make the logic significantly easier for dependent CMake projects
as it will always search within the prefix first.

I did something similar, trying to collet all the build of stuff that I had
to do in a single place powered by cmake
Used  CMAKE_PREFIX_PATH and a single source place where all the builds
download  and expand

you can have a look at

https://hpc-forge.cineca.it/svn/CmakeBuilds/lib/

It's just for my use only, so really dirty and not properly checked, I' m
also looking for good starting point for common stuff like Qt, boost and
others
(I' tried to collect in the folder  Packages the tricky part of building
the components,) I' ve tried to define a dependency graph but it' still
messy

anyway I would really appreciate a place where to share good recipies for
CMake building packeges

Thanks
   Luigi







The Qt external project was pretty tricky too, and we are using that
in several places along with smaller libraries like libxml2.

Marcus
--

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



--
Luigi Calori
SuperComputing Applications and Innovation Department
CINECA - via Magnanelli, 6/3, 40033 Casalecchio di Reno (Bologna) - ITALY
Tel: +39 051 6171509  Fax: +39 051 6132198
hpc.cineca.it


--

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

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add examples

2013-10-24 Thread Pau Garcia i Quiles
Hello,

Take a look at winstng:

https://elpauer.assembla.com/code/winstng/git/nodes

It's being used for the Wt SDKs:

http://www.webtoolkit.eu/wt/blog/2013/10/21/binary_packages_for_visual_studio/


On Thu, Oct 24, 2013 at 10:35 AM, Witold E Wolski wewol...@gmail.comwrote:

 Would also like to start configuring external dependencies with

 ExternalProject_Add

 So some examples would be pretty useful to me. So did you ended up
 collecting some examples?
 Sure, you posted in this links to repositories, but finding the
 ExternalProject_Add in these huge projects with hundreds of
 CMakeLists.txt is not easy if they are not in the top-level
 CMakeLists.txt and they are not there.

 My dependencies are

 gtest - Cmake
 glog - Cmake
 tbb - configure make
 vigra - Cmkae based
 soci - Cmake based
 pwiz



-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
--

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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] ExternalProject_Add examples

2013-10-24 Thread Magnus Therning
On Thu, Oct 24, 2013 at 09:04:25PM +0100, Fraser Hutchison wrote:
 There's a StackOverflow answer I did a while back which gives an example of
 ExternalProject_Add for GTest: http://stackoverflow.com/a/9695234/2556117
 
 It maybe needs updated, and I don't think I ever tried it on OSX, but it
 should hopefully be an OK starting point.  (If not - hack away at my
 answer!)

There's also a recent thread of mine on this list that's at least
slightly related:

http://www.cmake.org/pipermail/cmake/2013-October/056086.html

/M

-- 
Magnus Therning  OpenPGP: 0xAB4DFBA4 
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus

Time is a great teacher, but unfortunately it kills all its pupils.
 -- Hector Louis Berlioz


pgpg6xzorizx3.pgp
Description: PGP signature
--

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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] ExternalProject_Add - Automatic Incremental Rebuilds + Add Sources to IDE

2013-09-22 Thread Aaron Nowack
I finally got this working, including the sources from both projects and
simultaneous building. It was simpler than I thought, and as similar to how
you originally suggested. I created a superbuild CMakeLists.txt which just
contains the add_subdirectory(libs) and add_subdirectory(apps). I reference
the include directories for the libs headers by setting cache variable in
the libs/CMakeLists.txt, which are then referenced in the
apps/CMakeLists.txt . Since it's all together the targets from libs can be
directly referenced when linking in apps.

I'm not finished, but this method is already slick and straight forward.
Our previous build system was based on plain makefiles with lots of edge
cases, hardlinking, and referencing msvc7.0 via msys commandline  flags (I
know...).

Thanks VERY much for cmake, our last build system was horrendous. I'm glad
Sandia sponsors this.


On Fri, Sep 20, 2013 at 12:45 PM, Aaron Nowack aaronbnow...@gmail.comwrote:

 You can structure the app CMakeLists such that it can reference the libs
 as part of a big build everything tree like this, or as something that
 has to be found with find_package, or as something you just point to with
 CMake variables.


 Was the parent CMakeLists.txt an example of only how to combine the
 sources, or should it be reasonably possible to do step-building? For
 example, I attempted the following...

 I've setup a parent CMakeLists.txt for the apps and libs as you
 described with subdirectories for apps and libs. I build the libs first,
 and have it set a variable of where the library will be installed to, named
 apps_lib_path. apps_lib_path is set with PARENT_SCOPE so it is passed into
 the apps/ directory.

 Now, in the apps folder I must reference to the library that libs will
 build. This seems to create a chicken-egg issue as I am trying to reference
 a library that isn't yet created. I am using find_package(libs) which
 checks several possible locations for the library, the first being
 apps_lib_path for the library libApps. Since no libApps is present (hasn't
 been built yet, still in the cmake stage) it is set to NOTFOUND and cmake
 returns an error.

 The best approach I've seen for this sort of thing so far is being used in
 the Open Cheimstry projects. They build and install everything as part of a
 super build into a known installation prefix in the super build build
 tree. Then, they use CMAKE_PREFIX_PATH and find_package to find
 *previously* built/installed sub-projects in subsequent sub-projects.
 Everything is built via ExternalProject there, but none of the individual
 projects build anything with ExternalProject -- they find everything with
 find_package. ( See their repos here: https://github.com/OpenChemistry-- the 
 super build is in:
 https://github.com/OpenChemistry/openchemistry )


 This is a great example, so they install into a common place where each
 project can use find_project(other_project) and link correctly. They force
 incremental rebuilds by using ExternalProject_Add_Step.

 Thanks for the help,
 - Aaron

 On Wed, Sep 18, 2013 at 8:51 AM, David Cole dlrd...@aol.com wrote:

 Ideally, for these rapid co-development phases I would like to
 a) Be able to rebuild a project using ExternalProject_Add
 whenever any source file changes.


 ExternalProject is not well suited for handling source level changes.



  b) Provide the mechanism for an IDE project to include all
 the sources from another project specified by
 ExternalProject_Add.


 Because of my answer for (a), I still don't think it's a good idea.



  For b) there was a bug open and closed here,
 http://www.cmake.org/Bug/view.**php?id=12322http://www.cmake.org/Bug/view.php?id=12322

 I understand David's point about making bad assumptions, but I would
 find it extremely useful if I was able to include the sources and

 force a

 rebuild as I'm describing.


 I understand, and many others would also find it useful, but I doubt it
 can be done reliably. If somebody would like to prove me wrong, (on Windows
 with all supported versions of Visual Studio, and on the Mac with all
 versions of Xcode, and with Eclipse, and ...), I will gladly reverse my
 opinion.



  Does anyone have any ideas? We're currently doing a lot of

 refactoring on

 both repositories so removing as much development overhead will really
 help. When things get stable we will be using ExternalProject_Add on
 tagged revisions.


 The best solution for rapid co-development of multiple repositories is
 NOT to use ExternalProject. ExternalProject, as recently discussed in
 another mailing list thread here, is best suited for building static
 snapshots of repositories that do not change frequently.

 Does everything build with CMake? Good. Then you can make something like
 this work:

# CMakeLists.txt
cmake_minimum_required(VERSION 2.8.11)
project(GlueLibsAndApp)
add_subdirectory(libs)
add_subdirectory(app)

 # Then, checkout the two separate repositories in libs and app
 

Re: [CMake] ExternalProject_Add - Automatic Incremental Rebuilds + Add Sources to IDE

2013-09-20 Thread Aaron Nowack

 You can structure the app CMakeLists such that it can reference the libs
 as part of a big build everything tree like this, or as something that
 has to be found with find_package, or as something you just point to with
 CMake variables.


Was the parent CMakeLists.txt an example of only how to combine the
sources, or should it be reasonably possible to do step-building? For
example, I attempted the following...

I've setup a parent CMakeLists.txt for the apps and libs as you described
with subdirectories for apps and libs. I build the libs first, and have it
set a variable of where the library will be installed to, named
apps_lib_path. apps_lib_path is set with PARENT_SCOPE so it is passed into
the apps/ directory.

Now, in the apps folder I must reference to the library that libs will
build. This seems to create a chicken-egg issue as I am trying to reference
a library that isn't yet created. I am using find_package(libs) which
checks several possible locations for the library, the first being
apps_lib_path for the library libApps. Since no libApps is present (hasn't
been built yet, still in the cmake stage) it is set to NOTFOUND and cmake
returns an error.

The best approach I've seen for this sort of thing so far is being used in
 the Open Cheimstry projects. They build and install everything as part of a
 super build into a known installation prefix in the super build build
 tree. Then, they use CMAKE_PREFIX_PATH and find_package to find
 *previously* built/installed sub-projects in subsequent sub-projects.
 Everything is built via ExternalProject there, but none of the individual
 projects build anything with ExternalProject -- they find everything with
 find_package. ( See their repos here: https://github.com/OpenChemistry --
 the super build is in: https://github.com/OpenChemistry/openchemistry )


This is a great example, so they install into a common place where each
project can use find_project(other_project) and link correctly. They force
incremental rebuilds by using ExternalProject_Add_Step.

Thanks for the help,
- Aaron

On Wed, Sep 18, 2013 at 8:51 AM, David Cole dlrd...@aol.com wrote:

 Ideally, for these rapid co-development phases I would like to
 a) Be able to rebuild a project using ExternalProject_Add
 whenever any source file changes.


 ExternalProject is not well suited for handling source level changes.



  b) Provide the mechanism for an IDE project to include all
 the sources from another project specified by
 ExternalProject_Add.


 Because of my answer for (a), I still don't think it's a good idea.



  For b) there was a bug open and closed here,
 http://www.cmake.org/Bug/view.**php?id=12322http://www.cmake.org/Bug/view.php?id=12322

 I understand David's point about making bad assumptions, but I would
 find it extremely useful if I was able to include the sources and

 force a

 rebuild as I'm describing.


 I understand, and many others would also find it useful, but I doubt it
 can be done reliably. If somebody would like to prove me wrong, (on Windows
 with all supported versions of Visual Studio, and on the Mac with all
 versions of Xcode, and with Eclipse, and ...), I will gladly reverse my
 opinion.



  Does anyone have any ideas? We're currently doing a lot of

 refactoring on

 both repositories so removing as much development overhead will really
 help. When things get stable we will be using ExternalProject_Add on
 tagged revisions.


 The best solution for rapid co-development of multiple repositories is NOT
 to use ExternalProject. ExternalProject, as recently discussed in another
 mailing list thread here, is best suited for building static snapshots of
 repositories that do not change frequently.

 Does everything build with CMake? Good. Then you can make something like
 this work:

# CMakeLists.txt
cmake_minimum_required(VERSION 2.8.11)
project(GlueLibsAndApp)
add_subdirectory(libs)
add_subdirectory(app)

 # Then, checkout the two separate repositories in libs and app and
 boom: all your sources for everything are all in the generated IDE project

 You can structure the app CMakeLists such that it can reference the libs
 as part of a big build everything tree like this, or as something that
 has to be found with find_package, or as something you just point to with
 CMake variables.

 Then later on, you can create a super build that builds both libs and app
 separately using ExternalProject, and have that app refer to the libs built
 in that manner, rather than as targets in the same CMakeLists directory
 structure.


 The best approach I've seen for this sort of thing so far is being used in
 the Open Cheimstry projects. They build and install everything as part of a
 super build into a known installation prefix in the super build build
 tree. Then, they use CMAKE_PREFIX_PATH and find_package to find
 *previously* built/installed sub-projects in subsequent sub-projects.
 Everything is built via ExternalProject there, but none of 

Re: [CMake] ExternalProject_Add - Automatic Incremental Rebuilds + Add Sources to IDE

2013-09-18 Thread David Cole

Ideally, for these rapid co-development phases I would like to
a) Be able to rebuild a project using ExternalProject_Add
whenever any source file changes.


ExternalProject is not well suited for handling source level changes.



b) Provide the mechanism for an IDE project to include all
the sources from another project specified by
ExternalProject_Add.


Because of my answer for (a), I still don't think it's a good idea.



For b) there was a bug open and closed here,
http://www.cmake.org/Bug/view.php?id=12322

I understand David's point about making bad assumptions, but I would
find it extremely useful if I was able to include the sources and 

force a

rebuild as I'm describing.


I understand, and many others would also find it useful, but I doubt it 
can be done reliably. If somebody would like to prove me wrong, (on 
Windows with all supported versions of Visual Studio, and on the Mac 
with all versions of Xcode, and with Eclipse, and ...), I will gladly 
reverse my opinion.



Does anyone have any ideas? We're currently doing a lot of 

refactoring on

both repositories so removing as much development overhead will really
help. When things get stable we will be using ExternalProject_Add on
tagged revisions.


The best solution for rapid co-development of multiple repositories is 
NOT to use ExternalProject. ExternalProject, as recently discussed in 
another mailing list thread here, is best suited for building static 
snapshots of repositories that do not change frequently.


Does everything build with CMake? Good. Then you can make something 
like this work:


   # CMakeLists.txt
   cmake_minimum_required(VERSION 2.8.11)
   project(GlueLibsAndApp)
   add_subdirectory(libs)
   add_subdirectory(app)

# Then, checkout the two separate repositories in libs and app 
and boom: all your sources for everything are all in the generated IDE 
project


You can structure the app CMakeLists such that it can reference the 
libs as part of a big build everything tree like this, or as 
something that has to be found with find_package, or as something you 
just point to with CMake variables.


Then later on, you can create a super build that builds both libs and 
app separately using ExternalProject, and have that app refer to the 
libs built in that manner, rather than as targets in the same 
CMakeLists directory structure.



The best approach I've seen for this sort of thing so far is being used 
in the Open Cheimstry projects. They build and install everything as 
part of a super build into a known installation prefix in the super 
build build tree. Then, they use CMAKE_PREFIX_PATH and find_package to 
find *previously* built/installed sub-projects in subsequent 
sub-projects. Everything is built via ExternalProject there, but none 
of the individual projects build anything with ExternalProject -- they 
find everything with find_package. ( See their repos here: 
https://github.com/OpenChemistry -- the super build is in: 
https://github.com/OpenChemistry/openchemistry )



HTH,
David

--

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add + BundleUtilities

2013-06-18 Thread Andrew Hundt
Is this the right list to ask this question?

Cheers!
Andrew Hundt


On Sat, Jun 15, 2013 at 12:56 PM, Andrew Hundt athu...@gmail.com wrote:

 I''m building a cmake library with ExternalProject_Add, then using
 add_library(IMPORTED) to import the target. Next, I use BundleUtilities to
 package the library with the rest of my software. However, I'm getting the
 following error:

 warning: target 'libname.so' is not absolute...
 warning: target 'libname.so' does not exist...
 ldd: ./libname.so: No such file or directory

 I made sure to pass the path to the library to fixup_bundle(), how do I
 fix the problem?

 Cheers!
 Andrew Hundt

--

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] ExternalProject_Add + BundleUtilities

2013-06-18 Thread Jean-Christophe Fillion-Robin
Hi Andrew,

I guess sharing an example of code would probably help people having the
expertise to reproduce the issue and eventually answer.

Jc


On Tue, Jun 18, 2013 at 10:50 AM, Andrew Hundt athu...@gmail.com wrote:

 Is this the right list to ask this question?

 Cheers!
 Andrew Hundt


 On Sat, Jun 15, 2013 at 12:56 PM, Andrew Hundt athu...@gmail.com wrote:

 I''m building a cmake library with ExternalProject_Add, then using
 add_library(IMPORTED) to import the target. Next, I use BundleUtilities to
 package the library with the rest of my software. However, I'm getting the
 following error:


 warning: target 'libname.so' is not absolute...
 warning: target 'libname.so' does not exist...
 ldd: ./libname.so: No such file or directory

 I made sure to pass the path to the library to fixup_bundle(), how do I
 fix the problem?

 Cheers!
 Andrew Hundt



 --

 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




-- 
+1 919 869 8849
--

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] ExternalProject_Add + BundleUtilities

2013-06-18 Thread Andrew Hundt
I've been able to resolve the problem, and it was a rather simple error to
correct. My variable name for the library directory differed from the one
in find_package, so the path was not set correctly. My apologies.

Cheers!
Andrew Hundt


On Tue, Jun 18, 2013 at 12:47 PM, Jean-Christophe Fillion-Robin 
jchris.filli...@kitware.com wrote:

 Hi Andrew,

 I guess sharing an example of code would probably help people having the
 expertise to reproduce the issue and eventually answer.

 Jc


 On Tue, Jun 18, 2013 at 10:50 AM, Andrew Hundt athu...@gmail.com wrote:

 Is this the right list to ask this question?

 Cheers!
 Andrew Hundt


 On Sat, Jun 15, 2013 at 12:56 PM, Andrew Hundt athu...@gmail.com wrote:

 I''m building a cmake library with ExternalProject_Add, then using
 add_library(IMPORTED) to import the target. Next, I use BundleUtilities to
 package the library with the rest of my software. However, I'm getting the
 following error:

 warning: target 'libname.so' is not absolute...
 warning: target 'libname.so' does not exist...
 ldd: ./libname.so: No such file or directory

 I made sure to pass the path to the library to fixup_bundle(), how do I
 fix the problem?

 Cheers!
 Andrew Hundt



 --

 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




 --
 +1 919 869 8849

--

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] ExternalProject_Add and globbing

2013-03-04 Thread Petr Kmoch
Hi Luc,

would it help of you changed the command to run 'sh' and have it
execute 'cp lib/*.so /usr/local/lib'? Just a wild idea.

Petr

On Mon, Mar 4, 2013 at 12:50 PM, Luc J. Bourhis luc_j_bour...@mac.com wrote:
 Hi,

 ExternalProject_Add is a fantastic tool but I have got one issue with it.
 Let's say I do the following (tested on Linux)

 The install step fails as if the shell did not see the glob. The exact error
 reads

 Thanks for any help




 -
 --
 Luc J. Bourhis

 --
 View this message in context: 
 http://cmake.3232098.n2.nabble.com/ExternalProject-Add-and-globbing-tp7583473.html
 Sent from the CMake mailing list archive at Nabble.com.
 --

 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] ExternalProject_Add and globbing

2013-03-04 Thread Luc J. Bourhis
Petr Kmoch wrote
 would it help of you changed the command to run 'sh' and have it
 execute 'cp lib/*.so /usr/local/lib'? Just a wild idea.

A /good/ idea! Thanks. To be complete, for future readers, my actual command
is actually like

where DESTINATION_LIB is assigned a value with set(...). Then

replaces ${DESTINATION_LIB} correctly.

So it works great indeed! Thanks again, Petr.



-
--
Luc J. Bourhis

--
View this message in context: 
http://cmake.3232098.n2.nabble.com/ExternalProject-Add-and-globbing-tp7583473p7583476.html
Sent from the CMake mailing list archive at Nabble.com.
--

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] ExternalProject_Add and Boost

2012-06-21 Thread Stefan Eilemann

On 18. Jun 2012, at 20:03, Knox, Kent wrote:

 That is an interesting approach; if this 'superbuild' cmake project 
 downloaded and built all the external dependencies first, then my project 
 could find those dependencies with the appropriate find module?  I suppose 
 that the 'superbuild' could set the BOOST_ROOT variable (or other appropriate 
 variables) for my real project.  I'll play around with this idea when I get 
 some time, thanks for the comment!

Yes, see for example: https://github.com/Eyescale/Buildyard/


HTH,

Stefan.

-- 
http://www.eyescale.ch
http://www.equalizergraphics.com
http://www.linkedin.com/in/eilemann



--

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] ExternalProject_Add and Boost

2012-06-21 Thread Bill Lorensen
Take a look here:
https://gitorious.org/pclsuperbuild/pclsuperbuild

I recently created this superbuild for the Point Cloud Library. You'll
see that it configures and builds Boost with be. Also it downloads
PCL, configures and builds it and other dependencies.

It is new,, so there may be some issues. Currently it only works for
linux and mac,

Bill

On Mon, Jun 18, 2012 at 2:09 PM, Knox, Kent kent.k...@amd.com wrote:
 I’ll check out the reference to b2, thanks for the heads up.



 My own project is hosted with SVN, not GIT, so I did not want to require my
 developers to find and install a git client to get the build to work; that
 is why I wanted to choose the zipball.





 --

 Message: 3

 Date: Mon, 18 Jun 2012 10:55:50 +0200

 From: Mathias Gaunard mathias.gaun...@ens-lyon.org

 Subject: Re: [CMake] ExternalProject_Add and Boost

 To: cmake@cmake.org

 Message-ID: 4fdeed16.4020...@ens-lyon.org

 Content-Type: text/plain; charset=windows-1252; format=flowed



 On 18/06/2012 08:42, Knox, Kent wrote:



 BUILD_COMMAND bjam --with-program_options address-model=64

 toolset=msvc-11.0 link=static stage



 Two comments here:

   - bjam has been renamed to b2 since Boost 1.47

   - this probably uses the bjam/b2 in the path, rather than the one that you
 just built with bootstrap.bat, which is just asking for problems





 1.Github appears to only use the https protocol, and the cmake file(

 download ? ) command does not appear to handle this protocol. So, I

 think GitHub is verboten for any ExternalProject_Add. Am I right, or am

 I missing something? Any plans to add https support?



 Github also provides the git protocol, or did you just mean the zip

 download function?








 --

 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



-- 
Unpaid intern in BillsBasement at noware dot com
--

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] ExternalProject_Add and Boost

2012-06-18 Thread Mathias Gaunard

On 18/06/2012 08:42, Knox, Kent wrote:


BUILD_COMMAND bjam --with-program_options address-model=64
toolset=msvc-11.0 link=static stage


Two comments here:
 - bjam has been renamed to b2 since Boost 1.47
 - this probably uses the bjam/b2 in the path, rather than the one that 
you just built with bootstrap.bat, which is just asking for problems




1.Github appears to only use the https protocol, and the cmake file(
download … ) command does not appear to handle this protocol. So, I
think GitHub is verboten for any ExternalProject_Add. Am I right, or am
I missing something? Any plans to add https support?


Github also provides the git protocol, or did you just mean the zip 
download function?

--

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] ExternalProject_Add and Boost

2012-06-18 Thread Ben Medina
 4.   ExternalProject_Add will download, configure and build projects at
 ‘build’ time.  From the documentation, this sounded like a design decision.
 However, this means that you can’t use the already robust and mature
 findboost() module to configure the Boost project.  Would it be possible to
 add support to ExternalProject_Add to work at ‘configure’ time?

The approach that seems most common is to create a superbuilder
project that builds your dependencies as external projects, then
builds your own project (also as an external project) at the end.

On Sun, Jun 17, 2012 at 11:42 PM, Knox, Kent kent.k...@amd.com wrote:
 Hi all~



 I have been experimenting in my project with using ExternalProject_Add.  My
 goal is to make our build process more automated, with less headache to get
 up and started developing on a fresh system.  I decided that boost would be
 a great dependency to automate, which I successfully completed and is a HUGE
 help. I would like also like to ask the community to code review what I did,
 and possibly offer feedback.  I also have my own comments with the
 experience.



 My code for review (this was developed only for windows, for now):



 include( ExternalProject )



 set( Boost_Version 1.49.0 )

 string( REPLACE . _ Boost_Version_Underscore ${Boost_Version} )



 message( STATUS Boost_Version:  ${Boost_Version} )



 # Below is a CMake command to download, build and install Boost on the
 user’s computer

 ExternalProject_Add(

 Boost

     PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/boost

         URL
 http://downloads.sourceforge.net/project/boost/boost/${Boost_Version}/boost_${Boost_Version_Underscore}.zip

     URL_MD5 854dcbbff31b896c85c38247060b7713

         UPDATE_COMMAND bootstrap.bat

     CONFIGURE_COMMAND 

     BUILD_COMMAND bjam --with-program_options address-model=64
 toolset=msvc-11.0 link=static stage

     BUILD_IN_SOURCE 1

         INSTALL_COMMAND 

 )



 set_property( TARGET Boost PROPERTY FOLDER Externals)



 ExternalProject_Get_Property( Boost source_dir )

 ExternalProject_Get_Property( Boost binary_dir )

 set( Boost_INCLUDE_DIRS ${source_dir} )

 set( Boost_LIBRARIES
 debug;${binary_dir}/stage/lib/libboost_program_options-vc110-mt-gd-1_49.lib;optimized;${binary_dir}/stage/lib/libboost_program_options-vc110-mt-1_49.lib
 )



 A few of my comments while developing this.   Boost’s native build system is
 called Jam.  However, there are efforts to port Boost to cmake, available
 either on github or gitorious.  I would rather stick with one build system
 and use cmake, but I could not use either of these repositories with
 ExternalProject_Add.

 1.   Github appears to only use the https protocol, and the cmake file(
 download … ) command does not appear to handle this protocol.  So, I think
 GitHub is verboten for any ExternalProject_Add.  Am I right, or am I missing
 something?  Any plans to add https support?

 2.   ExternalProject_Add checks the file extension of the URL download,
 to ‘verify’ the download is a supported package.  I would actually like to
 request that it not verify the file extension.  A lot of these public code
 repositories offer tarball and zipball downloads, but the links they provide
 are forwarding scripts (and they don’t offer you direct links), and
 oftentimes the URL to use has no extension.  I had this problem with both
 github and gitorious.  I think it has to be left to the user to verify that
 the link they use if valid.

 3.   The official subversion repository of boost offers .7z packages to
 download.  These packages are about half the size of .zips.  Will cmake add
 decompression support for 7z archives in the near future?

 4.   ExternalProject_Add will download, configure and build projects at
 ‘build’ time.  From the documentation, this sounded like a design decision.
 However, this means that you can’t use the already robust and mature
 findboost() module to configure the Boost project.  Would it be possible to
 add support to ExternalProject_Add to work at ‘configure’ time?  Maybe a
 flag to choose when to pay the build cost?  This would help me abstract the
 differences between linux and windows, for instance.  I understand that some
 people care that ‘configure’ is fast, but I would prefer not to rewrite the
 logic already in the findboost packge.  Also, if ExternalProject_Add worked
 at ‘configure’ time, then I would think that it would be possible for the
 findboost package maintainer to incorporate ExternalProject_Add into the
 find module itself.  Then, users could pass a possible flag into findBoost
 that says, ‘if you don’t find boost locally on the system, just download the
 lastest version of boost for me and proceed with configuring.’



 Thanks in advance for comments,

 Kent


 --

 Powered by www.kitware.com

 Visit other Kitware open-source projects at
 

Re: [CMake] ExternalProject_Add and Boost

2012-06-18 Thread Knox, Kent
That is an interesting approach; if this 'superbuild' cmake project downloaded 
and built all the external dependencies first, then my project could find those 
dependencies with the appropriate find module?  I suppose that the 'superbuild' 
could set the BOOST_ROOT variable (or other appropriate variables) for my real 
project.  I'll play around with this idea when I get some time, thanks for the 
comment!

-Original Message-
From: Ben Medina [mailto:ben.med...@gmail.com] 
Sent: Monday, June 18, 2012 11:59 AM
To: Knox, Kent
Cc: cmake@cmake.org
Subject: Re: [CMake] ExternalProject_Add and Boost

 4.   ExternalProject_Add will download, configure and build projects at
 'build' time.  From the documentation, this sounded like a design decision.
 However, this means that you can't use the already robust and mature
 findboost() module to configure the Boost project.  Would it be 
 possible to add support to ExternalProject_Add to work at 'configure' time?

The approach that seems most common is to create a superbuilder
project that builds your dependencies as external projects, then builds your 
own project (also as an external project) at the end.



--

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] ExternalProject_Add and Boost

2012-06-18 Thread Bill Hoffman

On 6/18/2012 2:03 PM, Knox, Kent wrote:

That is an interesting approach; if this 'superbuild' cmake project
downloaded and built all the external dependencies first, then my
project could find those dependencies with the appropriate find
module?  I suppose that the 'superbuild' could set the BOOST_ROOT
variable (or other appropriate variables) for my real project.  I'll
play around with this idea when I get



Usually, you make your project just another build in the superbuild. 
Then you can send down all the cmake variables required to make your 
project see all of the projects it needs to find.



http://www.kitware.com/products/html/BuildingExternalProjectsWithCMake2.8.html

-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


Re: [CMake] ExternalProject_Add and Boost

2012-06-18 Thread Knox, Kent
I'll check out the reference to b2, thanks for the heads up.



My own project is hosted with SVN, not GIT, so I did not want to require my 
developers to find and install a git client to get the build to work; that is 
why I wanted to choose the zipball.





--

Message: 3

Date: Mon, 18 Jun 2012 10:55:50 +0200

From: Mathias Gaunard 
mathias.gaun...@ens-lyon.orgmailto:mathias.gaun...@ens-lyon.org

Subject: Re: [CMake] ExternalProject_Add and Boost

To: cmake@cmake.orgmailto:cmake@cmake.org

Message-ID: 
4fdeed16.4020...@ens-lyon.orgmailto:4fdeed16.4020...@ens-lyon.org

Content-Type: text/plain; charset=windows-1252; format=flowed



On 18/06/2012 08:42, Knox, Kent wrote:



 BUILD_COMMAND bjam --with-program_options address-model=64

 toolset=msvc-11.0 link=static stage



Two comments here:

  - bjam has been renamed to b2 since Boost 1.47

  - this probably uses the bjam/b2 in the path, rather than the one that you 
just built with bootstrap.bat, which is just asking for problems





 1.Github appears to only use the https protocol, and the cmake file(

 download ? ) command does not appear to handle this protocol. So, I

 think GitHub is verboten for any ExternalProject_Add. Am I right, or am

 I missing something? Any plans to add https support?



Github also provides the git protocol, or did you just mean the zip

download function?





--

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] ExternalProject_Add and Boost

2012-06-18 Thread Ben Medina
That's right. You can pass various initial cache entries, such as
BOOST_ROOT, via the CMAKE_CACHE_ARGS parameter to ExternalProject_Add.

A useful example of this is the Titan project:
http://www.kitware.com/InfovisWiki/index.php/Main_Page
You can see how it builds VTK as an external project, forcing it to
use the externally-built Boost via cache arguments.

On Mon, Jun 18, 2012 at 11:03 AM, Knox, Kent kent.k...@amd.com wrote:
 That is an interesting approach; if this 'superbuild' cmake project 
 downloaded and built all the external dependencies first, then my project 
 could find those dependencies with the appropriate find module?  I suppose 
 that the 'superbuild' could set the BOOST_ROOT variable (or other appropriate 
 variables) for my real project.  I'll play around with this idea when I get 
 some time, thanks for the comment!

 -Original Message-
 From: Ben Medina [mailto:ben.med...@gmail.com]
 Sent: Monday, June 18, 2012 11:59 AM
 To: Knox, Kent
 Cc: cmake@cmake.org
 Subject: Re: [CMake] ExternalProject_Add and Boost

 4.       ExternalProject_Add will download, configure and build projects at
 'build' time.  From the documentation, this sounded like a design decision.
 However, this means that you can't use the already robust and mature
 findboost() module to configure the Boost project.  Would it be
 possible to add support to ExternalProject_Add to work at 'configure' time?

 The approach that seems most common is to create a superbuilder
 project that builds your dependencies as external projects, then builds your 
 own project (also as an external project) at the end.



--

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] ExternalProject_Add examples

2012-03-17 Thread Pau Garcia i Quiles
Hi,

OpenSSL is very tricky on Windows. You'll find my solution (it requires a
two-stage process) at http://gitorious.org/winstng


On Sat, Mar 17, 2012 at 10:03 PM, Bill Lorensen bill.loren...@gmail.comwrote:

 Folks,

 I've recently created a number of super builds using CMake's External
 Project mechanism. Each external project requires some sort of
 download, configuration, build and possibly install. The CMake defines
 needed to correctly access the results of the external project vary
 significantly. The trickiest part is find the proper download,
 configuration and CMake defines.

 For example, for the Point Cloud Library (http://pointclouds.org/) I
 created these external projects:
 VTK - git, cmake, make; VTK_DIR
 FLANN - zip, cmake, make install; FLANN_LIBRARY, FLANN_INCUDE_DIR
 Eigen - .tar.bz2,; EIGEN_INCLUDE_DIR
 Qhull - git, cmake, make;QHULL_LIBRARY,QHULL_INCLUDE_DIR
 Boost - .tar.gz, bootstrap.sh, b2; BOOST_ROOT
 GTest - .zip, cmake, make; GTEST_ROOT,GTEST_INCLUDE_DIR

 Slicer4 has many more.

 Should we start collecting sample ExternalProject_Add files for
 external projects?

 Bill
 --
 Unpaid intern in BillsBasement at noware dot com
 --

 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




-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
--

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] ExternalProject_Add examples

2012-03-17 Thread Marcus D. Hanwell
On Sat, Mar 17, 2012 at 5:03 PM, Bill Lorensen bill.loren...@gmail.com wrote:
 Folks,

 I've recently created a number of super builds using CMake's External
 Project mechanism. Each external project requires some sort of
 download, configuration, build and possibly install. The CMake defines
 needed to correctly access the results of the external project vary
 significantly. The trickiest part is find the proper download,
 configuration and CMake defines.

 For example, for the Point Cloud Library (http://pointclouds.org/) I
 created these external projects:
 VTK - git, cmake, make; VTK_DIR
 FLANN - zip, cmake, make install; FLANN_LIBRARY, FLANN_INCUDE_DIR
 Eigen - .tar.bz2,; EIGEN_INCLUDE_DIR
 Qhull - git, cmake, make;QHULL_LIBRARY,QHULL_INCLUDE_DIR
 Boost - .tar.gz, bootstrap.sh, b2; BOOST_ROOT
 GTest - .zip, cmake, make; GTEST_ROOT,GTEST_INCLUDE_DIR

 Slicer4 has many more.

 Should we start collecting sample ExternalProject_Add files for
 external projects?

We have talked about doing this too (I have Eigen, Boost, GTest and
others for example). The standard CMake based projects hardly seem
worth it, but it depends on what you want to do with them I suppose.
For the work we are doing in chemistry we have been working on an
experimental superbuild that uses a common prefix in the build tree to
install to, and then all we need pass in is CMAKE_PREFIX_PATH - this
can make the logic significantly easier for dependent CMake projects
as it will always search within the prefix first.

The Qt external project was pretty tricky too, and we are using that
in several places along with smaller libraries like libxml2.

Marcus
--

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] ExternalProject_Add examples

2012-03-17 Thread Bill Lorensen
I agree, most all super builds are tricky. Is it practical to collect
examples are are they so Project specific they won't be useful. For
example, the Slicer4 external;s have a bunch of Slicer-specific stuff
in them.

However, it is still frustrating to star a superbuild from scratch.
Maybe we can collect a skeleton for each external package.

Bill

On Sat, Mar 17, 2012 at 2:11 PM, Marcus D. Hanwell
marcus.hanw...@kitware.com wrote:
 On Sat, Mar 17, 2012 at 5:03 PM, Bill Lorensen bill.loren...@gmail.com 
 wrote:
 Folks,

 I've recently created a number of super builds using CMake's External
 Project mechanism. Each external project requires some sort of
 download, configuration, build and possibly install. The CMake defines
 needed to correctly access the results of the external project vary
 significantly. The trickiest part is find the proper download,
 configuration and CMake defines.

 For example, for the Point Cloud Library (http://pointclouds.org/) I
 created these external projects:
 VTK - git, cmake, make; VTK_DIR
 FLANN - zip, cmake, make install; FLANN_LIBRARY, FLANN_INCUDE_DIR
 Eigen - .tar.bz2,; EIGEN_INCLUDE_DIR
 Qhull - git, cmake, make;QHULL_LIBRARY,QHULL_INCLUDE_DIR
 Boost - .tar.gz, bootstrap.sh, b2; BOOST_ROOT
 GTest - .zip, cmake, make; GTEST_ROOT,GTEST_INCLUDE_DIR

 Slicer4 has many more.

 Should we start collecting sample ExternalProject_Add files for
 external projects?

 We have talked about doing this too (I have Eigen, Boost, GTest and
 others for example). The standard CMake based projects hardly seem
 worth it, but it depends on what you want to do with them I suppose.
 For the work we are doing in chemistry we have been working on an
 experimental superbuild that uses a common prefix in the build tree to
 install to, and then all we need pass in is CMAKE_PREFIX_PATH - this
 can make the logic significantly easier for dependent CMake projects
 as it will always search within the prefix first.

 The Qt external project was pretty tricky too, and we are using that
 in several places along with smaller libraries like libxml2.

 Marcus



-- 
Unpaid intern in BillsBasement at noware dot com
--

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] ExternalProject_Add examples

2012-03-17 Thread Luigi Calori

On 17/03/2012 22.11, Marcus D. Hanwell wrote:

On Sat, Mar 17, 2012 at 5:03 PM, Bill Lorensenbill.loren...@gmail.com  wrote:

Folks,

I've recently created a number of super builds using CMake's External
Project mechanism. Each external project requires some sort of
download, configuration, build and possibly install. The CMake defines
needed to correctly access the results of the external project vary
significantly. The trickiest part is find the proper download,
configuration and CMake defines.

For example, for the Point Cloud Library (http://pointclouds.org/) I
created these external projects:
VTK - git, cmake, make; VTK_DIR
FLANN - zip, cmake, make install; FLANN_LIBRARY, FLANN_INCUDE_DIR
Eigen - .tar.bz2,; EIGEN_INCLUDE_DIR
Qhull - git, cmake, make;QHULL_LIBRARY,QHULL_INCLUDE_DIR
Boost - .tar.gz, bootstrap.sh, b2; BOOST_ROOT
GTest - .zip, cmake, make; GTEST_ROOT,GTEST_INCLUDE_DIR

Slicer4 has many more.

Should we start collecting sample ExternalProject_Add files for
external projects?

We have talked about doing this too (I have Eigen, Boost, GTest and
others for example). The standard CMake based projects hardly seem
worth it, but it depends on what you want to do with them I suppose.
For the work we are doing in chemistry we have been working on an
experimental superbuild that uses a common prefix in the build tree to
install to, and then all we need pass in is CMAKE_PREFIX_PATH - this
can make the logic significantly easier for dependent CMake projects
as it will always search within the prefix first.
I did something similar, trying to collet all the build of stuff that I 
had to do in a single place powered by cmake
Used  CMAKE_PREFIX_PATH and a single source place where all the builds 
download  and expand


you can have a look at

https://hpc-forge.cineca.it/svn/CmakeBuilds/lib/

It's just for my use only, so really dirty and not properly checked, I' 
m also looking for good starting point for common stuff like Qt, boost 
and others
(I' tried to collect in the folder  Packages the tricky part of 
building  the components,) I' ve tried to define a dependency graph but 
it' still messy


anyway I would really appreciate a place where to share good recipies 
for CMake building packeges


Thanks
  Luigi







The Qt external project was pretty tricky too, and we are using that
in several places along with smaller libraries like libxml2.

Marcus
--

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




--
Luigi Calori
SuperComputing Applications and Innovation Department
CINECA - via Magnanelli, 6/3, 40033 Casalecchio di Reno (Bologna) - ITALY
Tel: +39 051 6171509  Fax: +39 051 6132198
hpc.cineca.it

--

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


  1   2   >