From 83f6420d3682a53ec22b946b95c037e83a05ca59 Mon Sep 17 00:00:00 2001 From: bruneton Date: Wed, 18 Sep 2013 09:08:52 +0000 Subject: [PATCH] CMake: IF(WINDOWS) is deprecated - please always use IF(WIN32) --- CMakeLists.txt | 4 ++-- doc/docutils/CMakeLists.txt | 6 +++--- idl/CMakeLists.txt | 6 +++--- salome_adm/cmake_files/FindCAS.cmake | 4 ++-- salome_adm/cmake_files/FindSalomeHDF5.cmake | 8 ++++---- salome_adm/cmake_files/FindSalomeOmniORBPy.cmake | 6 +++--- salome_adm/cmake_files/FindSalomePython.cmake | 4 ++-- salome_adm/cmake_files/UseOmniORB.cmake | 10 +++++++--- src/DSC/CMakeLists.txt | 4 ++-- src/SALOMEDS/CMakeLists.txt | 4 ++-- src/SALOMEDS/Test/CMakeLists.txt | 4 ++-- 11 files changed, 32 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db000aea7..6785f2878 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,10 +192,10 @@ INCLUDE(CMakePackageConfigHelpers) # They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup" # Temporary solution for pakage src\DSC on windows -IF(NOT WINDOWS) +IF(NOT WIN32) SET(DSC_TGS CalciumC SalomeCalcium SalomeDatastream SalomePalm SalomeDSCSupervBasic SalomeDSCSuperv) -ENDIF(NOT WINDOWS) +ENDIF() SET(_${PROJECT_NAME}_exposed_targets ${DSC_TGS} DF Launcher OpUtil Registry ResourcesManager diff --git a/doc/docutils/CMakeLists.txt b/doc/docutils/CMakeLists.txt index 9ceadd855..c787e1b33 100755 --- a/doc/docutils/CMakeLists.txt +++ b/doc/docutils/CMakeLists.txt @@ -45,7 +45,7 @@ SALOME_CONFIGURE_FILE(conf.py.in conf.py) # Their root dir were found when looking for Sphinx (FindSalomeSphinx.cmake): SET(_pydir python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) -IF(WINDOWS) +IF(WIN32) STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\lib\\${_pydir}\\site-packages\\salome\;%PYTHONPATH% @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\bin\\salome\;%PYTHONPATH% @SET PATH=${CMAKE_INSTALL_PREFIX}\\lib\\salome\;%PATH% @@ -55,7 +55,7 @@ IF(WINDOWS) ") SET(EXT "bat") SET(CALL_STR "call") -ELSE(WINDOWS) +ELSE(WIN32) SET(SCR " export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/${_pydir}/site-packages/salome:\${PYTHONPATH} export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/bin/salome:\${PYTHONPATH} export LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib/salome:\${LD_LIBRARY_PATH} @@ -75,7 +75,7 @@ ELSE(WINDOWS) ENDIF() SET(EXT "sh") SET(CALL_STR ".") -ENDIF(WINDOWS) +ENDIF(WIN32) FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} "${SCR}") diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index 813ec82c6..4362cb815 100755 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -66,12 +66,12 @@ SET(IDL_INCLUDE_DIRS SET(COMMON_FLAGS ${OMNIORB_DEFINITIONS}) SET(TYPE) -IF(WINDOWS) +IF(WIN32) SET(COMMON_FLAGS "${COMMON_FLAGS} -DNOGDI") SET(TYPE STATIC) -ELSE(WINDOWS) +ELSE(WIN32) SET(TYPE SHARED) -ENDIF(WINDOWS) +ENDIF(WIN32) OMNIORB_ADD_MODULE(SalomeIDLKernel "${SalomeIDLKernel_IDLSOURCES}" "${IDL_INCLUDE_DIRS}") ADD_DEFINITIONS(${COMMON_FLAGS}) diff --git a/salome_adm/cmake_files/FindCAS.cmake b/salome_adm/cmake_files/FindCAS.cmake index 05b0061a5..8aa50cb47 100644 --- a/salome_adm/cmake_files/FindCAS.cmake +++ b/salome_adm/cmake_files/FindCAS.cmake @@ -62,9 +62,9 @@ SET(CAS_DEFINITIONS "-DLIN -DLINTEL -DCSFDB") SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DNo_exception") # No config.h file in the OPEN CASCADE on WINDOWS platform -IF(NOT WINDOWS) +IF(NOT WIN32) SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DHAVE_CONFIG_H") -ENDIF(NOT WINDOWS) +ENDIF() SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DOCC_CONVERT_SIGNALS") diff --git a/salome_adm/cmake_files/FindSalomeHDF5.cmake b/salome_adm/cmake_files/FindSalomeHDF5.cmake index d607ef7df..9b25dbeb2 100644 --- a/salome_adm/cmake_files/FindSalomeHDF5.cmake +++ b/salome_adm/cmake_files/FindSalomeHDF5.cmake @@ -27,10 +27,10 @@ # MPI root directory used for HDF5 compilation is exposed into MPI_ROOT_DIR_EXP # -if(WINDOWS) +if(WIN32) set(PREV_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES dll${CMAKE_IMPORT_LIBRARY_SUFFIX}) -endif(WINDOWS) +endif() SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(HDF5 HDF5_INCLUDE_DIR 1) MARK_AS_ADVANCED(FORCE HDF5_INCLUDE_DIR HDF5_LIB HDF5_DIR) @@ -80,6 +80,6 @@ IF(HDF5_IS_PARALLEL AND NOT SALOME_USE_MPI) MESSAGE(FATAL_ERROR "HDF5 is compiled with MPI, you have to set SALOME_USE_MPI to ON") ENDIF() -if(WINDOWS) +if(WIN32) set(CMAKE_FIND_LIBRARY_SUFFIXES ${PREV_CMAKE_FIND_LIBRARY_SUFFIXES}) -endif(WINDOWS) +endif() diff --git a/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake b/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake index 229d54d24..3e4a0c493 100644 --- a/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake +++ b/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake @@ -35,11 +35,11 @@ IF(SalomeOmniORB_FOUND) ENDIF() ENDIF() - IF(WINDOWS) + IF(WIN32) SET(DIR_COUNT 3) - ELSE(WINDOWS) + ELSE(WIN32) SET(DIR_COUNT 4) - ENDIF(WINDOWS) + ENDIF(WIN32) SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(OmniORBPy OMNIORB_PYTHON_BACKEND ${DIR_COUNT}) #MARK_AS_ADVANCED() diff --git a/salome_adm/cmake_files/FindSalomePython.cmake b/salome_adm/cmake_files/FindSalomePython.cmake index d7e2ba824..26b86dcf7 100644 --- a/salome_adm/cmake_files/FindSalomePython.cmake +++ b/salome_adm/cmake_files/FindSalomePython.cmake @@ -45,12 +45,12 @@ ENDIF() SET(PYTHON_ROOT_DIR "${_dflt_value}" CACHE PATH "Path to Python directory (interpreter and libs)") # 2. Find package - config mode first (i.e. looking for XYZ-config.cmake) -IF(WINDOWS) +IF(WIN32) IF(CMAKE_BUILD_TYPE STREQUAL Debug) SET(PythonInterp_FIND_VERSION _d) SET(PYTHON_DEFINITIONS "-DHAVE_DEBUG_PYTHON") ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug) -ENDIF(WINDOWS) +ENDIF(WIN32) IF(EXISTS "${PYTHON_ROOT_DIR}") # Hope to find direclty a CMake config file there SET(_CONF_DIR "${PYTHON_ROOT_DIR}/share/cmake") diff --git a/salome_adm/cmake_files/UseOmniORB.cmake b/salome_adm/cmake_files/UseOmniORB.cmake index 7d63d22f2..860308ed9 100644 --- a/salome_adm/cmake_files/UseOmniORB.cmake +++ b/salome_adm/cmake_files/UseOmniORB.cmake @@ -19,9 +19,9 @@ INSTALL( CODE " SET(INSTALL_PYIDL_DIR lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/salome) # R1 CHECK -IF(WINDOWS) +IF(WIN32) SET(INSTALL_PYIDL_DIR bin/salome) # R1 CHECK -ENDIF(WINDOWS) +ENDIF(WIN32) MACRO(OMNIORB_COMPILE_IDL_FORPYTHON_ON_INSTALL MYOMNIORBIDLPYTHON MYIDLPYFLAGS MYIDLFILE MYFULLDIR) FILE(MAKE_DIRECTORY \${MYFULLDIR}) @@ -76,9 +76,13 @@ MACRO(OMNIORB_ADD_MODULE module idlfiles incdirs) SET(_sources) # type of the libraries: SHARED for Linux, STATIC for Windows SET(_type SHARED) - IF(WINDOWS) + IF(WIN32) SET(_type STATIC) ENDIF() + IF(NOT WIN32 AND (_type STREQUAL STATIC)) + SET(CMAKE_POSITION_INDEPENDENT_CODE ON) + ENDIF() + # add additional include dirs to the C++ and Python backend options SET(_cxx_flags ${OMNIORB_IDLCXXFLAGS}) SET(_py_flags "${OMNIORB_IDLPYFLAGS}") diff --git a/src/DSC/CMakeLists.txt b/src/DSC/CMakeLists.txt index 1dfb7dbe7..5c38b578e 100755 --- a/src/DSC/CMakeLists.txt +++ b/src/DSC/CMakeLists.txt @@ -21,12 +21,12 @@ SET(SUBDIRS_COMMON DSC_Basic ) -IF(NOT WINDOWS) +IF(NOT WIN32) SET(SUBDIRS_ADD DSC_User DSC_Python ) -ENDIF(NOT WINDOWS) +ENDIF() IF(SALOME_PACO_PARALLEL) SET(SUBDIR_PAR diff --git a/src/SALOMEDS/CMakeLists.txt b/src/SALOMEDS/CMakeLists.txt index 1c7e51649..2e19bd812 100755 --- a/src/SALOMEDS/CMakeLists.txt +++ b/src/SALOMEDS/CMakeLists.txt @@ -37,9 +37,9 @@ INCLUDE_DIRECTORIES( ) ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${HDF5_DEFINITIONS} ${BOOST_DEFINITIONS}) -IF(WINDOWS) +IF(WIN32) ADD_DEFINITIONS(-DNOGDI) -ENDIF(WINDOWS) +ENDIF(WIN32) SET(COMMON_LIBS TOOLSDS diff --git a/src/SALOMEDS/Test/CMakeLists.txt b/src/SALOMEDS/Test/CMakeLists.txt index 7fd3f5fe4..678d5172a 100755 --- a/src/SALOMEDS/Test/CMakeLists.txt +++ b/src/SALOMEDS/Test/CMakeLists.txt @@ -67,9 +67,9 @@ SET(COMMON_LIBS ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS} ${OMNIORB_DEFINITIONS} ${BOOST_DEFINITIONS}) -IF(WINDOWS) +IF(WIN32) ADD_DEFINITIONS(-DNOGDI) -ENDIF(WINDOWS) +ENDIF(WIN32) ADD_LIBRARY(SALOMEDSTest SALOMEDSTest.cxx) TARGET_LINK_LIBRARIES(SALOMEDSTest ${COMMON_LIBS}) -- 2.39.2