Skip to content

Commit

Permalink
Merge pull request #1907 from bilke/rm-ext-project
Browse files Browse the repository at this point in the history
[CMake] Remove external projects
  • Loading branch information
bilke authored Sep 12, 2017
2 parents 864ec0b + 201c0ea commit 0facd3b
Show file tree
Hide file tree
Showing 43 changed files with 531 additions and 602 deletions.
15 changes: 8 additions & 7 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ configuration:
- Release

cache:
- C:\projects\deps\conan
- C:\projects\deps\conan -> scripts/cmake/ConanSetup.cmake

install:
# All external dependencies are installed in C:\projects\deps
- if not exist "C:\projects\deps\" mkdir C:\projects\deps

# Install conan
- if not exist "C:\projects\deps\conan\" mkdir C:\projects\deps\conan
- set PATH=%PATH%;%PYTHON%/Scripts/
- C:\Python27-x64\Scripts\pip.exe install conan
- set PATH=%PYTHON%/Scripts/;%PATH%
- pip.exe install conan --upgrade
- conan remote add -i 0 ogs https://ogs.jfrog.io/ogs/api/conan/conan

# Install Ninja
- set NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip"
Expand All @@ -43,10 +44,10 @@ before_build:

build_script:
- mkdir build & cd build
- conan install .. # -o gui=True
- cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=%configuration% -DBUILD_SHARED_LIBS=OFF -DOGS_EIGEN_DYNAMIC_SHAPE_MATRICES=ON -DOGS_USE_PCH=OFF # -DOGS_BUILD_GUI=ON
- cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=%configuration% -DBUILD_SHARED_LIBS=OFF -DOGS_EIGEN_DYNAMIC_SHAPE_MATRICES=ON -DOGS_USE_PCH=OFF -DOGS_USE_CONAN=ON # -DOGS_BUILD_GUI=ON
- cmake --build . --config %configuration%

test_script:
- cmake --build . --config %configuration% --target tests
- cmake --build . --config %configuration% --target ctest
# - cmake . -DOGS_BUILD_GUI=ON
# - cmake --build . --config %configuration% --target DataExplorer

3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ cache:
- $HOME/cmake-3.1.1-Linux-x86_64
- $HOME/VTK-Install-7.1
- $HOME/boost_1_56_0
- $HOME/eigen-eigen-dc6cfdf9bcec
- $HOME/.conan

env:
global:
- VTK_DIR=$HOME/VTK-Install-7.1/lib/cmake/vtk-7.1
- BOOST_ROOT=$HOME/boost_1_56_0
- EIGEN3_ROOT=$HOME/eigen-eigen-dc6cfdf9bcec
- CCACHE_SLOPPINESS=pch_defines,time_macros
matrix:
include:
Expand All @@ -46,6 +48,7 @@ before_install:
- if [ "$CASE" != "CHECK" ]; then bash scripts/travis/cmake.sh; fi
- if [ "$CASE" != "CONAN" ] && [ "$CASE" != "CHECK" ]; then bash scripts/travis/boost.sh; fi
- if [ "$CASE" != "CONAN" ] && [ "$CASE" != "CHECK" ]; then bash scripts/travis/vtk.sh; fi
- if [ "$CASE" != "CONAN" ] && [ "$CASE" != "CHECK" ]; then bash scripts/travis/eigen.sh; fi
- if [ "$CASE" == "CONAN" ] && [ "$CASE" != "CHECK" ]; then bash scripts/travis/conan.sh; fi

before_script:
Expand Down
2 changes: 0 additions & 2 deletions Applications/CLI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ target_link_libraries(ogs
PRIVATE BaseLib ApplicationsLib NumLib ProcessLib
)

ADD_VTK_DEPENDENCY(ogs)

if(OGS_USE_PETSC)
target_link_libraries(ogs PRIVATE ${PETSC_LIBRARIES})
endif()
Expand Down
2 changes: 0 additions & 2 deletions Applications/DataExplorer/DataExplorer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ if(VTKFBXCONVERTER_FOUND)
target_link_libraries(DataExplorer ${VTKFBXCONVERTER_LIBRARIES})
endif()

ADD_VTK_DEPENDENCY(DataExplorer)

set_property(TARGET DataExplorer PROPERTY FOLDER "DataExplorer")

if(OGS_USE_PCH)
Expand Down
2 changes: 0 additions & 2 deletions Applications/DataExplorer/DataView/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ target_link_libraries(QtDataView
DataHolderLib logog Qt5::Core Qt5::Gui
)

ADD_VTK_DEPENDENCY(QtDataView)

