Skip to content

Commit a34ea2b

Browse files
authored
Merge pull request #19 from habecker/fix/linux-compiling
fix: Tons of changes for linux compiling
2 parents 6adedab + 0647333 commit a34ea2b

File tree

16 files changed

+1820
-1507
lines changed

16 files changed

+1820
-1507
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ test/
2020
*.pyc
2121
gamemodes/reloadable-gamemode/
2222
gamemodes/remote-client/
23-
gamemodes/remote-server/
23+
gamemodes/remote-server/
24+
server/

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@ def OnPlayerConnect(playerid):
2525
As you can see, all referenced return values are removed and instead the method returns either a value or a tuple.
2626
The corresponding python gamemode has to be saved as `gamemode.py` in a `python/` subfolder of your server directory.
2727

28+
# Using
29+
Make sure, that you installed the 32-bit Python 3.5m version on your server!
30+
2831
# Compiling
2932
If the uploaded binaries don't suite your needs, you might have to compile the project on your own.
3033
You can also create an issue, so I can compile it for your system, just mention your system architecture.
3134

3235
So, if you want to compile it on your own, note the following things.
3336
- You read the [SAMPGDK tutorial](https://github.com/Zeex/sampgdk/wiki/Setting-up-GDK-with-CMake).
34-
- Python 3.6 is installed on your computer
37+
- Python (3.5 Linux)/(3.6 Windows) (32 bit version!) is installed on your computer
3538
- You copied the sampsdk and sampgdk files into the src folder, as defined in CMakeLists.txt
3639

3740
Use cmake to create a project and then compile it as you're used to it.

src/CMakeLists.txt

Lines changed: 60 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,60 @@
1-
project(PySAMP)
2-
3-
add_compile_options(-std=c++11)
4-
5-
6-
cmake_minimum_required(VERSION 2.8)
7-
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
8-
9-
find_package ( PythonInterp 3.4.2)
10-
find_package ( PythonLibs 3.4.2)
11-
12-
include(AMXConfig)
13-
include(AddSAMPPlugin)
14-
15-
include_directories(
16-
${CMAKE_CURRENT_SOURCE_DIR}
17-
${CMAKE_CURRENT_SOURCE_DIR}/amx
18-
${CMAKE_CURRENT_SOURCE_DIR}/bindings
19-
${CMAKE_CURRENT_SOURCE_DIR}/pysamp
20-
${PYTHON_INCLUDE_DIR}
21-
)
22-
23-
add_definitions(-DSAMPGDK_AMALGAMATION)
24-
25-
link_libraries(${PYTHON_LIBRARIES})
26-
27-
add_samp_plugin(pySAMP
28-
amxplugin.cpp
29-
main.h
30-
main.cpp
31-
main.def
32-
sampgdk.c
33-
sampgdk.h
34-
pysamp/pysamp.cpp
35-
pysamp/pysamp.h
36-
pysamp/pygamemode.cpp
37-
pysamp/pygamemode.h
38-
bindings/callbacks.h
39-
bindings/samp.h
40-
bindings/const.h
41-
bindings/const.cpp
42-
test/callbackstest.h
43-
test/callbackstest.cpp
44-
)
45-
46-
find_package(Doxygen)
47-
if(DOXYGEN_FOUND)
48-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
49-
add_custom_target(doc
50-
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
51-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
52-
COMMENT "Generating API documentation with Doxygen" VERBATIM
53-
)
54-
endif(DOXYGEN_FOUND)
1+
project(PySAMP)
2+
3+
add_compile_options(-std=c++11)
4+
5+
6+
cmake_minimum_required(VERSION 2.8)
7+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
8+
9+
#find_package (Python3 COMPONENTS Interpreter Development)
10+
11+
find_package (PythonInterp 3.5.3)
12+
find_package (PythonLibs 3.5.3)
13+
14+
include(AMXConfig)
15+
include(AddSAMPPlugin)
16+
17+
include_directories(
18+
${CMAKE_CURRENT_SOURCE_DIR}
19+
${CMAKE_CURRENT_SOURCE_DIR}/amx
20+
${CMAKE_CURRENT_SOURCE_DIR}/bindings
21+
${CMAKE_CURRENT_SOURCE_DIR}/pysamp
22+
${PYTHON_INCLUDE_DIR}
23+
)
24+
25+
message(STATUS "PYTHON_LIBRARY = ${PYTHON_LIBRARY}")
26+
message(STATUS "PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}")
27+
message(STATUS "PYTHON_INCLUDE_DIR = ${PYTHON_INCLUDE_DIR}")
28+
29+
add_definitions(-DSAMPGDK_AMALGAMATION)
30+
31+
link_libraries(${PYTHON_LIBRARIES})
32+
33+
add_samp_plugin(pySAMP
34+
amxplugin.cpp
35+
main.h
36+
main.cpp
37+
main.def
38+
sampgdk.c
39+
sampgdk.h
40+
pysamp/pysamp.cpp
41+
pysamp/pysamp.h
42+
pysamp/pygamemode.cpp
43+
pysamp/pygamemode.h
44+
bindings/callbacks.h
45+
bindings/samp.h
46+
bindings/const.h
47+
bindings/const.cpp
48+
test/callbackstest.h
49+
test/callbackstest.cpp
50+
)
51+
52+
find_package(Doxygen)
53+
if(DOXYGEN_FOUND)
54+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
55+
add_custom_target(doc
56+
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
57+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
58+
COMMENT "Generating API documentation with Doxygen" VERBATIM
59+
)
60+
endif(DOXYGEN_FOUND)

src/Doxyfile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
OUTPUT_DIRECTORY = doc/
2-
OUTPUT_LANGUAGE = English
1+
OUTPUT_DIRECTORY = doc/
2+
OUTPUT_LANGUAGE = English
33
EXTRACT_ALL = YES

0 commit comments

Comments
 (0)