--- CMakeLists.txt.orig	2024-12-12 09:17:49 UTC
+++ CMakeLists.txt
@@ -36,7 +36,7 @@ cmake_minimum_required(VERSION 2.8.11)
 cmake_minimum_required(VERSION 2.8.11)
 
 # installation directory ( has to be before `project()` )
-set(CMAKE_INSTALL_PREFIX "/opt/hpipm" CACHE STRING "Installation path")
+#set(CMAKE_INSTALL_PREFIX "/opt/hpipm" CACHE STRING "Installation path")
 
 project(hpipm C)
 
@@ -105,7 +105,7 @@ if(NOT TARGET blasfeo)
 # BLASFEO option
 if(NOT TARGET blasfeo)
 	# manually set BLASFEO installation path
-	set(BLASFEO_PATH "/opt/blasfeo" CACHE STRING "BLASFEO installation path")
+	set(BLASFEO_PATH ${CMAKE_INSTALL_PREFIX} CACHE STRING "BLASFEO installation path")
 	# match BLASFEO library type with HPIPM library type
 	if(BUILD_SHARED_LIBS MATCHES OFF)
 		set(HPIPM_BLASFEO_LIB "Static" CACHE STRING "BLASFEO library link type")
@@ -154,7 +154,7 @@ if(${TARGET} MATCHES AVX)
 if(${TARGET} MATCHES AVX)
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTARGET_AVX")
 	if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
-		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 -mavx")
+		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx")
 	endif()
 elseif(${TARGET} MATCHES GENERIC)
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTARGET_GENERIC")
@@ -165,7 +165,7 @@ if(${REF_BLAS} MATCHES OPENBLAS)
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ")
 endif(${REF_BLAS} MATCHES 0)
 if(${REF_BLAS} MATCHES OPENBLAS)
-	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DREF_BLAS_OPENBLAS -I/opt/openblas/include")
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DREF_BLAS_OPENBLAS")
 endif(${REF_BLAS} MATCHES OPENBLAS)
 if(${REF_BLAS} MATCHES BLIS)
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DREF_BLAS_BLIS -std=c99")
@@ -174,7 +174,7 @@ if(${REF_BLAS} MATCHES MKL)
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DREF_BLAS_NETLIB")
 endif(${REF_BLAS} MATCHES NETLIB)
 if(${REF_BLAS} MATCHES MKL)
-	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DREF_BLAS_MKL -m64 -I/opt/intel/mkl/include")
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DREF_BLAS_MKL")
 endif(${REF_BLAS} MATCHES MKL)
 if(${REF_BLAS} MATCHES ATLAS)
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DREF_BLAS_ATLAS")
@@ -357,7 +357,7 @@ install(TARGETS hpipm EXPORT hpipmConfig
 	ARCHIVE DESTINATION lib
 	RUNTIME DESTINATION bin)
 
-install(EXPORT hpipmConfig DESTINATION cmake)
+install(EXPORT hpipmConfig DESTINATION lib/cmake)
 
 file(GLOB_RECURSE HPIPM_HEADERS "include/*.h")
 install(FILES ${HPIPM_HEADERS} DESTINATION ${HPIPM_HEADERS_INSTALLATION_DIRECTORY})
