Skip to content

Commit

Permalink
EHN: build_always flag for super build set to true
Browse files Browse the repository at this point in the history
  • Loading branch information
leochan2009 committed Aug 4, 2017
1 parent 396aa70 commit b755c90
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 100 deletions.
11 changes: 9 additions & 2 deletions SuperBuild/External_openHEVC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ IF((EXISTS ${OPENHEVC_SOURCE_DIR}) AND (EXISTS ${OPENHEVC_LIBRARY_DIR}))
IF(EXISTS "${OPENHEVC_SOURCE_DIR}/gpac/modules/openhevc_dec/openHevcWrapper.h")
IF(WIN32)
ELSE()
IF("${OPENHEVC_LIBRARY_DIR}/${CMAKE_BUILD_TYPE}/libLibOpenHevcWrapper.a" )
SET(OpenHEVC_Proj_BUILT "1")
IF(${CMAKE_BUILD_TYPE})
IF(EXISTS "${OPENHEVC_LIBRARY_DIR}/${CMAKE_BUILD_TYPE}/libLibOpenHevcWrapper.a" )
SET(OpenHEVC_Proj_BUILT "1")
ENDIF()
ELSE()
IF(EXISTS "${OPENHEVC_LIBRARY_DIR}/libLibOpenHevcWrapper.a" )
SET(OpenHEVC_Proj_BUILT "1")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
ENDIF()
message(${OpenHEVC_Proj_BUILT})
IF(OpenHEVC_Proj_BUILT EQUAL "1")
# openHEVC has been built already
MESSAGE(STATUS "Using openHEVC available at: ${OPENHEVC_SOURCE_DIR}")
Expand Down
10 changes: 5 additions & 5 deletions SuperBuild/External_x265.cmake
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
cmake_minimum_required(VERSION 2.8.2)
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
SET(X265_Proj_BUILT "0")
IF((EXISTS ${X265_SOURCE_DIR}) AND (EXISTS ${X265_LIBRARY_DIR}))
IF(EXISTS "${X265_SOURCE_DIR}/x265.h")
IF((EXISTS ${X265_SOURCE_DIR}) AND (EXISTS ${X265_LIBRARY_DIR}))
IF(WIN32)
IF(EXISTS "${X265_LIBRARY_DIR}\\${CMAKE_BUILD_TYPE}\\x265-static.lib")
IF((EXISTS "${X265_SOURCE_DIR}\\source\\x265.h") AND
(EXISTS "${X265_LIBRARY_DIR}\\${CMAKE_BUILD_TYPE}\\x265-static.lib"))
SET(X265_Proj_BUILT "1")
ENDIF()
ELSE()
IF(EXISTS "${X265_LIBRARY_DIR}/libx265.a")
IF((EXISTS "${X265_SOURCE_DIR}/source/x265.h") AND
(EXISTS "${X265_LIBRARY_DIR}/libx265.a"))
SET(X265_Proj_BUILT "1")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
IF(X265_Proj_BUILT EQUAL "1")
# x265 has been built already
Expand Down
136 changes: 43 additions & 93 deletions SuperBuild/Superbuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,96 +43,46 @@ IF(BUILD_VIDEOSTREAM)
LIST(APPEND OpenIGTLink_DEPENDENCIES websocket)
ENDIF()
ENDIF()

