[CMake] CMake Installerproject with NSIS

Eric Noulard eric.noulard at gmail.com
Wed Oct 24 02:21:47 EDT 2012


2012/10/24 Lodron, Gerald <Gerald.Lodron at joanneum.at>:
> Hi
>
> I am trying to make my first installer of my already working cmake
> application but I have the problem that no output is done by CMake. I have
> installed NSIS, whereby my CMake flags in GUI are:
> CPACK_BINARY_NSIS is true, CPACK_BINARY_ZIP is false and CPACK_SOURCE_ZIP is
> true
>
> My CMake script looks like this:
>
> SET(Srcs MySource.cpp )
>
> INCLUDE_DIRECTORIES(
> ${CMAKE_CURRENT_BINARY_DIR}
> )
>
> ADD_EXECUTABLE( MyApp ${ Srcs _Srcs})
>
> TARGET_LINK_LIBRARIES(MyApp
>         MyLib
>                       )
>
> install(
> TARGETS MyApp
> RUNTIME
> DESTINATION bin
> COMPONENT applications
>    )
>
> set(CPACK_PACKAGE_NAME " MyApp ")
> set(CPACK_PACKAGE_VENDOR "www.joanneum.at")
> set(CPACK_PACKAGE_DESCRIPTION_SUMMARY " MyApp - Installation")
> set(CPACK_PACKAGE_VERSION "1.0.0")
> set(CPACK_PACKAGE_VERSION_MAJOR "1")
> set(CPACK_PACKAGE_VERSION_MINOR "0")
> set(CPACK_PACKAGE_VERSION_PATCH "0")
> set(CPACK_PACKAGE_INSTALL_DIRECTORY " MyApp ")
>
> set(CPACK_COMPONENTS_ALL applications libraries headers)
> set(CPACK_COMPONENT_APPLICATIONS_DISPLAY_NAME " MyApp Application")
> set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
> set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ Headers")
> set(CPACK_COMPONENT_APPLICATIONS_DESCRIPTION " MyApp executable")
> set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION "Libraries used by MyApp")
> set(CPACK_COMPONENT_HEADERS_DESCRIPTION "C/C++ header files")
>
> include(CPack)
>
>
> When I configure and generate I run without errors, when I look into my
> visual studio there are no changes visible.


You should have 2 new buildable target:
"PACKAGE" and "PACKAGE_SOURCE".

> When I look into the binary
> directory there is also no installer found, also no *.nsi file which could
> be opened by NSIS. So how could I generate a exe ? Thanks for help…

Installer and *.nsi file are generated when you build PACKAGE target.

-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list