From d74c6408fd67a51b3baf6f4770ff934b0c2069d3 Mon Sep 17 00:00:00 2001 From: Mark A Potts Date: Wed, 26 Feb 2020 16:20:01 +0000 Subject: [PATCH 1/4] fixed lingering kind issues --- Modules/Findg2tmpl.cmake | 4 ++-- Modules/Findgfsio.cmake | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/Findg2tmpl.cmake b/Modules/Findg2tmpl.cmake index 133e4a9..dc0d307 100644 --- a/Modules/Findg2tmpl.cmake +++ b/Modules/Findg2tmpl.cmake @@ -10,8 +10,8 @@ if(DEFINED ENV{G2TMPL_LIB} ) string(REGEX MATCH "(v[0-9]+\\.[0-9]+\\.[0-9]+)" _ ${${uppercase_name}_LIB}) set(version ${CMAKE_MATCH_1}) - set(lib_name ${name}_${kind}) - set(versioned_lib_name ${name}_${version}_${kind}) + set(lib_name ${name}) + set(versioned_lib_name ${name}_${version}) if(EXISTS ${${uppercase_name}_LIB} ) get_filename_component(lib_dir ${${uppercase_name}_LIB} DIRECTORY) diff --git a/Modules/Findgfsio.cmake b/Modules/Findgfsio.cmake index 44b221a..f3c6347 100644 --- a/Modules/Findgfsio.cmake +++ b/Modules/Findgfsio.cmake @@ -12,8 +12,8 @@ if(DEFINED ENV{GFSIO_LIB4} ) set(kinds "4") foreach(kind ${kinds}) - set(lib_name ${name}_${kind}) - set(versioned_lib_name ${name}_${version}_${kind}) + set(lib_name ${name}) + set(versioned_lib_name ${name}_${version}_${kinds}) if(EXISTS ${${uppercase_name}_LIB${kind}} ) get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY) @@ -28,4 +28,4 @@ if(DEFINED ENV{GFSIO_LIB4} ) endif() find_package_handle_standard_args(gfsio - REQUIRED_VARS gfsio_path_4) + REQUIRED_VARS gfsio_path) From 1cdb239b066a8ecc5f0357096f63c9fd0f98a1c2 Mon Sep 17 00:00:00 2001 From: Mark A Potts Date: Wed, 26 Feb 2020 16:20:01 +0000 Subject: [PATCH 2/4] fixed lingering kind issues --- Modules/Findg2tmpl.cmake | 4 ++-- Modules/Findgfsio.cmake | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/Findg2tmpl.cmake b/Modules/Findg2tmpl.cmake index 133e4a9..dc0d307 100644 --- a/Modules/Findg2tmpl.cmake +++ b/Modules/Findg2tmpl.cmake @@ -10,8 +10,8 @@ if(DEFINED ENV{G2TMPL_LIB} ) string(REGEX MATCH "(v[0-9]+\\.[0-9]+\\.[0-9]+)" _ ${${uppercase_name}_LIB}) set(version ${CMAKE_MATCH_1}) - set(lib_name ${name}_${kind}) - set(versioned_lib_name ${name}_${version}_${kind}) + set(lib_name ${name}) + set(versioned_lib_name ${name}_${version}) if(EXISTS ${${uppercase_name}_LIB} ) get_filename_component(lib_dir ${${uppercase_name}_LIB} DIRECTORY) diff --git a/Modules/Findgfsio.cmake b/Modules/Findgfsio.cmake index 44b221a..f3c6347 100644 --- a/Modules/Findgfsio.cmake +++ b/Modules/Findgfsio.cmake @@ -12,8 +12,8 @@ if(DEFINED ENV{GFSIO_LIB4} ) set(kinds "4") foreach(kind ${kinds}) - set(lib_name ${name}_${kind}) - set(versioned_lib_name ${name}_${version}_${kind}) + set(lib_name ${name}) + set(versioned_lib_name ${name}_${version}_${kinds}) if(EXISTS ${${uppercase_name}_LIB${kind}} ) get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY) @@ -28,4 +28,4 @@ if(DEFINED ENV{GFSIO_LIB4} ) endif() find_package_handle_standard_args(gfsio - REQUIRED_VARS gfsio_path_4) + REQUIRED_VARS gfsio_path) From e61238fd40e1a8599f72d3a3346380a2621611d2 Mon Sep 17 00:00:00 2001 From: Mark A Potts Date: Wed, 26 Feb 2020 17:17:12 +0000 Subject: [PATCH 3/4] returned kind extension to gfsio_path --- Modules/Findgfsio.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Modules/Findgfsio.cmake b/Modules/Findgfsio.cmake index f3c6347..0b75829 100644 --- a/Modules/Findgfsio.cmake +++ b/Modules/Findgfsio.cmake @@ -1,7 +1,7 @@ # This module looks for environment variables detailing where GFSIO lib is # If variables are not set, GFSIO will be built from external source if(DEFINED ENV{GFSIO_LIB4} ) - set(GFSIO_LIB4 $ENV{GFSIO_LIB4} CACHE STRING "GFSIO Library Location" ) + set(GFSIO_LIB4 $ENV{GFSIO_LIB4} CACHE STRING "GFSIO_4 Library Location" ) set(GFSIO_INC4 $ENV{GFSIO_INC4} CACHE STRING "GFSIO_4 Include Location" ) set(name "gfsio") @@ -12,20 +12,20 @@ if(DEFINED ENV{GFSIO_LIB4} ) set(kinds "4") foreach(kind ${kinds}) - set(lib_name ${name}) - set(versioned_lib_name ${name}_${version}_${kinds}) + set(lib_name ${name}_${kind}) + set(versioned_lib_name ${name}_${version}_${kind}) if(EXISTS ${${uppercase_name}_LIB${kind}} ) get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY) - find_library(gfsio_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH) + find_library(gfsio_path_${kind} NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH) add_library(${lib_name} STATIC IMPORTED) set_target_properties(${lib_name} PROPERTIES - IMPORTED_LOCATION ${gfsio_path} + IMPORTED_LOCATION ${gfsio_path}_${kind} INTERFACE_INCLUDE_DIRECTORIES ${${uppercase_name}_INC${kind}}) endif() endforeach() endif() find_package_handle_standard_args(gfsio - REQUIRED_VARS gfsio_path) + REQUIRED_VARS gfsio_path_4) From ab04ead7fca9897bb3e0104efc37403a00e78a15 Mon Sep 17 00:00:00 2001 From: Mark A Potts Date: Wed, 26 Feb 2020 18:10:06 +0000 Subject: [PATCH 4/4] one more fix --- Modules/Findgfsio.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Findgfsio.cmake b/Modules/Findgfsio.cmake index 0b75829..fd34f72 100644 --- a/Modules/Findgfsio.cmake +++ b/Modules/Findgfsio.cmake @@ -21,7 +21,7 @@ if(DEFINED ENV{GFSIO_LIB4} ) add_library(${lib_name} STATIC IMPORTED) set_target_properties(${lib_name} PROPERTIES - IMPORTED_LOCATION ${gfsio_path}_${kind} + IMPORTED_LOCATION ${gfsio_path_${kind}} INTERFACE_INCLUDE_DIRECTORIES ${${uppercase_name}_INC${kind}}) endif() endforeach()