[vlc-commits] contrib: target for CMake toolchain configuration

Rémi Denis-Courmont git at videolan.org
Tue Jun 28 18:45:29 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jun 25 00:02:47 2011 +0300| [386df22d0b8f1ad3cb4e5f025cb05ba3428cc935] | committer: Rémi Denis-Courmont

contrib: target for CMake toolchain configuration

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=386df22d0b8f1ad3cb4e5f025cb05ba3428cc935
---

 contrib/src/main.mak |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 779a3a1..2dfad1d 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -176,6 +176,7 @@ install: $(PKGS:%=.%)
 
 mostlyclean:
 	-$(RM) $(ALL_PKGS:%=.%) $(ALL_PKGS:%=.sum-%)
+	-$(RM) toolchain.cmake
 	-$(RM) -R "$(PREFIX)"
 	-find -maxdepth 1 -type d '!' -name . -exec $(RM) -R '{}' ';'
 
@@ -190,4 +191,24 @@ package: install
 	(cd $(PREFIX)/.. && \
 	tar cvJ $(notdir $(PREFIX))/) > ../vlc-contrib-$(HOST)-$(DATE).tar.xz
 
+# CMake toolchain
+toolchain.cmake:
+	$(RM) $@
+ifdef HAVE_WIN32
+	echo "set(CMAKE_SYSTEM_NAME Windows)" >> $@
+	echo "set(CMAKE_RC_COMPILER $(HOST)-windres)" >> $@
+endif
+ifdef HAVE_MACOSX
+	echo "set(CMAKE_SYSTEM_NAME Darwin)" >> $@
+	echo "set(CMAKE_C_FLAGS $(CFLAGS))" >> $@
+	echo "set(CMAKE_CXX_FLAGS $(CFLAGS)" >> $@
+	echo "set(CMAKE_LD_FLAGS $(LDFLAGS))" >> $@
+endif
+	echo "set(CMAKE_C_COMPILER $(CC))" >> $@
+	echo "set(CMAKE_CXX_COMPILER $(CXX))" >> $@
+	echo "set(CMAKE_FIND_ROOT_PATH $(PREFIX))" >> $@
+	echo "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)" >> $@
+	echo "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)" >> $@
+	echo "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" >> $@
+
 .DELETE_ON_ERROR:



More information about the vlc-commits mailing list