いろんなShellスクリプトを利用させていただいている。
dockerでTOPPERS/FMPをコンパイルするような。
自分の作業として、言語規格や各種書籍等のソースコードをコンパイルするときに、shellスクリプト等が付いていない場合に、shellスクリプトを自作している。
場合によっては、clang++, g++の-std=c++03, -std=c++11, -std=c++17, -std=c++2aなど、各種版の違いを確認したいため、何種類も並行して作業する。
最近はCmakeを使うのがおしゃれらしい。
Cmakeを使っていないソースの、Cmakeファイルを作り、それをダウンロードしたディレクトリに展開するshellスクリプトを作る過程を記録する。
shellスクリプトの知識も経験も浅い。熟練者が作る手順とは違うかもしれない。
出来上がったものも、もっとこうした方がいいという箇所が多数あるかもしれない。
shellスクリプトを作る際に間違えたらどうするかを
#!/bin/bash
./CMakeLis.sh dir
cmake CMakeLists.txt
make
#!/bin/bash
while read line
do
echo "cp CMakeLists.txt.$line ./$line/CMakeLists.txt"
done < ./$1
basics
bridge
debugging
deduce
details
expertmpl
inherit
meta
names
overload
poly
traits
tuples
typeoverload
utils
variant
個別のCmakeLists.txtファイルはこちら
https://github.com/kaizen-nagoya/cpp-compile-test
今からやろうとするのは、上記githubからダウンロードしたスクリプト等を自動実行するshellスクリプトの作成 by shell and Cmake 超初心者。
#!/bin/bash
echo ./s.sh > pwd.txt
cdir = `cat pwd.txt`
cd $1
./CMakeLis.sh ${cdir} dir
cmake CMakeLists.txt
make
#!/bin/bash
echo `pwd`
#!/bin/bash
cp $1/CMakeLists.txt .
while read line
do
echo "cp $1/CMakeLists.txt.$line ./$line/CMakeLists.txt"
done < ./$2
$ ./CMakel.sh ../tmplbook-code2
./CMakel.sh: line 3: cdir: command not found
./CMakel.sh: line 5: ./CMakeLis.sh: No such file or directory
CMake Error: The source directory "/Users/ogawakiyoshi/Downloads/tmplbook-code2" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** No targets specified and no makefile found. Stop.
#!/bin/bash
echo ./s.sh > pwd.txt
cdir=`cat pwd.txt`
cd $1
./CMakeLis.sh ${cdir} dir
cmake CMakeLists.txt
make
$ ./CMakel.sh ../tmplbook-code2
./CMakel.sh: line 5: ./CMakeLis.sh: No such file or directory
CMake Error: The source directory "/Users/ogawakiyoshi/Downloads/tmplbook-code2" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** No targets specified and no makefile found. Stop.
ファイル名がCMakelis.shになっていた。
$ mv CMakelis.sh CMakeLis.sh
#!/bin/bash
./s.sh > pwd.txt
cdir=`cat pwd.txt`
echo ${cdir}
cd $1
../${dir}/CMakeLis.sh ${cdir} dir
cmake CMakeLists.txt
make
$ ./CMakel.sh ../tmplbook-code2
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master
./CMakel.sh: line 6: ..//CMakeLis.sh: No such file or directory
CMake Error: The source directory "/Users/ogawakiyoshi/Downloads/tmplbook-code2" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** No targets specified and no makefile found. Stop.
#!/bin/bash
./s.sh > pwd.txt
cdir=`cat pwd.txt`
echo ${cdir}
cd $1
${dir}/CMakeLis.sh ${cdir} dir
cmake CMakeLists.txt
make
同じ
$ ./CMakel.sh ../tmplbook-code2
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master
./CMakel.sh: line 6: /CMakeLis.sh: No such file or directory
CMake Error: The source directory "/Users/ogawakiyoshi/Downloads/tmplbook-code2" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** No targets specified and no makefile found. Stop.
$ ./CMakel.sh ../tmplbook-code2
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLis.sh: line 6: ./dir: No such file or directory
-- The C compiler identification is AppleClang 9.1.0.9020039
-- The CXX compiler identification is AppleClang 9.1.0.9020039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
CMake Warning (dev) at CMakeLists.txt:29 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/basics
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:30 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/bridge
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:31 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/debugging
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:32 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/deduce
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:33 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/details
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:34 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/exprtmpl
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:35 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/inherit
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:36 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/meta
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:37 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/names
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:38 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/overload
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:39 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/poly
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:40 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/traits
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:41 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/tuples
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:42 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/typeoverload
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:43 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/utils
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:44 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/variant
does not contain a CMakeLists.txt file.
CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.
Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ogawakiyoshi/Downloads/tmplbook-code2
#!/bin/bash
./s.sh > pwd.txt
cdir=`cat pwd.txt`
echo ${cdir}
cd $1
${cdir}/CMakeLis.sh ${cdir} ${cdir}/dir
cmake CMakeLists.txt
make
$ ./CMakel.sh ../tmplbook-code2
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLis.sh: line 6: .//Users/ogawakiyoshi/Downloads/cpp-compile-test-master/dir: No such file or directory
CMake Warning (dev) at CMakeLists.txt:29 (add_subdirectory):
The source directory
*** snip ***
#!/bin/bash
./s.sh > pwd.txt
cdir=`cat pwd.txt`
echo ${cdir}
cp CMakeLis.sh $1
cp dir $1
cd $1
CMakeLis.sh ${cdir} dir
cmake CMakeLists.txt
make
$ ./CMakel.sh ../tmplbook-code2
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master
./CMakel.sh: line 8: CMakeLis.sh: command not found
CMake Warning (dev) at CMakeLists.txt:29 (add_subdirectory):
The source directory
/Users/ogawakiyoshi/Downloads/tmplbook-code2/basics
does not contain a CMakeLists.txt file.
$ cd ../tmplbook-code
$ ./CMakeLis.sh /Users/ogawakiyoshi/Downloads/cpp-compile-test-master dir
cp: ./CMakeLists.txt and /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt are identical (not copied).
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.basics ./basics/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.bridge ./bridge/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.debugging ./debugging/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.deduce ./deduce/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.details ./details/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.expertmpl ./expertmpl/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.inherit ./inherit/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.meta ./meta/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.names ./names/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.overload ./overload/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.poly ./poly/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.traits ./traits/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.tuples ./tuples/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.typeoverload ./typeoverload/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.utils ./utils/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.variant ./variant/CMakeLists.txt
cp /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt. .//CMakeLists.txt
dirの最後の空白行を削除。/を入れると色々な悪さをしてくれる。
#!/bin/bash
./s.sh > pwd.txt
cdir=`cat pwd.txt`
echo ${cdir}
cp CMakeLis.sh $1
cp dir $1
cd $1
./CMakeLis.sh ${cdir} dir
cmake CMakeLists.txt
make
#!/bin/bash
cp $1/CMakeLists.txt .
while read line
do
cp $1/CMakeLists.txt.$line ./$line/CMakeLists.txt
done < ./$2
$ ./CMakeLis.sh /Users/ogawakiyoshi/Downloads/cpp-compile-test-master dir
cp: /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt.expertmpl: No such file or directory
dirの訂正。
#!/bin/bash
./s.sh > pwd.txt
cdir=`cat pwd.txt`
echo ${cdir}
cp CMakeLis.sh $1
cp dir $1
pwd
cd $1
pwd
./CMakeLis.sh ${cdir} dir
cmake CMakeLists.txt
make
CMake Error at deduce/CMakeLists.txt:8 (add_executable):
Cannot find source file:
initlist2.cpp
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx
miss spell. change from "initlist2" to "initlist
set_source_files_properties(
aliastemplate.cpp
initlist.cpp
resulttypetmpl.cpp
PROPERTIES COMPILE_FLAGS -std=c++2a
)
add_executable(aliastemplate aliastemplate.cpp)
add_executable(initlist2 initlist.cpp)
add_executable(resulttypetmpl resulttypetmpl.cpp)
$ ./CMakeL.sh ../tmplbook-codel5
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master
./CMakeL.sh: line 8: cd: ../tmplbook-codel5: Not a directory
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master
cp: ./CMakeLists.txt and /Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeLists.txt are identical (not copied).
cp: ./basics/CMakeLists.txt: No such file or directory
cp: ./bridge/CMakeLists.txt: No such file or directory
cp: ./debugging/CMakeLists.txt: No such file or directory
cp: ./deduce/CMakeLists.txt: No such file or directory
cp: ./details/CMakeLists.txt: No such file or directory
cp: ./exprtmpl/CMakeLists.txt: No such file or directory
cp: ./inherit/CMakeLists.txt: No such file or directory
cp: ./meta/CMakeLists.txt: No such file or directory
cp: ./names/CMakeLists.txt: No such file or directory
cp: ./overload/CMakeLists.txt: No such file or directory
cp: ./poly/CMakeLists.txt: No such file or directory
cp: ./traits/CMakeLists.txt: No such file or directory
cp: ./tuples/CMakeLists.txt: No such file or directory
cp: ./typeoverload/CMakeLists.txt: No such file or directory
cp: ./utils/CMakeLists.txt: No such file or directory
cp: ./variant/CMakeLists.txt: No such file or directory
-- The C compiler identification is AppleClang 9.1.0.9020039
-- The CXX compiler identification is AppleClang 9.1.0.9020039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
CMake Error at CMakeLists.txt:29 (add_subdirectory):
add_subdirectory given source "basics" which is not an existing directory.
CMake Error at CMakeLists.txt:30 (add_subdirectory):
add_subdirectory given source "bridge" which is not an existing directory.
CMake Error at CMakeLists.txt:31 (add_subdirectory):
add_subdirectory given source "debugging" which is not an existing
directory.
CMake Error at CMakeLists.txt:32 (add_subdirectory):
add_subdirectory given source "deduce" which is not an existing directory.
CMake Error at CMakeLists.txt:33 (add_subdirectory):
add_subdirectory given source "details" which is not an existing directory.
CMake Error at CMakeLists.txt:34 (add_subdirectory):
add_subdirectory given source "exprtmpl" which is not an existing
directory.
CMake Error at CMakeLists.txt:35 (add_subdirectory):
add_subdirectory given source "inherit" which is not an existing directory.
CMake Error at CMakeLists.txt:36 (add_subdirectory):
add_subdirectory given source "meta" which is not an existing directory.
CMake Error at CMakeLists.txt:37 (add_subdirectory):
add_subdirectory given source "names" which is not an existing directory.
CMake Error at CMakeLists.txt:38 (add_subdirectory):
add_subdirectory given source "overload" which is not an existing
directory.
CMake Error at CMakeLists.txt:39 (add_subdirectory):
add_subdirectory given source "poly" which is not an existing directory.
CMake Error at CMakeLists.txt:40 (add_subdirectory):
add_subdirectory given source "traits" which is not an existing directory.
CMake Error at CMakeLists.txt:41 (add_subdirectory):
add_subdirectory given source "tuples" which is not an existing directory.
CMake Error at CMakeLists.txt:42 (add_subdirectory):
add_subdirectory given source "typeoverload" which is not an existing
directory.
CMake Error at CMakeLists.txt:43 (add_subdirectory):
add_subdirectory given source "utils" which is not an existing directory.
CMake Error at CMakeLists.txt:44 (add_subdirectory):
add_subdirectory given source "variant" which is not an existing directory.
-- Configuring incomplete, errors occurred!
See also "/Users/ogawakiyoshi/Downloads/cpp-compile-test-master/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.
呼び出し間違い。
$ ./CMakeL.sh ../tmplbook-code5
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master
/Users/ogawakiyoshi/Downloads/tmplbook-code5
-- The C compiler identification is AppleClang 9.1.0.9020039
-- The CXX compiler identification is AppleClang 9.1.0.9020039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
CMake Error at overload/CMakeLists.txt:8 (add_executable):
add_executable cannot create target "initlist" because another target with
the same name already exists. The existing target is an executable created
in source directory "/Users/ogawakiyoshi/Downloads/tmplbook-code5/deduce".
See documentation for policy CMP0002 for more details.
-- Configuring incomplete, errors occurred!
See also "/Users/ogawakiyoshi/Downloads/tmplbook-code5/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.
$
$ ./CMakeL.sh ../tmplbook-code6 dir
./CMakeL.sh: line 2: ./s.sh: No such file or directory
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master-2
/Users/ogawakiyoshi/Downloads/tmplbook-code6
cp CMakeLists.txt ./basics/CMakeLists.txt
cp CMakeLists.txt ./bridge/CMakeLists.txt
cp CMakeLists.txt ./debugging/CMakeLists.txt
cp CMakeLists.txt ./deduce/CMakeLists.txt
cp CMakeLists.txt ./details/CMakeLists.txt
cp CMakeLists.txt ./exprtmpl/CMakeLists.txt
cp CMakeLists.txt ./inherit/CMakeLists.txt
cp CMakeLists.txt ./meta/CMakeLists.txt
cp CMakeLists.txt ./names/CMakeLists.txt
cp CMakeLists.txt ./overload/CMakeLists.txt
cp CMakeLists.txt ./poly/CMakeLists.txt
cp CMakeLists.txt ./traits/CMakeLists.txt
cp CMakeLists.txt ./tuples/CMakeLists.txt
cp CMakeLists.txt ./typeoverload/CMakeLists.txt
cp CMakeLists.txt ./utils/CMakeLists.txt
cp CMakeLists.txt ./variant/CMakeLists.txt
CMake Error: The source directory "/Users/ogawakiyoshi/Downloads/tmplbook-code6" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** No targets specified and no makefile found. Stop.
$ ./CMakeL.sh ../tmplbook-code6 dir
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master-2
/Users/ogawakiyoshi/Downloads/cpp-compile-test-master-2
/Users/ogawakiyoshi/Downloads/tmplbook-code6
./CMakeLis.sh: line 5: .//Users/ogawakiyoshi/Downloads/cpp-compile-test-master-2: No such file or directory
CMake Error: The source directory "/Users/ogawakiyoshi/Downloads/tmplbook-code6" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** No targets specified and no makefile found. Stop.
文書履歴(document history)
ver. 0.01 初稿 20180513
ver. 0.04 URL追記 20230305
最後までおよみいただきありがとうございました。
いいね 💚、フォローをお願いします。
Thank you very much for reading to the last sentence.
Please press the like icon 💚 and follow me for your happy life.