Commit 09ce33d4 authored by Rashad Kanavath's avatar Rashad Kanavath

PKG: set WIN32 to TRUE and avoid OR with CMAKE_CROSSCOMPILING

parent 58ffe199
......@@ -24,7 +24,7 @@ if(NOT GENERATE_PACKAGE AND NOT GENERATE_XDK)
return()
endif()
if(WIN32 OR CMAKE_CROSSCOMPILING)
if(WIN32)
if(NOT MXE_TARGET_DIR)
message(FATAL_ERROR "you must set MXE_TARGET_DIR")
endif()
......@@ -40,7 +40,7 @@ if(OUT_OF_SOURCE_BUILD)
if(BUILD_TESTING)
include(CTest)
endif()
if(WIN32 OR CMAKE_CROSSCOMPILING)
if(WIN32)
set(Monteverdi_SOURCE_DIR "" CACHE PATH "monteverdi source directory")
set(Monteverdi_BINARY_DIR "" CACHE PATH "monteverdi binary directory")
set(MONTEVERDI_INSTALL_DIR "" CACHE PATH "monteverdi install directory")
......@@ -57,7 +57,7 @@ else(OUT_OF_SOURCE_BUILD)
# if doing packages from source tree.
set(SUPERBUILD_BINARY_DIR ${CMAKE_BINARY_DIR})
set(SUPERBUILD_INSTALL_DIR ${SB_INSTALL_PREFIX})
if(WIN32 OR CMAKE_CROSSCOMPILING)
if(WIN32)
set(MONTEVERDI_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
get_filename_component(OTB_INSTALL_DIR ${OTB_MODULES_DIR} PATH)
get_filename_component(OTB_INSTALL_DIR ${OTB_INSTALL_DIR} PATH)
......@@ -69,7 +69,7 @@ endif(OUT_OF_SOURCE_BUILD)
get_filename_component(SUPERBUILD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} PATH)
get_filename_component(OTB_SOURCE_DIR ${SUPERBUILD_SOURCE_DIR} PATH)
if(WIN32 OR CMAKE_CROSSCOMPILING)
if(WIN32)
foreach(req
Monteverdi_SOURCE_DIR
Monteverdi_BINARY_DIR
......@@ -102,7 +102,7 @@ else() #Unix like
endif()
if(WIN32 OR CMAKE_CROSSCOMPILING)
if(WIN32)
set(CMAKE_INSTALL_PREFIX "${MONTEVERDI_INSTALL_DIR}")
else()
set(CMAKE_INSTALL_PREFIX "${SUPERBUILD_INSTALL_DIR}")
......@@ -110,7 +110,7 @@ endif()
set(PACKAGE_NAME OTB)
set(PACKAGE_LONG_NAME OrfeoToolBox)
if(WIN32 OR CMAKE_CROSSCOMPILING)
if(WIN32)
set(PACKAGE_PLATFORM_NAME "win")
if(MXE_TARGET_DIR MATCHES "i686")
set(MXE_ARCH "i686")
......@@ -122,7 +122,7 @@ if(WIN32 OR CMAKE_CROSSCOMPILING)
get_filename_component(MXE_MXEROOT ${MXE_TARGET_DIR} PATH)
get_filename_component(MXE_MXEROOT ${MXE_MXEROOT} PATH)
set(PACKAGE_VERSION_STRING ${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}.${OTB_VERSION_PATCH})
else() #(WIN32 OR CMAKE_CROSSCOMPILING)
else() #(WIN32)
if(UNIX)
set(PACKAGE_ARCH 32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
......@@ -135,21 +135,20 @@ else() #(WIN32 OR CMAKE_CROSSCOMPILING)
endif()
get_version("${SUPERBUILD_SOURCE_DIR}/CMake/External_itk.cmake" "ITK_SB_VERSION" ITK_SB_VERSION)
endif(UNIX)
endif() #(WIN32 OR CMAKE_CROSSCOMPILING)
endif() #(WIN32)
get_version("${OTB_SOURCE_DIR}/CMakeLists.txt" "OTB_VERSION_" OTB_VERSION_STRING)
set(PACKAGE_VERSION_STRING ${get_version_OTB_VERSION_STRING})
include(${SUPERBUILD_SOURCE_DIR}/CMake/External_pkgtools.cmake)
set(EXTRA_CACHE_CONFIG
"set(CMAKE_CROSSCOMPILING ON)
"set(CMAKE_CROSSCOMPILING TRUE)
set(WIN32 TRUE)
set(MXE_ARCH \"${MXE_ARCH}\")
set(MXE_MXEROOT \"${MXE_MXEROOT}\")")
#guess install directory from OTB_MODULES_DIR
#copy of cmake variables not needed.
if(WIN32 OR CMAKE_CROSSCOMPILING)
if(WIN32)
set(Monteverdi_SOURCE_DIR "${Monteverdi_SOURCE_DIR}")
set(Monteverdi_BINARY_DIR "${Monteverdi_BINARY_DIR}")
set(MONTEVERDI_INSTALL_DIR "${MONTEVERDI_INSTALL_DIR}")
......@@ -170,15 +169,7 @@ if(WIN32 OR CMAKE_CROSSCOMPILING)
set(EXTRA_CACHE_CONFIG)
endif()
macro_setup_cmake_sources(OTB)
if(GENERATE_XDK)
macro_setup_cmake_sources(XDK)
endif()
set(PACKAGE-configure_DEPENDS PACKAGE-TOOLS)
macro_update_dependencies_list(PACKAGE-configure_DEPENDS)
macro_create_targets_for_package(OTB)
macro_setup_cmake_project(OTB)
if(GENERATE_XDK)
macro_create_targets_for_package(XDK)
macro_setup_cmake_project(XDK)
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment