Skip to content

please autodetect system libsimpleini-dev using pkg-config #46

@a-detiste

Description

@a-detiste

I can't say I'm really proud of this, but it get the release out of the door.

libsimpleini is crippled in Debian (not by me) and needs #define SI_NO_CONVERSION 1

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e328570..c3e29c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,12 +33,9 @@ endif()
 set(CMAKE_CXX_STANDARD 11)
 set(CMAKE_CXX_EXTENSIONS OFF)
 
-include(FetchContent)
-FetchContent_Declare(simpleini
-  GIT_REPOSITORY https://github.com/brofield/simpleini.git
-  GIT_TAG        09c21bda1dc1b578fa55f4a005d79b0afd481296 # v4.22
-  )
-FetchContent_MakeAvailable(simpleini)
+
+pkg_check_modules(simpleini REQUIRED simpleini)
+
 
 add_executable(${LIRI_EXECUTABLE_NAME} WIN32
   src/audio.cc
@@ -74,7 +71,7 @@ else()
   target_link_libraries(${LIRI_EXECUTABLE_NAME} PRIVATE ${SDL2_LINK_LIBRARIES})
 endif()
 
-target_link_libraries(${LIRI_EXECUTABLE_NAME} PRIVATE SimpleIni::SimpleIni)
+target_link_libraries(${LIRI_EXECUTABLE_NAME} PUBLIC simpleini)
 
 
 include(GNUInstallDirs)
diff --git a/src/config.h.in b/src/config.h.in
index 11fcd97..df98e3f 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -16,4 +16,10 @@
 /* Folder where data is installed */
 #define LIRI_DATA_DIR "@LIRI_DATA_DIR@"
 
+// I don't know how to use CMake
+// https://sources.debian.org/src/libsimpleini/4.20%2Bdfsg-1/debian/copyright/
+// libsimpleini is crippled in Debian:
+// Files-Excluded: ConvertUTF.*
+#define SI_NO_CONVERSION 1
+
 #endif // LIRI_CONFIG_H

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions