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 135799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:50:51+00:00 2026-05-11T06:50:51+00:00

I’m wondering how i can make a portable build system (step-by-step), i currently use

  • 0

I’m wondering how i can make a portable build system (step-by-step), i currently use cmake because it was easy to set up in the first place, with only one arch target, but now that i have to package the library I’m developing I’m wondering how is the best way to make it portable for arch I’m testing.

I know I need a config.h to define things depending on the arch but I don’t know how automatic this can be.

Any other way to have a build system are warmly welcome!

  • 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. 2026-05-11T06:50:52+00:00Added an answer on May 11, 2026 at 6:50 am

    You can just use CMake, it’s pretty straightforward.

    You need these things:

    First, means to find out the configuration specifics. For example, if you know that some function is named differently on some platform, you can use TRY_COMPILE to discover that:

    TRY_COMPILE(HAVE_ALTERNATIVE_FUNC      ${CMAKE_BINARY_DIR}     ${CMAKE_SOURCE_DIR}/alternative_function_test.cpp     CMAKE_FLAGS -DINCLUDE_DIRECTORIES=xxx ) 

    where alternative_function_test.cpp is a file in your source directory that compiles only with the alternative definition.

    This will define variable HAVE_ALTERNATIVE_FUNC if the compile succeeds.

    Second, you need to make this definition affect your sources. Either you can add it to compile flags

    IF(HAVE_TR1_RANDOM)     ADD_DEFINITIONS(-DHAVE_TR1_RANDOM) ENDIF(HAVE_TR1_RANDOM) 

    or you can make a config.h file. Create config.h.in with the following line

    #cmakedefine HAVE_ALTERNATIVE_FUNCS 

    and create a config.h file by this line in CMakeLists.txt (see CONFIGURE_FILE)

    CONFIGURE_FILE(config.h.in config.h @ONLY) 

    the #cmakedefine will be translated to #define or #undef depending on the CMake variable.

    BTW, for testing edianness, see this mail

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

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I am currently running into a problem where an element is coming back from
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

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.