我想提出一个子标题的
我的项目结构就是这样:
app/
A
B
lib/
A
B
C
有时,我只想提一下,不希望清理图书馆。
是否有可能告诉CMake为每个名录设定一个clean的目标?
Or a custom target like app-clean which will call clean on each application sub-directory?
我想提出一个子标题的
我的项目结构就是这样:
app/
A
B
lib/
A
B
C
有时,我只想提一下,不希望清理图书馆。
是否有可能告诉CMake为每个名录设定一个clean的目标?
Or a custom target like app-clean which will call clean on each application sub-directory?
您仅可打到{CMAKE_BINaire_DIR}/app/A,并在那里操作make Clean
。
Of course, you can add_custom_target(app-A-clean ...) which would do this for you.
macro(add_clean_target dir)
add_custom_target(clean-${dir} COMMAND ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir})
endmacro(add_clean_target)
现在你可以这样使用:
add_clean_target(app-A)
也许会设法设立你的CMakeLists.txt,拥有一个project <<<<<<<><>>> 每个名录上的项目;以及一个“root”CMakeLists.txt, 简单地说是
例如,在我的一个项目中,我有以下结构: 在项目调查中,我设立了一个CMakeList。 类似: 在<代码>图书馆/上,我做了以下工作: 之后在<代码>中,应用/: 在这种情况下,我可以步入<条码>、项目/申请/编码>和<条码><>make或<条码>>。 同样,请打电话<代码>make Clean或 所有图书馆额外名录的附加好处是,我可以一劳永逸地建造这些图书馆,管理<条码><<>make>>/代码>或<条码>。 sln in the projectroot/
applications/
appA
libraries/
libA
libB
project(MyProject)
add_subdirectory(libraries)
add_subdirectory(applications)
project(Libraries)
add_subdirectory(libA)
add_subdirectory(libB)
add_subdirectory(libC)
project(Applications)
add_subdirectory(appA)
msbuild /t:Clean appA.sln
。libraries/
dir.
How do I write a CMakeLists.txt file so that cmake generates a Makefile with functionality equivalent to all: proj debug: CXXFLAGS += -DDEBUG -g -Og debug: proj proj: $(CXX) $(CXXFLAGS) main....
My setup: Windows 10 Pro 22H2 (19045.2965) CLion 2020.1.3 (JetBrains) WSL2 with Ubuntu 22.04.2 LTS gcc 11.3.0 cmake 3.22.1 gdb 12.1 gmake 4.3 CMakeLists.txt cmake_minimum_required(VERSION 3.22)...
We build several private frameworks that get copied into our application bundle during our Xcode build process. I m moving the whole build process to CMake, and this is one area that I haven t been ...
I am trying to use CMake to compile a C++ application that uses the C library GStreamer. My main.cpp file looks like this: extern "C" { #include <gst/gst.h> #include <glib.h> } int main(...
I m trying to add the item <key>UIStatusBarHidden</key><true/> to my plist that s auto-generated by CMake. For certain keys, it appears there are pre-defined ways to add an item; ...
Let s assume I have directories like: dir1 main.cpp dir2 abc.cpp dir3 def.cpp dir4 ghi.cpp jkl.cpp And let s assume that main.cpp ...
On a Windows 7 machine I cannot read any registry values that contain a semicolon. For example if you have 7-zip, running the following SET(MYPATH [HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip;Path]) ...
I am using the macports version of python on a Snow Leopard computer, and using cmake to build a cross-platform extension to it. I search for the python interpreter and libraries on the system using ...