Skip to content

Commit

Permalink
maybe cmake fixes?? pls cmake gods bless me
Browse files Browse the repository at this point in the history
i'm tired and want to give up
  • Loading branch information
muhopensores committed Oct 11, 2021
1 parent b238a54 commit dd714d7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
32 changes: 18 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,28 @@ endforeach(OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES)
# string(REGEX REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

find_package(Git)

execute_process(COMMAND
"${GIT_EXECUTABLE}" log -1 --pretty=\"%h\"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_COMMIT_HASH
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)

execute_process(COMMAND
"${GIT_EXECUTABLE}" log -1 --date short --pretty=\"%ad\"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_COMMITTER_DATE
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if (Git_FOUND)
execute_process(COMMAND
"${GIT_EXECUTABLE}" log -1 --pretty=\"%h\"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_COMMIT_HASH
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)

execute_process(COMMAND
"${GIT_EXECUTABLE}" log -1 --date short --pretty=\"%ad\"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_COMMITTER_DATE
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
set(GIT_HASH ${GIT_COMMIT_HASH})
set(GIT_DATE ${GIT_COMMITTER_DATE})
else()
set(GIT_HASH "install_git_exe_bro")
set(GIT_DATE "really")
endif()

set(LOG_FILENAME "${CMAKE_PROJECT_NAME}_framework_log.txt")
set(LOG_ENTRY "${CMAKE_PROJECT_NAME} ModFramework entry")
set(CONFIG_FILENAME "${CMAKE_PROJECT_NAME}_fw_config.txt")
set(GIT_HASH ${GIT_COMMIT_HASH})
set(GIT_DATE ${GIT_COMMITTER_DATE})

configure_file(Config.hpp.in ${CMAKE_SOURCE_DIR}/src/Config.hpp @ONLY)
add_compile_options(/W0)
Expand Down
8 changes: 8 additions & 0 deletions dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ SET(GLM_TEST_ENABLE OFF CACHE BOOL "Build unit tests" FORCE)
add_subdirectory(glm)

project(minhook)
set(CompilerFlags
CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE
)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()

add_library(minhook STATIC
minhook/src/buffer.c
minhook/src/buffer.h
Expand Down

0 comments on commit dd714d7

Please sign in to comment.