rbdc 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bindings/ruby/rbdc/extconf.rb +57 -0
- data/bindings/ruby/rbdc/rbdc.c +304 -0
- data/dyncall/AUTHORS +4 -0
- data/dyncall/BUGS +3 -0
- data/dyncall/CMakeLists.txt +79 -0
- data/dyncall/ChangeLog +165 -0
- data/dyncall/LICENSE +15 -0
- data/dyncall/Makefile.M +15 -0
- data/dyncall/Makefile.embedded +71 -0
- data/dyncall/Makefile.generic +36 -0
- data/dyncall/Nmakefile +45 -0
- data/dyncall/README +92 -0
- data/dyncall/ToDo +114 -0
- data/dyncall/autovar/LICENSE.txt +15 -0
- data/dyncall/autovar/README.txt +69 -0
- data/dyncall/autovar/autovar_ABI.h +44 -0
- data/dyncall/autovar/autovar_ARCH.h +56 -0
- data/dyncall/autovar/autovar_CC.h +46 -0
- data/dyncall/autovar/autovar_OS.h +78 -0
- data/dyncall/autovar/autovar_OSFAMILY.h +39 -0
- data/dyncall/buildsys/cmake/Modules/FindDynCall.cmake +43 -0
- data/dyncall/buildsys/cmake/Modules/FindDynCallback.cmake +43 -0
- data/dyncall/buildsys/cmake/Modules/FindDynLoad.cmake +45 -0
- data/dyncall/buildsys/cmake/Modules/UseLATEX.cmake +811 -0
- data/dyncall/buildsys/dynmake/Makefile.base.M +82 -0
- data/dyncall/buildsys/dynmake/dynmake.bat +2 -0
- data/dyncall/buildsys/dynmake/dynmake.sh +4 -0
- data/dyncall/buildsys/lua/Makefile +10 -0
- data/dyncall/buildsys/lua/README.txt +4 -0
- data/dyncall/buildsys/lua/bootstrap.sh +34 -0
- data/dyncall/buildsys/lua/cleanup.sh +6 -0
- data/dyncall/buildsys/lua/mkfile +34 -0
- data/dyncall/buildsys/lua/setenv.sh +4 -0
- data/dyncall/buildsys/mk/app.mk +30 -0
- data/dyncall/buildsys/mk/dirs.mk +27 -0
- data/dyncall/buildsys/mk/epilog.mk +30 -0
- data/dyncall/buildsys/mk/lib.mk +23 -0
- data/dyncall/buildsys/mk/pcc.mk +60 -0
- data/dyncall/buildsys/mk/prolog.mk +35 -0
- data/dyncall/buildsys/nmake/common.nmake +61 -0
- data/dyncall/buildsys/nmake/epilog.nmake +28 -0
- data/dyncall/buildsys/nmake/prolog.nmake +76 -0
- data/dyncall/buildsys/nmake/tool_gcc.nmake +82 -0
- data/dyncall/buildsys/nmake/tool_msvc.nmake +67 -0
- data/dyncall/buildsys/scripts/batch-build-linux.sh +11 -0
- data/dyncall/buildsys/scripts/batch-build-minix.sh +11 -0
- data/dyncall/buildsys/scripts/batch-build-psp.sh +11 -0
- data/dyncall/buildsys/scripts/conf-nds.bat +41 -0
- data/dyncall/buildsys/scripts/setenv-cross-ios.sh +8 -0
- data/dyncall/buildsys/scripts/setenv-sdk-ios.sh +22 -0
- data/dyncall/buildsys/vs2005/dyncall/dyncall.vcproj +245 -0
- data/dyncall/buildsys/vs2005/test_plain/test_plain.vcproj +202 -0
- data/dyncall/buildsys/vs2005/vs2005.sln +29 -0
- data/dyncall/configure +152 -0
- data/dyncall/configure.bat +157 -0
- data/dyncall/configure.rc +234 -0
- data/dyncall/dynMakefile +4 -0
- data/dyncall/dyncall/CMakeLists.txt +53 -0
- data/dyncall/dyncall/DynCallConfig.cmake +3 -0
- data/dyncall/dyncall/Makefile.M +10 -0
- data/dyncall/dyncall/Makefile.embedded +20 -0
- data/dyncall/dyncall/Makefile.generic +16 -0
- data/dyncall/dyncall/Nmakefile +62 -0
- data/dyncall/dyncall/README-Developer.txt +45 -0
- data/dyncall/dyncall/README.txt +65 -0
- data/dyncall/dyncall/TODO +9 -0
- data/dyncall/dyncall/dynMakefile +4 -0
- data/dyncall/dyncall/dyncall.3 +189 -0
- data/dyncall/dyncall/dyncall.h +135 -0
- data/dyncall/dyncall/dyncall_alloc.h +40 -0
- data/dyncall/dyncall/dyncall_api.c +167 -0
- data/dyncall/dyncall/dyncall_call.S +72 -0
- data/dyncall/dyncall/dyncall_call_arm32_arm.S +80 -0
- data/dyncall/dyncall/dyncall_call_arm32_arm.h +61 -0
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +96 -0
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +44 -0
- data/dyncall/dyncall/dyncall_call_arm32_thumb.h +65 -0
- data/dyncall/dyncall/dyncall_call_arm32_thumb_apple.s +80 -0
- data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +121 -0
- data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +101 -0
- data/dyncall/dyncall/dyncall_call_mips.h +50 -0
- data/dyncall/dyncall/dyncall_call_mips_eabi.h +61 -0
- data/dyncall/dyncall/dyncall_call_mips_eabi_gas.s +115 -0
- data/dyncall/dyncall/dyncall_call_mips_gas.S +36 -0
- data/dyncall/dyncall/dyncall_call_mips_n32.h +67 -0
- data/dyncall/dyncall/dyncall_call_mips_n32_gas.s +192 -0
- data/dyncall/dyncall/dyncall_call_mips_n64.h +67 -0
- data/dyncall/dyncall/dyncall_call_mips_n64_gas.s +192 -0
- data/dyncall/dyncall/dyncall_call_mips_o32.h +70 -0
- data/dyncall/dyncall/dyncall_call_mips_o32_gas.s +109 -0
- data/dyncall/dyncall/dyncall_call_ppc32.S +266 -0
- data/dyncall/dyncall/dyncall_call_ppc32.h +62 -0
- data/dyncall/dyncall/dyncall_call_sparc.S +192 -0
- data/dyncall/dyncall/dyncall_call_sparc.h +42 -0
- data/dyncall/dyncall/dyncall_call_sparc64.S +361 -0
- data/dyncall/dyncall/dyncall_call_sparc64.h +42 -0
- data/dyncall/dyncall/dyncall_call_sparc_v9.S +220 -0
- data/dyncall/dyncall/dyncall_call_sparc_v9.h +42 -0
- data/dyncall/dyncall/dyncall_call_x64-att.S +146 -0
- data/dyncall/dyncall/dyncall_call_x64.S +149 -0
- data/dyncall/dyncall/dyncall_call_x64.h +63 -0
- data/dyncall/dyncall/dyncall_call_x64_generic_masm.asm +70 -0
- data/dyncall/dyncall/dyncall_call_x86.S +238 -0
- data/dyncall/dyncall/dyncall_call_x86.h +70 -0
- data/dyncall/dyncall/dyncall_call_x86_8a.s +127 -0
- data/dyncall/dyncall/dyncall_call_x86_generic_masm.asm +136 -0
- data/dyncall/dyncall/dyncall_call_x86_nasm.asm +234 -0
- data/dyncall/dyncall/dyncall_callf.c +112 -0
- data/dyncall/dyncall/dyncall_callf.h +52 -0
- data/dyncall/dyncall/dyncall_callvm.c +68 -0
- data/dyncall/dyncall/dyncall_callvm.h +88 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +250 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +59 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +204 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +63 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +271 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +59 -0
- data/dyncall/dyncall/dyncall_callvm_base.c +33 -0
- data/dyncall/dyncall/dyncall_callvm_mips.c +40 -0
- data/dyncall/dyncall/dyncall_callvm_mips.h +37 -0
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +181 -0
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +61 -0
- data/dyncall/dyncall/dyncall_callvm_mips_n32.c +268 -0
- data/dyncall/dyncall/dyncall_callvm_mips_n64.c +268 -0
- data/dyncall/dyncall/dyncall_callvm_mips_n64.h +53 -0
- data/dyncall/dyncall/dyncall_callvm_mips_o32.c +235 -0
- data/dyncall/dyncall/dyncall_callvm_mips_o32.h +45 -0
- data/dyncall/dyncall/dyncall_callvm_ppc32.c +372 -0
- data/dyncall/dyncall/dyncall_callvm_ppc32.h +61 -0
- data/dyncall/dyncall/dyncall_callvm_sparc.c +155 -0
- data/dyncall/dyncall/dyncall_callvm_sparc.h +44 -0
- data/dyncall/dyncall/dyncall_callvm_sparc64.c +239 -0
- data/dyncall/dyncall/dyncall_callvm_sparc64.h +47 -0
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +182 -0
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +45 -0
- data/dyncall/dyncall/dyncall_callvm_x64.c +228 -0
- data/dyncall/dyncall/dyncall_callvm_x64.h +111 -0
- data/dyncall/dyncall/dyncall_callvm_x86.c +667 -0
- data/dyncall/dyncall/dyncall_callvm_x86.h +75 -0
- data/dyncall/dyncall/dyncall_config.h +46 -0
- data/dyncall/dyncall/dyncall_macros.h +248 -0
- data/dyncall/dyncall/dyncall_signature.h +71 -0
- data/dyncall/dyncall/dyncall_struct.c +255 -0
- data/dyncall/dyncall/dyncall_struct.h +69 -0
- data/dyncall/dyncall/dyncall_types.h +74 -0
- data/dyncall/dyncall/dyncall_utils.h +38 -0
- data/dyncall/dyncall/dyncall_value.h +73 -0
- data/dyncall/dyncall/dyncall_vector.c +52 -0
- data/dyncall/dyncall/dyncall_vector.h +56 -0
- data/dyncall/dyncall/gen-masm.sh +7 -0
- data/dyncall/dyncall/mkfile +29 -0
- data/dyncall/dyncallback/CMakeLists.txt +55 -0
- data/dyncall/dyncallback/DynCallbackConfig.cmake +2 -0
- data/dyncall/dyncallback/Makefile.M +10 -0
- data/dyncall/dyncallback/Makefile.embedded +15 -0
- data/dyncall/dyncallback/Makefile.generic +20 -0
- data/dyncall/dyncallback/Nmakefile +71 -0
- data/dyncall/dyncallback/README.txt +9 -0
- data/dyncall/dyncallback/TODO +4 -0
- data/dyncall/dyncallback/dynMakefile +4 -0
- data/dyncall/dyncallback/dyncall_alloc_wx.c +35 -0
- data/dyncall/dyncallback/dyncall_alloc_wx.h +46 -0
- data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +40 -0
- data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +42 -0
- data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +42 -0
- data/dyncall/dyncallback/dyncall_args.c +45 -0
- data/dyncall/dyncallback/dyncall_args.h +65 -0
- data/dyncall/dyncallback/dyncall_args_arm32_arm.c +112 -0
- data/dyncall/dyncallback/dyncall_args_arm32_arm.h +40 -0
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +29 -0
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.h +32 -0
- data/dyncall/dyncallback/dyncall_args_mips.c +81 -0
- data/dyncall/dyncallback/dyncall_args_mips.h +41 -0
- data/dyncall/dyncallback/dyncall_args_ppc32.c +88 -0
- data/dyncall/dyncallback/dyncall_args_ppc32.h +41 -0
- data/dyncall/dyncallback/dyncall_args_sparc32.c +41 -0
- data/dyncall/dyncallback/dyncall_args_sparc32.h +37 -0
- data/dyncall/dyncallback/dyncall_args_sparc64.c +41 -0
- data/dyncall/dyncallback/dyncall_args_sparc64.h +37 -0
- data/dyncall/dyncallback/dyncall_args_x64.c +73 -0
- data/dyncall/dyncallback/dyncall_args_x64.h +44 -0
- data/dyncall/dyncallback/dyncall_args_x86.c +121 -0
- data/dyncall/dyncallback/dyncall_args_x86.h +58 -0
- data/dyncall/dyncallback/dyncall_callback.c +45 -0
- data/dyncall/dyncallback/dyncall_callback.h +51 -0
- data/dyncall/dyncallback/dyncall_callback_arch.S +71 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.c +63 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +45 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +73 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_gas.s +73 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb.c +29 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb.h +33 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_apple.s +32 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_gas.s +32 -0
- data/dyncall/dyncallback/dyncall_callback_mips.c +61 -0
- data/dyncall/dyncallback/dyncall_callback_mips.h +42 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.S +33 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.c +60 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.h +43 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +180 -0
- data/dyncall/dyncallback/dyncall_callback_sparc32.c +57 -0
- data/dyncall/dyncallback/dyncall_callback_sparc32.h +43 -0
- data/dyncall/dyncallback/dyncall_callback_sparc32.s +30 -0
- data/dyncall/dyncallback/dyncall_callback_sparc64.c +57 -0
- data/dyncall/dyncallback/dyncall_callback_sparc64.s +30 -0
- data/dyncall/dyncallback/dyncall_callback_x64.S +187 -0
- data/dyncall/dyncallback/dyncall_callback_x64.c +69 -0
- data/dyncall/dyncallback/dyncall_callback_x64.h +44 -0
- data/dyncall/dyncallback/dyncall_callback_x64_apple.s +122 -0
- data/dyncall/dyncallback/dyncall_callback_x64_gas.s +119 -0
- data/dyncall/dyncallback/dyncall_callback_x64_gas_w64.s +102 -0
- data/dyncall/dyncallback/dyncall_callback_x64_masm.asm +89 -0
- data/dyncall/dyncallback/dyncall_callback_x86.S +115 -0
- data/dyncall/dyncallback/dyncall_callback_x86.c +281 -0
- data/dyncall/dyncallback/dyncall_callback_x86.h +49 -0
- data/dyncall/dyncallback/dyncall_callback_x86_8a.s +100 -0
- data/dyncall/dyncallback/dyncall_callback_x86_masm.asm +74 -0
- data/dyncall/dyncallback/dyncall_thunk.c +47 -0
- data/dyncall/dyncallback/dyncall_thunk.h +84 -0
- data/dyncall/dyncallback/dyncall_thunk_arm32_arm.c +45 -0
- data/dyncall/dyncallback/dyncall_thunk_arm32_arm.h +40 -0
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +29 -0
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +35 -0
- data/dyncall/dyncallback/dyncall_thunk_mips.c +52 -0
- data/dyncall/dyncallback/dyncall_thunk_mips.h +37 -0
- data/dyncall/dyncallback/dyncall_thunk_ppc32.c +51 -0
- data/dyncall/dyncallback/dyncall_thunk_ppc32.h +40 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc32.c +32 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc32.h +36 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc64.c +32 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc64.h +36 -0
- data/dyncall/dyncallback/dyncall_thunk_x64.c +48 -0
- data/dyncall/dyncallback/dyncall_thunk_x64.h +39 -0
- data/dyncall/dyncallback/dyncall_thunk_x86.c +44 -0
- data/dyncall/dyncallback/dyncall_thunk_x86.h +39 -0
- data/dyncall/dyncallback/dyncallback.3 +134 -0
- data/dyncall/dyncallback/gen-masm.sh +8 -0
- data/dyncall/dyncallback/mkfile +29 -0
- data/dyncall/dynload/CMakeLists.txt +25 -0
- data/dyncall/dynload/DynLoadConfig.cmake +3 -0
- data/dyncall/dynload/Makefile.M +10 -0
- data/dyncall/dynload/Makefile.embedded +22 -0
- data/dyncall/dynload/Makefile.generic +18 -0
- data/dyncall/dynload/Nmakefile +57 -0
- data/dyncall/dynload/README.txt +113 -0
- data/dyncall/dynload/TODO +20 -0
- data/dyncall/dynload/dynMakefile +4 -0
- data/dyncall/dynload/dynload.3 +64 -0
- data/dyncall/dynload/dynload.c +38 -0
- data/dyncall/dynload/dynload.h +65 -0
- data/dyncall/dynload/dynload_alloc.h +40 -0
- data/dyncall/dynload/dynload_darwin.c +89 -0
- data/dyncall/dynload/dynload_syms.c +38 -0
- data/dyncall/dynload/dynload_syms_elf.c +214 -0
- data/dyncall/dynload/dynload_syms_mach-o.c +167 -0
- data/dyncall/dynload/dynload_syms_pe.c +109 -0
- data/dyncall/dynload/dynload_unix.c +57 -0
- data/dyncall/dynload/dynload_windows.c +59 -0
- data/dyncall/mkfile +36 -0
- data/dyncall/portasm/README.txt +42 -0
- data/dyncall/portasm/gen-masm.sh +3 -0
- data/dyncall/portasm/portasm-arm.S +36 -0
- data/dyncall/portasm/portasm-ppc.S +98 -0
- data/dyncall/portasm/portasm-x64-att.S +155 -0
- data/dyncall/portasm/portasm-x86.S +127 -0
- metadata +311 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
# - Try to find dyncall library
|
2
|
+
#
|
3
|
+
# The following variables will be defined:
|
4
|
+
#
|
5
|
+
# DYNCALL_FOUND
|
6
|
+
# DYNCALL_INCLUDE_DIRS
|
7
|
+
# DYNCALL_LIBRARIES
|
8
|
+
#
|
9
|
+
# ----------------------------------------------------------------------------
|
10
|
+
#
|
11
|
+
# Package: dyncall
|
12
|
+
# File: buildsys/cmake/Modules/CMakeLists.txt
|
13
|
+
# Description: CMake Module to find DynCall library
|
14
|
+
# License:
|
15
|
+
#
|
16
|
+
# Copyright (c) 2010,2011 Daniel Adler <dadler@uni-goettingen.de>
|
17
|
+
#
|
18
|
+
# Permission to use, copy, modify, and distribute this software for any
|
19
|
+
# purpose with or without fee is hereby granted, provided that the above
|
20
|
+
# copyright notice and this permission notice appear in all copies.
|
21
|
+
#
|
22
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
23
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
24
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
25
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
26
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
27
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
28
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
29
|
+
#
|
30
|
+
|
31
|
+
find_path(DYNCALL_INCLUDE_DIR NAMES dyncall.h)
|
32
|
+
find_library(DYNCALL_LIBRARY dyncall_s)
|
33
|
+
|
34
|
+
include(FindPackageHandleStandardArgs)
|
35
|
+
find_package_handle_standard_args(DynCall DEFAULT_MSG DYNCALL_LIBRARY DYNCALL_INCLUDE_DIR)
|
36
|
+
|
37
|
+
if(DYNCALL_FOUND)
|
38
|
+
set(DYNCALL_INCLUDE_DIRS ${DYNCALL_INCLUDE_DIR})
|
39
|
+
set(DYNCALL_LIBRARIES ${DYNCALL_LIBRARY})
|
40
|
+
endif(DYNCALL_FOUND)
|
41
|
+
|
42
|
+
mark_as_advanced(DYNCALL_INCLUDE_DIR DYNCALL_LIBRARY)
|
43
|
+
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# - Try to find DynLoad library
|
2
|
+
#
|
3
|
+
# The following variables will be defined:
|
4
|
+
#
|
5
|
+
# DYNCALLBACK_FOUND
|
6
|
+
# DYNCALLBACK_INCLUDE_DIRS
|
7
|
+
# DYNCALLBACK_LIBRARIES
|
8
|
+
#
|
9
|
+
# ----------------------------------------------------------------------------
|
10
|
+
#
|
11
|
+
# Package: dyncall
|
12
|
+
# File: buildsys/cmake/Modules/FindDynLoad.cmake
|
13
|
+
# Description: CMake Module to find dynload library
|
14
|
+
# License:
|
15
|
+
#
|
16
|
+
# Copyright (c) 2010,2011 Daniel Adler <dadler@uni-goettingen.de>
|
17
|
+
#
|
18
|
+
# Permission to use, copy, modify, and distribute this software for any
|
19
|
+
# purpose with or without fee is hereby granted, provided that the above
|
20
|
+
# copyright notice and this permission notice appear in all copies.
|
21
|
+
#
|
22
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
23
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
24
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
25
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
26
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
27
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
28
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
29
|
+
#
|
30
|
+
|
31
|
+
find_path(DYNCALLBACK_INCLUDE_DIR NAMES dyncall_callback.h)
|
32
|
+
find_library(DYNCALLBACK_LIBRARY dyncallback_s)
|
33
|
+
|
34
|
+
include(FindPackageHandleStandardArgs)
|
35
|
+
find_package_handle_standard_args(DynCallback DEFAULT_MSG DYNCALLBACK_LIBRARY DYNCALLBACK_INCLUDE_DIR)
|
36
|
+
|
37
|
+
if(DYNCALLBACK_FOUND)
|
38
|
+
set(DYNCALLBACK_INCLUDE_DIRS ${DYNCALLBACK_INCLUDE_DIR})
|
39
|
+
set(DYNCALLBACK_LIBRARIES ${DYNCALLBACK_LIBRARY})
|
40
|
+
endif(DYNCALLBACK_FOUND)
|
41
|
+
|
42
|
+
mark_as_advanced(DYNCALLBACK_INCLUDE_DIR DYNCALLBACK_LIBRARY)
|
43
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# - Try to find dynload library
|
2
|
+
#
|
3
|
+
# The following variables will be defined:
|
4
|
+
#
|
5
|
+
# DYNLOAD_FOUND
|
6
|
+
# DYNLOAD_INCLUDE_DIRS
|
7
|
+
# DYNLOAD_LIBRARIES
|
8
|
+
#
|
9
|
+
# ----------------------------------------------------------------------------
|
10
|
+
#
|
11
|
+
# Package: dyncall
|
12
|
+
# File: buildsys/cmake/Modules/FindDynLoad.cmake
|
13
|
+
# Description: CMake Module to find dynload library
|
14
|
+
# License:
|
15
|
+
#
|
16
|
+
# Copyright (c) 2010-2011 Daniel Adler <dadler@uni-goettingen.de>
|
17
|
+
#
|
18
|
+
# Permission to use, copy, modify, and distribute this software for any
|
19
|
+
# purpose with or without fee is hereby granted, provided that the above
|
20
|
+
# copyright notice and this permission notice appear in all copies.
|
21
|
+
#
|
22
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
23
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
24
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
25
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
26
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
27
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
28
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
29
|
+
#
|
30
|
+
|
31
|
+
find_path(DYNLOAD_INCLUDE_DIR NAMES dynload.h)
|
32
|
+
find_library(DYNLOAD_LIBRARY dynload_s)
|
33
|
+
|
34
|
+
mark_as_advanced(DYNLOAD_INCLUDE_DIR DYNLOAD_LIBRARY)
|
35
|
+
|
36
|
+
include(FindPackageHandleStandardArgs)
|
37
|
+
find_package_handle_standard_args(DynLoad DEFAULT_MSG DYNLOAD_LIBRARY DYNLOAD_INCLUDE_DIR)
|
38
|
+
|
39
|
+
if(DYNLOAD_FOUND)
|
40
|
+
set(DYNLOAD_INCLUDE_DIRS ${DYNLOAD_INCLUDE_DIR})
|
41
|
+
set(DYNLOAD_LIBRARIES ${DYNLOAD_LIBRARY})
|
42
|
+
endif(DYNLOAD_FOUND)
|
43
|
+
|
44
|
+
mark_as_advanced(DYNLOAD_INCLUDE_DIR DYNLOAD_LIBRARY)
|
45
|
+
|
@@ -0,0 +1,811 @@
|
|
1
|
+
# File: UseLATEX.cmake
|
2
|
+
# CMAKE commands to actually use the LaTeX compiler
|
3
|
+
# Version: 1.7.2
|
4
|
+
# Author: Kenneth Moreland (kmorel at sandia dot gov)
|
5
|
+
#
|
6
|
+
# Copyright 2004 Sandia Corporation.
|
7
|
+
# Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
|
8
|
+
# license for use of this work by or on behalf of the
|
9
|
+
# U.S. Government. Redistribution and use in source and binary forms, with
|
10
|
+
# or without modification, are permitted provided that this Notice and any
|
11
|
+
# statement of authorship are reproduced on all copies.
|
12
|
+
#
|
13
|
+
# The following MACROS are defined:
|
14
|
+
#
|
15
|
+
# ADD_LATEX_DOCUMENT(<tex_file>
|
16
|
+
# [BIBFILES <bib_files>]
|
17
|
+
# [INPUTS <input_tex_files>]
|
18
|
+
# [IMAGE_DIRS] <image_directories>
|
19
|
+
# [IMAGES] <image_files>
|
20
|
+
# [CONFIGURE] <tex_files>
|
21
|
+
# [DEPENDS] <tex_files>
|
22
|
+
# [USE_INDEX] [USE_GLOSSARY]
|
23
|
+
# [DEFAULT_PDF] [MANGLE_TARGET_NAMES])
|
24
|
+
# Adds targets that compile <tex_file>. The latex output is placed
|
25
|
+
# in LATEX_OUTPUT_PATH or CMAKE_CURRENT_BINARY_DIR if the former is
|
26
|
+
# not set. The latex program is picky about where files are located,
|
27
|
+
# so all input files are copied from the source directory to the
|
28
|
+
# output directory. This includes the target tex file, any tex file
|
29
|
+
# listed with the INPUTS option, the bibliography files listed with
|
30
|
+
# the BIBFILES option, and any .cls, .bst, and .clo files found in
|
31
|
+
# the current source directory. Images found in the IMAGE_DIRS
|
32
|
+
# directories or listed by IMAGES are also copied to the output
|
33
|
+
# directory and coverted to an appropriate format if necessary. Any
|
34
|
+
# tex files also listed with the CONFIGURE option are also processed
|
35
|
+
# with the CMake CONFIGURE_FILE command (with the @ONLY flag. Any
|
36
|
+
# file listed in CONFIGURE but not the target tex file or listed with
|
37
|
+
# INPUTS has no effect. DEPENDS can be used to specify generated files
|
38
|
+
# that are needed to compile the latex target.
|
39
|
+
#
|
40
|
+
# The following targets are made:
|
41
|
+
# dvi: Makes <name>.dvi
|
42
|
+
# pdf: Makes <name>.pdf using pdflatex.
|
43
|
+
# safepdf: Makes <name>.pdf using ps2pdf. If using the default
|
44
|
+
# program arguments, this will ensure all fonts are
|
45
|
+
# embedded and no lossy compression has been performed
|
46
|
+
# on images.
|
47
|
+
# ps: Makes <name>.ps
|
48
|
+
# html: Makes <name>.html
|
49
|
+
# auxclean: Deletes <name>.aux. This is sometimes necessary
|
50
|
+
# if a LaTeX error occurs and writes a bad aux file.
|
51
|
+
#
|
52
|
+
# The dvi target is added to the ALL. That is, it will be the target
|
53
|
+
# built by default. If the DEFAULT_PDF argument is given, then the
|
54
|
+
# pdf target will be the default instead of dvi.
|
55
|
+
#
|
56
|
+
# If the argument MANGLE_TARGET_NAMES is given, then each of the
|
57
|
+
# target names above will be mangled with the <tex_file> name. This
|
58
|
+
# is to make the targets unique if ADD_LATEX_DOCUMENT is called for
|
59
|
+
# multiple documents. If the argument USE_INDEX is given, then
|
60
|
+
# commands to build an index are made. If the argument USE_GLOSSARY
|
61
|
+
# is given, then commands to build a glossary are made.
|
62
|
+
#
|
63
|
+
# History:
|
64
|
+
#
|
65
|
+
# 1.7.2 Use ps2pdf to convert eps to pdf to get around the problem with
|
66
|
+
# ImageMagick dropping the bounding box (thanks to Lukasz Lis).
|
67
|
+
#
|
68
|
+
# 1.7.1 Fixed some dependency issues.
|
69
|
+
#
|
70
|
+
# 1.7.0 Added DEPENDS options (thanks to Theodore Papadopoulo).
|
71
|
+
#
|
72
|
+
# 1.6.1 Ported the makeglossaries command to CMake and embedded the port
|
73
|
+
# into UseLATEX.cmake.
|
74
|
+
#
|
75
|
+
# 1.6.0 Allow the use of the makeglossaries command. Thanks to Oystein
|
76
|
+
# S. Haaland for the patch.
|
77
|
+
#
|
78
|
+
# 1.5.0 Allow any type of file in the INPUTS lists, not just tex file
|
79
|
+
# (suggested by Eric Noulard). As a consequence, the ability to
|
80
|
+
# specify tex files without the .tex extension is removed. The removed
|
81
|
+
# function is of dubious value anyway.
|
82
|
+
#
|
83
|
+
# When copying input files, skip over any file that exists in the
|
84
|
+
# binary directory but does not exist in the source directory with the
|
85
|
+
# assumption that these files were added by some other mechanism. I
|
86
|
+
# find this useful when creating large documents with multiple
|
87
|
+
# chapters that I want to build separately (for speed) as I work on
|
88
|
+
# them. I use the same boilerplate as the starting point for all
|
89
|
+
# and just copy it with different configurations. This was what the
|
90
|
+
# separate ADD_LATEX_DOCUMENT method was supposed to originally be for.
|
91
|
+
# Since its external use is pretty much deprecated, I removed that
|
92
|
+
# documentation.
|
93
|
+
#
|
94
|
+
# 1.4.1 Copy .sty files along with the other class and package files.
|
95
|
+
#
|
96
|
+
# 1.4.0 Added a MANGLE_TARGET_NAMES option that will mangle the target names.
|
97
|
+
#
|
98
|
+
# Fixed problem with copying bib files that became apparent with
|
99
|
+
# CMake 2.4.
|
100
|
+
#
|
101
|
+
# 1.3.0 Added a LATEX_OUTPUT_PATH variable that allows you or the user to
|
102
|
+
# specify where the built latex documents to go. This is especially
|
103
|
+
# handy if you want to do in-source builds.
|
104
|
+
#
|
105
|
+
# Removed the ADD_LATEX_IMAGES macro and absorbed the functionality
|
106
|
+
# into ADD_LATEX_DOCUMENT. The old interface was always kind of
|
107
|
+
# clunky anyway since you had to specify the image directory in both
|
108
|
+
# places. It also made supporting LATEX_OUTPUT_PATH problematic.
|
109
|
+
#
|
110
|
+
# Added support for jpeg files.
|
111
|
+
#
|
112
|
+
# 1.2.0 Changed the configuration options yet again. Removed the NO_CONFIGURE
|
113
|
+
# Replaced it with a CONFIGURE option that lists input files for which
|
114
|
+
# configure should be run.
|
115
|
+
#
|
116
|
+
# The pdf target no longer depends on the dvi target. This allows you
|
117
|
+
# to build latex documents that require pdflatex. Also added an option
|
118
|
+
# to make the pdf target the default one.
|
119
|
+
#
|
120
|
+
# 1.1.1 Added the NO_CONFIGURE option. The @ character can be used when
|
121
|
+
# specifying table column separators. If two or more are used, then
|
122
|
+
# will incorrectly substitute them.
|
123
|
+
#
|
124
|
+
# 1.1.0 Added ability include multiple bib files. Added ability to do copy
|
125
|
+
# sub-tex files for multipart tex files.
|
126
|
+
#
|
127
|
+
# 1.0.0 If both ps and pdf type images exist, just copy the one that
|
128
|
+
# matches the current render mode. Replaced a bunch of STRING
|
129
|
+
# commands with GET_FILENAME_COMPONENT commands that were made to do
|
130
|
+
# the desired function.
|
131
|
+
#
|
132
|
+
# 0.4.0 First version posted to CMake Wiki.
|
133
|
+
#
|
134
|
+
|
135
|
+
#############################################################################
|
136
|
+
# Find the location of myself while originally executing. If you do this
|
137
|
+
# inside of a macro, it will recode where the macro was invoked.
|
138
|
+
#############################################################################
|
139
|
+
SET(LATEX_USE_LATEX_LOCATION ${CMAKE_CURRENT_LIST_FILE}
|
140
|
+
CACHE INTERNAL "Location of UseLATEX.cmake file." FORCE
|
141
|
+
)
|
142
|
+
|
143
|
+
#############################################################################
|
144
|
+
# Generic helper macros
|
145
|
+
#############################################################################
|
146
|
+
|
147
|
+
# Helpful list macros.
|
148
|
+
MACRO(LATEX_CAR var)
|
149
|
+
SET(${var} ${ARGV1})
|
150
|
+
ENDMACRO(LATEX_CAR)
|
151
|
+
MACRO(LATEX_CDR var junk)
|
152
|
+
SET(${var} ${ARGN})
|
153
|
+
ENDMACRO(LATEX_CDR)
|
154
|
+
|
155
|
+
MACRO(LATEX_LIST_CONTAINS var value)
|
156
|
+
SET(${var})
|
157
|
+
FOREACH (value2 ${ARGN})
|
158
|
+
IF (${value} STREQUAL ${value2})
|
159
|
+
SET(${var} TRUE)
|
160
|
+
ENDIF (${value} STREQUAL ${value2})
|
161
|
+
ENDFOREACH (value2)
|
162
|
+
ENDMACRO(LATEX_LIST_CONTAINS)
|
163
|
+
|
164
|
+
# Parse macro arguments.
|
165
|
+
MACRO(LATEX_PARSE_ARGUMENTS prefix arg_names option_names)
|
166
|
+
SET(DEFAULT_ARGS)
|
167
|
+
FOREACH(arg_name ${arg_names})
|
168
|
+
SET(${prefix}_${arg_name})
|
169
|
+
ENDFOREACH(arg_name)
|
170
|
+
FOREACH(option ${option_names})
|
171
|
+
SET(${prefix}_${option})
|
172
|
+
ENDFOREACH(option)
|
173
|
+
|
174
|
+
SET(current_arg_name DEFAULT_ARGS)
|
175
|
+
SET(current_arg_list)
|
176
|
+
FOREACH(arg ${ARGN})
|
177
|
+
LATEX_LIST_CONTAINS(is_arg_name ${arg} ${arg_names})
|
178
|
+
IF (is_arg_name)
|
179
|
+
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
180
|
+
SET(current_arg_name ${arg})
|
181
|
+
SET(current_arg_list)
|
182
|
+
ELSE (is_arg_name)
|
183
|
+
LATEX_LIST_CONTAINS(is_option ${arg} ${option_names})
|
184
|
+
IF (is_option)
|
185
|
+
SET(${prefix}_${arg} TRUE)
|
186
|
+
ELSE (is_option)
|
187
|
+
SET(current_arg_list ${current_arg_list} ${arg})
|
188
|
+
ENDIF (is_option)
|
189
|
+
ENDIF (is_arg_name)
|
190
|
+
ENDFOREACH(arg)
|
191
|
+
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
192
|
+
ENDMACRO(LATEX_PARSE_ARGUMENTS)
|
193
|
+
|
194
|
+
# Match the contents of a file to a regular expression.
|
195
|
+
MACRO(LATEX_FILE_MATCH variable filename regexp default)
|
196
|
+
# The FILE STRINGS command would be a bit better, but it's not supported on
|
197
|
+
# older versions of CMake.
|
198
|
+
FILE(READ ${filename} file_contents)
|
199
|
+
STRING(REGEX MATCHALL "${regexp}"
|
200
|
+
${variable} ${file_contents}
|
201
|
+
)
|
202
|
+
IF (NOT ${variable})
|
203
|
+
SET(${variable} "${default}")
|
204
|
+
ENDIF (NOT ${variable})
|
205
|
+
ENDMACRO(LATEX_FILE_MATCH)
|
206
|
+
|
207
|
+
#############################################################################
|
208
|
+
# Macros that perform processing during a LaTeX build.
|
209
|
+
#############################################################################
|
210
|
+
MACRO(LATEX_MAKEGLOSSARIES)
|
211
|
+
MESSAGE("**************************** In makeglossaries")
|
212
|
+
IF (NOT LATEX_TARGET)
|
213
|
+
MESSAGE(SEND_ERROR "Need to define LATEX_TARGET")
|
214
|
+
ENDIF (NOT LATEX_TARGET)
|
215
|
+
|
216
|
+
IF (NOT MAKEINDEX_COMPILER)
|
217
|
+
MESSAGE(SEND_ERROR "Need to define MAKEINDEX_COMPILER")
|
218
|
+
ENDIF (NOT MAKEINDEX_COMPILER)
|
219
|
+
|
220
|
+
SET(aux_file ${LATEX_TARGET}.aux)
|
221
|
+
|
222
|
+
IF (NOT EXISTS ${aux_file})
|
223
|
+
MESSAGE(SEND_ERROR "${aux_file} does not exist. Run latex on your target file.")
|
224
|
+
ENDIF (NOT EXISTS ${aux_file})
|
225
|
+
|
226
|
+
LATEX_FILE_MATCH(newglossary_lines ${aux_file}
|
227
|
+
"@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}"
|
228
|
+
"@newglossary{main}{glg}{gls}{glo}"
|
229
|
+
)
|
230
|
+
|
231
|
+
LATEX_FILE_MATCH(istfile_line ${aux_file}
|
232
|
+
"@istfilename[ \t]*{([^}]*)}"
|
233
|
+
"@istfilename{${LATEX_TARGET}.ist}"
|
234
|
+
)
|
235
|
+
STRING(REGEX REPLACE "@istfilename[ \t]*{([^}]*)}" "\\1"
|
236
|
+
istfile ${istfile_line}
|
237
|
+
)
|
238
|
+
|
239
|
+
FOREACH(newglossary ${newglossary_lines})
|
240
|
+
STRING(REGEX REPLACE
|
241
|
+
"@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}"
|
242
|
+
"\\1" glossary_name ${newglossary}
|
243
|
+
)
|
244
|
+
STRING(REGEX REPLACE
|
245
|
+
"@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}"
|
246
|
+
"${LATEX_TARGET}.\\2" glossary_log ${newglossary}
|
247
|
+
)
|
248
|
+
STRING(REGEX REPLACE
|
249
|
+
"@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}"
|
250
|
+
"${LATEX_TARGET}.\\3" glossary_out ${newglossary}
|
251
|
+
)
|
252
|
+
STRING(REGEX REPLACE
|
253
|
+
"@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}"
|
254
|
+
"${LATEX_TARGET}.\\4" glossary_in ${newglossary}
|
255
|
+
)
|
256
|
+
MESSAGE("${MAKEINDEX_COMPILER} ${MAKEGLOSSARIES_COMPILER_FLAGS} -s ${istfile} -t ${glossary_log} -o ${glossary_out} ${glossary_in}")
|
257
|
+
EXEC_PROGRAM(${MAKEINDEX_COMPILER} ARGS ${MAKEGLOSSARIES_COMPILER_FLAGS}
|
258
|
+
-s ${istfile} -t ${glossary_log} -o ${glossary_out} ${glossary_in}
|
259
|
+
)
|
260
|
+
ENDFOREACH(newglossary)
|
261
|
+
ENDMACRO(LATEX_MAKEGLOSSARIES)
|
262
|
+
|
263
|
+
#############################################################################
|
264
|
+
# Helper macros for establishing LaTeX build.
|
265
|
+
#############################################################################
|
266
|
+
|
267
|
+
MACRO(LATEX_NEEDIT VAR NAME)
|
268
|
+
IF (NOT ${VAR})
|
269
|
+
MESSAGE(SEND_ERROR "I need the ${NAME} command.")
|
270
|
+
ENDIF(NOT ${VAR})
|
271
|
+
ENDMACRO(LATEX_NEEDIT)
|
272
|
+
|
273
|
+
MACRO(LATEX_WANTIT VAR NAME)
|
274
|
+
IF (NOT ${VAR})
|
275
|
+
MESSAGE(STATUS "I could not find the ${NAME} command.")
|
276
|
+
ENDIF(NOT ${VAR})
|
277
|
+
ENDMACRO(LATEX_WANTIT)
|
278
|
+
|
279
|
+
MACRO(LATEX_SETUP_VARIABLES)
|
280
|
+
SET(LATEX_OUTPUT_PATH "${LATEX_OUTPUT_PATH}"
|
281
|
+
CACHE PATH "If non empty, specifies the location to place LaTeX output."
|
282
|
+
)
|
283
|
+
|
284
|
+
FIND_PACKAGE(LATEX)
|
285
|
+
|
286
|
+
MARK_AS_ADVANCED(CLEAR
|
287
|
+
LATEX_COMPILER
|
288
|
+
PDFLATEX_COMPILER
|
289
|
+
BIBTEX_COMPILER
|
290
|
+
MAKEINDEX_COMPILER
|
291
|
+
DVIPS_CONVERTER
|
292
|
+
PS2PDF_CONVERTER
|
293
|
+
LATEX2HTML_CONVERTER
|
294
|
+
)
|
295
|
+
|
296
|
+
LATEX_NEEDIT(LATEX_COMPILER latex)
|
297
|
+
LATEX_WANTIT(PDFLATEX_COMPILER pdflatex)
|
298
|
+
LATEX_NEEDIT(BIBTEX_COMPILER bibtex)
|
299
|
+
LATEX_NEEDIT(MAKEINDEX_COMPILER makeindex)
|
300
|
+
LATEX_WANTIT(DVIPS_CONVERTER dvips)
|
301
|
+
LATEX_WANTIT(PS2PDF_CONVERTER ps2pdf)
|
302
|
+
LATEX_WANTIT(LATEX2HTML_CONVERTER latex2html)
|
303
|
+
|
304
|
+
SET(LATEX_COMPILER_FLAGS "-interaction=nonstopmode"
|
305
|
+
CACHE STRING "Flags passed to latex.")
|
306
|
+
SET(PDFLATEX_COMPILER_FLAGS ${LATEX_COMPILER_FLAGS}
|
307
|
+
CACHE STRING "Flags passed to pdflatex.")
|
308
|
+
SET(BIBTEX_COMPILER_FLAGS ""
|
309
|
+
CACHE STRING "Flags passed to bibtex.")
|
310
|
+
SET(MAKEINDEX_COMPILER_FLAGS ""
|
311
|
+
CACHE STRING "Flags passed to makeindex.")
|
312
|
+
SET(MAKEGLOSSARIES_COMPILER_FLAGS ""
|
313
|
+
CACHE STRING "Flags passed to makeglossaries.")
|
314
|
+
SET(DVIPS_CONVERTER_FLAGS "-Ppdf -G0 -t letter"
|
315
|
+
CACHE STRING "Flags passed to dvips.")
|
316
|
+
SET(PS2PDF_CONVERTER_FLAGS "-dMaxSubsetPct=100 -dCompatibilityLevel=1.3 -dSubsetFonts=true -dEmbedAllFonts=true -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode -dMonoImageFilter=/FlateEncode"
|
317
|
+
CACHE STRING "Flags passed to ps2pdf.")
|
318
|
+
SET(LATEX2HTML_CONVERTER_FLAGS ""
|
319
|
+
CACHE STRING "Flags passed to latex2html.")
|
320
|
+
MARK_AS_ADVANCED(
|
321
|
+
LATEX_COMPILER_FLAGS
|
322
|
+
PDFLATEX_COMPILER_FLAGS
|
323
|
+
BIBTEX_COMPILER_FLAGS
|
324
|
+
MAKEINDEX_COMPILER_FLAGS
|
325
|
+
MAKEGLOSSARIES_COMPILER_FLAGS
|
326
|
+
DVIPS_CONVERTER_FLAGS
|
327
|
+
PS2PDF_CONVERTER_FLAGS
|
328
|
+
LATEX2HTML_CONVERTER_FLAGS
|
329
|
+
)
|
330
|
+
SEPARATE_ARGUMENTS(LATEX_COMPILER_FLAGS)
|
331
|
+
SEPARATE_ARGUMENTS(PDFLATEX_COMPILER_FLAGS)
|
332
|
+
SEPARATE_ARGUMENTS(BIBTEX_COMPILER_FLAGS)
|
333
|
+
SEPARATE_ARGUMENTS(MAKEINDEX_COMPILER_FLAGS)
|
334
|
+
SEPARATE_ARGUMENTS(MAKEGLOSSARIES_COMPILER_FLAGS)
|
335
|
+
SEPARATE_ARGUMENTS(DVIPS_CONVERTER_FLAGS)
|
336
|
+
SEPARATE_ARGUMENTS(PS2PDF_CONVERTER_FLAGS)
|
337
|
+
SEPARATE_ARGUMENTS(LATEX2HTML_CONVERTER_FLAGS)
|
338
|
+
|
339
|
+
FIND_PROGRAM(IMAGEMAGICK_CONVERT convert
|
340
|
+
DOC "The convert program that comes with ImageMagick (available at http://www.imagemagick.org)."
|
341
|
+
)
|
342
|
+
IF (NOT IMAGEMAGICK_CONVERT)
|
343
|
+
MESSAGE(SEND_ERROR "Could not find convert program. Please download ImageMagick from http://www.imagemagick.org and install.")
|
344
|
+
ENDIF (NOT IMAGEMAGICK_CONVERT)
|
345
|
+
|
346
|
+
OPTION(LATEX_SMALL_IMAGES
|
347
|
+
"If on, the raster images will be converted to 1/6 the original size. This is because papers usually require 600 dpi images whereas most monitors only require at most 96 dpi. Thus, smaller images make smaller files for web distributation and can make it faster to read dvi files."
|
348
|
+
OFF)
|
349
|
+
IF (LATEX_SMALL_IMAGES)
|
350
|
+
SET(LATEX_RASTER_SCALE 16)
|
351
|
+
SET(LATEX_OPPOSITE_RASTER_SCALE 100)
|
352
|
+
ELSE (LATEX_SMALL_IMAGES)
|
353
|
+
SET(LATEX_RASTER_SCALE 100)
|
354
|
+
SET(LATEX_OPPOSITE_RASTER_SCALE 16)
|
355
|
+
ENDIF (LATEX_SMALL_IMAGES)
|
356
|
+
|
357
|
+
# Just holds extensions for known image types. They should all be lower case.
|
358
|
+
SET(LATEX_DVI_VECTOR_IMAGE_EXTENSIONS .eps)
|
359
|
+
SET(LATEX_DVI_RASTER_IMAGE_EXTENSIONS)
|
360
|
+
SET(LATEX_DVI_IMAGE_EXTENSIONS
|
361
|
+
${LATEX_DVI_VECTOR_IMAGE_EXTENSIONS} ${LATEX_DVI_RASTER_IMAGE_EXTENSIONS})
|
362
|
+
SET(LATEX_PDF_VECTOR_IMAGE_EXTENSIONS .pdf)
|
363
|
+
SET(LATEX_PDF_RASTER_IMAGE_EXTENSIONS .png .jpeg .jpg)
|
364
|
+
SET(LATEX_PDF_IMAGE_EXTENSIONS
|
365
|
+
${LATEX_PDF_VECTOR_IMAGE_EXTENSIONS} ${LATEX_PDF_RASTER_IMAGE_EXTENSIONS})
|
366
|
+
SET(LATEX_IMAGE_EXTENSIONS
|
367
|
+
${LATEX_DVI_IMAGE_EXTENSIONS} ${LATEX_PDF_IMAGE_EXTENSIONS})
|
368
|
+
ENDMACRO(LATEX_SETUP_VARIABLES)
|
369
|
+
|
370
|
+
MACRO(LATEX_GET_OUTPUT_PATH var)
|
371
|
+
SET(${var})
|
372
|
+
IF (LATEX_OUTPUT_PATH)
|
373
|
+
IF ("${LATEX_OUTPUT_PATH}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
374
|
+
MESSAGE(SEND_ERROR "You cannot set LATEX_OUTPUT_PATH to the same directory that contains LaTeX input files.")
|
375
|
+
ELSE ("${LATEX_OUTPUT_PATH}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
376
|
+
SET(${var} "${LATEX_OUTPUT_PATH}")
|
377
|
+
ENDIF ("${LATEX_OUTPUT_PATH}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
378
|
+
ELSE (LATEX_OUTPUT_PATH)
|
379
|
+
IF ("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
380
|
+
MESSAGE(SEND_ERROR "LaTeX files must be built out of source or you must set LATEX_OUTPUT_PATH.")
|
381
|
+
ELSE ("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
382
|
+
SET(${var} "${CMAKE_CURRENT_BINARY_DIR}")
|
383
|
+
ENDIF ("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
384
|
+
ENDIF (LATEX_OUTPUT_PATH)
|
385
|
+
ENDMACRO(LATEX_GET_OUTPUT_PATH)
|
386
|
+
|
387
|
+
MACRO(LATEX_ADD_CONVERT_COMMAND output_path input_path output_extension
|
388
|
+
input_extension flags)
|
389
|
+
SET (converter ${IMAGEMAGICK_CONVERT})
|
390
|
+
SET (convert_flags "")
|
391
|
+
# ImageMagick has broken eps to pdf conversion
|
392
|
+
# use ps2pdf instead
|
393
|
+
IF (${input_extension} STREQUAL ".eps" AND ${output_extension} STREQUAL ".pdf")
|
394
|
+
IF (PS2PDF_CONVERTER)
|
395
|
+
SET (converter ${PS2PDF_CONVERTER})
|
396
|
+
SET (convert_flags "-dEPSCrop ${flags}")
|
397
|
+
ELSE (PS2PDF_CONVERTER)
|
398
|
+
MESSAGE(SEND_ERROR "Using postscript files with pdflatex requires ps2pdf for conversion.")
|
399
|
+
ENDIF (PS2PDF_CONVERTER)
|
400
|
+
ELSE (${input_extension} STREQUAL ".eps" AND ${output_extension} STREQUAL ".pdf")
|
401
|
+
SET (convert_flags ${flags})
|
402
|
+
ENDIF (${input_extension} STREQUAL ".eps" AND ${output_extension} STREQUAL ".pdf")
|
403
|
+
|
404
|
+
ADD_CUSTOM_COMMAND(OUTPUT ${output_path}
|
405
|
+
COMMAND ${converter}
|
406
|
+
ARGS ${convert_flags} ${input_path} ${output_path}
|
407
|
+
DEPENDS ${input_path}
|
408
|
+
)
|
409
|
+
ENDMACRO(LATEX_ADD_CONVERT_COMMAND)
|
410
|
+
|
411
|
+
# Makes custom commands to convert a file to a particular type.
|
412
|
+
MACRO(LATEX_CONVERT_IMAGE output_files input_file output_extension convert_flags
|
413
|
+
output_extensions other_files)
|
414
|
+
SET(input_dir ${CMAKE_CURRENT_SOURCE_DIR})
|
415
|
+
LATEX_GET_OUTPUT_PATH(output_dir)
|
416
|
+
|
417
|
+
GET_FILENAME_COMPONENT(extension "${input_file}" EXT)
|
418
|
+
|
419
|
+
STRING(REGEX REPLACE "\\.[^.]*\$" ${output_extension} output_file
|
420
|
+
"${input_file}")
|
421
|
+
|
422
|
+
LATEX_LIST_CONTAINS(is_type ${extension} ${output_extensions})
|
423
|
+
IF (is_type)
|
424
|
+
IF (convert_flags)
|
425
|
+
LATEX_ADD_CONVERT_COMMAND(${output_dir}/${output_file}
|
426
|
+
${input_dir}/${input_file} ${output_extension} ${extension}
|
427
|
+
"${convert_flags}")
|
428
|
+
SET(${output_files} ${${output_files}} ${output_dir}/${output_file})
|
429
|
+
ELSE (convert_flags)
|
430
|
+
# As a shortcut, we can just copy the file.
|
431
|
+
ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${input_file}
|
432
|
+
COMMAND ${CMAKE_COMMAND}
|
433
|
+
ARGS -E copy ${input_dir}/${input_file} ${output_dir}/${input_file}
|
434
|
+
DEPENDS ${input_dir}/${input_file}
|
435
|
+
)
|
436
|
+
SET(${output_files} ${${output_files}} ${output_dir}/${input_file})
|
437
|
+
ENDIF (convert_flags)
|
438
|
+
ELSE (is_type)
|
439
|
+
SET(do_convert TRUE)
|
440
|
+
# Check to see if there is another input file of the appropriate type.
|
441
|
+
FOREACH(valid_extension ${output_extensions})
|
442
|
+
STRING(REGEX REPLACE "\\.[^.]*\$" ${output_extension} try_file
|
443
|
+
"${input_file}")
|
444
|
+
LATEX_LIST_CONTAINS(has_native_file "${try_file}" ${other_files})
|
445
|
+
IF (has_native_file)
|
446
|
+
SET(do_convert FALSE)
|
447
|
+
ENDIF (has_native_file)
|
448
|
+
ENDFOREACH(valid_extension)
|
449
|
+
|
450
|
+
# If we still need to convert, do it.
|
451
|
+
IF (do_convert)
|
452
|
+
LATEX_ADD_CONVERT_COMMAND(${output_dir}/${output_file}
|
453
|
+
${input_dir}/${input_file} ${output_extension} ${extension}
|
454
|
+
"${convert_flags}")
|
455
|
+
SET(${output_files} ${${output_files}} ${output_dir}/${output_file})
|
456
|
+
ENDIF (do_convert)
|
457
|
+
ENDIF (is_type)
|
458
|
+
ENDMACRO(LATEX_CONVERT_IMAGE)
|
459
|
+
|
460
|
+
# Adds custom commands to process the given files for dvi and pdf builds.
|
461
|
+
# Adds the output files to the given variables (does not replace).
|
462
|
+
MACRO(LATEX_PROCESS_IMAGES dvi_outputs pdf_outputs)
|
463
|
+
LATEX_GET_OUTPUT_PATH(output_dir)
|
464
|
+
FOREACH(file ${ARGN})
|
465
|
+
IF (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
|
466
|
+
GET_FILENAME_COMPONENT(extension "${file}" EXT)
|
467
|
+
SET(convert_flags)
|
468
|
+
|
469
|
+
# Check to see if we need to downsample the image.
|
470
|
+
LATEX_LIST_CONTAINS(is_raster extension
|
471
|
+
${LATEX_DVI_RASTER_IMAGE_EXTENSIONS}
|
472
|
+
${LATEX_PDF_RASTER_IMAGE_EXTENSIONS})
|
473
|
+
IF (LATEX_SMALL_IMAGES)
|
474
|
+
IF (is_raster)
|
475
|
+
SET(convert_flags -resize ${LATEX_RASTER_SCALE}%)
|
476
|
+
ENDIF (is_raster)
|
477
|
+
ENDIF (LATEX_SMALL_IMAGES)
|
478
|
+
|
479
|
+
# Make sure the output directory exists.
|
480
|
+
GET_FILENAME_COMPONENT(path "${output_dir}/${file}" PATH)
|
481
|
+
MAKE_DIRECTORY("${path}")
|
482
|
+
|
483
|
+
# Do conversions for dvi.
|
484
|
+
LATEX_CONVERT_IMAGE(${dvi_outputs} "${file}" .eps "${convert_flags}"
|
485
|
+
"${LATEX_DVI_IMAGE_EXTENSIONS}" "${ARGN}")
|
486
|
+
|
487
|
+
# Do conversions for pdf.
|
488
|
+
IF (is_raster)
|
489
|
+
LATEX_CONVERT_IMAGE(${pdf_outputs} "${file}" .png "${convert_flags}"
|
490
|
+
"${LATEX_PDF_IMAGE_EXTENSIONS}" "${ARGN}")
|
491
|
+
ELSE (is_raster)
|
492
|
+
LATEX_CONVERT_IMAGE(${pdf_outputs} "${file}" .pdf "${convert_flags}"
|
493
|
+
"${LATEX_PDF_IMAGE_EXTENSIONS}" "${ARGN}")
|
494
|
+
ENDIF (is_raster)
|
495
|
+
ELSE (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
|
496
|
+
MESSAGE("Could not find file \"${CMAKE_CURRENT_SOURCE_DIR}/${file}\"")
|
497
|
+
ENDIF (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
|
498
|
+
ENDFOREACH(file)
|
499
|
+
ENDMACRO(LATEX_PROCESS_IMAGES)
|
500
|
+
|
501
|
+
MACRO(ADD_LATEX_IMAGES)
|
502
|
+
MESSAGE("The ADD_LATEX_IMAGES macro is deprecated. Image directories are specified with LATEX_ADD_DOCUMENT.")
|
503
|
+
ENDMACRO(ADD_LATEX_IMAGES)
|
504
|
+
|
505
|
+
MACRO(LATEX_COPY_GLOBBED_FILES pattern dest)
|
506
|
+
FILE(GLOB file_list ${pattern})
|
507
|
+
FOREACH(in_file ${file_list})
|
508
|
+
GET_FILENAME_COMPONENT(out_file ${in_file} NAME)
|
509
|
+
CONFIGURE_FILE(${in_file} ${dest}/${out_file} COPYONLY)
|
510
|
+
ENDFOREACH(in_file)
|
511
|
+
ENDMACRO(LATEX_COPY_GLOBBED_FILES)
|
512
|
+
|
513
|
+
MACRO(LATEX_COPY_INPUT_FILE file)
|
514
|
+
LATEX_GET_OUTPUT_PATH(output_dir)
|
515
|
+
|
516
|
+
IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file})
|
517
|
+
GET_FILENAME_COMPONENT(path ${file} PATH)
|
518
|
+
FILE(MAKE_DIRECTORY ${output_dir}/${path})
|
519
|
+
|
520
|
+
LATEX_LIST_CONTAINS(use_config ${file} ${LATEX_CONFIGURE})
|
521
|
+
IF (use_config)
|
522
|
+
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}
|
523
|
+
${output_dir}/${file}
|
524
|
+
@ONLY
|
525
|
+
)
|
526
|
+
ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${file}
|
527
|
+
COMMAND ${CMAKE_COMMAND}
|
528
|
+
ARGS ${CMAKE_BINARY_DIR}
|
529
|
+
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
|
530
|
+
)
|
531
|
+
ELSE (use_config)
|
532
|
+
ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${file}
|
533
|
+
COMMAND ${CMAKE_COMMAND}
|
534
|
+
ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${output_dir}/${file}
|
535
|
+
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
|
536
|
+
)
|
537
|
+
ENDIF (use_config)
|
538
|
+
ELSE (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file})
|
539
|
+
IF (EXISTS ${output_dir}/${file})
|
540
|
+
# Special case: output exists but input does not. Assume that it was
|
541
|
+
# created elsewhere and skip the input file copy.
|
542
|
+
ELSE (EXISTS ${output_dir}/${file})
|
543
|
+
MESSAGE("Could not find input file ${CMAKE_CURRENT_SOURCE_DIR}/${file}")
|
544
|
+
ENDIF (EXISTS ${output_dir}/${file})
|
545
|
+
ENDIF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file})
|
546
|
+
ENDMACRO(LATEX_COPY_INPUT_FILE)
|
547
|
+
|
548
|
+
#############################################################################
|
549
|
+
# Commands provided by the UseLATEX.cmake "package"
|
550
|
+
#############################################################################
|
551
|
+
|
552
|
+
MACRO(LATEX_USAGE command message)
|
553
|
+
MESSAGE(SEND_ERROR
|
554
|
+
"${message}\nUsage: ${command}(<tex_file>\n [BIBFILES <bib_file> <bib_file> ...]\n [INPUTS <tex_file> <tex_file> ...]\n [IMAGE_DIRS <directory1> <directory2> ...]\n [IMAGES <image_file1> <image_file2>\n [CONFIGURE <tex_file> <tex_file> ...]\n [DEPENDS <tex_file> <tex_file> ...]\n [USE_INDEX] [USE_GLOSSARY] [DEFAULT_PDF] [MANGLE_TARGET_NAMES])"
|
555
|
+
)
|
556
|
+
ENDMACRO(LATEX_USAGE command message)
|
557
|
+
|
558
|
+
# Parses arguments to ADD_LATEX_DOCUMENT and ADD_LATEX_TARGETS and sets the
|
559
|
+
# variables LATEX_TARGET, LATEX_IMAGE_DIR, LATEX_BIBFILES, LATEX_DEPENDS, and
|
560
|
+
# LATEX_INPUTS.
|
561
|
+
MACRO(PARSE_ADD_LATEX_ARGUMENTS command)
|
562
|
+
LATEX_PARSE_ARGUMENTS(
|
563
|
+
LATEX
|
564
|
+
"BIBFILES;INPUTS;IMAGE_DIRS;IMAGES;CONFIGURE;DEPENDS"
|
565
|
+
"USE_INDEX;USE_GLOSSARY;USE_GLOSSARIES;DEFAULT_PDF;MANGLE_TARGET_NAMES"
|
566
|
+
${ARGN}
|
567
|
+
)
|
568
|
+
|
569
|
+
# The first argument is the target latex file.
|
570
|
+
IF (LATEX_DEFAULT_ARGS)
|
571
|
+
LATEX_CAR(LATEX_MAIN_INPUT ${LATEX_DEFAULT_ARGS})
|
572
|
+
LATEX_CDR(LATEX_DEFAULT_ARGS ${LATEX_DEFAULT_ARGS})
|
573
|
+
GET_FILENAME_COMPONENT(LATEX_TARGET ${LATEX_MAIN_INPUT} NAME_WE)
|
574
|
+
ELSE (LATEX_DEFAULT_ARGS)
|
575
|
+
LATEX_USAGE(${command} "No tex file target given to ${command}.")
|
576
|
+
ENDIF (LATEX_DEFAULT_ARGS)
|
577
|
+
|
578
|
+
IF (LATEX_DEFAULT_ARGS)
|
579
|
+
LATEX_USAGE(${command} "Invalid or depricated arguments: ${LATEX_DEFAULT_ARGS}")
|
580
|
+
ENDIF (LATEX_DEFAULT_ARGS)
|
581
|
+
|
582
|
+
# Backward compatibility between 1.6.0 and 1.6.1.
|
583
|
+
IF (LATEX_USE_GLOSSARIES)
|
584
|
+
SET(LATEX_USE_GLOSSARY TRUE)
|
585
|
+
ENDIF (LATEX_USE_GLOSSARIES)
|
586
|
+
ENDMACRO(PARSE_ADD_LATEX_ARGUMENTS)
|
587
|
+
|
588
|
+
MACRO(ADD_LATEX_TARGETS)
|
589
|
+
LATEX_GET_OUTPUT_PATH(output_dir)
|
590
|
+
PARSE_ADD_LATEX_ARGUMENTS(ADD_LATEX_TARGETS ${ARGV})
|
591
|
+
|
592
|
+
# Set up target names.
|
593
|
+
IF (LATEX_MANGLE_TARGET_NAMES)
|
594
|
+
SET(dvi_target ${LATEX_TARGET}_dvi)
|
595
|
+
SET(pdf_target ${LATEX_TARGET}_pdf)
|
596
|
+
SET(ps_target ${LATEX_TARGET}_ps)
|
597
|
+
SET(safepdf_target ${LATEX_TARGET}_safepdf)
|
598
|
+
SET(html_target ${LATEX_TARGET}_html)
|
599
|
+
SET(auxclean_target ${LATEX_TARGET}_auxclean)
|
600
|
+
ELSE (LATEX_MANGLE_TARGET_NAMES)
|
601
|
+
SET(dvi_target dvi)
|
602
|
+
SET(pdf_target pdf)
|
603
|
+
SET(ps_target ps)
|
604
|
+
SET(safepdf_target safepdf)
|
605
|
+
SET(html_target html)
|
606
|
+
SET(auxclean_target auxclean)
|
607
|
+
ENDIF (LATEX_MANGLE_TARGET_NAMES)
|
608
|
+
|
609
|
+
# For each directory in LATEX_IMAGE_DIRS, glob all the image files and
|
610
|
+
# place them in LATEX_IMAGES.
|
611
|
+
FOREACH(dir ${LATEX_IMAGE_DIRS})
|
612
|
+
FOREACH(extension ${LATEX_IMAGE_EXTENSIONS})
|
613
|
+
FILE(GLOB files ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/*${extension})
|
614
|
+
FOREACH(file ${files})
|
615
|
+
GET_FILENAME_COMPONENT(filename ${file} NAME)
|
616
|
+
SET(LATEX_IMAGES ${LATEX_IMAGES} ${dir}/${filename})
|
617
|
+
ENDFOREACH(file)
|
618
|
+
ENDFOREACH(extension)
|
619
|
+
ENDFOREACH(dir)
|
620
|
+
|
621
|
+
SET(dvi_images)
|
622
|
+
SET(pdf_images)
|
623
|
+
LATEX_PROCESS_IMAGES(dvi_images pdf_images ${LATEX_IMAGES})
|
624
|
+
|
625
|
+
SET(make_dvi_command
|
626
|
+
${CMAKE_COMMAND} -E chdir ${output_dir}
|
627
|
+
${LATEX_COMPILER} ${LATEX_COMPILER_FLAGS} ${LATEX_MAIN_INPUT})
|
628
|
+
SET(make_pdf_command
|
629
|
+
${CMAKE_COMMAND} -E chdir ${output_dir}
|
630
|
+
${PDFLATEX_COMPILER} ${PDFLATEX_COMPILER_FLAGS} ${LATEX_MAIN_INPUT})
|
631
|
+
|
632
|
+
SET(make_dvi_depends ${LATEX_DEPENDS} ${dvi_images})
|
633
|
+
SET(make_pdf_depends ${LATEX_DEPENDS} ${pdf_images})
|
634
|
+
FOREACH(input ${LATEX_MAIN_INPUT} ${LATEX_INPUTS})
|
635
|
+
SET(make_dvi_depends ${make_dvi_depends} ${output_dir}/${input})
|
636
|
+
SET(make_pdf_depends ${make_pdf_depends} ${output_dir}/${input})
|
637
|
+
ENDFOREACH(input)
|
638
|
+
|
639
|
+
IF (LATEX_BIBFILES)
|
640
|
+
SET(make_dvi_command ${make_dvi_command}
|
641
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
642
|
+
${BIBTEX_COMPILER} ${BIBTEX_COMPILER_FLAGS} ${LATEX_TARGET})
|
643
|
+
SET(make_pdf_command ${make_pdf_command}
|
644
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
645
|
+
${BIBTEX_COMPILER} ${BIBTEX_COMPILER_FLAGS} ${LATEX_TARGET})
|
646
|
+
FOREACH (bibfile ${LATEX_BIBFILES})
|
647
|
+
SET(make_dvi_depends ${make_dvi_depends} ${output_dir}/${bibfile})
|
648
|
+
SET(make_pdf_depends ${make_pdf_depends} ${output_dir}/${bibfile})
|
649
|
+
ENDFOREACH (bibfile ${LATEX_BIBFILES})
|
650
|
+
ENDIF (LATEX_BIBFILES)
|
651
|
+
|
652
|
+
IF (LATEX_USE_INDEX)
|
653
|
+
SET(make_dvi_command ${make_dvi_command}
|
654
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
655
|
+
${LATEX_COMPILER} ${LATEX_COMPILER_FLAGS} ${LATEX_MAIN_INPUT}
|
656
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
657
|
+
${MAKEINDEX_COMPILER} ${MAKEINDEX_COMPILER_FLAGS} ${LATEX_TARGET}.idx)
|
658
|
+
SET(make_pdf_command ${make_pdf_command}
|
659
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
660
|
+
${PDFLATEX_COMPILER} ${PDFLATEX_COMPILER_FLAGS} ${LATEX_MAIN_INPUT}
|
661
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
662
|
+
${MAKEINDEX_COMPILER} ${MAKEINDEX_COMPILER_FLAGS} ${LATEX_TARGET}.idx)
|
663
|
+
ENDIF (LATEX_USE_INDEX)
|
664
|
+
|
665
|
+
IF (LATEX_USE_GLOSSARY)
|
666
|
+
SET(make_dvi_command ${make_dvi_command}
|
667
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
668
|
+
${LATEX_COMPILER} ${LATEX_COMPILER_FLAGS} ${LATEX_MAIN_INPUT}
|
669
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
670
|
+
${CMAKE_COMMAND}
|
671
|
+
-D LATEX_BUILD_COMMAND=makeglossaries
|
672
|
+
-D LATEX_TARGET=${LATEX_TARGET}
|
673
|
+
-D MAKEINDEX_COMPILER=${MAKEINDEX_COMPILER}
|
674
|
+
-D MAKEGLOSSARIES_COMPILER_FLAGS=${MAKEGLOSSARIES_COMPILER_FLAGS}
|
675
|
+
-P ${LATEX_USE_LATEX_LOCATION}
|
676
|
+
)
|
677
|
+
SET(make_pdf_command ${make_pdf_command}
|
678
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
679
|
+
${PDFLATEX_COMPILER} ${PDFLATEX_COMPILER_FLAGS} ${LATEX_MAIN_INPUT}
|
680
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
681
|
+
${CMAKE_COMMAND}
|
682
|
+
-D LATEX_BUILD_COMMAND=makeglossaries
|
683
|
+
-D LATEX_TARGET=${LATEX_TARGET}
|
684
|
+
-D MAKEINDEX_COMPILER=${MAKEINDEX_COMPILER}
|
685
|
+
-D MAKEGLOSSARIES_COMPILER_FLAGS=${MAKEGLOSSARIES_COMPILER_FLAGS}
|
686
|
+
-P ${LATEX_USE_LATEX_LOCATION}
|
687
|
+
)
|
688
|
+
ENDIF (LATEX_USE_GLOSSARY)
|
689
|
+
|
690
|
+
SET(make_dvi_command ${make_dvi_command}
|
691
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
692
|
+
${LATEX_COMPILER} ${LATEX_COMPILER_FLAGS} ${LATEX_MAIN_INPUT}
|
693
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
694
|
+
${LATEX_COMPILER} ${LATEX_COMPILER_FLAGS} ${LATEX_MAIN_INPUT})
|
695
|
+
SET(make_pdf_command ${make_pdf_command}
|
696
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
697
|
+
${PDFLATEX_COMPILER} ${PDFLATEX_COMPILER_FLAGS} ${LATEX_MAIN_INPUT}
|
698
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
699
|
+
${PDFLATEX_COMPILER} ${PDFLATEX_COMPILER_FLAGS} ${LATEX_MAIN_INPUT})
|
700
|
+
|
701
|
+
# Add commands and targets for building dvi outputs.
|
702
|
+
ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${LATEX_TARGET}.dvi
|
703
|
+
COMMAND ${make_dvi_command}
|
704
|
+
DEPENDS ${make_dvi_depends}
|
705
|
+
)
|
706
|
+
IF (LATEX_DEFAULT_PDF)
|
707
|
+
ADD_CUSTOM_TARGET(${dvi_target}
|
708
|
+
DEPENDS ${output_dir}/${LATEX_TARGET}.dvi)
|
709
|
+
ELSE (LATEX_DEFAULT_PDF)
|
710
|
+
ADD_CUSTOM_TARGET(${dvi_target} ALL
|
711
|
+
DEPENDS ${output_dir}/${LATEX_TARGET}.dvi)
|
712
|
+
ENDIF (LATEX_DEFAULT_PDF)
|
713
|
+
|
714
|
+
# Add commands and targets for building pdf outputs (with pdflatex).
|
715
|
+
IF (PDFLATEX_COMPILER)
|
716
|
+
ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${LATEX_TARGET}.pdf
|
717
|
+
COMMAND ${make_pdf_command}
|
718
|
+
DEPENDS ${make_pdf_depends}
|
719
|
+
)
|
720
|
+
IF (LATEX_DEFAULT_PDF)
|
721
|
+
ADD_CUSTOM_TARGET(${pdf_target} ALL
|
722
|
+
DEPENDS ${output_dir}/${LATEX_TARGET}.pdf)
|
723
|
+
ELSE (LATEX_DEFAULT_PDF)
|
724
|
+
ADD_CUSTOM_TARGET(${pdf_target}
|
725
|
+
DEPENDS ${output_dir}/${LATEX_TARGET}.pdf)
|
726
|
+
ENDIF (LATEX_DEFAULT_PDF)
|
727
|
+
ENDIF (PDFLATEX_COMPILER)
|
728
|
+
|
729
|
+
IF (DVIPS_CONVERTER)
|
730
|
+
ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${LATEX_TARGET}.ps
|
731
|
+
COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir}
|
732
|
+
${DVIPS_CONVERTER} ${DVIPS_CONVERTER_FLAGS} -o ${LATEX_TARGET}.ps ${LATEX_TARGET}.dvi
|
733
|
+
DEPENDS ${output_dir}/${LATEX_TARGET}.dvi)
|
734
|
+
ADD_CUSTOM_TARGET(${ps_target}
|
735
|
+
DEPENDS ${output_dir}/${LATEX_TARGET}.ps)
|
736
|
+
IF (PS2PDF_CONVERTER)
|
737
|
+
# Since both the pdf and safepdf targets have the same output, we
|
738
|
+
# cannot properly do the dependencies for both. When selecting safepdf,
|
739
|
+
# simply force a recompile every time.
|
740
|
+
ADD_CUSTOM_TARGET(${safepdf_target}
|
741
|
+
${CMAKE_COMMAND} -E chdir ${output_dir}
|
742
|
+
${PS2PDF_CONVERTER} ${PS2PDF_CONVERTER_FLAGS} ${LATEX_TARGET}.ps ${LATEX_TARGET}.pdf
|
743
|
+
)
|
744
|
+
ADD_DEPENDENCIES(${safepdf_target} ${ps_target})
|
745
|
+
ENDIF (PS2PDF_CONVERTER)
|
746
|
+
ENDIF (DVIPS_CONVERTER)
|
747
|
+
|
748
|
+
IF (LATEX2HTML_CONVERTER)
|
749
|
+
ADD_CUSTOM_TARGET(${html_target}
|
750
|
+
${CMAKE_COMMAND} -E chdir ${output_dir}
|
751
|
+
${LATEX2HTML_CONVERTER} ${LATEX2HTML_CONVERTER_FLAGS} ${LATEX_MAIN_INPUT}
|
752
|
+
)
|
753
|
+
ADD_DEPENDENCIES(${html_target} ${LATEX_MAIN_INPUT} ${LATEX_INPUTS})
|
754
|
+
ENDIF (LATEX2HTML_CONVERTER)
|
755
|
+
|
756
|
+
ADD_CUSTOM_TARGET(${auxclean_target}
|
757
|
+
${CMAKE_COMMAND} -E remove ${output_dir}/${LATEX_TARGET}.aux ${output_dir}/${LATEX_TARGET}.idx ${output_dir}/${LATEX_TARGET}.ind
|
758
|
+
)
|
759
|
+
ENDMACRO(ADD_LATEX_TARGETS)
|
760
|
+
|
761
|
+
MACRO(ADD_LATEX_DOCUMENT)
|
762
|
+
LATEX_GET_OUTPUT_PATH(output_dir)
|
763
|
+
IF (output_dir)
|
764
|
+
PARSE_ADD_LATEX_ARGUMENTS(ADD_LATEX_DOCUMENT ${ARGV})
|
765
|
+
|
766
|
+
LATEX_COPY_INPUT_FILE(${LATEX_MAIN_INPUT})
|
767
|
+
|
768
|
+
FOREACH (bib_file ${LATEX_BIBFILES})
|
769
|
+
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${bib_file}
|
770
|
+
${output_dir}/${bib_file}
|
771
|
+
COPYONLY)
|
772
|
+
ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${bib_file}
|
773
|
+
COMMAND ${CMAKE_COMMAND}
|
774
|
+
ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${bib_file} ${output_dir}/${bib_file}
|
775
|
+
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${bib_file}
|
776
|
+
)
|
777
|
+
ENDFOREACH (bib_file)
|
778
|
+
|
779
|
+
FOREACH (input ${LATEX_INPUTS})
|
780
|
+
LATEX_COPY_INPUT_FILE(${input})
|
781
|
+
ENDFOREACH(input)
|
782
|
+
|
783
|
+
LATEX_COPY_GLOBBED_FILES(${CMAKE_CURRENT_SOURCE_DIR}/*.cls ${output_dir})
|
784
|
+
LATEX_COPY_GLOBBED_FILES(${CMAKE_CURRENT_SOURCE_DIR}/*.bst ${output_dir})
|
785
|
+
LATEX_COPY_GLOBBED_FILES(${CMAKE_CURRENT_SOURCE_DIR}/*.clo ${output_dir})
|
786
|
+
LATEX_COPY_GLOBBED_FILES(${CMAKE_CURRENT_SOURCE_DIR}/*.sty ${output_dir})
|
787
|
+
|
788
|
+
ADD_LATEX_TARGETS(${ARGV})
|
789
|
+
ENDIF (output_dir)
|
790
|
+
ENDMACRO(ADD_LATEX_DOCUMENT)
|
791
|
+
|
792
|
+
#############################################################################
|
793
|
+
# Actually do stuff
|
794
|
+
#############################################################################
|
795
|
+
|
796
|
+
IF (LATEX_BUILD_COMMAND)
|
797
|
+
SET(command_handled)
|
798
|
+
|
799
|
+
IF ("${LATEX_BUILD_COMMAND}" STREQUAL makeglossaries)
|
800
|
+
LATEX_MAKEGLOSSARIES()
|
801
|
+
SET(command_handled TRUE)
|
802
|
+
ENDIF ("${LATEX_BUILD_COMMAND}" STREQUAL makeglossaries)
|
803
|
+
|
804
|
+
IF (NOT command_handled)
|
805
|
+
MESSAGE(SEND_ERROR "Unknown command: ${LATEX_BUILD_COMMAND}")
|
806
|
+
ENDIF (NOT command_handled)
|
807
|
+
|
808
|
+
ELSE (LATEX_BUILD_COMMAND)
|
809
|
+
# Must be part of the actual configure (included from CMakeLists.txt).
|
810
|
+
LATEX_SETUP_VARIABLES()
|
811
|
+
ENDIF (LATEX_BUILD_COMMAND)
|