Skip to content

Commit

Permalink
Merge pull request #109 from traversaro/fix/shared/cmake
Browse files Browse the repository at this point in the history
Permit to compile qpOASES as a shared library in CMake
  • Loading branch information
apotschka committed Mar 8, 2021
2 parents a44e8c9 + cb49b52 commit 3636252
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Expand Up @@ -54,10 +54,13 @@ IF( NOT CMAKE_BUILD_TYPE )
)
ENDIF( NOT CMAKE_BUILD_TYPE )


option(BUILD_SHARED_LIBS "If ON, build shared library instead of static" OFF)
option(QPOASES_BUILD_EXAMPLES "Build examples." ON)
option(QPOASES_AVOID_LA_NAMING_CONFLICTS "If ON, avoid to re-defined symbols that conflict with Blas/Lapack provided functions." OFF)

IF(BUILD_SHARED_LIBS AND WIN32)
MESSAGE(FATAL_ERROR "Compiling qpOASES as a shared library in Windows is not supported.")
ENDIF()

############################################################
#################### compiler flags ########################
Expand Down Expand Up @@ -109,7 +112,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
FILE(GLOB SRC src/*.cpp)

# library
ADD_LIBRARY(qpOASES STATIC ${SRC})
ADD_LIBRARY(qpOASES ${SRC})
INSTALL(TARGETS qpOASES
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
Expand Down

0 comments on commit 3636252

Please sign in to comment.