Skip to content

Commit

Permalink
cmake: enable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
giaf committed May 7, 2020
1 parent 9b3a855 commit c596447
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down
43 changes: 19 additions & 24 deletions test_problems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit c596447

Please sign in to comment.