From 5b1ef68da594648202315c86cebf357d26224ff3 Mon Sep 17 00:00:00 2001 From: wanghengbing <wanghengbing@momenta.ai> Date: Wed, 16 Jun 2021 10:58:08 +0800 Subject: [PATCH 1/9] spell error fix --- source/baselib/CMakeLists.txt | 2 +- source/examples/fibcmd/CMakeLists.txt | 2 +- source/examples/fibgui/CMakeLists.txt | 2 +- source/fiblib/CMakeLists.txt | 2 +- source/tests/fiblib-test/CMakeLists.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/baselib/CMakeLists.txt b/source/baselib/CMakeLists.txt index 806eac2..1d96b9f 100644 --- a/source/baselib/CMakeLists.txt +++ b/source/baselib/CMakeLists.txt @@ -177,7 +177,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/examples/fibcmd/CMakeLists.txt b/source/examples/fibcmd/CMakeLists.txt index 4689fe1..55fd890 100644 --- a/source/examples/fibcmd/CMakeLists.txt +++ b/source/examples/fibcmd/CMakeLists.txt @@ -98,7 +98,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/examples/fibgui/CMakeLists.txt b/source/examples/fibgui/CMakeLists.txt index 50dd4e6..06016c3 100644 --- a/source/examples/fibgui/CMakeLists.txt +++ b/source/examples/fibgui/CMakeLists.txt @@ -121,7 +121,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/fiblib/CMakeLists.txt b/source/fiblib/CMakeLists.txt index 87ca876..7d16a1e 100644 --- a/source/fiblib/CMakeLists.txt +++ b/source/fiblib/CMakeLists.txt @@ -180,7 +180,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/tests/fiblib-test/CMakeLists.txt b/source/tests/fiblib-test/CMakeLists.txt index 9eeb4e9..8091419 100644 --- a/source/tests/fiblib-test/CMakeLists.txt +++ b/source/tests/fiblib-test/CMakeLists.txt @@ -95,7 +95,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) From 03b6b63ad2c03b97e1b08f979c71d3d6795111b9 Mon Sep 17 00:00:00 2001 From: wanghengbing <wanghengbing@momenta.ai> Date: Wed, 16 Jun 2021 11:30:44 +0800 Subject: [PATCH 2/9] upgrade cmake minimum version to 3.13 --- CMakeLists.txt | 2 +- README.md | 8 ++++---- source/tests/CMakeLists.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0842ab7..7f110dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # # CMake version -cmake_minimum_required(VERSION 3.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13 FATAL_ERROR) # # Configure CMake environment diff --git a/README.md b/README.md index cc99eea..e901257 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The main target platforms are typical desktop, laptop, and server platforms. Cur However, other UNIX versions may work as well if they are supported by CMake. The cmake-init template assumes you want to setup a project using -* CMake (3.0 or above) +* CMake (3.13 or above) * C/C++ compiler @@ -99,7 +99,7 @@ As with most CMake projects, cmake-init initializes the CMake environment. This ```cmake # CMake version -cmake_minimum_required(VERSION 3.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13 FATAL_ERROR) ``` required policies, @@ -155,12 +155,12 @@ if (WriterCompilerDetectionHeaderFound) endif () ``` -Another issue with older CMake versions is the unavailability of then-unpublished language standards (e.g., C++11 and CMake 3.0). For those versions, the compile options has to be extended manually. +Another issue with older CMake versions is the unavailability of then-unpublished language standards (e.g., C++11 and CMake 3.13). For those versions, the compile options has to be extended manually. For new projects, we suggest to require at least CMake 3.2 and to therefore adjust the minimum required version: ```cmake -cmake_minimum_required(VERSION 3.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13 FATAL_ERROR) ``` diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index a458b51..13bdb43 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -4,7 +4,7 @@ # # CMake version -cmake_minimum_required(VERSION 3.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13 FATAL_ERROR) # Meta information about the project set(META_PROJECT_NAME "template") From 60fe13c7716ef887c60892c0c2faaa2345727377 Mon Sep 17 00:00:00 2001 From: wanghengbing <wanghengbing@momenta.ai> Date: Wed, 16 Jun 2021 11:38:58 +0800 Subject: [PATCH 3/9] upgrade Windows build VM for making cmake version above 3.13 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 7218492..52b0a5a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,9 +4,9 @@ branches: - master clone_folder: c:\projects\cmake-init image: -- Visual Studio 2013 - Visual Studio 2015 - Visual Studio 2017 +- Visual Studio 2019 configuration: - Release - Debug From fa4095fe1139fbe6d51c624b04520052f920d31c Mon Sep 17 00:00:00 2001 From: wanghengbing <wanghengbing@momenta.ai> Date: Wed, 16 Jun 2021 11:51:14 +0800 Subject: [PATCH 4/9] fix cmake generator error --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 52b0a5a..26f0091 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,7 +27,7 @@ init: - echo %APPVEYOR_BUILD_WORKER_IMAGE% - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set generator="Visual Studio 15 2017%arch%" ) - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( set generator="Visual Studio 14 2015%arch%" ) -- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2013" ( set generator="Visual Studio 12 2013%arch%" ) +- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" ( set generator="Visual Studio 16 2019%arch%" ) - echo %generator% before_build: From 7d02f6673f4ea637e5190dabd8e939187a1f3cba Mon Sep 17 00:00:00 2001 From: wanghengbing <wanghengbing@momenta.ai> Date: Wed, 16 Jun 2021 12:11:43 +0800 Subject: [PATCH 5/9] appveyor cmake generator error fix --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 26f0091..815200c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,7 +27,7 @@ init: - echo %APPVEYOR_BUILD_WORKER_IMAGE% - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set generator="Visual Studio 15 2017%arch%" ) - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( set generator="Visual Studio 14 2015%arch%" ) -- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" ( set generator="Visual Studio 16 2019%arch%" ) +- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" ( set generator="Visual Studio 16 2019 -A %arch%" ) - echo %generator% before_build: From 3f02cdc5939c9ae84a198166bad632ae4c3ee526 Mon Sep 17 00:00:00 2001 From: wanghengbing <wanghengbing@momenta.ai> Date: Wed, 16 Jun 2021 12:55:05 +0800 Subject: [PATCH 6/9] fix continuous integration errors --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 815200c..942d8d1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -25,9 +25,9 @@ init: - if "%arch%"=="Win64" ( set arch= Win64) - echo %arch% - echo %APPVEYOR_BUILD_WORKER_IMAGE% -- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set generator="Visual Studio 15 2017%arch%" ) -- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( set generator="Visual Studio 14 2015%arch%" ) -- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" ( set generator="Visual Studio 16 2019 -A %arch%" ) +- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set generator="Visual Studio 15 2017" ) +- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( set generator="Visual Studio 14 2015" ) +- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" ( set generator="Visual Studio 16 2019" ) - echo %generator% before_build: @@ -35,7 +35,7 @@ before_build: mkdir build cd build cmake --version - cmake .. -G %generator% + cmake .. -G %generator% - A arch build: project: c:\projects\cmake-init\build\template.sln From fdc976cfd70e7fe8386a3aa83c77483975baf7ad Mon Sep 17 00:00:00 2001 From: wanghengbing <wanghengbing@momenta.ai> Date: Wed, 16 Jun 2021 12:57:07 +0800 Subject: [PATCH 7/9] fix continuous integration error --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 942d8d1..a8a4bfd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -35,7 +35,7 @@ before_build: mkdir build cd build cmake --version - cmake .. -G %generator% - A arch + cmake .. -G %generator% - A %arch% build: project: c:\projects\cmake-init\build\template.sln From e7ccb78c73114785c1280cf6db4fba418a5700a6 Mon Sep 17 00:00:00 2001 From: wanghengbing <wanghengbing@momenta.ai> Date: Wed, 16 Jun 2021 13:00:37 +0800 Subject: [PATCH 8/9] fix arch error --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index a8a4bfd..49df54d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,7 +22,7 @@ matrix: # skip unsupported combinations init: - set arch= -- if "%arch%"=="Win64" ( set arch= Win64) +- if "%arch%"=="Win64" ( set arch= x64) - echo %arch% - echo %APPVEYOR_BUILD_WORKER_IMAGE% - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set generator="Visual Studio 15 2017" ) From 4f229aaa5d213d797421c1abd56af0c5fd39091d Mon Sep 17 00:00:00 2001 From: wanghengbing <wanghengbing@momenta.ai> Date: Wed, 16 Jun 2021 13:02:22 +0800 Subject: [PATCH 9/9] cmake -A error fix --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 49df54d..84114ff 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -35,7 +35,7 @@ before_build: mkdir build cd build cmake --version - cmake .. -G %generator% - A %arch% + cmake .. -G %generator% -A %arch% build: project: c:\projects\cmake-init\build\template.sln