Skip to content

Commit

Permalink
Cmake: Improved error-messages of visualizer and cluster-vem.
Browse files Browse the repository at this point in the history
  • Loading branch information
safl committed May 20, 2015
1 parent de39f5c commit 30c625b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 34 deletions.
38 changes: 22 additions & 16 deletions extmethods/visualizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,37 @@ if(NOT EXT_VISUALIZER)
return()
endif()

# freeglut3 freeglut3-dev libxmu-dev libxi-dev
# Ubuntu packages: freeglut3 freeglut3-dev libxmu-dev libxi-dev

#########################################################
# FIND GLUT
#########################################################
find_package(GLUT REQUIRED)
if(NOT GLUT_FOUND)
message(FATAL_ERROR "GLUT not found! Set EXT_VISUALIZER=OFF or install GLUT.")
endif()

find_package(OpenGL REQUIRED)
if(NOT OPENGL_FOUND)
message(FATAL_ERROR "OPENGL not found! Set EXT_VISUALIZER=OFF or install GLUT.")
endif()

if(GLUT_Xi_LIBRARY MATCHES "NOTFOUND")
message(FATAL_ERROR "libxi not found! Set EXT_VISUALIZER=OFF or install libxi.")
endif()

if(GLUT_Xmu_LIBRARY MATCHES "NOTFOUND")
message(FATAL_ERROR "libxmu not found! Set EXT_VISUALIZER=OFF or install libxmu.")
endif()

# Dependencies are met

include_directories(../../include)

include_directories(${GLUT_INCLUDE_DIRS})
link_directories(${GLUT_LIBRARY_DIRS})
add_definitions(${GLUT_DEFINITIONS})
if(NOT GLUT_FOUND)
message(ERROR " GLUT not found!")
endif(NOT GLUT_FOUND)

#########################################################
# FIND OPENGL
#########################################################
find_package(OpenGL REQUIRED)
include_directories(${OpenGL_INCLUDE_DIRS})
link_directories(${OpenGL_LIBRARY_DIRS})
add_definitions(${OpenGL_DEFINITIONS})
if(NOT OPENGL_FOUND)
message(ERROR " OPENGL not found!")
endif(NOT OPENGL_FOUND)

include_directories(../../include)

file(GLOB SRC *.cpp)

Expand Down
32 changes: 14 additions & 18 deletions vem/cluster/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,28 @@ if(NOT VEM_CLUSTER)
return()
endif()

include_directories(../../include)

if(NO_VEM_CLUSTER)
return()
endif()

#External dependencies
find_package(MPI)
set_package_properties(MPI PROPERTIES DESCRIPTION "Message Passing Interface" URL "www.mpi-forum.org")
set_package_properties(MPI PROPERTIES TYPE RECOMMENDED PURPOSE "Enables the Cluster-VEM.")

if(MPI_CXX_FOUND)
if(NOT MPI_CXX_FOUND)
message(FATAL_ERROR " MPI not found! Set VEM_CLUSTER=OFF or install MPI.")
endif()

file(GLOB SRC *.cpp)
include_directories(../../include)
file(GLOB SRC *.cpp)

include_directories(${MPI_CXX_INCLUDE_PATH})
include_directories(${MPI_CXX_INCLUDE_PATH})

add_library(bh_vem_cluster SHARED ${SRC})
add_library(bh_vem_cluster SHARED ${SRC})

add_executable(bh_vem_cluster_slave bh_vem_cluster_slave.cpp)
add_executable(bh_vem_cluster_slave bh_vem_cluster_slave.cpp)

target_link_libraries(bh_vem_cluster ${MPI_CXX_LIBRARIES})
target_link_libraries(bh_vem_cluster bh)
target_link_libraries(bh_vem_cluster_slave ${MPI_CXX_LIBRARIES})
target_link_libraries(bh_vem_cluster_slave bh_vem_cluster)
target_link_libraries(bh_vem_cluster ${MPI_CXX_LIBRARIES})
target_link_libraries(bh_vem_cluster bh)
target_link_libraries(bh_vem_cluster_slave ${MPI_CXX_LIBRARIES})
target_link_libraries(bh_vem_cluster_slave bh_vem_cluster)

install(TARGETS bh_vem_cluster DESTINATION lib COMPONENT bohrium-cluster)
install(TARGETS bh_vem_cluster_slave DESTINATION bin COMPONENT bohrium-cluster)
endif()
install(TARGETS bh_vem_cluster DESTINATION lib COMPONENT bohrium-cluster)
install(TARGETS bh_vem_cluster_slave DESTINATION bin COMPONENT bohrium-cluster)

0 comments on commit 30c625b

Please sign in to comment.