]> granicus.if.org Git - taglib/commitdiff
Win32 taglib-config.cmd support.
authorFestus Hagen <festushagen2002@yahoo.com>
Sat, 29 Sep 2012 01:41:45 +0000 (21:41 -0400)
committerFestus Hagen <festushagen2002@yahoo.com>
Sat, 29 Sep 2012 01:41:45 +0000 (21:41 -0400)
CMakeLists.txt [changed mode: 0644->0755]
taglib-config.cmd.cmake [new file with mode: 0755]

old mode 100644 (file)
new mode 100755 (executable)
index 20a1141..1f29e46
@@ -66,8 +66,15 @@ math(EXPR TAGLIB_SOVERSION_PATCH "${TAGLIB_SOVERSION_REVISION}")
 
 include(ConfigureChecks.cmake)
 
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib-config )
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/taglib-config DESTINATION ${BIN_INSTALL_DIR})
+if(NOT WIN32)
+  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib-config )
+  install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/taglib-config DESTINATION ${BIN_INSTALL_DIR})
+endif()
+
+if(WIN32)
+  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib-config.cmd.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib-config.cmd )
+  install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/taglib-config.cmd DESTINATION ${BIN_INSTALL_DIR})
+endif()
 
 if(NOT WIN32 AND NOT BUILD_FRAMEWORK)
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib.pc )
diff --git a/taglib-config.cmd.cmake b/taglib-config.cmd.cmake
new file mode 100755 (executable)
index 0000000..bef752e
--- /dev/null
@@ -0,0 +1,36 @@
+@echo off\r
+goto beginning\r
+  *\r
+  * It is what it is, you can do with it as you please.\r
+  *\r
+  * Just don't blame me if it teaches your computer to smoke!\r
+  *\r
+  *  -Enjoy\r
+  *  fh :)_~\r
+  *\r
+:beginning\r
+if /i "%1#" == "--libs#"    goto doit\r
+if /i "%1#" == "--cflags#"  goto doit\r
+if /i "%1#" == "--version#" goto doit\r
+if /i "%1#" == "--prefix#"  goto doit\r
+\r
+echo "usage: %0 [OPTIONS]"\r
+echo   [--libs]\r
+echo   [--cflags]\r
+echo   [--version]\r
+echo   [--prefix]\r
+goto theend\r
+\r
+  *\r
+  * NOTE: Windows does not assume libraries are prefixed with 'lib'.\r
+  * NOTE: If '-llibtag' is the last element, it is easily appended in the users installation/makefile process\r
+  *       to allow for static, shared or debug builds.\r
+  * It would be preferable if the top level CMakeLists.txt provided the library name during config. ??\r
+:doit\r
+if /i "%1#" == "--libs#"    echo -L${LIB_INSTALL_DIR} -llibtag\r
+if /i "%1#" == "--cflags#"  echo -I${INCLUDE_INSTALL_DIR}/taglib\r
+if /i "%1#" == "--version#" echo ${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}\r
+if /i "%1#" == "--prefix#"  echo ${CMAKE_INSTALL_PREFIX}\r
+\r
+:theend\r
+\r