Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

Commit

Permalink
Forked from @paolo-projects
Browse files Browse the repository at this point in the history
  • Loading branch information
muhac committed May 14, 2020
1 parent 8005971 commit 40d4a83
Show file tree
Hide file tree
Showing 45 changed files with 5,089 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# vmware-macos-unlocker
Unlocker for VMware Workstation macOS
# MacOS Unlocker for VMware Workstation
This repository is forked from [unlocker](https://github.com/paolo-projects/unlocker) and [auto-unlocker](https://github.com/paolo-projects/auto-unlocker). &emsp; <sub> (May 14, 2020) </sub>

90 changes: 90 additions & 0 deletions auto-unlocker/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project (Unlocker)

SET(UNLOCKER_STATIC_LIBS_WIN ON CACHE BOOL "Links statically") # Set to OFF for dynamic linking

IF (MSVC)
# prevent default manifest from being linked
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO")
ENDIF(MSVC)

find_package(ZLIB REQUIRED)

if(ZLIB_FOUND)
message (STATUS "ZLib found, version ${ZLIB_VERSION_STRING}")
endif()

include_directories(${ZLIB_INCLUDE_DIRS})

find_package(CURL REQUIRED)

if(CURL_FOUND)
message (STATUS "Curl found, version ${CURL_VERSION_STRING}")
endif()

include_directories(${CURL_INCLUDE_DIRS})

find_package(LibArchive REQUIRED)

if(LibArchive_FOUND)
message (STATUS "LibArchive found, version ${LibArchive_VERSION}")
endif()

include_directories(${LibArchive_INCLUDE_DIRS})

# main include files
include_directories ("${PROJECT_SOURCE_DIR}/include")

# main source files
set (SOURCE_FILES src/unlocker.cpp /
src/versionparser.cpp /
src/buildsparser.cpp /
src/archiveutils.cpp /
src/netutils.cpp /
src/debugutils.cpp /
src/installinfoutils.cpp /
src/servicestoputils.cpp /
src/patchutils.cpp /
)

IF (MSVC)
IF (UNLOCKER_STATIC_LIBS_WIN)
# Preprocessor definitions needed to avoid name mangling when statically importing libs on MSVC compiler
# Name mangling is needed if libraries are built dynamically with MSVC
# Should not be an issue with other compilers
add_compile_definitions( "CURL_STATICLIB" "LIBARCHIVE_STATIC")
ENDIF()
ENDIF (MSVC)

add_executable(Unlocker ${SOURCE_FILES})

set_target_properties(Unlocker PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS ON)

if(LINUX)
target_link_libraries (Unlocker -lpthread)
endif()

target_link_libraries (Unlocker ${ZLIB_LIBRARIES})
target_link_libraries (Unlocker ${CURL_LIBRARIES})
target_link_libraries (Unlocker ${LibArchive_LIBRARIES})

if(WIN32)
target_link_libraries (Unlocker ws2_32 Wldap32)
endif()

# Amend manifest to tell Windows that the app needs admin privileges
IF (MSVC)
IF (CMAKE_MAJOR_VERSION LESS 3)
MESSAGE(WARNING "CMake version 3.0 or newer is required use build variable TARGET_FILE")
ELSE()
ADD_CUSTOM_COMMAND(
TARGET Unlocker
POST_BUILD
COMMAND "mt.exe" -manifest \"${PROJECT_SOURCE_DIR}/Unlocker.exe.manifest\" -outputresource:\"$<TARGET_FILE:Unlocker>\"\;\#1
COMMENT "Embedding manifest..."
)
ENDIF()
ENDIF(MSVC)

Loading

0 comments on commit 40d4a83

Please sign in to comment.