33# See accompanying file LICENSE_1_0.txt
44# or copy at http://www.boost.org/LICENSE_1_0.txt)
55
6- message (STATUS "Building examples" )
6+ message (STATUS "Boost.OpenMethod: building examples" )
77
88if (CMAKE_BUILD_TYPE STREQUAL "Release" )
99 if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
@@ -18,10 +18,9 @@ endif()
1818file (GLOB cpp_files "*.cpp" )
1919
2020foreach (cpp ${cpp_files} )
21- cmake_path (REMOVE_EXTENSION cpp LAST_ONLY OUTPUT_VARIABLE stem )
22- string (REGEX REPLACE ".*/" "" stem ${stem} )
21+ get_filename_component (stem ${cpp} NAME_WE )
2322 add_executable (${stem} ${cpp} )
24- target_link_libraries (${stem} PUBLIC Boost::openmethod Boost::unit_test_framework )
23+ target_link_libraries (${stem} PRIVATE Boost::openmethod Boost::unit_test_framework )
2524 add_test (NAME ${stem} COMMAND ${stem} )
2625 add_dependencies (tests ${stem} )
2726endforeach ()
@@ -40,8 +39,8 @@ function(add_step_by_step dir)
4039 file (GLOB cpp_files "${subdir} /*.cpp" )
4140 set (target "${dir} _${subex} " )
4241 add_executable (${target} ${cpp_files} )
43- target_link_libraries (${target} PUBLIC Boost::openmethod )
44- set (output_dir " ${subdir} " )
42+ target_link_libraries (${target} PRIVATE Boost::openmethod )
43+ set (output_dir openmethod/ ${dir} / ${subex} )
4544 set_target_properties (${target} PROPERTIES
4645 RUNTIME_OUTPUT_DIRECTORY "${output_dir} "
4746 LIBRARY_OUTPUT_DIRECTORY "${output_dir} "
0 commit comments