Skip to main content

Executable CMakeLists.txt in root.

 I can not append sources but compiled it by revisement of CMakeLists.txt.




---
$ tree .
.
├── CMakeLists.txt
├── build
└── src
    ├── CMakeLists.txt
    ├── main.c
    └── main.h

2 directories, 4 files

---
$ cd build
$ cmake ..

-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- ========== Configuring Audacity_001 ==========
-- ========== Configuring /home/nakagawa/src/20201024/src ==========
-- ========== Configuring /home/nakagawa/src/20201024 ==========
CMake Error at src/CMakeLists.txt:9 (add_executable):
  add_executable called with incorrect number of arguments


CMake Error at src/CMakeLists.txt:16 (source_organization):
  Unknown CMake command "source_organization".


-- Configuring incomplete, errors occurred!
See also "/home/nakagawa/src/20201024/build/CMakeFiles/CMakeOutput.log".

---
#cmake_minimum_required( VERSION 3.6.1 )
cmake_minimum_required( VERSION 2.8.12.2 )

project( Audacity_001 )

set( topdir "${CMAKE_SOURCE_DIR}" )
add_subdirectory( "src" )
set( TARGET Audacity_001 )
set( TARGET_ROOT ${topdir}/src )

message( STATUS "========== Configuring ${TARGET} ==========" )
message( STATUS "========== Configuring ${TARGET_ROOT} ==========" )
message( STATUS "========== Configuring ${topdir} ==========" )

#add_executable( ${TARGET} ${SOURCES} )
add_executable( ${TARGET} main.c )

list ( APPEND SOURCES
        PRIVATE
                main.c
)
$ cmake ..
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- ========== Configuring Audacity_001 ==========
-- ========== Configuring /home/nakagawa/src/20201024/src ==========
-- ========== Configuring /home/nakagawa/src/20201024 ==========
-- Configuring done
-- Generating done
-- Build files have been written to: /home/nakagawa/src/20201024/build

Comments

Popular posts from this blog

ffmpeg: compilation: Makefile

1. Find sub-directory and ... 2. Care of the literature and ... * Parameter print - - - - CONFIG_POSTPROC - - - .PHONY ...  there is a file named  clean . ... - - - - - - - - - - - - .\Makefile File changed time Fri Jun 04 12:29:06 2021 1 :MAIN_MAKEFILE=1 2 :include config.mak 3 : 4 :vpath %.c $(SRC_PATH) 5 :vpath %.cpp $(SRC_PATH) 6 :vpath %.h $(SRC_PATH) 7 :vpath %.inc $(SRC_PATH) 8 :vpath %.m $(SRC_PATH) 9 :vpath %.S $(SRC_PATH) 10 :vpath %.asm $(SRC_PATH) 11 :vpath %.rc $(SRC_PATH) 12 :vpath %.v $(SRC_PATH) 13 :vpath %.texi $(SRC_PATH) 14 :vpath %/fate_config.sh.template $(SRC_PATH) 15 : 16 :AVPROGS-$(CONFIG_FFMPEG) += ffmpeg 17 :AVPROGS-$(CONFIG_FFPLAY) += ffplay 18 :AVPROGS-$(CONFIG_FFPROBE) += ffprobe 19 :AVPROGS-$(CONFIG_FFSERVER) += ffserver 20 : 21 :AVPROGS := $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF)) 22 :INSTPROGS = $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF)) ...

Big Leaves:

They are growing this year.Dirt is well for any leaves.Weirds are cut by the machine on the line. 2022/10/09 10:24:08 *

cmake-gui

We could yum-search cmake-gui, install it and boot it so that easily create project files for compilation, which means almost make files as configured: cmake-gui can use VERSION 3.6.1 if you add entry: message is the below: CMake Error: The source directory "...../read_005/src" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. We must create CMakeLists.txt but we can select "from UNIX makefile" as "Configure". "cmake-gui" itself is CMake 2.8.12.2 displayed. We could see CmakeCache.txt like the below so that we could not create tags by use of cmak-gui. ######################## # EXTERNAL cache entries ######################## cmake_minimum_required:STRING=VERSION 3.6.1 We'd rather love: cmake_minimum_required(VERSION 3.6.1) cmake-gui version itself must be higher, at least, we think.  (20200911: cmake3-gui) Configured and Generator: Now they are same. --- CMake Error: The source dir...