if(GEOTIFF_FOUND)
target_link_libraries(QtDataView PRIVATE ${GEOTIFF_LIBRARIES})
endif () # GEOTIFF_FOUND
Expand Down
2 changes: 0 additions & 2 deletions Applications/DataExplorer/VtkVis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ add_library(VtkVis
${UIS}
)

ADD_VTK_DEPENDENCY(VtkVis)

if(GEOTIFF_FOUND)
include_directories(${GEOTIFF_INCLUDE_DIRS})
target_link_libraries(VtkVis INTERFACE ${GEOTIFF_LIBRARIES})
Expand Down
2 changes: 0 additions & 2 deletions Applications/FileIO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ if(OGS_BUILD_SWMM)
target_link_libraries(ApplicationsFileIO PRIVATE SwmmInterface)
endif()

ADD_VTK_DEPENDENCY(ApplicationsFileIO)

if(TARGET Eigen)
add_dependencies(ApplicationsFileIO Eigen)
endif()
Expand Down
7 changes: 0 additions & 7 deletions Applications/Utils/FileConverter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ if (Qt5XmlPatterns_FOUND)
add_executable(FEFLOW2OGS FEFLOW2OGS.cpp)
set_target_properties(FEFLOW2OGS PROPERTIES FOLDER Utilities)
target_link_libraries(FEFLOW2OGS ApplicationsFileIO)
ADD_VTK_DEPENDENCY(FEFLOW2OGS)
endif ()

add_executable(convertGEO convertGEO.cpp)
Expand All @@ -17,34 +16,28 @@ target_link_libraries(convertGEO GeoLib ApplicationsFileIO)

add_executable(generateMatPropsFromMatID generateMatPropsFromMatID.cpp )
target_link_libraries(generateMatPropsFromMatID MeshLib)
ADD_VTK_DEPENDENCY(generateMatPropsFromMatID)
set_target_properties(generateMatPropsFromMatID
PROPERTIES FOLDER Utilities)

add_executable(GMSH2OGS GMSH2OGS.cpp)
set_target_properties(GMSH2OGS PROPERTIES FOLDER Utilities)
target_link_libraries(GMSH2OGS ApplicationsFileIO)
ADD_VTK_DEPENDENCY(GMSH2OGS)

add_executable(OGS2VTK OGS2VTK.cpp)
set_target_properties(OGS2VTK PROPERTIES FOLDER Utilities)
target_link_libraries(OGS2VTK MeshLib)
ADD_VTK_DEPENDENCY(OGS2VTK)

add_executable(VTK2OGS VTK2OGS.cpp)
set_target_properties(VTK2OGS PROPERTIES FOLDER Utilities)
target_link_libraries(VTK2OGS MeshLib)
ADD_VTK_DEPENDENCY(VTK2OGS)

add_executable(VTK2TIN VTK2TIN.cpp)
set_target_properties(VTK2TIN PROPERTIES FOLDER Utilities)
target_link_libraries(VTK2TIN MeshLib)
ADD_VTK_DEPENDENCY(VTK2TIN)

add_executable(TIN2VTK TIN2VTK.cpp)
set_target_properties(TIN2VTK PROPERTIES FOLDER Utilities)
target_link_libraries(TIN2VTK MeshLib)
ADD_VTK_DEPENDENCY(TIN2VTK)

####################
### Installation ###
Expand Down
10 changes: 0 additions & 10 deletions Applications/Utils/MeshEdit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@

add_executable(moveMeshNodes moveMeshNodes.cpp)
target_link_libraries(moveMeshNodes MeshLib)
ADD_VTK_DEPENDENCY(moveMeshNodes)
set_target_properties(moveMeshNodes PROPERTIES FOLDER Utilities)

add_executable(MapGeometryToMeshSurface
MapGeometryToMeshSurface.cpp )
target_link_libraries(MapGeometryToMeshSurface MeshGeoToolsLib MeshLib)
ADD_VTK_DEPENDENCY(MapGeometryToMeshSurface)
set_target_properties(MapGeometryToMeshSurface PROPERTIES FOLDER Utilities)

add_executable(removeMeshElements removeMeshElements.cpp)
target_link_libraries(removeMeshElements MeshLib)
ADD_VTK_DEPENDENCY(removeMeshElements)
set_target_properties(removeMeshElements PROPERTIES FOLDER Utilities)

add_executable(NodeReordering NodeReordering.cpp)
target_link_libraries(NodeReordering MeshLib)
ADD_VTK_DEPENDENCY(NodeReordering)
set_target_properties(NodeReordering PROPERTIES FOLDER Utilities)

add_executable(MoveMesh MoveMesh.cpp)
target_link_libraries(MoveMesh MeshLib)
ADD_VTK_DEPENDENCY(MoveMesh)
set_target_properties(MoveMesh PROPERTIES FOLDER Utilities)

add_executable(appendLinesAlongPolyline appendLinesAlongPolyline.cpp)
Expand All @@ -31,22 +26,18 @@ target_link_libraries(appendLinesAlongPolyline
MeshLib
ApplicationsFileIO
)
ADD_VTK_DEPENDENCY(appendLinesAlongPolyline)
set_target_properties(appendLinesAlongPolyline PROPERTIES FOLDER Utilities)

add_executable(editMaterialID editMaterialID.cpp)
target_link_libraries(editMaterialID MeshLib)
ADD_VTK_DEPENDENCY(editMaterialID)
set_target_properties(editMaterialID PROPERTIES FOLDER Utilities)

add_executable(checkMesh checkMesh.cpp)
target_link_libraries(checkMesh MeshLib)
ADD_VTK_DEPENDENCY(checkMesh)
set_target_properties(checkMesh PROPERTIES FOLDER Utilities)

add_executable(reviseMesh reviseMesh.cpp)
target_link_libraries (reviseMesh MeshLib)
ADD_VTK_DEPENDENCY(reviseMesh)
set_target_properties(reviseMesh PROPERTIES FOLDER Utilities)

add_executable(ResetPropertiesInPolygonalRegion
Expand Down Expand Up @@ -76,7 +67,6 @@ target_link_libraries(CreateBoundaryConditionsAlongPolylines
MeshLib
ApplicationsFileIO
)
ADD_VTK_DEPENDENCY(CreateBoundaryConditionsAlongPolylines)
set_target_properties(CreateBoundaryConditionsAlongPolylines
PROPERTIES FOLDER Utilities)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
add_executable(partmesh PartitionMesh.cpp NodeWiseMeshPartitioner.h NodeWiseMeshPartitioner.cpp)
set_target_properties(partmesh PROPERTIES FOLDER Utilities)
target_link_libraries(partmesh MeshLib)
ADD_VTK_DEPENDENCY(partmesh)

####################
### Installation ###
Expand Down
2 changes: 0 additions & 2 deletions Applications/Utils/OGSFileConverter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ target_link_libraries(OGSFileConverterLib
PUBLIC QtBase MathLib
INTERFACE MeshLib ApplicationsFileIO
)
ADD_VTK_DEPENDENCY(OGSFileConverterLib)

add_executable(OGSFileConverter main.cpp)

target_link_libraries(OGSFileConverter
OGSFileConverterLib
ApplicationsFileIO
)
ADD_VTK_DEPENDENCY(OGSFileConverter)

set_property(TARGET OGSFileConverter PROPERTY FOLDER "Utilities")

Expand Down
1 change: 0 additions & 1 deletion Applications/Utils/PostProcessing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

add_executable(postLIE postLIE.cpp)
target_link_libraries(postLIE MeshLib ProcessLib)
ADD_VTK_DEPENDENCY(postLIE)
set_target_properties(postLIE PROPERTIES FOLDER Utilities)

####################
Expand Down
2 changes: 0 additions & 2 deletions Applications/Utils/SWMMConverter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ target_link_libraries(SWMMConverter

include_directories( ${PROJECT_SOURCE_DIR}/Applications/FileIO )

ADD_VTK_DEPENDENCY(SWMMConverter)

set_target_properties(SWMMConverter PROPERTIES FOLDER Utilities)

install(TARGETS SWMMConverter RUNTIME DESTINATION bin COMPONENT Utilities)
1 change: 0 additions & 1 deletion Applications/Utils/SimpleMeshCreation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ if(OGS_BUILD_GUI)
ApplicationsFileIO
MeshLib
)
ADD_VTK_DEPENDENCY(createMeshElemPropertiesFromASCRaster)
endif() # OGS_BUILD_GUI (VtkVis-target is existing)


Expand Down
32 changes: 12 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,22 @@ list(APPEND CMAKE_PREFIX_PATH
option(BUILD_SHARED_LIBS "Create shared libraries?" OFF)
set(CMAKE_LIBRARY_SEARCH_PATH "" CACHE PATH
"Additional library installation path, e.g. /opt/local or C:/libs")
set(OGS_CPU_ARCHITECTURE "native" CACHE STRING "Processor architecture, defaults to native (*nix) / blend (MSVC).")
set(OGS_CPU_ARCHITECTURE "native" CACHE STRING "Processor architecture, \
defaults to native (*nix) / blend (MSVC).")
option(OGS_ENABLE_AVX2 "Enable the use of AVX2 instructions" OFF)
option(OGS_BUILD_TESTS "Should the test executables be built?" ON)
option(OGS_USE_PCH "Should pre-compiled headers be used?" ON)
option(OGS_USE_CONAN "Should Conan package manager be used?" OFF)
set(OGS_CONAN_BUILD "missing" CACHE STRING "Possible values: all, missing, \
never or list of libs to build" )

### CMake includes ###
include(scripts/cmake/PreFind.cmake)
include(scripts/cmake/ConanSetup.cmake)
include(scripts/cmake/CheckTypeSizes.cmake)
include(scripts/cmake/Functions.cmake)
include(scripts/cmake/SubmoduleSetup.cmake)
include(scripts/cmake/CMakeSetup.cmake)
include(scripts/cmake/ConanSetup.cmake)
include(scripts/cmake/CompilerSetup.cmake)
include(scripts/cmake/Find.cmake)
include(scripts/cmake/CCacheSetup.cmake)
Expand Down Expand Up @@ -153,16 +157,12 @@ option(OGS_SYNC_SUBMODULES "Sync git submodules on CMake run. Overwrites custom
option(OGS_DOWNLOAD_ADDITIONAL_CONTENT "Should addional content such as manuals be downloaded and packaged?" OFF)
include(scripts/cmake/packaging/Pack.cmake)

# Third-party libraries
# Default checks for system first, then builds locally
set(OGS_LIB_VTK "Default" CACHE STRING "Which VTK library should be used?")
set(OGS_LIB_BOOST "Default" CACHE STRING "Which Boost library should be used?")
set(OGS_LIB_EIGEN "Default" CACHE STRING "Which Eigen library should be used?")
set_property(CACHE
OGS_LIB_VTK
OGS_LIB_BOOST
OGS_LIB_EIGEN
PROPERTY STRINGS "Default" "System" "Local")
# Third-party libraries, names come from Conan package names
set(OGS_LIBS VTK Boost Eigen3 Qt Shapelib libgeotiff CACHE INTERNAL "")
foreach(LIB ${OGS_LIBS})
set(OGS_LIB_${LIB} "Default" CACHE STRING "Which ${LIB} library should be used?")
set_property(CACHE OGS_LIB_${LIB} PROPERTY STRINGS "Default" "System")
endforeach(LIB)

# Options controlling which FEM elements will be compiled
set(OGS_MAX_ELEMENT_DIM 3 CACHE STRING "Maximum dimension of FEM elements to be built.")
Expand Down Expand Up @@ -246,19 +246,11 @@ add_definitions(-DLOGOG_LEVEL=${OGS_LOG_LEVEL})
######################

# External projects
include(scripts/cmake/ExternalProjectBoost.cmake)
include(VtkModules)
if(OGS_INSITU)
include(ExternalProjectCatalyst)
include("${PARAVIEW_USE_FILE}")
add_definitions(-DUSE_INSITU)
else()
include(ExternalProjectVtk)
endif()

include_directories( SYSTEM ${Boost_INCLUDE_DIRS} )
include(scripts/cmake/ExternalProjectEigen.cmake)
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})

# Add subdirectories with the projects
add_subdirectory( ThirdParty )
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env groovy
@Library('jenkins-pipeline@1.0.7') _
@Library('jenkins-pipeline@1.0.8') _

def builders = [:]
def helper = new ogs.helper()
Expand Down
2 changes: 0 additions & 2 deletions MeshLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ if(OGS_USE_MPI)
)
endif()

ADD_VTK_DEPENDENCY(MeshLib)

if(TARGET Eigen)
add_dependencies(MeshLib Eigen)
endif()
Expand Down
2 changes: 0 additions & 2 deletions ProcessLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ target_link_libraries(ProcessLib
PRIVATE MeshGeoToolsLib
)

ADD_VTK_DEPENDENCY(ProcessLib)

if(TARGET Eigen)
add_dependencies(ProcessLib Eigen)
endif()
Expand Down
3 changes: 0 additions & 3 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ target_link_libraries(testrunner
ProcessLib
Threads::Threads
)
ADD_VTK_DEPENDENCY(testrunner)

if(OGS_USE_PETSC)
target_link_libraries(testrunner ${PETSC_LIBRARIES})
Expand Down Expand Up @@ -74,8 +73,6 @@ if(Qt5XmlPatterns_FOUND)
endif()
endif()

ADD_VTK_DEPENDENCY(testrunner)

if(OGS_USE_PCH)
cotire(testrunner)
endif()
Expand Down
2 changes: 1 addition & 1 deletion ThirdParty/cmake-modules
2 changes: 1 addition & 1 deletion ThirdParty/vtkdiff
Submodule vtkdiff updated 1 files
+0 −4 CMakeLists.txt
Loading

0 comments on commit 0facd3b

Please sign in to comment.