Skip to content

Commit

Permalink
Try to help cmake find the right resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Collonval authored and fcollonval committed Oct 3, 2019
1 parent b3a82ca commit 1dbf854
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
2 changes: 0 additions & 2 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
REG QUERY HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0 /v VCTargetsPath
REG QUERY HKLM\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\4.0 /v VCTargetsPath
cd wrappers\Python
"%PYTHON%" setup.py install cmake=vc%VS_MAJOR%,%ARCH%
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
3 changes: 2 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ source:
- url: https://github.com/CoolProp/{{ name }}/archive/v{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
- setup.patch
- CMakeLists.patch
# External dependencies
# See https://github.com/CoolProp/CoolProp/tree/master/externals
Expand Down Expand Up @@ -61,7 +62,7 @@ test:
imports:
- CoolProp
- CoolProp.tests
- CoolProp.Plots
- CoolProp.Plots # [not py2k or not linux]
- CoolProp.GUI

about:
Expand Down
46 changes: 46 additions & 0 deletions recipe/setup.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/wrappers/Python/setup.py b/wrappers/Python/setup.py
--- a/wrappers/Python/setup.py
+++ b/wrappers/Python/setup.py
@@ -48,14 +48,6 @@ if __name__=='__main__':

# Trying to change the standard library for C++
import platform
- try:
- macVersion = platform.mac_ver()[0].split('.')
- if int(macVersion[0]) >= 10 and int(macVersion[1]) > 8:
- os.environ["CC"] = "gcc"
- os.environ["CXX"] = "g++"
- print('switching compiler to g++ for OSX')
- except:
- pass

# ******************************
# CMAKE OPTIONS
@@ -110,7 +110,7 @@ if __name__=='__main__':
if cmake_bitness == '32':
cmake_config_args += ['-G','"Visual Studio 9 2008"']
elif cmake_bitness == '64':
- cmake_config_args += ['-G','"Visual Studio 9 2008 Win64"']
+ cmake_config_args += ['-G','"NMake Makefiles"']
else:
raise ValueError('cmake_bitness must be either 32 or 64; got ' + cmake_bitness)
elif cmake_compiler == 'vc10':
@@ -126,7 +126,7 @@ if __name__=='__main__':
if cmake_bitness == '32':
cmake_config_args += ['-G','"Visual Studio 14 2015"']
elif cmake_bitness == '64':
- cmake_config_args += ['-G','"Visual Studio 14 2015 Win64"']
+ cmake_config_args += ['-G','"NMake Makefiles"']
else:
raise ValueError('cmake_bitness must be either 32 or 64; got ' + cmake_bitness)
elif cmake_compiler == 'mingw':
@@ -171,7 +171,8 @@ if __name__=='__main__':
static_libs = []
for search_suffix in ['Release/*.lib','Release/*.a', 'Debug/*.lib', 'Debug/*.a','*.a']:
static_libs += glob.glob(os.path.join(cmake_build_dir,search_suffix))
-
+ static_libs += glob.glob(os.path.join(cmake_build_dir, '*.lib'))
+ print(cmake_build_dir, static_libs)
if len(static_libs) != 1:
raise ValueError("Found more than one static library using CMake build. Found: "+str(static_libs))
else:

0 comments on commit 1dbf854

Please sign in to comment.