Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,21 @@ jobs:
with:
options: CMAKE_CXX_STANDARD=${{ matrix.cxx_standard }}


cmake-no-install:
runs-on: ubuntu-latest
steps:
- name: checkout project
uses: actions/checkout@v5

- name: build without installation
uses: threeal/cmake-action@v2.0.0
with:
options: CMAKE_CXX_STANDARD=11 JSONCPP_WITH_INSTALL=OFF
Comment thread
greptile-apps[bot] marked this conversation as resolved.

- name: verify nothing is installed
run: |
install_dir="$(mktemp -d)"
DESTDIR="$install_dir" cmake --install build
installed_files="$(find "$install_dir" -mindepth 1 -print -quit)"
test -z "$installed_files"
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ option(JSONCPP_WITH_STRICT_ISO "Issue all the warnings demanded by strict ISO C
option(JSONCPP_WITH_PKGCONFIG_SUPPORT "Generate and install .pc files" ON)
option(JSONCPP_WITH_CMAKE_PACKAGE "Generate and install cmake package files" ON)
option(JSONCPP_WITH_EXAMPLE "Compile JsonCpp example" OFF)
option(JSONCPP_WITH_INSTALL "Include JsonCpp header and binaries in the install target" ON)
option(JSONCPP_WITH_INSTALL "Include JsonCpp files in the install target" ON)
option(JSONCPP_STATIC_WINDOWS_RUNTIME "Use static (MT/MTd) Windows runtime" OFF)
option(BUILD_SHARED_LIBS "Build jsoncpp_lib as a shared library." ON)
option(BUILD_STATIC_LIBS "Build jsoncpp_lib as a static library." ON)
Expand Down Expand Up @@ -161,7 +161,7 @@ if(JSONCPP_WITH_WARNING_AS_ERROR)
use_compilation_warning_as_error()
endif()

if(JSONCPP_WITH_PKGCONFIG_SUPPORT)
if(JSONCPP_WITH_INSTALL AND JSONCPP_WITH_PKGCONFIG_SUPPORT)
include(JoinPaths)

join_paths(libdir_for_pc_file "\${exec_prefix}" "${CMAKE_INSTALL_LIBDIR}")
Expand All @@ -175,7 +175,7 @@ if(JSONCPP_WITH_PKGCONFIG_SUPPORT)
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif()

if(JSONCPP_WITH_CMAKE_PACKAGE)
if(JSONCPP_WITH_INSTALL AND JSONCPP_WITH_CMAKE_PACKAGE)
include(CMakePackageConfigHelpers)
install(EXPORT jsoncpp
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/jsoncpp
Expand Down