Skip to content

Commit 5d8c597

Browse files
committed
Simplify BUILD_SHARED_LIBS and BUILD_STATIC_LIBS options.
1 parent a366339 commit 5d8c597

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ add_subdirectory(doc)
151151

152152
# 'make core' builds everything that isn't generated. for devs.
153153
add_custom_target(core)
154-
if($CACHE{SC_BUILD_SHARED_LIBS})
154+
if(BUILD_SHARED_LIBS)
155155
add_dependencies(core stepdai stepeditor exp2cxx check-express)
156156
else()
157157
add_dependencies(core stepdai-static stepeditor-static exp2cxx check-express)

cmake/SC_Build_opts.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ macro(OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT)
1616
endmacro(OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT)
1717

1818
# build shared libs by default
19-
OPTION_WITH_DEFAULT(SC_BUILD_SHARED_LIBS "Build shared libs" ON)
19+
option(BUILD_SHARED_LIBS "Build shared libs" ON)
2020

2121
# don't build static libs by default
22-
OPTION_WITH_DEFAULT(SC_BUILD_STATIC_LIBS "Build static libs" OFF)
22+
OPTION_WITH_DEFAULT(BUILD_STATIC_LIBS "Build static libs" OFF)
2323

2424
OPTION_WITH_DEFAULT(SC_PYTHON_GENERATOR "Compile exp2python" ON)
2525
OPTION_WITH_DEFAULT(SC_CPP_GENERATOR "Compile exp2cxx" ON)
@@ -39,8 +39,8 @@ OPTION_WITH_DEFAULT(SC_ENABLE_COVERAGE "Enable code coverage test" OFF)
3939
if(SC_ENABLE_COVERAGE)
4040
set(SC_ENABLE_TESTING ON CACHE BOOL "Testing enabled by coverage option" FORCE)
4141
# build static libs, better coverage report
42-
set(SC_BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
43-
set(SC_BUILD_STATIC_LIBS ON CACHE BOOL "Build static libs" FORCE)
42+
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
43+
set(BUILD_STATIC_LIBS ON CACHE BOOL "Build static libs" FORCE)
4444
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
4545
set(CMAKE_C_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
4646
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage" CACHE STRING "Extra linker flags required by code coverage" FORCE)

cmake/SC_CXX_schema_macros.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ macro(SCHEMA_TARGETS expFile schemaName sourceFiles)
9393
${SC_SOURCE_DIR}/src/base/judy/src
9494
)
9595
# if testing is enabled, "TESTABLE" sets property EXCLUDE_FROM_ALL and prevents installation
96-
if($CACHE{SC_BUILD_SHARED_LIBS})
96+
if(BUILD_SHARED_LIBS)
9797
SC_ADDLIB(${PROJECT_NAME} SHARED SOURCES ${sourceFiles} LINK_LIBRARIES stepdai stepcore stepeditor steputils base TESTABLE)
9898
add_dependencies(${PROJECT_NAME} generate_cpp_${PROJECT_NAME})
9999
if(WIN32)

example/ap203min/ExternalProjectBuild/cmake/External_STEPCode.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ SET( STEPCODE_BINARY_DIR ${BINARY_DIR} )
2626
# Consequently, force Debug so it installs in ../sc-install directory
2727
# instead of /usr/local/lib.
2828
#
29-
# SC's own programs fail to build with -DSC_BUILD_SHARED_LIBS=OFF

0 commit comments

Comments
 (0)