Skip to content

Commit

Permalink
CMake: adjust output when building with DSS-Extensions:
Browse files Browse the repository at this point in the history
- With this change, building from the DSS C-API repo will output everything to the same folder.
- Only change the debug suffix on the DSS-Extensions build. This should allow more freedom for third-party builds.
  • Loading branch information
PMeira committed Dec 12, 2024
1 parent 0d138e3 commit 892b12b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@

cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(klusolvex)
SET(CMAKE_DEBUG_POSTFIX "")
SET(CMAKE_RELEASE_PREFIX "")

if(DSS_EXTENSIONS)
SET(CMAKE_DEBUG_POSTFIX "d")
SET(CMAKE_RELEASE_PREFIX "")
endif()

SET(USE_SYSTEM_SUITESPARSE ON CACHE BOOL "Use system SuiteSparse.")
SET(DSS_EXTENSIONS OFF CACHE BOOL "If building for distribution on DSS-Extensions, enable this. It tweaks the output folders.")
SET(USE_SYSTEM_EIGEN ON CACHE BOOL "Use system Eigen3 (v3.4 recommended).")

# Move fromKLUSOLVEX_LIB_TYPE to BUILD_SHARED_LIBS to simplify the build process when
# Moved from KLUSOLVEX_LIB_TYPE to BUILD_SHARED_LIBS to simplify the build process when
# integrating with other build tools
option(BUILD_SHARED_LIBS "Build using shared libraries (DLL); default is ON for KLUSolveX. Set it to OFF to generate a static library." ON)

Expand All @@ -40,7 +43,7 @@ else ()
MESSAGE(FATAL_ERROR "Unsupported system? ${CMAKE_SYSTEM_NAME}" )
endif ()

SET(KLUSOLVEX_OUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib/${KLUSOLVEX_OUT_DIR_PREFIX}_${KLUSOLVEX_OUT_DIR_SUFFIX}")
SET(KLUSOLVEX_OUT_DIR "${CMAKE_SOURCE_DIR}/lib/${KLUSOLVEX_OUT_DIR_PREFIX}_${KLUSOLVEX_OUT_DIR_SUFFIX}")
add_definitions("-Dcsi=int")

SET(KLUSOLVEX_SRC
Expand Down Expand Up @@ -185,7 +188,6 @@ else()

#SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
add_definitions("-DSUITESPARSE_DLLEXPORT=__declspec(dllexport)")
set(CMAKE_DEBUG_POSTFIX "d")

file(GLOB AMD_TEMPLATE_SRC "${SUITESPARSE_DIR}/AMD/Source/*.c")
file(GLOB COLAMD_TEMPLATE_SRC "${SUITESPARSE_DIR}/COLAMD/Source/*.c")
Expand Down

0 comments on commit 892b12b

Please sign in to comment.