Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9265559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:05:48+00:00 2026-06-18T14:05:48+00:00

I am writing a C++ library which can be used from both C++ and

  • 0

I am writing a C++ library which can be used from both C++ and Python on Mac and Linux. So I have decided to use CMake and SWIG for my project.

As well described in the SWIG 2.0 documentation, combination of SWIG and CMake also works fine on my Mac.
http://www.swig.org/Doc2.0/SWIGDocumentation.html#Introduction_build_system

But I have a question about make install.

After typing cmake . and make, _example.so was successfully generated. But make install does not work, because the auto-generated Makefile does not have install target. I would like to know how I can add install target in the Makefile. I would like _example.so to be installed under site-packages directory on each system.

I would very appreciate it if anyone could tell me how to modify the CMake example written in the above link.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:05:50+00:00Added an answer on June 18, 2026 at 2:05 pm

    The CMake interface to make install is the CMake command install(). In your example, you could add an installation rule like this:

    install(
      TARGETS ${SWIG_MODULE_example_REAL_NAME} 
      # ... add other arguments to install() as necessary
    )
    

    Once there are any install() commands in a CMakeList, CMake will generate an install target callable as make install.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a library which uses a few functions from the windows user32.dll
I am writing library which wraps a lot of functions and methods from other
So I'm writing an Android app which uses a large c++ library. I have
I am writing a library which is a set of classes meant to be
I have been writing a library for my project (for now I am using
I'm writing a library search engine where a user can search based on various
I have an issue which I hope I will solve by writing this question
I have a JS library file of variables (caption strings) used by server-side JavaScript.
I'm writing a library and wonder what's the best practice for datatypes used in
I have a C++ class I'm writing now that will be used all over

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.