Skip to content

Commit

Permalink
Refs eProsima#3010. Fixing windows installer.
Browse files Browse the repository at this point in the history
  • Loading branch information
richiware committed Jun 22, 2018
1 parent 1255cd8 commit 246a3e0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ message(STATUS "To change de version modify the file configure.ac")
# Generation of windows installers.
###############################################################################
option(EPROSIMA_INSTALLER "Activate the creation of a build to create windows installers" OFF)
if(WIN32)
option(EPROSIMA_INSTALLER_MINION "Informs this is part of an installer" OFF)
endif()

###############################################################################
# Warning level
Expand All @@ -116,7 +113,7 @@ if(MSVC OR MSVC_IDE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EPROSIMA_EXTRA_CMAKE_CXX_FLAGS}")
endif()
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Wno-unknown-pragmas -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Wno-unknown-pragmas")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down Expand Up @@ -182,7 +179,6 @@ endif()
# eProsima build options
###############################################################################
option(EPROSIMA_BUILD "Activate internal building" OFF)
option(MINION "Tells if it is a subproject of a superproject" OFF)

if(EPROSIMA_INSTALLER)
set(EPROSIMA_BUILD ON)
Expand Down
7 changes: 5 additions & 2 deletions cmake/common/eprosima_libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

macro(eprosima_find_package package)

if(NOT ${package}_FOUND AND NOT (EPROSIMA_INSTALLER AND (MSVC OR MSVC_IDE)))
if(NOT ${package}_FOUND)

# Parse arguments.
set(options REQUIRED)
Expand All @@ -29,7 +29,10 @@ macro(eprosima_find_package package)

option(THIRDPARTY_${package} "Activate the use of internal thirdparty ${package}" OFF)

find_package(${package} QUIET)
if(NOT EPROSIMA_INSTALLER)
find_package(${package} QUIET)
endif()

if(NOT ${package}_FOUND AND (THIRDPARTY OR THIRDPARTY_${package}))
set(SUBDIRECTORY_EXIST TRUE)
if(THIRDPARTY_UPDATE OR NOT EXISTS "${PROJECT_SOURCE_DIR}/thirdparty/${package}/CMakeLists.txt")
Expand Down
7 changes: 1 addition & 6 deletions cmake/dev/generate_msvc_libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,8 @@ macro(generate_msvc_libraries platform)
COMMAND ${CMAKE_COMMAND} -E make_directory "${PROJECT_BINARY_DIR}/eprosima_installer/${platform}"
)

set(SECURITY_ACTIVATION)
if(NOT EPROSIMA_INSTALLER_MINION)
set(SECURITY_ACTIVATION "-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_} -DSECURITY=ON")
endif()

add_custom_target(${PROJECT_NAME}_${platform} ALL
COMMAND ${CMAKE_COMMAND} -G "${GENERATOR_}" -DEPROSIMA_BUILD=ON -DMINION=ON -DEPROSIMA_INSTALLER_MINION=ON ${SECURITY_ACTIVATION} -DCMAKE_INSTALL_PREFIX:PATH=${PROJECT_BINARY_DIR}/eprosima_installer/${platform}/install ${PROJECT_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -G "${GENERATOR_}" -DEPROSIMA_BUILD=ON -DEPROSIMA_INSTALLER_MINION=ON -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_} -DSECURITY=ON -DCMAKE_INSTALL_PREFIX:PATH=${PROJECT_BINARY_DIR}/eprosima_installer/${platform}/install ${PROJECT_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
COMMAND ${CMAKE_COMMAND} --build . --target install --config Debug
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/eprosima_installer/${platform}
Expand Down
6 changes: 3 additions & 3 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ if(MSVC OR MSVC_IDE)
generate_msvc_libraries(x64Win64VS2013)
generate_msvc_libraries(i86Win32VS2015)
generate_msvc_libraries(x64Win64VS2015)
else()
elseif(NOT EPROSIMA_INSTALLER)
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_source_files})

add_library(${PROJECT_NAME}_static STATIC ${${PROJECT_NAME}_source_files})
Expand Down Expand Up @@ -376,12 +376,12 @@ endif()

# Install libraries
if(MSVC OR MSVC_IDE)
if(EPROSIMA_INSTALLER)
if(EPROSIMA_INSTALLER AND IS_TOP_LEVEL)
install_msvc_libraries(i86Win32VS2013)
install_msvc_libraries(x64Win64VS2013)
install_msvc_libraries(i86Win32VS2015)
install_msvc_libraries(x64Win64VS2015)
else()
elseif(NOT EPROSIMA_INSTALLER)
set(DIR_EXTENSION "")
if(EPROSIMA_INSTALLER_MINION)
set(DIR_EXTENSION "/${MSVC_ARCH}")
Expand Down

0 comments on commit 246a3e0

Please sign in to comment.