1+ cmake_minimum_required (VERSION 3.0)
2+
3+
4+ file (GLOB_RECURSE INTERCEPT_PLUGIN_SOURCES *.h *.hpp *.c *.cpp)
5+ SOURCE_GROUP ("src" FILES ${INTERCEPT_PLUGIN_SOURCES} )
6+
7+ #If you want to split your source files into different directories you can do so here
8+
9+ #The SOURCE_GROUP string is the directory it will display as inside your visual studio.
10+ #Here is a example of a "utilities" subdirectory.
11+
12+ #file(GLOB INTERCEPT_plugin_utilities_SOURCES "utilities/*.cpp" "utilities/*.hpp" "utilities/*.h")
13+ #SOURCE_GROUP("src/utilities" FILES ${INTERCEPT_plugin_utilities_SOURCES})
14+
15+ #----Don't change anything below this line
16+
17+
18+ #include the Intercept headers from the submodule
19+ set (INTERCEPT_CLIENT_PATH "${CMAKE_SOURCE_DIR} /intercept/src/client" )
20+
21+ set (INTERCEPT_INCLUDE_PATH "${INTERCEPT_CLIENT_PATH} /headers" "${INTERCEPT_CLIENT_PATH} /headers/shared" "${INTERCEPT_CLIENT_PATH} /headers/client/" "${INTERCEPT_CLIENT_PATH} /headers/client/sqf" )
22+
23+ if (USE_64BIT_BUILD)
24+ set (INTERCEPT_PLUGIN_NAME "${CMAKE_PROJECT_NAME} _x64" )
25+ else ()
26+ set (INTERCEPT_PLUGIN_NAME "${CMAKE_PROJECT_NAME} " )
27+ endif ()
28+
29+ add_definitions (/DINTERCEPT_NO_THREAD_SAFETY)
30+
31+ if (USE_ENGINE_TYPES)
32+ add_definitions (/DINTERCEPT_SQF_STRTYPE_RSTRING)
33+ endif ()
34+
35+ file (GLOB INTERCEPT_HOST_SOURCES "${INTERCEPT_CLIENT_PATH} /intercept/client/*.cpp" "${INTERCEPT_CLIENT_PATH} /intercept/client/sqf/*.cpp" "${INTERCEPT_CLIENT_PATH} /intercept/shared/*.cpp" )
36+ SOURCE_GROUP ("intercept" FILES ${INTERCEPT_HOST_SOURCES} )
37+
38+ add_library ( ${INTERCEPT_PLUGIN_NAME} SHARED ${INTERCEPT_PLUGIN_SOURCES} ${INTERCEPT_HOST_SOURCES} )
39+
40+ include_directories (${CMAKE_CURRENT_SOURCE_DIR} ${INTERCEPT_INCLUDE_PATH} )
41+
42+ set_target_properties (${INTERCEPT_PLUGIN_NAME} PROPERTIES PREFIX "" )
43+ set_target_properties (${INTERCEPT_PLUGIN_NAME} PROPERTIES FOLDER "${CMAKE_PROJECT_NAME} " )
44+
45+ if (CMAKE_COMPILER_IS_GNUCXX)
46+ set (CMAKE_CXX_FLAGS "-std=c++1z -O2 -s -fPIC -fpermissive -static-libgcc -static-libstdc++" )#-march=i686 -m32
47+ set (CMAKE_FIND_LIBRARY_SUFFIXES ".a" )
48+ set (CMAKE_SHARED_LINKER_FLAGS "-static -static-libgcc -static-libstdc++" )
49+ else ()
50+ set (CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1 /MP /EHsc" )
51+ set (CMAKE_CXX_FLAGS_RELEASE "/MT /Zi /O2 /Ob1 /EHsc /MP" ) #with debug info
52+ set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "/OPT:REF /DEBUG:FULL" )
53+ endif ()
0 commit comments