Skip to content

Commit

Permalink
Find system libs
Browse files Browse the repository at this point in the history
  • Loading branch information
bernedom committed Apr 20, 2024
1 parent 229dd6e commit dad2682
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion chapter04/ex07_pack_nsis_standalone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,19 @@ endif()
add_subdirectory(executable)
add_subdirectory(library)

include(InstallRequiredSystemLibraries)
install(TARGETS ch4_ex07_executable
RUNTIME_DEPENDENCIES
PRE_EXCLUDE_REGEXES "api-ms-.*" "ext-ms-.*"
POST_EXCLUDE_REGEXES ".*system32/.*\\.dll"
DIRECTORIES "${RUNTIME_DIRS}")


# We will not explicitly specify project name and version here and
# let CPack to get project name and version from the project()
set(CPACK_PACKAGE_VENDOR "CBP Authors")
# Enable DEB, RPM and TBZ2 generators by default
set(CPACK_GENERATOR "DEB;TBZ2;TGZ;STGZ")
set(CPACK_GENERATOR "NSIS")
# Use all available cores when parallelism is supported
set(CPACK_THREADS 0)
# The DEB generator requires CPACK_DEBIAN_PACKAGE_MAINTAINER
Expand Down
2 changes: 1 addition & 1 deletion chapter04/ex07_pack_nsis_standalone/library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ project(
LANGUAGES CXX)

# Define the executable that will consume the ch4_ex05_lib package
add_library(ch4_ex07_library STATIC src/lib.cpp)
add_library(ch4_ex07_library SHARED src/lib.cpp)

# Set the required C++ standard for the target
target_compile_features(ch4_ex07_library PRIVATE cxx_std_11)
Expand Down

0 comments on commit dad2682

Please sign in to comment.