Output directory of libraries in CMake

General questions regarding the usage of CodeLite
amwink
CodeLite Enthusiast
Posts: 25
Joined: Mon Jun 08, 2020 4:04 pm
Genuine User: Yes
IDE Question: c++
Contact:

Output directory of libraries in CMake

Post by amwink »

I am using the CMake build plugin for a number of projects that share bin/, lib/, etc. directories.

in each library project I put the General settings:
Output File to lib$(ProjectName).so
Executable to run / execute to $(WorkspacePath)/cmake-build-$(WorkspaceConfiguration)/lib/$(OutputFile)
Working Directory to $(WorkspacePath)/cmake-build-$(WorkspaceConfiguration)/lib

and Global settings
Library Path to .;..;$(WorkspacePath)/cmake-build-$(WorkspaceConfiguration)/lib

So I expected to have each library put in the lib/ directory, and have other libraries link against the files in there as well.
However, each time I run CMake, it overwrites the output directory for the library to $(WorkspacePath)/cmake-build-$(WorkspaceConfiguration)/lib: this is what is in the file CMakeLists.txt:

Code: Select all

set(CL_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/${CL_WORKSPACE_DIRECTORY}/cmake-build-${CONFIGURATION_NAME}/output)

The lib directory occurs once in there, but only as the library path for the linker.
In other words, every time I run CMake, I need to manually change CMakeLists.txt before building.

Is there a setting to do this automatically, or perhaps the possibility to change the template CMakeLists.txt?
Many thanks!