Closed ClausKlein closed 2 years ago
I thank you for the PR. This is indeed a great idea. Would it be possible to separate in different PR
ASIO_ENABLE_INSTALL
to make it optionalAnd I don't think it is a good idea to index the version of asio.cmake to the version of asio, otherwise this script version can't evolve independently.
I have no time to create separate MR.
The install is now optional and only available if CPM.cmake
is used!
So I merged everything in #10 #9 #8 #7 Thank you for the suggestion. I'm going to do a breaking release that change default for the repository to use CPM by default. Tell me if you think something is missing.
Tell me if you think something is missing.
INCLUDE_HEADER_PATTERN "*.hpp"
with this option, are you sure that none of the *.ipp header are needed!
Aren't ipp compiled already?
Aren't ipp compiled already?
Yes, perfect. I have checked it:
Claus-iMac:asio.cmake clausklein$ ll standalone
lrwxr-xr-x 1 clausklein staff 13 7 Sep 07:45 standalone -> tests/install
Claus-iMac:asio.cmake clausklein$ cmake -S standalone -B ./cmake-build-asio.cmake-x86_64-Debug/standalone -G Ninja -D CMAKE_CXX_COMPILER_LAUNCHER=/usr/local/bin/ccache -D CMAKE_EXPORT_COMPILE_COMMANDS=1 -D CMAKE_BUILD_TYPE=Debug -D CMAKE_PREFIX_PATH=/Users/clausklein/Workspace/cpp/asio.cmake/stage -D BUILD_TESTING=1 -D CMAKE_CXX_STANDARD=20
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
BUILD_TESTING
-- Build files have been written to: /Users/clausklein/Workspace/cpp/asio.cmake/cmake-build-asio.cmake-x86_64-Debug/standalone
Claus-iMac:asio.cmake clausklein$ ninja -C cmake-build-asio.cmake-x86_64-Debug/standalone
ninja: Entering directory `cmake-build-asio.cmake-x86_64-Debug/standalone'
[2/2] Linking CXX executable time_t_timer
Claus-iMac:asio.cmake clausklein$ cd cmake-build-asio.cmake-x86_64-Debug/standalone
Claus-iMac:standalone clausklein$ ninja -t deps | grep -w asio | grep -vw hpp
/Users/clausklein/Workspace/cpp/asio.cmake/standalone/time_t_timer.cpp
Claus-iMac:standalone clausklein$ ninja clean
[1/1] Cleaning all built files...
Cleaning... 2 files.
Claus-iMac:standalone clausklein$ ninja -nv
[1/2] /usr/local/bin/ccache /Applications/Xcode.app/Contents/Developer/usr/bin/g++ -DASIO_NO_DEPRECATED -DASIO_SEPARATE_COMPILATION -DASIO_STANDALONE -isystem /Users/clausklein/Workspace/cpp/asio.cmake/stage/include -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -std=gnu++20 -MD -MT CMakeFiles/time_t_timer.dir/time_t_timer.cpp.o -MF CMakeFiles/time_t_timer.dir/time_t_timer.cpp.o.d -o CMakeFiles/time_t_timer.dir/time_t_timer.cpp.o -c /Users/clausklein/Workspace/cpp/asio.cmake/standalone/time_t_timer.cpp
[2/2] : && /Applications/Xcode.app/Contents/Developer/usr/bin/g++ -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/time_t_timer.dir/time_t_timer.cpp.o -o time_t_timer /Users/clausklein/Workspace/cpp/asio.cmake/stage/lib/asio/libasio.a && :
Claus-iMac:standalone clausklein$
I think it was covered with the https://github.com/OlivierLDff/asio.cmake/blob/aee5a9802ec1322264fa18b8c61bda1af66f580f/tests/install/CMakeLists.txt#L1-L5 test case I added (it also run in CI)
I merged your latest commit in https://github.com/OlivierLDff/asio.cmake/pull/12 For using upstream cpm, I like having all the code I use on my github, so it is easy to backup.
For using upstream cpm, I like having all the code I use on my github, so it is easy to backup. You may exchange the
CPM.cmake bootstrap
module with the real CPM.cmake module.
use origin
CPM.cmake
url use newestCMake
properties if available fix typo