diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-21 17:47:25 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-22 09:45:52 +0300 |
commit | e82587774cec8c05c61e52e94d60057d98cd45e5 (patch) | |
tree | 483f7c20c0641b606e04b1458d08307d5efd1492 | |
parent | update cmake-common (diff) | |
download | windows7-drivers-e82587774cec8c05c61e52e94d60057d98cd45e5.tar.gz windows7-drivers-e82587774cec8c05c61e52e94d60057d98cd45e5.zip |
cmake: install() PDB files
-rw-r--r-- | um/service/utils/CMakeLists.txt | 30 | ||||
-rw-r--r-- | um/wrappers/simple/utils/CMakeLists.txt | 3 | ||||
-rw-r--r-- | um/wrappers/special/nt_namespace/utils/CMakeLists.txt | 3 |
3 files changed, 21 insertions, 15 deletions
diff --git a/um/service/utils/CMakeLists.txt b/um/service/utils/CMakeLists.txt index fa81443..1dd3ec9 100644 --- a/um/service/utils/CMakeLists.txt +++ b/um/service/utils/CMakeLists.txt @@ -1,18 +1,18 @@ -add_executable(service_install install_service.cpp) -target_link_libraries(service_install PRIVATE service) -set_target_properties(service_install PROPERTIES OUTPUT_NAME install_service) +function(add_util action src) + set(target "service_${action}") + set(name "${action}_service") -add_executable(service_start start_service.cpp) -target_link_libraries(service_start PRIVATE service) -set_target_properties(service_start PROPERTIES OUTPUT_NAME start_service) + add_executable("${target}" ${src}) + target_link_libraries("${target}" PRIVATE service) + set_target_properties("${target}" PROPERTIES OUTPUT_NAME "${name}") -add_executable(service_stop stop_service.cpp) -target_link_libraries(service_stop PRIVATE service) -set_target_properties(service_stop PROPERTIES OUTPUT_NAME stop_service) + install(TARGETS "${target}" RUNTIME DESTINATION bin) + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + install(FILES "$<TARGET_PDB_FILE:${target}>" DESTINATION bin OPTIONAL) + endif() +endfunction() -add_executable(service_uninstall uninstall_service.cpp) -target_link_libraries(service_uninstall PRIVATE service) -set_target_properties(service_uninstall PROPERTIES OUTPUT_NAME uninstall_service) - -install(TARGETS service_install service_start service_stop service_uninstall - RUNTIME DESTINATION bin) +add_util(install install_service.cpp) +add_util(start start_service.cpp) +add_util(stop stop_service.cpp) +add_util(uninstall uninstall_service.cpp) diff --git a/um/wrappers/simple/utils/CMakeLists.txt b/um/wrappers/simple/utils/CMakeLists.txt index 7c2a70d..c266f83 100644 --- a/um/wrappers/simple/utils/CMakeLists.txt +++ b/um/wrappers/simple/utils/CMakeLists.txt @@ -3,3 +3,6 @@ target_link_libraries(simple_exchange_ints PRIVATE simple) set_target_properties(simple_exchange_ints PROPERTIES OUTPUT_NAME exchange_ints) install(TARGETS simple_exchange_ints RUNTIME DESTINATION bin) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + install(FILES "$<TARGET_PDB_FILE:simple_exchange_ints>" DESTINATION bin OPTIONAL) +endif() diff --git a/um/wrappers/special/nt_namespace/utils/CMakeLists.txt b/um/wrappers/special/nt_namespace/utils/CMakeLists.txt index 5d354ce..a40b6e4 100644 --- a/um/wrappers/special/nt_namespace/utils/CMakeLists.txt +++ b/um/wrappers/special/nt_namespace/utils/CMakeLists.txt @@ -7,3 +7,6 @@ if(MINGW) endif() install(TARGETS nt_namespace_convert RUNTIME DESTINATION bin) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + install(FILES "$<TARGET_PDB_FILE:nt_namespace_convert>" DESTINATION bin OPTIONAL) +endif() |