1
1
include (AMXConfig)
2
2
include (AddSAMPPlugin)
3
3
4
+ # Create dummy target that does nothing
5
+ add_custom_target (spdloglib_deps)
6
+
4
7
set (SOURCE_FILES
5
8
Logprintf.cpp
6
9
Natives.cpp
@@ -29,11 +32,35 @@ target_compile_definitions(
29
32
BOOST_ALL_NO_LIB
30
33
)
31
34
35
+ # SPDLog Include file handling
36
+ set (SPDLOG_VERSION_FILE "${SAMP_LOG_BIN_ROOT} /Version.hpp" )
37
+ set (SPDLOG_INCLUDE_RAW "${SAMP_LOG_ROOT} /include/a_spdlog.inc.in" )
38
+ set (SPDLOG_INCLUDE_SRC "${SAMP_LOG_BIN_ROOT} /a_spdlog.inc" )
39
+ set (SPDLOG_INCLUDE_DST "${SAMP_LOG_BIN_OUT_DIR} /include/a_spdlog.inc" )
40
+
41
+ # Parse include file to out
42
+ add_custom_command (
43
+ TARGET spdloglib_deps POST_BUILD
44
+ COMMAND ${PYTHON_EXECUTABLE} ${SAMP_LOG_ROOT} /build /write_version.py ${SAMP_LOG_ROOT} ${SPDLOG_INCLUDE_RAW} ${SPDLOG_INCLUDE_SRC} ${SPDLOG_VERSION_FILE}
45
+ COMMENT "Generate version file" )
46
+
47
+ # Copy to output directorry (we also can write the file
48
+ # directly but then we need to create also the directory tree)
49
+ add_custom_command (
50
+ TARGET spdloglib_deps POST_BUILD
51
+ COMMAND ${CMAKE_COMMAND} -E copy
52
+ ${SPDLOG_INCLUDE_SRC}
53
+ ${SPDLOG_INCLUDE_DST}
54
+ COMMENT "Copy Pawno include file" )
55
+
56
+ # Deps
57
+ add_dependencies (spdloglib spdloglib_deps)
58
+
32
59
# Link
33
60
target_link_libraries (spdloglib boost-lib-filesystem sampsdk spdlog)
34
61
35
62
# Includes
36
- target_include_directories (spdloglib PRIVATE ${BOOST_LIB_PATH} )
63
+ target_include_directories (spdloglib PRIVATE ${BOOST_LIB_PATH} ${SAMP_LOG_BIN_ROOT} )
37
64
38
65
# Properties
39
66
set_target_properties (spdloglib PROPERTIES OUTPUT_NAME "spdlog" )
@@ -45,21 +72,3 @@ set_target_properties(spdloglib
45
72
LIBRARY_OUTPUT_DIRECTORY "${SAMP_LOG_BIN_OUT_DIR} "
46
73
RUNTIME_OUTPUT_DIRECTORY "${SAMP_LOG_BIN_OUT_DIR} "
47
74
)
48
-
49
- # SPDLog Include file handling
50
- set (SPDLOG_INCLUDE_RAW "${SAMP_LOG_ROOT} /include/a_spdlog.inc.in" )
51
- set (SPDLOG_INCLUDE_SRC "${SAMP_LOG_BIN_ROOT} /a_spdlog.inc" )
52
- set (SPDLOG_INCLUDE_DST "${SAMP_LOG_BIN_OUT_DIR} /include/a_spdlog.inc" )
53
-
54
- # Parse include file to out
55
- add_custom_command (
56
- TARGET spdloglib PRE_BUILD
57
- COMMAND ${PYTHON_EXECUTABLE} ${SAMP_LOG_ROOT} /build /write_version.py ${SAMP_LOG_ROOT} ${SPDLOG_INCLUDE_RAW} ${SPDLOG_INCLUDE_SRC} )
58
-
59
- # Copy to output directorry (we also can write the file
60
- # directly but then we need to create also the directory tree)
61
- add_custom_command (
62
- TARGET spdloglib POST_BUILD
63
- COMMAND ${CMAKE_COMMAND} -E copy
64
- ${SPDLOG_INCLUDE_SRC}
65
- ${SPDLOG_INCLUDE_DST} )
0 commit comments