Update to minimum CMake 3.5

And modernise some examples.
This commit is contained in:
Thom Troy
2018-03-18 17:23:57 +00:00
parent 54e75664c1
commit b81da6f68b
52 changed files with 303 additions and 212 deletions

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.5)
project(hello_library)
@@ -6,32 +6,28 @@ project(hello_library)
# Create a library
############################################################
# Source files to be used in the library
set(library_SOURCES
#Generate the shared library from the library sources
add_library(hello_library SHARED
src/Hello.cpp
)
#Generate the shared library from the library sources
add_library(hello_library SHARED ${library_SOURCES})
add_library(hello::library ALIAS hello_library)
target_include_directories(hello_library
PUBLIC ${PROJECT_SOURCE_DIR}/include
PUBLIC
${PROJECT_SOURCE_DIR}/include
)
############################################################
# Create an executable
############################################################
# Source fles for the binary
set(binary_SOURCES
# Add an executable with the above sources
add_executable(hello_binary
src/main.cpp
)
# Add an executable with the above sources
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
PRIVATE
hello::library
)