Skip to content

Commit

Permalink
master: Fix setting SHARED on cpapd_ipopt library.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradbell committed Feb 9, 2025
1 parent fa63553 commit 2018cd0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 9 additions & 2 deletions cppad_ipopt/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
# SPDX-FileCopyrightText: Bradley M. Bell <[email protected]>
# SPDX-FileContributor: 2003-22 Bradley M. Bell
# SPDX-FileContributor: 2003-25 Bradley M. Bell
# ----------------------------------------------------------------------------
# Build the cppad_ipopt/src library
# Inherit build type from ../CMakeList.txt
Expand All @@ -18,8 +18,15 @@ SET(source_list
)
# END_SORT_THIS_LINE_MINUS_2

ADD_LIBRARY(cppad_ipopt ${source_list})
# set_compiler_flags
set_compile_flags( cppad_ipopt "${cppad_debug_which}" "${source_list}" )
#
# add_library
IF( "${is_cppad_lib_dynamic}" STREQUAL "0" )
ADD_LIBRARY( cppad_ipopt STATIC ${source_list} )
ELSEIF( "${is_cppad_lib_dynamic}" STREQUAL "1" )
ADD_LIBRARY( cppad_ipopt SHARED ${source_list} )
ENDIF( )

# install(FILES files... DESTINATION <dir>
# [PERMISSIONS permissions...]
Expand Down
9 changes: 5 additions & 4 deletions cppad_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ IF( cppad_has_cppadcg )
SET(source_list ${source_list} code_gen_fun.cpp)
ENDIF( cppad_has_cppadcg )
#
# set_compile_flags
set_compile_flags(cppad_lib "${cppad_debug_which}" "${source_list}" )
#
# is_windows
# add_library
IF( "${is_cppad_lib_dynamic}" STREQUAL "0" )
MESSAGE( STATUS "Windows system so building static cppad_lib")
MESSAGE( STATUS "Building static cppad_lib")
ADD_LIBRARY( cppad_lib STATIC ${source_list} )
ELSEIF( "${is_cppad_lib_dynamic}" STREQUAL "1" )
MESSAGE( STATUS "Not Windows system so building shared cppad_lib")
MESSAGE( STATUS "Building shared cppad_lib")
ADD_LIBRARY( cppad_lib SHARED ${source_list} )
SET_TARGET_PROPERTIES( cppad_lib PROPERTIES
SOVERSION ${soversion}
Expand All @@ -59,7 +60,7 @@ ELSEIF( "${is_cppad_lib_dynamic}" STREQUAL "1" )
IF( dl_LIBRARY )
TARGET_LINK_LIBRARIES(cppad_lib ${dl_LIBRARY})
ENDIF( dl_LIBRARY )
ELSE( "${is_cppad_lib_dynamic}" == "0" )
ELSE( )
MESSAGE(FATAL_ERROR "CMkakeLists.txt Error: invalid is_cppad_lib_dynamic")
ENDIF( )
#
Expand Down

0 comments on commit 2018cd0

Please sign in to comment.