#---------------------------------------------------
# OpenIGTLink library
SET(OpenIGTLink_BUILT "0")
IF (OpenIGTLink_DIR)
SET(CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}/OpenIGTLink-bin")
find_package(OpenIGTLink)
IF(OpenIGTLink_FOUND)
SET(OpenIGTLink_BUILT "1")
ENDIF()
ENDIF()
IF(OpenIGTLink_BUILT EQUAL "1")
# when the openigtlink is not built, it can sync with the parent setting, after it is compiled, the configuration wouldn't sync.
# The following command is necessary to reconfig the openigtlink project
message("library already built, reconfig the project only")
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}"
${PLATFORM_SPECIFIC_ARGS}
-DOpenIGTLink_SUPERBUILD:BOOL=OFF
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY:STRING=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY:STRING=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DBUILD_SHARED_LIBS:BOOL=${OpenIGTLink_BUILD_SHARED_LIBS}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_TESTING:BOOL=${BUILD_TESTING}
-DUSE_GTEST:BOOL=${USE_GTEST}
-DBUILD_VIDEOSTREAM:BOOL=${BUILD_VIDEOSTREAM}
-DUSE_H264:BOOL=${USE_H264}
-DUSE_VP9:BOOL=${USE_VP9}
-DUSE_X265:BOOL=${USE_X265}
-DUSE_OPENHEVC:BOOL=${USE_OPENHEVC}
-DBUILD_WEBSOCKET:BOOL=${BUILD_WEBSOCKET}
-DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DH264_SOURCE_DIR:STRING=${H264_SOURCE_DIR}
-DH264_LIBRARY_DIR:STRING=${H264_LIBRARY_DIR}
-DX265_SOURCE_DIR:STRING=${X265_SOURCE_DIR}
-DX265_LIBRARY_DIR:STRING=${X265_LIBRARY_DIR}
-DOPENHEVC_SOURCE_DIR:STRING=${OPENHEVC_SOURCE_DIR}
-DOPENHEVC_LIBRARY_DIR:STRING=${OPENHEVC_LIBRARY_DIR}
-DVP9_SOURCE_DIR:STRING=${VP9_SOURCE_DIR}
-DVP9_LIBRARY_DIR:STRING=${VP9_LIBRARY_DIR}
-DYASM_SOURCE_DIR:STRING=${YASM_SOURCE_DIR}
-DYASM_LIBRARY_DIR:STRING=${YASM_LIBRARY_DIR}
-DH264_SOURCE_DIR:STRING=${H264_SOURCE_DIR}
-DH264_LIBRARY_DIR:STRING=${H264_LIBRARY_DIR}
"${CMAKE_BINARY_DIR}/OpenIGTLink"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/OpenIGTLink-bin" )
ELSE()
ExternalProject_Add( OpenIGTLink-lib
PREFIX "${CMAKE_BINARY_DIR}/OpenIGTLink-prefix"
SOURCE_DIR "${CMAKE_BINARY_DIR}/OpenIGTLink"
BINARY_DIR "${CMAKE_BINARY_DIR}/OpenIGTLink-bin"
#--Download step--------------
GIT_REPOSITORY "https://github.com/leochan2009/OpenIGTLink.git"
GIT_TAG superbuild-findmodules
#--Configure step-------------
CMAKE_ARGS
${PLATFORM_SPECIFIC_ARGS}
-DOpenIGTLink_SUPERBUILD:BOOL=OFF
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY:STRING=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY:STRING=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DBUILD_SHARED_LIBS:BOOL=${OpenIGTLink_BUILD_SHARED_LIBS}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_TESTING:BOOL=${BUILD_TESTING}
-DUSE_GTEST:BOOL=${USE_GTEST}
-DBUILD_VIDEOSTREAM:BOOL=${BUILD_VIDEOSTREAM}
-DUSE_H264:BOOL=${USE_H264}
-DUSE_VP9:BOOL=${USE_VP9}
-DUSE_X265:BOOL=${USE_X265}
-DUSE_OPENHEVC:BOOL=${USE_OPENHEVC}
-DBUILD_WEBSOCKET:BOOL=${BUILD_WEBSOCKET}
-DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DH264_SOURCE_DIR:STRING=${H264_SOURCE_DIR}
-DH264_LIBRARY_DIR:STRING=${H264_LIBRARY_DIR}
-DX265_SOURCE_DIR:STRING=${X265_SOURCE_DIR}
-DX265_LIBRARY_DIR:STRING=${X265_LIBRARY_DIR}
-DOPENHEVC_SOURCE_DIR:STRING=${OPENHEVC_SOURCE_DIR}
-DOPENHEVC_LIBRARY_DIR:STRING=${OPENHEVC_LIBRARY_DIR}
-DVP9_SOURCE_DIR:STRING=${VP9_SOURCE_DIR}
-DVP9_LIBRARY_DIR:STRING=${VP9_LIBRARY_DIR}
-DYASM_SOURCE_DIR:STRING=${YASM_SOURCE_DIR}
-DYASM_LIBRARY_DIR:STRING=${YASM_LIBRARY_DIR}
#--Build step-----------------
BUILD_ALWAYS 1
#--Install step-----------------
INSTALL_COMMAND ""
DEPENDS ${OpenIGTLink_DEPENDENCIES}
)
ENDIF()
ExternalProject_Add( OpenIGTLink-lib
PREFIX "${CMAKE_BINARY_DIR}/OpenIGTLink-prefix"
SOURCE_DIR "${CMAKE_BINARY_DIR}/OpenIGTLink"
BINARY_DIR "${CMAKE_BINARY_DIR}/OpenIGTLink-bin"
#--Download step--------------
GIT_REPOSITORY "https://github.com/leochan2009/OpenIGTLink.git"
GIT_TAG superbuild-findmodules
#--Configure step-------------
CMAKE_ARGS
${PLATFORM_SPECIFIC_ARGS}
-DOpenIGTLink_SUPERBUILD:BOOL=OFF
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY:STRING=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY:STRING=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DBUILD_SHARED_LIBS:BOOL=${OpenIGTLink_BUILD_SHARED_LIBS}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_TESTING:BOOL=${BUILD_TESTING}
-DUSE_GTEST:BOOL=${USE_GTEST}
-DBUILD_VIDEOSTREAM:BOOL=${BUILD_VIDEOSTREAM}
-DUSE_H264:BOOL=${USE_H264}
-DUSE_VP9:BOOL=${USE_VP9}
-DUSE_X265:BOOL=${USE_X265}
-DUSE_OPENHEVC:BOOL=${USE_OPENHEVC}
-DBUILD_WEBSOCKET:BOOL=${BUILD_WEBSOCKET}
-DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DH264_SOURCE_DIR:STRING=${H264_SOURCE_DIR}
-DH264_LIBRARY_DIR:STRING=${H264_LIBRARY_DIR}
-DX265_SOURCE_DIR:STRING=${X265_SOURCE_DIR}
-DX265_LIBRARY_DIR:STRING=${X265_LIBRARY_DIR}
-DOPENHEVC_SOURCE_DIR:STRING=${OPENHEVC_SOURCE_DIR}
-DOPENHEVC_LIBRARY_DIR:STRING=${OPENHEVC_LIBRARY_DIR}
-DVP9_SOURCE_DIR:STRING=${VP9_SOURCE_DIR}
-DVP9_LIBRARY_DIR:STRING=${VP9_LIBRARY_DIR}
-DYASM_SOURCE_DIR:STRING=${YASM_SOURCE_DIR}
-DYASM_LIBRARY_DIR:STRING=${YASM_LIBRARY_DIR}
#--Build step-----------------
BUILD_ALWAYS 1
#--Install step-----------------
INSTALL_COMMAND ""
DEPENDS ${OpenIGTLink_DEPENDENCIES}
)

0 comments on commit b755c90

Please sign in to comment.