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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:18:01+00:00 2026-06-14T11:18:01+00:00

I am using CMake 2.8.8 and the ExternalProject module. CMake retrieves the project’s source

  • 0

I am using CMake 2.8.8 and the ExternalProject module. CMake retrieves the project’s source files and builds them correctly (resulting in project.a and project.so files on unix). I want to always go with the dynamic library. How can I do that and still be cross platform?

I tried

list(
    APPEND foo_LIBRARIES
    ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}project${CMAKE_FIND_LIBRARY_SUFFIXES}
)

but that does not work because {CMAKE_FIND_LIBRARY_SUFFIXES} is a list of .a;.so.

list(
    APPEND foo_LIBRARIES
    ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}project.so
)

works, but only on unix systems. Is there a clean way to achieve this?

  • 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-14T11:18:02+00:00Added an answer on June 14, 2026 at 11:18 am

    Given that for WIN32 the ${CMAKE_FIND_LIBRARY_SUFFIXES} is just .lib, you could do something like:

    set(ProjectSuffix ${CMAKE_FIND_LIBRARY_SUFFIXES})
    list(REMOVE_ITEM ProjectSuffix .a)
    list(APPEND foo_LIBRARIES
        ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}project${ProjectSuffix})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using CMake to generate Visual Studio project files. I want to run
I'm using cmake with C++ project. I want to use precompiled headers in GCC.
I want to disallow people from cluttering our source tree with generated CMake files...
I'm using cmake for my project. No I want to split some parts into
We are using CMake to manage our builds and have a rather large project
I am using CMake to build my project and I have the following line:
I want to run code which needs boost libraries. I built it using CMake.
I have downloaded mysql-connector-c-6.0.2. I build it using below commands: cmake -G Unix Makefiles
I'am using CMake to create a Visual Studio 2008 project. In this project I
I am using CMake 2.8 under Windows XP and want to generate a Visual

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.