Skip to content

Commit

Permalink
Permit to compile qpOASES as a shared library in CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro committed Feb 17, 2021
1 parent 326a651 commit 4177d3a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ 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)

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 @@ -104,11 +107,11 @@ 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
RUNTIME DESTINATION lib
RUNTIME DESTINATION bin
)
SET_TARGET_PROPERTIES(
qpOASES
Expand Down

0 comments on commit 4177d3a

Please sign in to comment.