Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Help/guide/importing-exporting/DownstreamComponents/CMakeLists.txt
5017 views
1
cmake_minimum_required(VERSION 3.15)
2
project(DownstreamComponents)
3
4
# specify the C++ standard
5
set(CMAKE_CXX_STANDARD 11)
6
set(CMAKE_CXX_STANDARD_REQUIRED True)
7
8
# find MathFunctions
9
find_package(MathFunctions 3.4 COMPONENTS Addition SquareRoot)
10
11
# create executable
12
add_executable(myexe main.cc)
13
14
# use MathFunctions library
15
target_link_libraries(myexe PRIVATE MathFunctions::Addition MathFunctions::SquareRoot)
16
17
# Workaround for GCC on AIX to avoid -isystem, not needed in general.
18
set_property(TARGET myexe PROPERTY NO_SYSTEM_FROM_IMPORTED 1)
19
20