diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ea359dc..acfcd9d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ cmake_minimum_required(VERSION 2.8.11) -# Installation ( has to be before `project()` ) +# installation directory ( has to be before `project()` ) set(CMAKE_INSTALL_PREFIX "/opt/hpipm" CACHE STRING "Installation path") project(hpipm C) @@ -63,8 +63,8 @@ set(ALLOWED_REF_BLAS ) set_property(CACHE REF_BLAS PROPERTY STRINGS ${ALLOWED_REF_BLAS}) -# set(HPIPM_TESTING ON CACHE BOOL "Tests enabled") -set(HPIPM_TESTING OFF CACHE BOOL "Tests disabled") +set(HPIPM_TESTING ON CACHE BOOL "Tests enabled") +# set(HPIPM_TESTING OFF CACHE BOOL "Tests disabled") # Target architecture set(TARGET AVX CACHE STRING "Set CPU architecture target") diff --git a/test_problems/CMakeLists.txt b/test_problems/CMakeLists.txt index 229ce931..3f90777a 100644 --- a/test_problems/CMakeLists.txt +++ b/test_problems/CMakeLists.txt @@ -33,35 +33,30 @@ # # ################################################################################################### -add_executable(d_cond test_d_cond.c d_tools.c) -target_include_directories(d_cond PRIVATE "${HPIPM_INCLUDE_DIR}" "${BLASFEO_INCLUDE_DIR}") -target_link_libraries(d_cond hpipm blasfeo m) +add_executable(d_cond test_d_cond.c d_tools.c) add_executable(d_part_cond test_d_part_cond.c d_tools.c) -target_include_directories(d_part_cond PRIVATE "${HPIPM_INCLUDE_DIR}" "${BLASFEO_INCLUDE_DIR}") -target_link_libraries(d_part_cond hpipm blasfeo m) - add_executable(d_dense_qp test_d_dense.c) -target_include_directories(d_dense_qp PRIVATE "${HPIPM_INCLUDE_DIR}" "${BLASFEO_INCLUDE_DIR}") -target_link_libraries(d_dense_qp hpipm blasfeo m) - -#add_executable(s_dense_qp test_s_dense.c) -#target_link_libraries(s_dense_qp hpipm blasfeo m) - add_executable(d_ocp_qp test_d_ocp.c d_tools.c) -target_include_directories(d_ocp_qp PRIVATE "${HPIPM_INCLUDE_DIR}" "${BLASFEO_INCLUDE_DIR}") -target_link_libraries(d_ocp_qp hpipm blasfeo m) - -#add_executable(s_ocp_qp test_s_ocp.c s_tools.c) -#target_link_libraries(s_ocp_qp hpipm blasfeo m) - -#add_executable(m_ocp_qp test_m_ocp.c d_tools.c) -#target_link_libraries(m_ocp_qp hpipm blasfeo m) - add_executable(d_tree_ocp_qp test_d_tree_ocp.c d_tools.c) + +target_include_directories(d_cond PRIVATE "${HPIPM_INCLUDE_DIR}" "${BLASFEO_INCLUDE_DIR}") +target_include_directories(d_part_cond PRIVATE "${HPIPM_INCLUDE_DIR}" "${BLASFEO_INCLUDE_DIR}") +target_include_directories(d_dense_qp PRIVATE "${HPIPM_INCLUDE_DIR}" "${BLASFEO_INCLUDE_DIR}") +target_include_directories(d_ocp_qp PRIVATE "${HPIPM_INCLUDE_DIR}" "${BLASFEO_INCLUDE_DIR}") target_include_directories(d_tree_ocp_qp PRIVATE "${HPIPM_INCLUDE_DIR}" "${BLASFEO_INCLUDE_DIR}") -target_link_libraries(d_tree_ocp_qp hpipm blasfeo m) -#add_executable(s_tree_ocp_qp test_s_tree_ocp.c s_tools.c) -#target_link_libraries(s_tree_ocp_qp hpipm blasfeo m) +if(CMAKE_C_COMPILER_ID MATCHES MSVC) # no explicit math library + target_link_libraries(d_cond hpipm blasfeo) + target_link_libraries(d_part_cond hpipm blasfeo) + target_link_libraries(d_dense_qp hpipm blasfeo) + target_link_libraries(d_ocp_qp hpipm blasfeo) + target_link_libraries(d_tree_ocp_qp hpipm blasfeo) +else() # add explicit math library + target_link_libraries(d_cond hpipm blasfeo m) + target_link_libraries(d_part_cond hpipm blasfeo m) + target_link_libraries(d_dense_qp hpipm blasfeo m) + target_link_libraries(d_ocp_qp hpipm blasfeo m) + target_link_libraries(d_tree_ocp_qp hpipm blasfeo m) +endif()