Skip to content

Commit 2018cd0

Browse files
committed
master: Fix setting SHARED on cpapd_ipopt library.
1 parent fa63553 commit 2018cd0

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

cppad_ipopt/src/CMakeLists.txt

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
22
# SPDX-FileCopyrightText: Bradley M. Bell <[email protected]>
3-
# SPDX-FileContributor: 2003-22 Bradley M. Bell
3+
# SPDX-FileContributor: 2003-25 Bradley M. Bell
44
# ----------------------------------------------------------------------------
55
# Build the cppad_ipopt/src library
66
# Inherit build type from ../CMakeList.txt
@@ -18,8 +18,15 @@ SET(source_list
1818
)
1919
# END_SORT_THIS_LINE_MINUS_2
2020

21-
ADD_LIBRARY(cppad_ipopt ${source_list})
21+
# set_compiler_flags
2222
set_compile_flags( cppad_ipopt "${cppad_debug_which}" "${source_list}" )
23+
#
24+
# add_library
25+
IF( "${is_cppad_lib_dynamic}" STREQUAL "0" )
26+
ADD_LIBRARY( cppad_ipopt STATIC ${source_list} )
27+
ELSEIF( "${is_cppad_lib_dynamic}" STREQUAL "1" )
28+
ADD_LIBRARY( cppad_ipopt SHARED ${source_list} )
29+
ENDIF( )
2330

2431
# install(FILES files... DESTINATION <dir>
2532
# [PERMISSIONS permissions...]

cppad_lib/CMakeLists.txt

+5-4
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,15 @@ IF( cppad_has_cppadcg )
4141
SET(source_list ${source_list} code_gen_fun.cpp)
4242
ENDIF( cppad_has_cppadcg )
4343
#
44+
# set_compile_flags
4445
set_compile_flags(cppad_lib "${cppad_debug_which}" "${source_list}" )
4546
#
46-
# is_windows
47+
# add_library
4748
IF( "${is_cppad_lib_dynamic}" STREQUAL "0" )
48-
MESSAGE( STATUS "Windows system so building static cppad_lib")
49+
MESSAGE( STATUS "Building static cppad_lib")
4950
ADD_LIBRARY( cppad_lib STATIC ${source_list} )
5051
ELSEIF( "${is_cppad_lib_dynamic}" STREQUAL "1" )
51-
MESSAGE( STATUS "Not Windows system so building shared cppad_lib")
52+
MESSAGE( STATUS "Building shared cppad_lib")
5253
ADD_LIBRARY( cppad_lib SHARED ${source_list} )
5354
SET_TARGET_PROPERTIES( cppad_lib PROPERTIES
5455
SOVERSION ${soversion}
@@ -59,7 +60,7 @@ ELSEIF( "${is_cppad_lib_dynamic}" STREQUAL "1" )
5960
IF( dl_LIBRARY )
6061
TARGET_LINK_LIBRARIES(cppad_lib ${dl_LIBRARY})
6162
ENDIF( dl_LIBRARY )
62-
ELSE( "${is_cppad_lib_dynamic}" == "0" )
63+
ELSE( )
6364
MESSAGE(FATAL_ERROR "CMkakeLists.txt Error: invalid is_cppad_lib_dynamic")
6465
ENDIF( )
6566
#

0 commit comments

Comments
 (0)