11## PROJECT VAR
22## <=====================================>
3+ unset (EXEC)
34set ( EXEC "SWEngine-unpacker_${CMAKE_PROJECT_VERSION} " )
45set ( EXT cpp )
56## <=====================================>
@@ -15,6 +16,8 @@ set( SRC_FOLDERS
1516 )
1617## INCLUDE FOLDERS
1718set ( INC_FOLDERS
19+ ${CMAKE_CURRENT_SOURCE_DIR} /libraries/
20+
1821 ${CMAKE_CURRENT_SOURCE_DIR} /includes/
1922 ${CMAKE_CURRENT_SOURCE_DIR} /includes/file/
2023 ${CMAKE_CURRENT_SOURCE_DIR} /includes/unpack/
@@ -31,15 +34,29 @@ endforeach()
3134file (GLOB SRC ${TMP} )
3235## <=====================================>
3336
34-
3537## OUTPUT
3638## <=====================================>
37- ## EXECUTABLE
38- add_executable (${EXEC} ${SRC} )
39+
40+ if (NOT ${BUILD_UNPACK_LIB_SHARED} AND NOT ${BUILD_UNPACK_LIB_STATIC} )
41+ ## EXECUTABLE
42+ add_executable (${EXEC} ${SRC} )
43+ message (${PREFIX_MESSAGE} "Unpacker build as executable" )
44+ elseif (${BUILD_UNPACK_LIB_SHARED} )
45+ ## SHARED LIB
46+ add_library (${EXEC} SHARED ${SRC} )
47+ message (${PREFIX_MESSAGE} "Unpacker build as Shared library" )
48+ elseif (${BUILD_UNPACK_LIB_STATIC} )
49+ ## STATIC LIB
50+ add_library (${EXEC} STATIC ${SRC} )
51+ message (${PREFIX_MESSAGE} "Unpacker build as Static library" )
52+ endif ()
53+
3954## <=====================================>
4055
4156target_compile_definitions (${EXEC} PUBLIC "SWFP_UNPACKER" )
42-
57+ if (${SWFP_COMP} )
58+ target_compile_definitions (${EXEC} PUBLIC "SWFP_COMP" )
59+ endif ()
4360## ADD INCLUDES
4461## <=====================================>
4562target_include_directories (${EXEC} PUBLIC ${INC_FOLDERS} )
@@ -52,6 +69,16 @@ if(MSVC)
5269endif ()
5370## <=====================================>
5471
72+ ## STATIC LIBRARY LINKING
73+ ## <=====================================>
74+ if (NOT ${STATIC_LIB_NAME} STREQUAL "" )
75+ target_link_libraries (${EXEC}
76+ PUBLIC
77+ ${STATIC_LIB_NAME}
78+ )
79+ endif ()
80+ ## <=====================================>
81+
5582if (${CMAKE_BUILD_TYPE} MATCHES Debug)
5683 set_target_properties (${EXEC} PROPERTIES
5784 DEBUG_POSTFIX "d" )
0 commit comments