[CMake] Cpack Nsis not installing libraries

Eric Noulard eric.noulard at gmail.com
Mon Feb 27 17:47:21 EST 2012


2012/2/27 Mauricio Klein <mauricio.klein.msk at gmail.com>:
> Hello everybody!
>
> I'm creating a NSIS package using CPack to install my software.
>
> The code is compilled using Visual Studio 9, and the compilation + packing
> is working well.
>
> But, once i install the software using the generated NSIS package, the
> program doesn't start because NSIS did't installed the required libraries.
>
> The strange is that in my CMakeLists.txt, i tell that my binary requires
> these libraries.
>
> The libraries are:
> * OpenSSL
> * Pthreads
> (both found using find macros)
>
>
> The piece of configuration that defines these relashionship is showed
> bellow:
> -------------------------------------------------------------------------------------
> find_package(Pthreads REQUIRED)
> find_package(OpenSSL REQUIRED)
>
> include_directories(${OPENSSL_INCLUDE_DIR})
> include_directories(${PTHREADS_INCLUDE_DIR})
>
> install(TARGETS MyBin DESTINATION "MyBin1-0/bin")


> install(TARGETS ${PTHREADS} DESTINATION "MyBin1-0/bin")
> install(TARGETS ${OPENSSL} DESTINATION "MyBin1-0/bin")

${PTHREADS} and ${OPENSSL} seems wrong
usually those are:
${PTHREADS_LIBRARIES}
${OPENSSL_LIBRARIES}

moreover you cannot use install(TARGETS ....) for those
because they are not TARGET unless you somehow define
them as IMPORTED library.

Usually "third party" libs (those which are not built in your project)
are not installed because they may be found on the host where
your software is installed already.

If you are interested in creating "autonomous" bundle
have a look at the BundleUtilities module.

> The "MyBin" binary is installed well, but the libraries of Pthreads and
> OpenSSL not!
>
> Any hint??
>
> Thanks in advance for your attention, and any help is very welcome!

May be you can tell us which version of CMake you are using
and which system you are targeting (Windows, Linux, MacOS Xetc...)
-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list