Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
RobWork
RobWork
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 18
    • Issues 18
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Requirements
    • Requirements
    • List
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • SDU Robotics
  • RobWorkRobWork
  • Issues
  • #5

Closed
Open
Created Apr 28, 2016 by Thomas Nicky Thulesen@TThulesenOwner

Inconsistency between building of static and shared libraries.

For the first build of RobWork, static libraries are built. If cmake is run again, shared libraries are built (causing a recompilation of the entire project). Previously I have experienced a similar issue in RobWorkSim where the config.cmake.template overrules options from the second run of cmake and onwards.

The RW_INIT_PROJECT macro will load the config.cmake.template file, which specifies:

 SET(PROJECT_SHARED_LIBS ON)

After this, the RW_OPTIONS macro is called, and sets shared libraries to OFF initially:

 option(PROJECT_SHARED_LIBS "Build shared libraries." OFF)

I think that this is what happens:

  • For the first run: the variable is set to ON and afterwards overwritten by the option statement, which sets it to OFF adds an entry to the CMake cache.
  • For the second run: the variable is OFF initially, but is overwritten by the set statement. The option statement has no effect, as it is a value read from the cache.

A Fix

In RobWorkMacros.cmake the default option can just be set to ON. This will, however, not change the fact that config.cmake.template will always overrule the CMakeCache. This is ugly in my opinion.

It is unfortunate that default parameters can be specified multiple places. Especially when these are often inconsistent. Maybe the .template file should not even be used.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking