Re: [CMake] External library dependency

2013-09-20 Thread Magnus Johansson

We have a similar situation and the following works well enough for us:

ExternalProject_Add(
  big_external_project
  ...
)

set(OUTPUT_FILES files generated by the external build here)
set_source_files_properties(${OUTPUT_FILES} PROPERTIES GENERATED true)

add_library(internal_library ${OUTPUT_FILES} and whatever else it 
depends on)

add_dependencies(internal_library big_external_project)

Once it has been built, the big_external_project rarely gets rebuilt 
unless we do a rm -rf * in the build tree.


Magnus


On 09/19/2013 07:31 PM, Weatherby,Gerard wrote:


We have an external library which is not easily cmakeable and takes 
a long time to compile. We have a static copy of the source in our 
SCCS, so we don't need to fetch etc.


What we'd like to have happen is have the code compile if and only if 
the output libraries are not present.  The best I've come up with is:


   add_custom_command(OUTPUT ${CHOMBO_LIBS_2D}

  PRE_BUILD

  COMMAND ${CHOMBO_BUILD_CMD}

#DEPENDS don't add depends line ... causes 
recompiling of Chombo every time


WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Chombo/lib

   )

   # include the Chombo libraries as source file to 
trigger building them via add_custom_command


   # if they don't exist

   add_executable(${EXE_2D} ${CHOMBO_LIBS_2D} ${SRC_FILES})

where CHOMBO_LIBS_2D are the libraries generated by CHOMBO_BUILD_CMD. 
The libraries link in the source tree.


This works, mostly. It doesn't work with parallel builds (make --j9)

I tried looking at ExternalProject_Add but didn't seem how to tell it 
what output is generated by the command (and hence I'm not sure how / 
if it can be used to only make if the libraries are missing).


Gerard Weatherby

Appllication Architect

Virtual Cell, Center for Cell Analysis and Modeling (CCAM)

University of Connecticut Health Center

860-679-2065



--

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



--
Magnus Johansson
Developer, Fox Technologies

--

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

[cmake-developers] CPack generators for IPS (Solaris 11), depot (HPUX), etc.

2013-09-10 Thread Magnus Johansson

I am wondering if anyone has experimented with generators for:

IPS, Image Packaging System (Solaris = 11)
PKG (Solaris = 10)
Depot (HPUX)
RPM (for AIX)

As far as I can see there is no support for these. I thought RPM for AIX 
would be easy, but my first try failed since the rpmbuild command did 
not exist on my AIX machines. I will investigate this further, but I am 
curious if anyone has successfully built RPMs for AIX.


I would also like to know what kind of effort is involved in writing a 
new generator. I had a brief look at the source code for the RPM 
generator, and it seemed fairly straight forward, but I would like some 
input from someone who has actually written a generator.


--
Magnus Johansson
Developer, Fox Technologies

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers