Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
a-detiste opened this issue Jan 22, 2024 · 3 comments
Open

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

a-detiste opened this issue Jan 22, 2024 · 3 comments

Comments

@a-detiste
Copy link

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
@petitlapin
Copy link
Owner

petitlapin commented Jan 22, 2024

Hi, I've had to do some changes to have simpleini working for flathub too.

Can you check if running cmake with -DUSE_SYSTEM_SIMPLEINI=ON works instead of this patch? (1f8ecfc to be more precise on what I did)

@a-detiste
Copy link
Author

Thanks, I've seen. It will be for another day.

#define SI_NO_CONVERSION 1 would help too.

@petitlapin
Copy link
Owner

I've just pushed it on the main branch (I've added it in the CMakeLists.txt but it should have the same effect).
If it does not work, I'll add it as you wrote within the config file directly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants