-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use CMake's FetchContent module to (optionally) download and build FM…
…ILibrary (#23) Download FMILibrary using FetchContent if not found
- Loading branch information
1 parent
d40ab19
commit 4a584c6
Showing
7 changed files
with
1,013 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright (C) 2018 Fondazione Istituto Italiano di Tecnologia | ||
# | ||
# Licensed under either the GNU Lesser General Public License v3.0 : | ||
# https://www.gnu.org/licenses/lgpl-3.0.html | ||
# or the GNU Lesser General Public License v2.1 : | ||
# https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html | ||
# at your option. | ||
|
||
# Fetch FMI library for downloading and installing | ||
include(FetchContent) | ||
FetchContent_Declare(FMILibrary | ||
GIT_REPOSITORY https://github.com/svn2github/FMILibrary.git) | ||
|
||
FetchContent_GetProperties(FMILibrary) | ||
if(NOT FMILibrary_POPULATED) | ||
FetchContent_Populate(FMILibrary) | ||
set(BUILD_SHARED_LIBS OFF) | ||
option (FMILIB_BUILD_TESTS "Build tests" OFF) | ||
add_subdirectory(${fmilibrary_SOURCE_DIR} ${fmilibrary_BINARY_DIR}) | ||
set(BUILD_SHARED_LIBS ON) | ||
endif() | ||
|
||
add_library(FMILibrary_FMILibrary INTERFACE) | ||
target_include_directories(FMILibrary_FMILibrary INTERFACE ${fmilibrary_SOURCE_DIR}/src/CAPI/include | ||
${fmilibrary_SOURCE_DIR}/src/Import/include | ||
${fmilibrary_SOURCE_DIR}/src/Util/include | ||
${fmilibrary_SOURCE_DIR}/src/XML/include | ||
${fmilibrary_SOURCE_DIR}/src/ZIP/include | ||
${fmilibrary_SOURCE_DIR}/ThirdParty/FMI/default | ||
${fmilibrary_SOURCE_DIR}/Config.cmake | ||
${fmilibrary_BINARY_DIR}) | ||
target_link_libraries(FMILibrary_FMILibrary INTERFACE fmilib) | ||
add_library(FMILibrary::FMILibrary ALIAS FMILibrary_FMILibrary) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.