Browse Source

Check for system version of simpleini. (#4751)

pull/4932/head
Yuvraj Tetarwal 4 years ago committed by Anders Jenbo
parent
commit
d9ae750564
  1. 18
      CMake/Dependencies.cmake
  2. 21
      CMake/finders/Findsimpleini.cmake
  3. 3
      vcpkg.json

18
CMake/Dependencies.cmake

@ -167,7 +167,23 @@ if(WIN32 AND NOT UWP_LIB)
add_subdirectory(3rdParty/find_steam_game)
endif()
add_subdirectory(3rdParty/simpleini)
if(NOT DEFINED DEVILUTIONX_SYSTEM_SIMPLEINI)
find_package(simpleini QUIET)
if(simpleini_FOUND)
message("-- Found simpleini")
else()
message("-- Suitable system simpleini package not found, will use simpleini from source")
set(DEVILUTIONX_SYSTEM_SIMPLEINI OFF)
endif()
endif()
dependency_options("simpleini" DEVILUTIONX_SYSTEM_SIMPLEINI ON DEVILUTIONX_STATIC_SIMPLEINI)
if(DEVILUTIONX_SYSTEM_SIMPLEINI)
if(NOT simpleini_FOUND)
find_package(simpleini REQUIRED)
endif()
else()
add_subdirectory(3rdParty/simpleini)
endif()
add_subdirectory(3rdParty/libmpq)

21
CMake/finders/Findsimpleini.cmake

@ -0,0 +1,21 @@
find_package(PkgConfig)
pkg_check_modules(PC_simpleini QUIET simpleini)
find_path(simpleini_INCLUDE_DIR SimpleIni.h
HINTS ${PC_simpleini_INCLUDEDIR} ${PC_simpleini_INCLUDE_DIRS})
find_library(simpleini_LIBRARY simpleini
HINTS ${PC_simpleini_LIBDIR} ${PC_simpleini_LIBRARY_DIRS})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(simpleini DEFAULT_MSG
simpleini_INCLUDE_DIR simpleini_LIBRARY)
if(simpleini_FOUND)
add_library(simpleini INTERFACE)
target_include_directories(simpleini INTERFACE ${simpleini_INCLUDE_DIR})
target_link_libraries(simpleini INTERFACE ${simpleini_LIBRARY})
mark_as_advanced(simpleini_INCLUDE_DIR simpleini_LIBRARY)
set(simpleini_LIBRARIES ${simpleini_LIBRARY})
set(simpleini_INCLUDE_DIRS ${simpleini_INCLUDE_DIR})
endif()

3
vcpkg.json

@ -3,7 +3,8 @@
"version-string": "1.3.0",
"dependencies": [
"fmt",
"bzip2"
"bzip2",
"simpleini"
],
"features": {
"sdl1": {

Loading…
Cancel
Save