cutter/cmake/CutterInstallDirs.cmake
Florian Märkl ae2ad5d50c Extend cmake config files with deps, version, etc. (#2916)
This improves how the installed CutterConfig.cmake can be used for
native plugin development:
* Transitive dependencies are resolved automatically
* Version file is included
* Cutter_USER_PLUGINDIR is set to a path that plugins can use as a
  default install destination

src/plugins/sample-cpp/CMakeLists.txt is an example for how to use it.
Rizin was also updated to prevent an error with multiple
`find_package()` calls.
2022-06-09 07:14:25 +08:00

24 lines
1.4 KiB
CMake

set(CUTTER_DIR_NAME "rizin/cutter")
if(WIN32)
set(CMAKE_INSTALL_BINDIR "." CACHE PATH "Executable install directory")
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "Include install directory")
set(CMAKE_INSTALL_LIBDIR "lib" CACHE PATH "Library install directory")
set(CMAKE_INSTALL_DATAROOTDIR "./" CACHE PATH "Resource installation directory")
set(CUTTER_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}" CACHE PATH "Resource installation directory")
elseif(APPLE)
if (CUTTER_ENABLE_PACKAGING)
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "Include install directory")
set(CMAKE_INSTALL_LIBDIR "lib" CACHE PATH "Library install directory")
set(CMAKE_INSTALL_DATAROOTDIR "./" CACHE PATH "Resource installation directory")
set(CMAKE_INSTALL_BINDIR "../MacOS" CACHE PATH "Executable install directory") # BUNDLE step sets prefix to Resources
set(CUTTER_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}" CACHE PATH "Resource installation directory")
else()
include(GNUInstallDirs)
set(CUTTER_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}/${CUTTER_DIR_NAME}" CACHE PATH "Resource installation directory")
endif()
else()
include(GNUInstallDirs)
set(CUTTER_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}/${CUTTER_DIR_NAME}" CACHE PATH "Resource installation directory")
endif()
set(CUTTER_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/Cutter" CACHE PATH "CMake file install location")