CMake configure_file replace ON/OFF with 1/0
Tag : cmake , By : Longchao Dong
Date : March 29 2020, 07:55 AM
will help you Suppose I have two libraries ABC, XYZ and two variables ABC_FOUND XYZ_FOUND in CMakeLists.txt. In a config.h.in file, I have the following lines , Define ABC_FOUND to either 0 or 1 with #cmakedefine01 @ABC_FOUND@
|
CMake and configure_file: what if I need $ONLY instead of @ONLY?
Tag : cmake , By : Pierre LeBoo
Date : March 29 2020, 07:55 AM
it fixes the issue At least I found a solution that works, even if I'm not sure that's the best approach ever. I leave it as an answer for future readers in case no solutions come up. @DontTouchMe@/${PROJECT_NAME}
@@Workaround@DontTouchMe@Workaround@@/${PROJECT_NAME}
@DontTouchMe@/TheNameOfTheProject
|
CMake Error (configure_file): configure_file error configuring file
Tag : cmake , By : mansoor
Date : March 29 2020, 07:55 AM
around this issue I am working on a project on c++ and need to execute a CMakeLists.txt file to run it. I installed cmake, doxygen, cmake-curses-gui and make using sudo. Then I tried running the file. , The error is clear configure_file(${PROJECT_SOURCE_DIR}/doc/Doxyfile.in ${PROJECT_SOURCE_DIR}/doc/Doxyfile @ONLY)
|
CMake : different configure_file() for each target
Date : March 29 2020, 07:55 AM
To fix the issue you can do The command configure_file creates a "real" file: it has the same content for each target. However, the created file may contain #ifdef (or other conditional statements), so its interpretation may differ for different target. #ifndef TEST
#define MY_A 10
#endif
#ifdef PINK
#define MY_A 20
#endif
add_executable(FirstTarget ...)
# When "config.h" will be included into this target, it will use "PINK" branch.
target_compile_definitions(FirstTarget PRIVATE PINK)
add_executable(SecondTarget ...)
# When "config.h" will be included into this target, it will use "TEST" branch.
target_compile_definitions(FirstTarget PRIVATE TEST)
|
CMake: Is it possible to run CONFIGURE_FILE after each make?
Date : March 29 2020, 07:55 AM
|