Skip to content

Commit

Permalink
Merge pull request #412 from Galfodo/master
Browse files Browse the repository at this point in the history
Visual Studio support for Python api
  • Loading branch information
joakim-hove authored May 31, 2018
2 parents 3a9e9eb + 6cc6131 commit 820832a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
35 changes: 16 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required( VERSION 2.8.12 )
cmake_minimum_required( VERSION 2.8.12 ) # If you are creating Python wrappers for Windows, the actual version requirement is 3.4
project( ERT C CXX )

include(GNUInstallDirs)
Expand Down Expand Up @@ -326,11 +326,6 @@ if (MSVC)
add_definitions( -D__func__="\\"????\\"")
endif()
if (ERT_WINDOWS)
message(WARNING "Python is not supported on Windows")
set( ENABLE_PYTHON OFF )
endif ()
if (ERT_LINUX)
add_definitions( -DHAVE_PROC )
endif()
Expand All @@ -339,20 +334,22 @@ add_subdirectory( lib )
add_subdirectory( applications )
add_subdirectory( bin )
if (ENABLE_PYTHON AND ERT_WINDOWS)
if ((NOT MSVC) OR (MSVC_VERSION LESS 1900))
message(FATAL_ERROR "The Python wrappers require Visual Studio 2015 or newer")
endif()
endif()
if (ENABLE_PYTHON)
if (ERT_WINDOWS)
message(WARNING "Python is not supported on Windows")
set( ENABLE_PYTHON OFF )
else()
# If finding the Python interpreter and required packages
# fails in the python/CMakeLists.txt file the ENABLE_PYTHON
# will be set to OFF.
add_subdirectory( python )
if(RST_DOC)
add_subdirectory( docs )
endif()
endif()
# If finding the Python interpreter and required packages
# fails in the python/CMakeLists.txt file the ENABLE_PYTHON
# will be set to OFF.
add_subdirectory( python )
if(RST_DOC)
add_subdirectory( docs )
endif()
endif()
if (ENABLE_PYTHON)
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build_script:
cd build
cmake .. -G"Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DERT_BUILD_CXX=OFF -DENABLE_PYTHON=OFF -DBUILD_APPLICATIONS=ON
cmake .. -G"Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DERT_BUILD_CXX=OFF -DENABLE_PYTHON=ON -DBUILD_APPLICATIONS=ON
msbuild /m /p:Configuration=Release /p:Platform="x64" ERT.sln
7 changes: 7 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ add_library(ecl util/rng.cpp
geometry/geo_polygon_collection.cpp
)

if (ERT_WINDOWS)
set_target_properties(ecl PROPERTIES PREFIX "lib")
if (MSVC)
set_target_properties(ecl PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
endif ()

target_link_libraries(ecl PUBLIC ${m}
${dl}
${pthread}
Expand Down
2 changes: 1 addition & 1 deletion lib/util/TestArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/

#include <string>

#include <ert/util/util.hpp>
Expand Down Expand Up @@ -120,4 +121,3 @@ namespace ERT {
}

}

0 comments on commit 820832a

Please sign in to comment.