--- a/CMakeLists.txt Fri Mar 10 11:42:25 2023 +0100
+++ b/CMakeLists.txt Tue Aug 22 08:35:46 2023 +0200
@@ -1,8 +1,8 @@
+cmake_minimum_required(VERSION 2.6.4)
+
project(hedgewars)
-
#initialise cmake environment
-cmake_minimum_required(VERSION 2.6.4)
foreach(hwpolicy CMP0003 CMP0012 CMP0017 CMP0018)
if(POLICY ${hwpolicy})
cmake_policy(SET ${hwpolicy} NEW)
@@ -177,6 +177,7 @@
"-fno-warn-unused-do-bind"
"-O0"
)
+ set(USE_DEBUG_LIBRARIES TRUE)
else()
list(APPEND haskell_flags "-w" # no warnings
"-O2"
@@ -249,7 +250,15 @@
if(PHYSFS_LIBRARY AND PHYSFS_INCLUDE_DIR)
#use an IMPORTED tharget so that we can just use 'physfs' to link
add_library(physfs UNKNOWN IMPORTED)
- set_target_properties(physfs PROPERTIES IMPORTED_LOCATION ${PHYSFS_LIBRARY})
+ if (DEFINED PHYSFS_LIBRARY_RELEASE)
+ if (${USE_DEBUG_LIBRARIES})
+ set_target_properties(physfs PROPERTIES IMPORTED_LOCATION ${PHYSFS_LIBRARY_DEBUG})
+ else()
+ set_target_properties(physfs PROPERTIES IMPORTED_LOCATION ${PHYSFS_LIBRARY_RELEASE})
+ endif()
+ else()
+ set_target_properties(physfs PROPERTIES IMPORTED_LOCATION ${PHYSFS_LIBRARY})
+ endif()
else()
message(FATAL_ERROR "Missing PhysFS! Install PhysFS to fix this.")
endif()