ソースを参照

Fix installed target definition.

Using CMAKE_INSTALL_INCLUDEDIR before including GNUINstallDirs results
in a broken installation when CMAKE_INSTALL_PREFIX is a non-standard
directory.

Inspired from https://github.com/google/crc32c/pull/39

PiperOrigin-RevId: 278427974
main
Victor Costan 5年前
committed by Victor Costan
コミット
5abdf4c019
1個のファイルの変更3行の追加1行の削除
  1. +3
    -1
      CMakeLists.txt

+ 3
- 1
CMakeLists.txt ファイルの表示

@ -106,6 +106,9 @@ if(BUILD_SHARED_LIBS)
add_compile_options(-fvisibility=hidden) add_compile_options(-fvisibility=hidden)
endif(BUILD_SHARED_LIBS) endif(BUILD_SHARED_LIBS)
# Must be included before CMAKE_INSTALL_INCLUDEDIR is used.
include(GNUInstallDirs)
add_library(leveldb "") add_library(leveldb "")
target_sources(leveldb target_sources(leveldb
PRIVATE PRIVATE
@ -417,7 +420,6 @@ int main() {
endif(LEVELDB_BUILD_BENCHMARKS) endif(LEVELDB_BUILD_BENCHMARKS)
if(LEVELDB_INSTALL) if(LEVELDB_INSTALL)
include(GNUInstallDirs)
install(TARGETS leveldb install(TARGETS leveldb
EXPORT leveldbTargets EXPORT leveldbTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}

読み込み中…
キャンセル
保存