install externally supplied include and lib

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

install externally supplied include and lib

Ran Regev

Hello,

I have a very simple problem, which I don't find a solution for:

I'm working with a company that once in a while sends me two directories, one with .h files and the second with a library in two forms, shared and static.
say -
X/include/*
X/lib/libX.so
X/lib/libX.a

I would like to create a cmake project that just wrap this input and do this simple action:
installs the headers and the library.

When I'm fine with the 'install only' mode I would add XConfig.cmake, aliases and maybe more. 

But first I need to find a way to create the correct target and install it.


Ran.










--

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
Reply | Threaded
Open this post in threaded view
|

Re: install externally supplied include and lib

guymac

Ran, I did something like that with the following:

cmake_minimum_required(VERSION 3.11)

project(X)

include(GNUInstallDirs)

set(X_inc "${CMAKE_CURRENT_SOURCE_DIR}/include/")
set(X_lib "${CMAKE_CURRENT_SOURCE_DIR}/lib/")

install(DIRECTORY ${X_lib} DESTINATION ${CMAKE_INSTALL_LIBDIR} FILES_MATCHING PATTERN "libX*.*")

install(DIRECTORY ${X_inc} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h")

--

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