diff --git a/01-basic/B-hello-headers/CMakeLists.txt b/01-basic/B-hello-headers/CMakeLists.txt index d326979..236ad99 100644 --- a/01-basic/B-hello-headers/CMakeLists.txt +++ b/01-basic/B-hello-headers/CMakeLists.txt @@ -19,5 +19,5 @@ add_executable(hello_headers ${SOURCES}) # Set the direcoties that should be included in the build command for this target # when running g++ these will be included as -I/directory/path/ target_include_directories(hello_headers - PRIVATE ${PROJECT_SOURCE_DIR}/inc -) \ No newline at end of file + PRIVATE ${PROJECT_SOURCE_DIR}/include +) diff --git a/01-basic/B-hello-headers/README.adoc b/01-basic/B-hello-headers/README.adoc index 2c8221a..eb86fc5 100644 --- a/01-basic/B-hello-headers/README.adoc +++ b/01-basic/B-hello-headers/README.adoc @@ -16,7 +16,7 @@ The files in this tutorial include: B-hello-headers$ tree . ├── CMakeLists.txt -├── inc +├── include │   └── Hello.h └── src ├── Hello.cpp @@ -24,7 +24,7 @@ B-hello-headers$ tree ``` * link:CMakeLists.txt[CMakeLists.txt] - Contains the CMake commands you wish to run. - * link:inc/Hello.h[inc/Hello.h] - The header file to include. + * link:include/Hello.h[include/Hello.h] - The header file to include. * link:src/Hello.cpp[src/Hello.cpp] - A source file to compile. * link:src/main.cpp[src/main.cpp] - The source file with main. @@ -91,7 +91,7 @@ When you have different include folders, you can make your compiler aware of the [source,cmake] ---- target_include_directories(target - PRIVATE ${PROJECT_SOURCE_DIR}/inc + PRIVATE ${PROJECT_SOURCE_DIR}/include ) ---- @@ -162,10 +162,10 @@ make -f CMakeFiles/hello_headers.dir/build.make CMakeFiles/hello_headers.dir/bui make[2]: Entering directory `/home/matrim/workspace/cmake-examples/01-basic/hello_headers/build' /usr/bin/cmake -E cmake_progress_report /home/matrim/workspace/cmake-examples/01-basic/hello_headers/build/CMakeFiles 1 [ 50%] Building CXX object CMakeFiles/hello_headers.dir/src/Hello.cpp.o -/usr/bin/c++ -I/home/matrim/workspace/cmake-examples/01-basic/hello_headers/inc -o CMakeFiles/hello_headers.dir/src/Hello.cpp.o -c /home/matrim/workspace/cmake-examples/01-basic/hello_headers/src/Hello.cpp +/usr/bin/c++ -I/home/matrim/workspace/cmake-examples/01-basic/hello_headers/include -o CMakeFiles/hello_headers.dir/src/Hello.cpp.o -c /home/matrim/workspace/cmake-examples/01-basic/hello_headers/src/Hello.cpp /usr/bin/cmake -E cmake_progress_report /home/matrim/workspace/cmake-examples/01-basic/hello_headers/build/CMakeFiles 2 [100%] Building CXX object CMakeFiles/hello_headers.dir/src/main.cpp.o -/usr/bin/c++ -I/home/matrim/workspace/cmake-examples/01-basic/hello_headers/inc -o CMakeFiles/hello_headers.dir/src/main.cpp.o -c /home/matrim/workspace/cmake-examples/01-basic/hello_headers/src/main.cpp +/usr/bin/c++ -I/home/matrim/workspace/cmake-examples/01-basic/hello_headers/include -o CMakeFiles/hello_headers.dir/src/main.cpp.o -c /home/matrim/workspace/cmake-examples/01-basic/hello_headers/src/main.cpp Linking CXX executable hello_headers /usr/bin/cmake -E cmake_link_script CMakeFiles/hello_headers.dir/link.txt --verbose=1 /usr/bin/c++ CMakeFiles/hello_headers.dir/src/Hello.cpp.o CMakeFiles/hello_headers.dir/src/main.cpp.o -o hello_headers -rdynamic diff --git a/01-basic/B-hello-headers/inc/Hello.h b/01-basic/B-hello-headers/include/Hello.h similarity index 100% rename from 01-basic/B-hello-headers/inc/Hello.h rename to 01-basic/B-hello-headers/include/Hello.h diff --git a/01-basic/C-static-library/CMakeLists.txt b/01-basic/C-static-library/CMakeLists.txt index 7624d23..8cde8fc 100644 --- a/01-basic/C-static-library/CMakeLists.txt +++ b/01-basic/C-static-library/CMakeLists.txt @@ -15,7 +15,7 @@ set(library_SOURCES add_library(hello_library STATIC ${library_SOURCES}) target_include_directories(hello_library - PUBLIC ${PROJECT_SOURCE_DIR}/inc + PUBLIC ${PROJECT_SOURCE_DIR}/include ) diff --git a/01-basic/C-static-library/README.adoc b/01-basic/C-static-library/README.adoc index 71b37ba..8754ce3 100644 --- a/01-basic/C-static-library/README.adoc +++ b/01-basic/C-static-library/README.adoc @@ -14,7 +14,7 @@ The files in this tutorial are below: $ tree . ├── CMakeLists.txt -├── inc +├── include │   └── Hello.h └── src ├── Hello.cpp @@ -22,7 +22,7 @@ $ tree ``` * link:CMakeLists.txt[] - Contains the CMake commands you wish to run - * link:inc/Hello.h[] - The header file to include + * link:include/Hello.h[] - The header file to include * link:src/Hello.cpp[] - A source file to compile * link:src/main.cpp[] - The source file with main @@ -53,7 +53,7 @@ In this example, we include directories in the library using the +target_include [source,cmake] ---- target_include_directories(hello_library - PUBLIC ${PROJECT_SOURCE_DIR}/inc + PUBLIC ${PROJECT_SOURCE_DIR}/include ) ---- diff --git a/01-basic/C-static-library/inc/Hello.h b/01-basic/C-static-library/include/Hello.h similarity index 100% rename from 01-basic/C-static-library/inc/Hello.h rename to 01-basic/C-static-library/include/Hello.h diff --git a/01-basic/D-shared-library/CMakeLists.txt b/01-basic/D-shared-library/CMakeLists.txt index b2a2973..50343a5 100644 --- a/01-basic/D-shared-library/CMakeLists.txt +++ b/01-basic/D-shared-library/CMakeLists.txt @@ -16,7 +16,7 @@ add_library(hello_library SHARED ${library_SOURCES}) add_library(hello::library ALIAS hello_library) target_include_directories(hello_library - PUBLIC ${PROJECT_SOURCE_DIR}/inc + PUBLIC ${PROJECT_SOURCE_DIR}/include ) ############################################################ @@ -34,4 +34,4 @@ add_executable(hello_binary ${binary_SOURCES}) # link the new hello_library target with the hello_binary target target_link_libraries( hello_binary PRIVATE hello::library -) \ No newline at end of file +) diff --git a/01-basic/D-shared-library/README.adoc b/01-basic/D-shared-library/README.adoc index 02685db..fc6a60b 100644 --- a/01-basic/D-shared-library/README.adoc +++ b/01-basic/D-shared-library/README.adoc @@ -16,7 +16,7 @@ The files in this tutorial are below: $ tree . ├── CMakeLists.txt -├── inc +├── include │   └── Hello.h └── src ├── Hello.cpp @@ -24,7 +24,7 @@ $ tree ``` * link:CMakeLists.txt[] - Contains the CMake commands you wish to run - * link:inc/Hello.h[] - The header file to include + * link:include/Hello.h[] - The header file to include * link:src/Hello.cpp[] - A source file to compile * link:src/main.cpp[] - The source file with main diff --git a/01-basic/D-shared-library/inc/Hello.h b/01-basic/D-shared-library/include/Hello.h similarity index 100% rename from 01-basic/D-shared-library/inc/Hello.h rename to 01-basic/D-shared-library/include/Hello.h diff --git a/01-basic/E-installing/CMakeLists.txt b/01-basic/E-installing/CMakeLists.txt index 3e2606c..f73c73f 100644 --- a/01-basic/E-installing/CMakeLists.txt +++ b/01-basic/E-installing/CMakeLists.txt @@ -16,7 +16,7 @@ add_library(cmake_examples_inst SHARED ${library_SOURCES}) target_include_directories(cmake_examples_inst - PUBLIC ${PROJECT_SOURCE_DIR}/inc + PUBLIC ${PROJECT_SOURCE_DIR}/include ) ############################################################ diff --git a/01-basic/E-installing/README.adoc b/01-basic/E-installing/README.adoc index 0216dd4..f4d3f54 100644 --- a/01-basic/E-installing/README.adoc +++ b/01-basic/E-installing/README.adoc @@ -16,7 +16,7 @@ $ tree . ├── cmake-examples.conf ├── CMakeLists.txt -├── inc +├── include │   └── Hello.h ├── README.adoc └── src @@ -26,7 +26,7 @@ $ tree * link:CMakeLists.txt[] - Contains the CMake commands you wish to run * link:cmake-examples.conf[] - An example configuration file - * link:inc/Hello.h[] - The header file to include + * link:include/Hello.h[] - The header file to include * link:src/Hello.cpp[] - A source file to compile * link:src/main.cpp[] - The source file with main diff --git a/01-basic/E-installing/inc/Hello.h b/01-basic/E-installing/include/Hello.h similarity index 100% rename from 01-basic/E-installing/inc/Hello.h rename to 01-basic/E-installing/include/Hello.h