Fix Visual Studio solution generation with CMake
authorevpobr <evpobr@gmail.com>
Sat, 11 May 2019 08:55:33 +0000 (13:55 +0500)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Sat, 11 May 2019 23:00:07 +0000 (09:00 +1000)
Rename flac application target to flacapp to avoid name collision with FLAC library target.

Closes #101.

src/flac/CMakeLists.txt

index 9790357..ea4f687 100644 (file)
@@ -1,7 +1,7 @@
 check_include_file("sys/ioctl.h" HAVE_SYS_IOCTL_H)
 check_include_file("termios.h" HAVE_TERMIOS_H)
 
-add_executable(flac
+add_executable(flacapp
     analyze.c
     decode.c
     encode.c
@@ -10,14 +10,15 @@ add_executable(flac
     local_string_utils.c
     utils.c
     vorbiscomment.c)
-target_link_libraries(flac
+set_property(TARGET flacapp PROPERTY RUNTIME_OUTPUT_NAME flac)
+target_link_libraries(flacapp
     FLAC
     getopt
     replaygain_synthesis
     utf8)
 if(TARGET win_utf8_io)
-    target_link_libraries(flac win_utf8_io)
+    target_link_libraries(flacapp win_utf8_io)
 endif()
 
-install(TARGETS flac EXPORT targets
+install(TARGETS flacapp EXPORT targets
     RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")