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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:11:08+00:00 2026-05-22T15:11:08+00:00

The following is my CMakeLists file. By default, I expect it to define the

  • 0

The following is my CMakeLists file. By default, I expect it to define the symbol ALLEGRO_STATICLINK in the agui_allegro5 library, but it does not, however when I check off WANT_SHARED it defines it, which it shouldnt, but does not define AGUI_BACKEND_BUILD as it should. Is my logic flawed or something?

cmake_minimum_required(VERSION 2.6)

project(agui)

OPTION(WANT_SHARED "Build agui and the backend as a shared library" OFF) 

OPTION(WANT_ALLEGRO5_BACKEND "Build the Allegro 5 backend" ON) 

set(AGUI_SOURCES
    src/Agui/ActionEvent.cpp
    src/Agui/ActionListener.cpp
    src/Agui/BaseTypes.cpp
    src/Agui/BlinkingEvent.cpp
    src/Agui/BorderLayout.cpp
    src/Agui/Color.cpp
    src/Agui/Dimension.cpp
    src/Agui/EmptyWidget.cpp
    src/Agui/EventArgs.cpp
    src/Agui/FlowLayout.cpp
    src/Agui/FocusListener.cpp
    src/Agui/FocusManager.cpp
    src/Agui/Font.cpp
    src/Agui/FontLoader.cpp
    src/Agui/Graphics.cpp
    src/Agui/GridLayout.cpp
    src/Agui/Gui.cpp
    src/Agui/Image.cpp
    src/Agui/ImageLoader.cpp
    src/Agui/Input.cpp
    src/Agui/KeyboardListener.cpp
    src/Agui/Layout.cpp
    src/Agui/MouseListener.cpp
    src/Agui/Point.cpp
    src/Agui/Rectangle.cpp
    src/Agui/ResizableText.cpp
    src/Agui/ResizableBorderLayout.cpp
    src/Agui/SelectionListener.cpp
    src/Agui/TopContainer.cpp
    src/Agui/Widget.cpp
    src/Agui/WidgetListener.cpp
    src/Agui/Widgets/Button/Button.cpp
    src/Agui/Widgets/Button/ButtonListener.cpp
    src/Agui/Widgets/CheckBox/CheckBox.cpp
    src/Agui/Widgets/CheckBox/CheckBoxListener.cpp
    src/Agui/Widgets/DropDown/DropDown.cpp
    src/Agui/Widgets/DropDown/DropDownListener.cpp
    src/Agui/Widgets/Frame/Frame.cpp
    src/Agui/Widgets/Frame/FrameListener.cpp
    src/Agui/Widgets/Label/Label.cpp
    src/Agui/Widgets/Label/LabelListener.cpp
    src/Agui/Widgets/ListBox/ListBox.cpp
    src/Agui/Widgets/ListBox/ListBoxListener.cpp
    src/Agui/Widgets/RadioButton/RadioButton.cpp
    src/Agui/Widgets/RadioButton/RadioButtonListener.cpp
    src/Agui/Widgets/RadioButton/RadioButtonGroup.cpp
    src/Agui/Widgets/ScrollBar/HScrollBar.cpp
    src/Agui/Widgets/ScrollBar/HScrollBarListener.cpp
    src/Agui/Widgets/ScrollBar/VScrollBar.cpp
    src/Agui/Widgets/ScrollBar/VScrollBarListener.cpp
    src/Agui/Widgets/ScrollPane/ScrollPane.cpp
    src/Agui/Widgets/Slider/Slider.cpp
    src/Agui/Widgets/Slider/SliderListener.cpp
    src/Agui/Widgets/Tab/Tab.cpp
    src/Agui/Widgets/Tab/TabbedPane.cpp
    src/Agui/Widgets/Tab/TabbedPaneListener.cpp
    src/Agui/Widgets/TextBox/TextBox.cpp
    src/Agui/Widgets/TextBox/TextBoxListener.cpp
    src/Agui/Widgets/TextBox/ExtendedTextBox.cpp
    src/Agui/Widgets/TextField/TextField.cpp
    src/Agui/Widgets/TextField/TextFieldListener.cpp
    )

set(ALLEGRO5_BACKEND_SOURCES
    src/Agui/Backends/Allegro5/Allegro5Font.cpp
    src/Agui/Backends/Allegro5/Allegro5FontLoader.cpp
    src/Agui/Backends/Allegro5/Allegro5Graphics.cpp
    src/Agui/Backends/Allegro5/Allegro5Image.cpp
    src/Agui/Backends/Allegro5/Allegro5ImageLoader.cpp
    src/Agui/Backends/Allegro5/Allegro5Input.cpp
    )

    include_directories (./include) 
if(WANT_SHARED)
  add_library(agui SHARED ${AGUI_SOURCES})
  set_target_properties(agui PROPERTIES DEFINE_SYMBOL "AGUI_BUILD")

  if(WANT_ALLEGRO5_BACKEND)
    add_library(agui_allegro5 SHARED ${ALLEGRO5_BACKEND_SOURCES})
    set_target_properties(agui_allegro5 PROPERTIES DEFINE_SYMBOL "AGUI_BACKEND_BUILD")
    target_link_libraries (agui_allegro5 agui)
  endif()

else()
  add_library(agui STATIC ${AGUI_SOURCES})

  if(WANT_ALLEGRO5_BACKEND)
    add_library(agui_allegro5 STATIC ${ALLEGRO5_BACKEND_SOURCES})
    set_target_properties(agui_allegro5 PROPERTIES DEFINE_SYMBOL "ALLEGRO_STATICLINK")
  endif()

endif()

Thanks

  • 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-22T15:11:09+00:00Added an answer on May 22, 2026 at 3:11 pm

    According to CMake documentation “DEFINE_SYMBOL sets the name of the preprocessor symbol defined when compiling sources in a shared library” while you are trying to use it on a static library, hence no effect. You may also find this discussion useful.

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

Sidebar

Related Questions

I have the following line in a CMakeLists.txt file... else message(FATAL_ERROR Could not locate
Following does not work on linux machine. Charset charset = Charset.forName(UTF-8); CharsetDecoder decoder =
Following command will let me know the names of databases. $ mysqlshow But how
I want to build LLVM clang compiler, but CMake ends up with the following
Following method is accepted if I set UIColor like: [tabBarController.tabBar setSelectedImageTintColor:[UIColor greenColor]]; However I
Does anyone know what The C compiler cl is not able to compile a
I have project of following struct A CMakeLists.txt B CMakeLists.txt C CMakeLists.txt I directory
Following the instructions here , I've set up a CMakeLists.txt : Find_Package (SDL REQUIRED)
Following my question regarding a .NET YAML Library ... as there doesn't seem to
Following this question: Good crash reporting library in c# Is there any library like

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.