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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:18:30+00:00 2026-05-24T09:18:30+00:00

In a CMakeLists.txt file, is there a way to detect the highest level of

  • 0

In a CMakeLists.txt file, is there a way to detect the highest level of SSE available, and save it to CMAKE_CXX_FLAGS? In other words, I’d like to be able to write something like:

FindSSE()  # defines SSE_FLAGS
set(CMAKE_CXX_FLAGS ${SSE_FLAGS})

For example, if the platform supports up to SSE level 3, then FindSSE() would set SSE_FLAGS to -msse3.

  • 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-05-24T09:18:31+00:00Added an answer on May 24, 2026 at 9:18 am

    This might be overkill, but the OptimizeForArchitecture.cmake from vc on gitorious will provide a list of optimizations based on the architecture.

    You could either use that script directly or trim it down to the code you need.

    A better solution would be to make a small cmake test script that uses SSE instructions and check if each variant compiles/runs.

    EDIT: More specifically, there’s also FindSSE.cmake in various places, although it still uses the somewhat clunky method of parsing /proc/cpuinfo

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

Sidebar

Related Questions

I have a CMakeLists.txt file that looks like this: add_executable(exec1 exec1.c source1.c source2.c source3.c)
I'm trying to create CMakeLists.txt file for KDE4/Qt4 project. In this project currently there
There is some CMake magic I don't understand. How should a CMakeLists.txt file look
My project directory contains a CMakeLists.txt file and src and include directories at its
I have a project structure like: src/CMakeLists.txt src/test/component1/CMakeLists.txt src/test/component2/CMakeLists.txt For the testing, I'm using
I got an app that links to boost_program_options, whose CMakeLists.txt looks like FIND_PACKAGE(Boost COMPONENTS
Here is my simple CMakeLists.txt file: include_directories (${CMAKE_SOURCE_DIR}/common) find_package(Threads) add_library (libusbmuxd SHARED libusbmuxd.c sock_stuff.c
I have a CMakeLists.txt that produces a .SLN file with 3 projects (libraries) generated
I have a problem with this CMakeLists.txt file: cmake_minimum_required(VERSION 2.6) SET(CMAKE_C_COMPILER C:/MinGW/bin/gcc) SET(CMAKE_CXX_COMPILER C:/MinGW/bin/g++)
When you INCLUDE(CPack) in a CMakeLists.txt file, it adds a target named package to

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.