Skip to content

Commit 42bb20c

Browse files
committed
Initial version of module.
1 parent ab68906 commit 42bb20c

4 files changed

Lines changed: 537 additions & 0 deletions

File tree

.gitignore

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#binaries
2+
*.exe
3+
*.dll
4+
*.dylib
5+
*.so
6+
7+
#cmake
8+
/cmbuild/
9+
/build/
10+
/build32/
11+
/build64/
12+
/release/
13+
/release32/
14+
/release64/
15+
/debug/
16+
/debug32/
17+
/debug64/
18+
/builds/
19+
*.o.d
20+
*.ninja
21+
.ninja*
22+
.dirstamp
23+
24+
#xcode
25+
*.xcodeproj/
26+
27+
#other stuff (windows stuff, qt moc stuff, etc)
28+
Release_MD/
29+
Release/
30+
Debug/
31+
x64/
32+
ipch/
33+
GeneratedFiles/
34+
.moc/
35+
36+
/other/
37+
38+
#make stuff
39+
configure
40+
depcomp
41+
install-sh
42+
Makefile.in
43+
Makefile
44+
45+
#random useless file stuff
46+
*.dmg
47+
*.app
48+
.DS_Store
49+
.directory
50+
.hg
51+
.depend
52+
tags
53+
*.trace
54+
*.vsp
55+
*.psess
56+
*.swp
57+
*.dat
58+
*.clbin
59+
*.log
60+
*.tlog
61+
*.sdf
62+
*.opensdf
63+
*.xml
64+
*.ipch
65+
*.css
66+
*.xslt
67+
*.aps
68+
*.suo
69+
*.ncb
70+
*.user
71+
*.lo
72+
*.ilk
73+
*.la
74+
*.o
75+
*.obj
76+
*.pdb
77+
*.res
78+
*.manifest
79+
*.dep
80+
*.zip
81+
*.lnk
82+
*.chm
83+
*~
84+
.DS_Store
85+
*/.DS_Store
86+
*/**/.DS_Store

CMakeLists.txt

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
cmake_minimum_required (VERSION 2.8.12)
2+
project (obs-ghostscript)
3+
4+
if (OBSSourcePath OR DEFINED ENV{OBSSourcePath})
5+
# Set already
6+
else()
7+
set(OBSSourcePath "" CACHE PATH "Path to OBS source code (e.g., C:/Dev/obs-studio/libobs/)")
8+
message("OBSSourcePath is missing. Please set this variable to the location of the OBS source (e.g., C:/Dev/obs-studio/libobs/).")
9+
endif()
10+
11+
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
12+
set(_lib_suffix 64)
13+
else()
14+
set(_lib_suffix 32)
15+
endif()
16+
17+
find_path(OBS_LIB_DIR
18+
NAMES obs.dll obs.lib
19+
HINTS
20+
${OBSSourcePath}/../build/libobs/Release/
21+
${OBSSourcePath}/../build${_lib_suffix}/libobs/Release/
22+
${OBSSourcePath}/../build/libobs/Debug/
23+
${OBSSourcePath}/../build${_lib_suffix}/libobs/Debug/
24+
PATHS
25+
/usr/lib /usr/local/lib /opt/local/lib /sw/lib)
26+
27+
find_path(GHOSTSCRIPT_INCLUDE_DIR
28+
NAMES psi/iapi.h devices/gdevdsp.h
29+
HINTS ${GSSourcePath}
30+
PATHS
31+
/usr/include /usr/local/include /opt/local/include /sw/include)
32+
33+
find_path(GHOSTSCRIPT_LIB_DIR
34+
NAMES gsdll${_lib_suffix}.dll gsdll${_lib_suffix}.lib
35+
HINTS
36+
${GSLibraryPath}
37+
PATHS
38+
/usr/lib /usr/local/lib /opt/local/lib /sw/lib)
39+
40+
if (NOT GHOSTSCRIPT_INCLUDE_DIR OR NOT GHOSTSCRIPT_LIB_DIR)
41+
message("Ghostscript headers or libraries could not be found! Please ensure that Ghostscript is installed somewhere, and set the GSSourcePath and GSLibraryPath variables if necessary.")
42+
endif()
43+
44+
# Source
45+
file (GLOB SOURCES ${CMAKE_SOURCE_DIR}/src/*.c)
46+
file (GLOB HEADER_FILES ${CMAKE_SOURCE_DIR}/include/*.h)
47+
48+
include_directories (include)
49+
add_library (${PROJECT_NAME} SHARED
50+
${SOURCES}
51+
${HEADER_FILES}
52+
)
53+
54+
# libobs
55+
include_directories(${OBSSourcePath})
56+
add_library (libobs SHARED IMPORTED)
57+
set_property (TARGET libobs PROPERTY IMPORTED_LOCATION ${OBS_LIB_DIR}/obs.dll)
58+
set_property (TARGET libobs PROPERTY IMPORTED_IMPLIB ${OBS_LIB_DIR}/obs.lib)
59+
target_link_libraries (${PROJECT_NAME} libobs)
60+
61+
# Ghostscript
62+
include_directories(${GHOSTSCRIPT_INCLUDE_DIR})
63+
add_library (gsdll SHARED IMPORTED)
64+
set_property (TARGET gsdll PROPERTY IMPORTED_LOCATION ${OBS_LIB_DIR}/gsdll${_lib_suffix}.dll)
65+
set_property (TARGET gsdll PROPERTY IMPORTED_IMPLIB ${GHOSTSCRIPT_LIB_DIR}/gsdll${_lib_suffix}.lib)
66+
target_link_libraries (${PROJECT_NAME} gsdll)

data/locale/en-US.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
PdfSource="PDF Document (Ghostscript)"
2+
PdfSource.FileName="Source File"
3+
PdfSource.PageNumber="Page Number"

0 commit comments

Comments
 (0)