windows - How to generate .msi installer with cmake? -


i trying generate .msi installer cmake. able generate .dll , .lib files configuration in cmakelists.txt. please provide example cmakelists.txt generate .msi installer. commands need use in command prompt ?

the commands using far are:

> cmake -g"visual studio 10" -h"root cmakelists.txt path" -b"path generate sln" > cmake --build "path of sln" --config release > cpack -c release output: cpack error: cpack generator not specified  

i used following configuration generate .dll , .lib files.

here cmakelists.txt:

cmake_minimum_required(version 2.8) project(mydll) include_directories(common/include)  set(my_lib_src dllmain.cpp mydll.cpp ) set_source_files_properties(${my_lib_src} properties language c) add_library(mydll  shared ${my_lib_src}) set_target_properties(mydll properties  linker_language c                                                                      runtime_output_directory ${cmake_source_dir}/common/bin runtime_output_directory_debug ${cmake_source_dir}/common/bin archive_output_directory ${cmake_source_dir}/common/lib archive_output_directory_debug ${cmake_source_dir}/common/lib) install(targets mydll    archive   destination lib   component libraries) install(files mydll.h   destination include   component headers) set(cpack_generator wix) set(cpack_package_name "mydll") set(cpack_package_vendor "cmake.org") set(cpack_package_description_summary "mylib - cpack component installation example") 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 "cpack component example")  include(cpack) 

you need set generator when run cpack instead of

3) cpack -c release
output: cpack error: cpack generator not specified

you should specify

cpack -g wix -c release 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -