Fixed dependencies on win_utf8_io
authorВиталий Кирсанов <krokoziabla@gmail.com>
Fri, 26 Apr 2019 20:38:10 +0000 (23:38 +0300)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Sat, 4 May 2019 01:41:48 +0000 (11:41 +1000)
src/CMakeLists.txt
src/flac/CMakeLists.txt
src/libFLAC++/CMakeLists.txt
src/libFLAC/CMakeLists.txt
src/libFLAC/ia32/CMakeLists.txt
src/metaflac/CMakeLists.txt
src/share/getopt/CMakeLists.txt
src/share/grabbag/CMakeLists.txt
src/utils/flacdiff/CMakeLists.txt

index da556d8..ba7a439 100644 (file)
@@ -9,9 +9,9 @@ add_subdirectory("libFLAC")
 if(BUILD_CXXLIBS)
     add_subdirectory("libFLAC++")
 endif()
+add_subdirectory("share")
 add_subdirectory("flac")
 add_subdirectory("metaflac")
-add_subdirectory("share")
 add_subdirectory("utils")
 
 if(WITH_XMMS)
index 240209d..c347c9a 100644 (file)
@@ -15,6 +15,9 @@ target_link_libraries(flac
     getopt
     replaygain_synthesis
     utf8)
+if(TARGET win_utf8_io)
+    target_link_libraries(flac win_utf8_io)
+endif()
 
 install(TARGETS flac EXPORT targets
     RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
index 71c9629..35d145c 100644 (file)
@@ -27,14 +27,14 @@ add_library(FLAC++-static STATIC ${SOURCES})
 target_compile_definitions(FLAC++-static PUBLIC FLAC__NO_DLL)
 target_include_directories(FLAC++-static INTERFACE
     "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
-    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>")
+    "$<INSTALL_INTERFACE:include>")
 target_link_libraries(FLAC++-static PUBLIC FLAC-static)
 
 add_library(FLAC++ SHARED ${SOURCES})
 target_compile_definitions(FLAC++ PRIVATE FLACPP_API_EXPORTS FLAC__USE_VISIBILITY_ATTR)
 target_include_directories(FLAC++ INTERFACE
     "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
-    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>")
+    "$<INSTALL_INTERFACE:include>")
 target_link_libraries(FLAC++ PRIVATE FLAC)
 set_target_properties(FLAC++ PROPERTIES
     CXX_VISIBILITY_PRESET hidden
index b6d59ae..16afbe7 100644 (file)
@@ -87,6 +87,9 @@ set(SOURCES
     $<$<BOOL:${OGG_FOUND}>:ogg_helper.c>
     $<$<BOOL:${OGG_FOUND}>:ogg_mapping.c>
     $<$<BOOL:${WIN32}>:windows_unicode_filenames.c>)
+if(TARGET FLAC-asm)
+    list(APPEND SOURCES $<TARGET_OBJECTS:FLAC-asm>)
+endif()
 
 include_directories("include")
 
@@ -94,14 +97,8 @@ add_library(FLAC-static STATIC ${SOURCES})
 target_compile_definitions(FLAC-static PUBLIC FLAC__NO_DLL)
 target_include_directories(FLAC-static INTERFACE
     "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
-    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>")
+    "$<INSTALL_INTERFACE:include>")
 target_link_libraries(FLAC-static PUBLIC $<$<BOOL:${HAVE_LROUND}>:m>)
-if(TARGET FLAC-asm)
-    target_link_libraries(FLAC-static PUBLIC FLAC-asm>)
-endif()
-if(TARGET win_utf8_io)
-    target_link_libraries(FLAC-static PUBLIC win_utf8_io>)
-endif()
 if(TARGET Ogg::Ogg-static)
     target_link_libraries(FLAC-static PUBLIC Ogg::Ogg-static)
 elseif(TARGET Ogg::Ogg)
@@ -112,14 +109,8 @@ add_library(FLAC SHARED ${SOURCES})
 target_compile_definitions(FLAC PRIVATE FLAC_API_EXPORTS FLAC__USE_VISIBILITY_ATTR)
 target_include_directories(FLAC INTERFACE
     "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
-    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>")
+    "$<INSTALL_INTERFACE:include>")
 target_link_libraries(FLAC PRIVATE $<$<BOOL:${HAVE_LROUND}>:m>)
-if(TARGET FLAC-asm)
-    target_link_libraries(FLAC PUBLIC FLAC-asm>)
-endif()
-if(TARGET win_utf8_io)
-    target_link_libraries(FLAC PUBLIC win_utf8_io>)
-endif()
 if(TARGET Ogg::Ogg)
     target_link_libraries(FLAC PUBLIC Ogg::Ogg)
 endif()
index 9435706..88dc69c 100644 (file)
@@ -12,7 +12,7 @@ else()
     add_compile_options(-dOBJ_FORMAT_elf)
 endif()
 
-add_library(FLAC-asm STATIC
+add_library(FLAC-asm OBJECT
     cpu_asm.nasm
     fixed_asm.nasm
     lpc_asm.nasm)
index 1895e9e..93f1ec6 100644 (file)
@@ -10,6 +10,9 @@ add_executable(metaflac
     usage.c
     utils.c)
 target_link_libraries(metaflac FLAC-static getopt utf8)
+if(TARGET win_utf8_io)
+    target_link_libraries(metaflac win_utf8_io)
+endif()
 
 install(TARGETS metaflac EXPORT targets
     RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
index 1e5f516..83b530e 100644 (file)
@@ -1,4 +1,11 @@
-check_include_file("libintl.h" HAVE_LIBINTL_H)
 check_include_file("string.h" HAVE_STRING_H)
 
+find_package(Intl)
+
 add_library(getopt STATIC getopt.c getopt1.c)
+
+if(Intl_FOUND)
+    target_include_directories(getopt PRIVATE ${Intl_INCLUDE_DIRS})
+    target_link_libraries(getopt PUBLIC ${Intl_LIBRARIES})
+    target_compile_definitions(getopt PRIVATE HAVE_LIBINTL_H)
+endif()
index a7ab166..8332fb4 100644 (file)
@@ -6,6 +6,9 @@ add_library(grabbag STATIC
     replaygain.c
     seektable.c
     snprintf.c)
-target_link_libraries(grabbag
+target_link_libraries(grabbag PUBLIC
     FLAC-static
     replaygain_analysis)
+if(TARGET win_utf8_io)
+    target_link_libraries(grabbag PUBLIC win_utf8_io)
+endif()
index 7f1421e..f212b0e 100644 (file)
@@ -1,2 +1,5 @@
 add_executable(flacdiff main.cpp)
 target_link_libraries(flacdiff FLAC++-static)
+if(TARGET win_utf8_io)
+    target_link_libraries(flacdiff win_utf8_io)
+endif()