Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Mar 29, 2020
2 parents 8a6b5fb + aef150a commit 79a1ab4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Builds the libraries for Boost.Nowide
#
# Options:
# BOOST_NOWIDE_INSTALL
# BOOST_NOWIDE_WERROR
# Boost_NOWIDE_INSTALL
# Boost_NOWIDE_WERROR
# BUILD_TESTING
#
# Created target: Boost::nowide
Expand Down Expand Up @@ -49,11 +49,11 @@ if(BUILD_SHARED_LIBS)
endif()
target_compile_definitions(boost_nowide PUBLIC BOOST_NOWIDE_NO_LIB)
target_include_directories(boost_nowide PUBLIC include)
boost_add_warnings(boost_nowide pedantic ${BOOST_NOWIDE_WERROR})
boost_add_warnings(boost_nowide pedantic ${Boost_NOWIDE_WERROR})

if(BOOST_SUPERPROJECT_SOURCE_DIR)
target_link_libraries(boost_nowide PUBLIC Boost::config Boost::smart_ptr Boost::static_assert)
set(BOOST_NOWIDE_INSTALL OFF) # smart_ptr does not support installation
set(Boost_NOWIDE_INSTALL OFF) # smart_ptr does not support installation
else()
# Default boost libs are static on windows and dynamic on linux
if(WIN32 AND NOT DEFINED Boost_USE_STATIC_LIBS)
Expand All @@ -67,7 +67,7 @@ if(BUILD_TESTING)
add_subdirectory(test)
endif()

if(BOOST_NOWIDE_INSTALL)
if(Boost_NOWIDE_INSTALL)
include(InstallTargets)
install_targets(TARGETS boost_nowide NAMESPACE Boost CONFIG_FILE ${PROJECT_SOURCE_DIR}/Config.cmake.in)
endif()
7 changes: 4 additions & 3 deletions cmake/BoostAddOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ else()
set(def_WERROR OFF)
endif()

string(TOUPPER ${PROJECT_NAME} NAME)
string(TOUPPER ${PROJECT_NAME} name)
string(REPLACE BOOST_ Boost_ name ${name})

option(${NAME}_INSTALL "Install library" "${def_INSTALL}")
option(${NAME}_WERROR "Treat warnings as errors" "${def_WERROR}")
option(${name}_INSTALL "Install library" "${def_INSTALL}")
option(${name}_WERROR "Treat warnings as errors" "${def_WERROR}")
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function(boost_nowide_add_test name)

add_executable(${name} ${ARG_SRC})
target_link_libraries(${name} PRIVATE Boost::nowide ${ARG_LIBRARIES})
boost_add_warnings(${name} pedantic ${BOOST_NOWIDE_WERROR})
boost_add_warnings(${name} pedantic ${Boost_NOWIDE_WERROR})
target_compile_definitions(${name} PRIVATE BOOST_ALL_NO_LIB ${ARG_DEFINITIONS})
if(NOT ARG_COMPILE_ONLY)
add_test(NAME ${name} COMMAND ${name} ${ARG_ARGS})
Expand Down
1 change: 1 addition & 0 deletions tools/create_standalone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ CMLs=$(find "$targetFolder" -name 'CMakeLists.txt' -or -name '*.cmake')

sed 's/ BOOST_ALL_NO_LIB//' -i $CMLs
sed 's/BOOST_NOWIDE_/NOWIDE_/g' -i $CMLs
sed 's/Boost_NOWIDE_/NOWIDE_/g' -i $CMLs
sed 's/boost_nowide/nowide/g' -i $CMLs
sed 's/boost_/nowide_/g' -i $CMLs
sed 's/Boost::nowide/nowide::nowide/g' -i $CMLs
Expand Down

0 comments on commit 79a1ab4

Please sign in to comment.