From 4d7e7596b6952175d6faf67ff80c2cbc549f9699 Mon Sep 17 00:00:00 2001 From: Karutoh Date: Wed, 24 Jul 2024 14:58:36 -0700 Subject: [PATCH] Simplified Windows build. --- CMakeLists.txt | 27 ++++++++++++++------------- CMakePresets.json | 12 ------------ vcpkg-configuration.json | 14 -------------- vcpkg.json | 6 ------ 4 files changed, 14 insertions(+), 45 deletions(-) delete mode 100644 CMakePresets.json delete mode 100644 vcpkg-configuration.json delete mode 100644 vcpkg.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a571e3..9fcf959 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,8 @@ project(EHS CXX C) if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows") set(IS_OS_WINDOWS TRUE) - set(USER_HOME_DIRECTORY $ENV{USERPROFILE}) + set(USER_HOME_DIRECTORY "$ENV{USERPROFILE}") + string(REPLACE "\\" "/" USER_HOME_DIRECTORY "${USER_HOME_DIRECTORY}") message("Building for the Windows operating system.") elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux") set(IS_OS_LINUX TRUE) @@ -239,14 +240,14 @@ endif() #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") #message("${CMAKE_CXX_FLAGS}") -add_library(EHS_STC STATIC ${EHS_SOURCES}) -add_library(EHS_DYN SHARED ${EHS_SOURCES}) +add_library(EHS_Stc STATIC ${EHS_SOURCES}) +add_library(EHS_Dyn SHARED ${EHS_SOURCES}) add_executable(StrToHash src/StrToHash.cpp) -target_compile_definitions(EHS_DYN PRIVATE EHS_LIB_EXPORT) +target_compile_definitions(EHS_Dyn PRIVATE EHS_LIB_EXPORT) -target_include_directories(EHS_STC PUBLIC ${PROJECT_SOURCE_DIR}/include) -target_include_directories(EHS_DYN PUBLIC ${PROJECT_SOURCE_DIR}/include) +target_include_directories(EHS_Stc PUBLIC ${PROJECT_SOURCE_DIR}/include) +target_include_directories(EHS_Dyn PUBLIC ${PROJECT_SOURCE_DIR}/include) if (IS_OS_LINUX) set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/.local") @@ -254,9 +255,9 @@ elseif (IS_OS_WINDOWS) set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/EHS") endif () -install(TARGETS EHS_STC DESTINATION lib) -install(TARGETS EHS_DYN RUNTIME DESTINATION bin) -install(TARGETS EHS_DYN LIBRARY DESTINATION lib) +install(TARGETS EHS_Stc DESTINATION lib) +install(TARGETS EHS_Dyn RUNTIME DESTINATION bin) +install(TARGETS EHS_Dyn LIBRARY DESTINATION lib) install(TARGETS StrToHash DESTINATION bin) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include) @@ -275,11 +276,11 @@ else () message(STATUS "OpenSSL was not found.") endif () -target_link_libraries(EHS_STC OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB) -target_link_libraries(EHS_DYN OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB avrt ws2_32) +target_link_libraries(EHS_Stc OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB) +target_link_libraries(EHS_Dyn OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB avrt ws2_32) if (IS_OS_WINDOWS) - target_link_libraries(StrToHash ws2_32 avrt EHS_STC) + target_link_libraries(StrToHash ws2_32 avrt EHS_Stc) elseif (IS_OS_LINUX) if (LINUX_WINDOW_SYSTEM STREQUAL "Wayland") target_link_libraries(StrToHash wayland-client) @@ -287,5 +288,5 @@ elseif (IS_OS_LINUX) target_link_libraries(StrToHash xcb xcb-cursor xcb-xfixes xcb-xinput) endif () - target_link_libraries(StrToHash z asound EHS_STC) + target_link_libraries(StrToHash z asound EHS_Stc) endif () \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json deleted file mode 100644 index afabfde..0000000 --- a/CMakePresets.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": 3, - "configurePresets": [ - { - "name": "default", - "binaryDir": "${sourceDir}/build", - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" - } - } - ] -} \ No newline at end of file diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json deleted file mode 100644 index 427355d..0000000 --- a/vcpkg-configuration.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "default-registry": { - "kind": "git", - "baseline": "42bb0d9e8d4cf33485afb9ee2229150f79f61a1f", - "repository": "https://github.com/microsoft/vcpkg" - }, - "registries": [ - { - "kind": "artifact", - "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", - "name": "microsoft" - } - ] -} diff --git a/vcpkg.json b/vcpkg.json deleted file mode 100644 index e769101..0000000 --- a/vcpkg.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dependencies": [ - "openssl", - "zlib" - ] -}