Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] Execute installation steps for CMake #80

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

uilianries
Copy link
Contributor

@uilianries uilianries commented Sep 11, 2024

Hello!

We are packaging minmea in ConanCenterIndex, through the PR conan-io/conan-center-index#24546 and we found there is no way to install the project via CMake.

This PR brings the support of installing the library and header, directly by using CMake:

cmake --fresh -S . -B build -DCMAKE_INSTALL_PREFIX=/tmp/install 
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Check for working C compiler: /usr/local/bin/cc
-- Check for working C compiler: /usr/local/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/bin/c++
-- Check for working CXX compiler: /usr/local/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'check'
--   Found check, version 0.15.2
-- scan-build not found, not scanning code
-- Configuring done
-- Generating done
-- Build files have been written to: /home/conan/project/build

$ cmake --build build --target install 
Scanning dependencies of target minmea
[ 16%] Building C object CMakeFiles/minmea.dir/minmea.c.o
[ 33%] Linking C static library libminmea.a
[ 33%] Built target minmea
Scanning dependencies of target example
[ 50%] Building C object CMakeFiles/example.dir/example.c.o
[ 66%] Linking C executable example
[ 66%] Built target example
Scanning dependencies of target tests
[ 83%] Building C object CMakeFiles/tests.dir/tests.c.o
[100%] Linking C executable tests
[100%] Built target tests
Install the project...
-- Install configuration: ""
-- Installing: /tmp/install/lib/libminmea.a
-- Installing: /tmp/install/include/minmea.h

So users do not need know what should be copied manually, but can use CMake as well to install the artifacts.

Regards!

Signed-off-by: Uilian Ries <[email protected]>
@kosma
Copy link
Owner

kosma commented Sep 11, 2024

image

@kosma kosma merged commit 4abb6f8 into kosma:master Sep 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants