Re: [CMake] Using CMake with TI armcl and armar

2019-11-07 Thread Eric Doenges

Am 07.11.19 um 18:01 schrieb samyuktar:

SET(CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_COMPILER}  ${CMAKE_C_FLAGS}
--c_file=../main.c -z --map_file=${TARGET_NAME}.map
--output_file=${TARGET_NAME} ${PLATFORM_CONFIG_L_FLAGS} ${CMD_SRCS}   ${LIB}
--include_path ${LWIP_INCLUDE_DIR} --verbose "  CACHE STRING
"linker executable")


As far as I can tell, you are trying to combine the compile and link 
steps, but CMake expects these to be separate steps. Furthermore, cmake 
knows about the TI compiler (see 
<...>/share/cmake-3.xx/Modules/Compiler/TI-C.cmake and friends), so you 
shouldn't need to mess around with CMAKE_C_LINK_EXECUTABLE - let cmake 
handle that for you. The flags you need for linking that cmake doesn't 
already add for you by default should go into 
CMAKE_EXE_LINKER_FLAGS__INIT (see the cmake documenation for 
details), or be set using the add_link_options and/or 
target_link_options commands (again, see the cmake documentation for 
details).



[ 50%] Building C object CMakeFiles/test.dir/main.c.o
/Applications/ti_ccs9/ccs9/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl
-I/Applications/ti_ccs9/ccs9/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk   -o
CMakeFiles/test.dir/main.c.o   -c /Users/sramnath/lwip_blinky/lwip/main.c

WARNING: object file specified, but linking not enabled


That compiler invocation looks wrong - I'm pretty sure the TI compiler 
doesn't use the MacOS10.14.sdk sysroot. I think what's happening here is 
that you set your toolchain settings (CMAKE_C_COMPILER and friends) 
after the project() command - but the project() command tells cmake to 
check what compiler you are using to figure out how it must be called, 
and it is using your host system's compiler (probably Apple's clang) to 
do so. You should put the toolchain definitions into a toolchain file as 
described in the cmake-toolchains(7) documentation and tell cmake to use 
it my specifying -DCMAKE_TOOLCHAIN_FILE= on 
the cmake command line.


I once played around a bit with cgtools 5.2.9 for Arm using the 
following toolchain file:


--- SNIP ---

# TI cgt-arm_5.2.9 cmake toolchain script
#
# This file is based on the cmake-toolchains(7) documentation.

# Set the operating system and processor architecture
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_SYSTEM_VERSION 1)

# Setup CMake's rules for using the CMAKE_FIND_ROOT_PATH for 
cross-compilation

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

# TI cgtools command line programs
set(SDK_PATH "/proj/he/opt/ti/ti-cgt-arm_5.2.9")
set(SDK_BIN "${SDK_PATH}/bin")

# This compiler doesn't work with CMAKE_SYSROOT, but we do need to set our
# CMAKE_FIND_ROOT_PATH. Note that setting a variable will override the 
value in
# the cache if the CACHE option was not used, so if we want to be able 
to use a
# CMAKE_FIND_ROOT_PATH passed to cmake via the command line, we must 
make sure

# not to overwrite any value that was already set.
if(NOT CMAKE_FIND_ROOT_PATH)
  set(CMAKE_FIND_ROOT_PATH ${SDK_PATH})
endif()

set(CMAKE_C_COMPILER "${SDK_BIN}/armcl")
set(CMAKE_CXX_COMPILER "${SDK_BIN}/armcl")
set(CMAKE_ASM_COMPILER "${SDK_BIN}/armasm")
set(CMAKE_AR "${SDK_BIN}/armar")
set(CMAKE_LINKER "${SDK_BIN}/armlnk")

string(CONCAT ARCH_C_FLAGS
  "-mv=7A8 --abi=eabi -me --float_support=VFPv3 --neon 
--printf_support=full")

set(CMAKE_C_FLAGS_INIT "${ARCH_C_FLAGS}")
set(CMAKE_CXX_FLAGS_INIT "${ARCH_C_FLAGS}")

# Normally, cmake checks if the compiler can compile and link programs. For
# TI's cgtools the link step doesn't work, and there seems to be no easy way
# to fix this. Instead, we simply disable the compiler checks for C and C++.
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)

--- SNIP ---

Note that the project this was intended for thankfully never got 
anywhere so I didn't pursue this much further than being able to compile 
libz with it ("thankfully" because the TI compiler is pretty awful).


--

*Dr. Eric Dönges*
Senior Software Engineer

MVTec Software GmbH | Arnulfstr. 205 | 80634 Munich | Germany
doen...@mvtec.com  | Tel: +49 89 457 695-0 
| www.mvtec.com 


Find our privacy policy here .

Sign up  for our MVTec Newsletter!

Geschäftsführer: Dr. Wolfgang Eckstein, Dr. Olaf Munkelt
Amtsgericht München HRB 114695

MVTec Software GmbH Logo
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: 

[CMake] (No Subject)

2019-11-07 Thread 王振
Hello


Sent from Mail Master-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[Cmake-commits] CMake branch, master, updated. v3.16.0-rc3-310-gdb669b4d1a

2019-11-07 Thread Kitware Robot via Cmake-commits
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  db669b4d1a5fc7e3cfa3d76a9d35e11753e806e2 (commit)
  from  449fceeb1fd9619d9b01f8aed0e9e5784e10dacb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db669b4d1a5fc7e3cfa3d76a9d35e11753e806e2
commit db669b4d1a5fc7e3cfa3d76a9d35e11753e806e2
Author: Kitware Robot 
AuthorDate: Fri Nov 8 00:01:09 2019 -0500
Commit: Kitware Robot 
CommitDate: Fri Nov 8 00:01:09 2019 -0500

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index bb56009e81..53a560b84a 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 16)
-set(CMake_VERSION_PATCH 20191107)
+set(CMake_VERSION_PATCH 20191108)
 #set(CMake_VERSION_RC 0)
 set(CMake_VERSION_IS_DIRTY 0)
 

---

Summary of changes:
 Source/CMakeVersion.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, master, updated. v3.16.0-rc3-309-g449fceeb1f

2019-11-07 Thread Kitware Robot via Cmake-commits
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  449fceeb1fd9619d9b01f8aed0e9e5784e10dacb (commit)
   via  bea26f5aa0e1b98dea9d87ba2444c0901842f97c (commit)
   via  87dcbe0b2122ee9cfea81369a45d15b22853ba90 (commit)
   via  016601e5e6f152403306c12997534aadd4287d38 (commit)
   via  c1435d98120dff203de01d75f8f91e99bc75fe2b (commit)
   via  eb9d945f142ac7638baaf879fb9464fa39e3e9a7 (commit)
   via  c544cb66984f16cc63ebace16ccd911adc550b9d (commit)
   via  6ce27d3a2efad4e40d4354a7d17e4259fb4c1e24 (commit)
   via  a7c1e15cc46aa97cc19c9eb84fe8cad55c650bfa (commit)
   via  73a40b19ffa49bfc92fbe10bd0fd3821b7facae6 (commit)
   via  af9ed543b0f9d032158f91cdce7ad6908ff9365b (commit)
  from  74569996e8fe798386cca2d4241acea0644f6275 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=449fceeb1fd9619d9b01f8aed0e9e5784e10dacb
commit 449fceeb1fd9619d9b01f8aed0e9e5784e10dacb
Merge: bea26f5aa0 87dcbe0b21
Author: Kyle Edwards 
AuthorDate: Thu Nov 7 18:10:46 2019 +
Commit: Kitware Robot 
CommitDate: Thu Nov 7 13:10:57 2019 -0500

Merge branch 'release-3.16'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bea26f5aa0e1b98dea9d87ba2444c0901842f97c
commit bea26f5aa0e1b98dea9d87ba2444c0901842f97c
Merge: 74569996e8 016601e5e6
Author: Kyle Edwards 
AuthorDate: Thu Nov 7 18:10:46 2019 +
Commit: Kitware Robot 
CommitDate: Thu Nov 7 13:10:57 2019 -0500

Merge topic 'ctest-resource-groups'

016601e5e6 Merge branch 'backport-ctest-resource-groups'
c1435d9812 Help: Fix error in resource allocation example
eb9d945f14 CTest: Rename hardware -> resources for RunCMake tests
c544cb6698 CTest: Rename hardware -> resources for source code
6ce27d3a2e cmCTestMultiProcessHandler: Rename resource locking functions
a7c1e15cc4 CTest: Rename hardware -> resources for CMake variables, command 
options
73a40b19ff CTest: Rename "Processes" lexer to "ResourceGroups"
af9ed543b0 CTest: Rename PROCESSES test property to RESOURCE_GROUPS

Acked-by: Kitware Robot 
Merge-request: !3994


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=016601e5e6f152403306c12997534aadd4287d38
commit 016601e5e6f152403306c12997534aadd4287d38
Merge: 370fe1495b c1435d9812
Author: Brad King 
AuthorDate: Tue Nov 5 12:59:16 2019 -0500
Commit: Brad King 
CommitDate: Tue Nov 5 12:59:16 2019 -0500

Merge branch 'backport-ctest-resource-groups'

diff --cc Source/CTest/cmCTestRunTest.h
index 881cbb6486,f781c7ab0d..d5e83d9e4d
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@@ -129,14 -128,13 +132,14 @@@ private
std::string StartTime;
std::string ActualCommand;
std::vector Arguments;
-   bool UseAllocatedHardware = false;
+   bool UseAllocatedResources = false;
std::vector>>
- AllocatedHardware;
+ std::string, std::vector>>
+ AllocatedResources;
 -  bool RunUntilFail;
 -  int NumberOfRunsLeft;
 -  bool RunAgain;
 +  cmCTest::Rerun RerunMode = cmCTest::Rerun::Never;
 +  int NumberOfRunsLeft = 1;  // default to 1 run of the test
 +  int NumberOfRunsTotal = 1; // default to 1 run of the test
 +  bool RunAgain = false; // default to not having to run again
size_t TotalNumberOfTests;
  };
  
diff --cc Source/ctest.cxx
index 2659e3071b,0d65902ef0..a7b11cd944
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@@ -99,14 -99,11 +99,14 @@@ static const char* cmDocumentationOptio
{ "-U, --union", "Take the Union of -I and -R" },
{ "--rerun-failed", "Run only the tests that failed previously" },
{ "--repeat-until-fail ",
 -"Require each test to run  "
 -"times without failing in order to pass" },
 +"Require each test to run  times without failing in order to pass" },
 +  { "--repeat-until-pass ",
 +"Allow each test to run up to  times in order to pass" },
 +  { "--repeat-after-timeout ",
 +"Allow each test to run up to  times if it times out" },
{ "--max-width ", "Set the max width for a test name to output" },
{ "--interactive-debug-mode [0|1]", "Set the interactive mode to 0 or 1." },
-   { "--hardware-spec-file ", "Set the hardware spec file to use." },
+   { "--resource-spec-file ", "Set the resource spec file to use." },
{ "--no-label-summary", "Disable timing summary information for labels." },
{ "--no-subproject-summary",
  "Disable timing summary information for "

---

Summary of changes:
 Help/command/ctest_test.rst|   8 +-
 Help/manual/cmake-properties.7.rst   

[Cmake-commits] CMake branch, release, updated. v3.16.0-rc3-55-g87dcbe0b21

2019-11-07 Thread Kitware Robot via Cmake-commits
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, release has been updated
   via  87dcbe0b2122ee9cfea81369a45d15b22853ba90 (commit)
   via  c1435d98120dff203de01d75f8f91e99bc75fe2b (commit)
   via  eb9d945f142ac7638baaf879fb9464fa39e3e9a7 (commit)
   via  c544cb66984f16cc63ebace16ccd911adc550b9d (commit)
   via  6ce27d3a2efad4e40d4354a7d17e4259fb4c1e24 (commit)
   via  a7c1e15cc46aa97cc19c9eb84fe8cad55c650bfa (commit)
   via  73a40b19ffa49bfc92fbe10bd0fd3821b7facae6 (commit)
   via  af9ed543b0f9d032158f91cdce7ad6908ff9365b (commit)
  from  02ed66c04bf24d4c13fb6f82d040b835c966bf0c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
---

Summary of changes:
 Help/command/ctest_test.rst|   8 +-
 Help/manual/cmake-properties.7.rst |   2 +-
 Help/manual/ctest.1.rst| 143 ++--
 Help/prop_test/PROCESSES.rst   |  54 -
 Help/prop_test/RESOURCE_GROUPS.rst |  54 +
 Help/prop_test/RESOURCE_LOCK.rst   |  14 +-
 Help/release/3.16.rst  |   4 +-
 Source/CMakeLists.txt  |  12 +-
 Source/CTest/cmCTestBinPacker.cxx  | 132 +--
 Source/CTest/cmCTestBinPacker.h|  10 +-
 Source/CTest/cmCTestMultiProcessHandler.cxx| 101 +
 Source/CTest/cmCTestMultiProcessHandler.h  |  32 +--
 Source/CTest/cmCTestProcessesLexerHelper.cxx   |  55 -
 ...eAllocator.cxx => cmCTestResourceAllocator.cxx} |  20 +-
 ...dwareAllocator.h => cmCTestResourceAllocator.h} |  10 +-
 Source/CTest/cmCTestResourceGroupsLexerHelper.cxx  |  55 +
 ...Helper.h => cmCTestResourceGroupsLexerHelper.h} |  12 +-
 ...estHardwareSpec.cxx => cmCTestResourceSpec.cxx} |  28 +--
 ...cmCTestHardwareSpec.h => cmCTestResourceSpec.h} |  10 +-
 Source/CTest/cmCTestRunTest.cxx|  16 +-
 Source/CTest/cmCTestRunTest.h  |  21 +-
 Source/CTest/cmCTestTestCommand.cxx|   6 +-
 Source/CTest/cmCTestTestCommand.h  |   2 +-
 Source/CTest/cmCTestTestHandler.cxx|  28 +--
 Source/CTest/cmCTestTestHandler.h  |  12 +-
 Source/LexerParser/.gitattributes  |   4 +-
 ...sesLexer.cxx => cmCTestResourceGroupsLexer.cxx} | 168 +++---
 ...ocessesLexer.h => cmCTestResourceGroupsLexer.h} | 252 ++---
 ...sLexer.in.l => cmCTestResourceGroupsLexer.in.l} |  38 ++--
 Source/cmCTest.cxx |   6 +-
 Source/ctest.cxx   |   2 +-
 Tests/CMakeLib/CMakeLists.txt  |   8 +-
 Tests/CMakeLib/testCTestBinPacker.cxx  |  18 +-
 ...llocator.cxx => testCTestResourceAllocator.cxx} |  66 +++---
 ...stProcesses.cxx => testCTestResourceGroups.cxx} |  11 +-
 ...tHardwareSpec.cxx => testCTestResourceSpec.cxx} |  16 +-
 .../spec1.json |   0
 .../spec10.json|   0
 .../spec11.json|   0
 .../spec12.json|   0
 .../spec13.json|   0
 .../spec14.json|   0
 .../spec15.json|   0
 .../spec16.json|   0
 .../spec17.json|   0
 .../spec18.json|   0
 .../spec2.json |   0
 .../spec3.json |   0
 .../spec4.json |   0
 .../spec5.json |   0
 .../spec6.json |   0
 .../spec7.json |   0
 .../spec8.json |   0
 .../spec9.json |   0
 Tests/RunCMake/CMakeLists.txt  |  24 +-
 Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake |   2 +-
 .../CTestCommandLine/show-only_json-v1_check.py|   6 +-
 .../CTestHardwareAllocation/HardwareCommon.cmake   |  23 --
 .../CTestHardwareAllocation/RunCMakeTest.cmake | 167 --
 .../checkfree1-ctest-s-hw-check.cmake  |   1 -
 .../CTestHardwareAllocation/checkfree1.cmake   |   7 -
 .../checkfree2-ctest-s-hw-check.cmake  |   1 -
 .../CTestHardwareAllocation/checkfree2.cmake   |   8 -
 

[CMake] Using CMake with TI armcl and armar

2019-11-07 Thread samyuktar
Hi,

I want to include some open-source stacks in my code for the CC1352P1, so
I'm trying to use cmake with armcl compiler and armar archiver.

Here is my code:

cmake_minimum_required(VERSION 3.10)
  
set (CMAKE_CONFIGURATION_TYPES "Debug;Release")

project(lwIP)

# Example lwIP application
set(LWIP_DIR "/Users/sramnath/lwip_blinky/lwip")

set (LWIP_DEFINITIONS LWIP_DEBUG=1)

set(CMAKE_VERBOSE_MAKEFILE ON)

#include(CMakeForceCompiler)
# this one is important
set(CMAKE_SYSTEM_NAME Generic)

set (cc1352p1_board_SRCS
${LWIP_DIR}/CC1352P1_LAUNCHXL_TIRTOS.cmd
${LWIP_DIR}/CC1352P1_LAUNCHXL_fxns.c
${LWIP_DIR}/CC1352P1_LAUNCHXL.c
${LWIP_DIR}/ccfg.c
)

set (LWIP_INCLUDE_DIRS
"${LWIP_DIR}/src/include"
"${LWIP_DIR}"
"${LWIP_DIR}/contrib/"
"${LWIP_DIR}/contrib/ports/tirtos/include"
"${LWIP_DIR}/contrib/examples/test"
#"/Users/sramnath/lwip_out/lwip/contrib/ports/tirtos"
"${LWIP_DIR}/contrib/ports/tirtos"
"${LWIP_TIRTOS_SRCS}"
)

set (LWIP_BIOS_OPTS
"--define=ti_sysbios_BIOS_swiEnabled__D=TRUE"
"--define=ti_sysbios_BIOS_taskEnabled__D=TRUE"
"--define=ti_sysbios_BIOS_clockEnabled__D=TRUE"
"--define=ti_sysbios_BIOS_runtimeCreatesEnabled__D=TRUE"
"--define=ti_sysbios_hal_Hwi_DISABLE_ALL_HOOKS"
"--define=ti_sysbios_knl_Swi_DISABLE_ALL_HOOKS"
"--define=ti_sysbios_BIOS_smpEnabled__D=FALSE"
"--define=ti_sysbios_Build_useHwiMacros"
"--define=ti_sysbios_knl_Swi_numPriorities__D=6"
"--define=ti_sysbios_knl_Task_deleteTerminatedTasks__D=FALSE"
"--define=ti_sysbios_knl_Task_numPriorities__D=16"
"--define=ti_sysbios_knl_Task_checkStackFlag__D=FALSE"
"--define=ti_sysbios_knl_Task_initStackFlag__D=TRUE"
"--define=ti_sysbios_knl_Task_DISABLE_ALL_HOOKS"
   
"--define=ti_sysbios_knl_Clock_TICK_SOURCE=ti_sysbios_knl_Clock_TickSource_TIMER"
   
"--define=ti_sysbios_knl_Clock_TICK_MODE=ti_sysbios_knl_Clock_TickMode_DYNAMIC"
   
"--define=ti_sysbios_hal_Core_delegate_getId=ti_sysbios_hal_CoreNull_getId__E"
   
"--define=ti_sysbios_hal_Core_delegate_interruptCore=ti_sysbios_hal_CoreNull_interruptCore__E"
   
"--define=ti_sysbios_hal_Core_delegate_lock=ti_sysbios_hal_CoreNull_lock__E"
   
"--define=ti_sysbios_hal_Core_delegate_unlock=ti_sysbios_hal_CoreNull_unlock__E"
"--define=ti_sysbios_hal_Core_numCores__D=1"
"--define=ti_sysbios_hal_CoreNull_numCores__D=1"
"--define=ti_sysbios_utils_Load_taskEnabled__D=TRUE"
"--define=ti_sysbios_utils_Load_swiEnabled__D=FALSE"
"--define=ti_sysbios_utils_Load_hwiEnabled__D=FALSE"
"--define=ti_sysbios_family_arm_m3_Hwi_dispatcherSwiSupport__D=TRUE"
   
"--define=ti_sysbios_family_arm_m3_Hwi_dispatcherTaskSupport__D=TRUE"
   
"--define=ti_sysbios_family_arm_m3_Hwi_dispatcherAutoNestingSupport__D=TRUE"
"--define=ti_sysbios_knl_Semaphore_supportsEvents__D=FALSE"
"--define=ti_sysbios_knl_Semaphore_supportsPriority__D=FALSE"
"--define=xdc_runtime_Assert_DISABLE_ALL"
"--define=xdc_runtime_Log_DISABLE_ALL"
)

set(CCS_PATH "/Applications/ti_ccs9/ccs9/ccs")
# set(CMAKE_MAKE_PROGRAM ${CCS_PATH}/utils/bin/gmake CACHE PATH "make
program" FORCE)
set(CG_TOOL_ROOT ${CCS_PATH}/tools/compiler/ti-cgt-arm_18.12.2.LTS)

# specify the cross compiler
SET(CMAKE_C_COMPILER_FLAGS "")
# SET(CMAKE_C_COMPILER   "${CG_TOOL_ROOT}/bin/armcl ${cc1352p1_board_SRCS}"
CACHE PATH "c compiler")
SET(CMAKE_C_COMPILER  
"/Applications/ti_ccs9/ccs9/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl")



SET(CMAKE_CXX_COMPILER ${CMAKE_C_COMPILER}  CACHE PATH "cxx compiler")
#SET(CMAKE_ASM_COMPILER ${CG_TOOL_ROOT}/bin/armasm  CACHE PATH "assembler")
SET(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}  CACHE PATH "assembler")
SET(CMAKE_LINKER ${CMAKE_C_COMPILER} CACHE PATH "linker")


# Add the default include and lib directories for tool chain
include_directories(${CG_TOOL_ROOT}/include)
link_directories(${CG_TOOL_ROOT}/lib)
message("link_directories(${CG_TOOL_ROOT}/lib)")

# set target environment
set(CMAKE_FIND_ROOT_PATH ${CG_TOOL_ROOT})

# specifiy target cpu flags
set(PLATFORM_CONFIG_C_FLAGS"-mv7M4 --code_state=32
--float_support=VFPv3D16 --abi=eabi -me -g --diag_warning=225
--display_error_number --diag_wrap=off --enum_type=packed
--include_path=${CG_TOOL_ROOT}/include --define=_RM46x_
--define=_VFP_SUPPORT_=1" CACHE STRING "platform config c flags")
set(PLATFORM_CONFIG_L_FLAGS"-i ${CG_TOOL_ROOT}/lib --reread_libs
--warn_sections --rom_model")

# combine flags to C and C++ flags
SET(CMAKE_C_FLAGS "${PLATFORM_CONFIG_C_FLAGS} ${CMAKE_C_FLAGS}" CACHE STRING
"platform config c flags")
SET(CMAKE_CXX_FLAGS "${PLATFORM_CONFIG_C_FLAGS} ${CMAKE_CXX_FLAGS}" CACHE
STRING "platform config cxx flags")
SET(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS}")
SET(LIB "-l rtsv7R4_T_le_v3D16_eabi.lib")
SET(CMD_SRCS
"/Users/sramnath/lwip_blinky/lwip/CC1352P1_LAUNCHXL_TIRTOS.cmd")


Re: [CMake] Using generator expression with add_library

2019-11-07 Thread Andrew Fuller
Another option is to use BUILD_SHARED_LIBS to control static vs. shared.  Set 
it to false on MSVC and true everywhere else, then omit the library type in the 
add_library calls that you wish to have controllable behaviour.  Those 
add_library calls will then consult BUILD_SHARED_LIBS to determine whether to 
generate a static or shared lib.

From: CMake  on behalf of David Aldrich 

Sent: November 7, 2019 3:52 AM
To: Petr Kmoch 
Cc: CMake MailingList 
Subject: Re: [CMake] Using generator expression with add_library

Thank you. So I guess I can make it as simple as:

if(MSVC)
add_library(${_star_lib_name} STATIC "")
else()
add_library(${_star_lib_name} SHARED "")
endif()

I just wondered if there was a more elegant way.

On Thu, Nov 7, 2019 at 11:45 AM Petr Kmoch 
mailto:petr.km...@gmail.com>> wrote:
Hi.

The argument STATIC or SHARED is processed at CMake configure time (that is, 
when CMake is executing the add_library() command). However, generator 
expressions are only evaluated at generate time, which comes only after all 
CMake code is processed.

Fortunately for you, compiler ID is something that is already known at 
configure time, meaning you don't need to use a genex to read it. You can just 
do this:

if(MSVC)
  set(LibType STATIC)
else()
  set(LibType SHARED)
endif()
add_library(
  ${_star_lib_name}
  ${LibType}
  ...
)

(Feel free to modify the if(), use CMAKE__COMPILER_ID 
(https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html) etc. 
as necessary).

Petr

On Thu, 7 Nov 2019 at 12:28, David Aldrich 
mailto:david.aldrich.n...@gmail.com>> wrote:

I want to build a shared library for Linux and a static library for Windows. So 
I have tried:

 set (_star_lib_name "StdStars")

 add_library(${_star_lib_name}
 $<$:SHARED>
 $<$:STATIC>
 ""
 )


but that gives me error:

CMake Error at 
C:/SVNProj/zodiac/branches/TRY_TML_CMake_3Oct2019/StarLibs/StdStars/CMakeLists.txt:7
 (add_library):
Cannot find source file:

STATIC

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx


What is the correct way of doing this please?

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[Cmake-commits] CMake branch, release, updated. v3.16.0-rc3-47-g02ed66c04b

2019-11-07 Thread Kitware Robot via Cmake-commits
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, release has been updated
   via  02ed66c04bf24d4c13fb6f82d040b835c966bf0c (commit)
   via  0746a3398f4e22f80c19b6253c4df652f9c41214 (commit)
   via  03e4fe65b0c4666ed46d0f2a7e2cfe00e30f7406 (commit)
   via  7ddf46230431cd3375f911d4b406af663595861d (commit)
   via  9a7b4f47aa3cf4ce03aad117d2e1de893c34acb0 (commit)
   via  f0c00bec1d7ce8f1209c4024e6000f907f11f1e9 (commit)
  from  ef86e8991b6b9b2d4b25f98a95ba950f9ba19485 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
---

Summary of changes:
 Help/prop_tgt/UNITY_BUILD.rst | 5 ++---
 Modules/CMakeOBJCInformation.cmake| 2 +-
 Modules/CMakeOBJCXXInformation.cmake  | 2 +-
 Source/CMakeLists.txt | 2 +-
 Source/cmLocalGenerator.cxx   | 1 -
 Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake | 6 +++---
 Tests/RunCMake/UnityBuild/unitybuild_skip.cmake   | 5 +
 7 files changed, 9 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, master, updated. v3.16.0-rc3-298-g74569996e8

2019-11-07 Thread Kitware Robot via Cmake-commits
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  74569996e8fe798386cca2d4241acea0644f6275 (commit)
   via  d4611b05a87e125406588921a7cedc4efae8c8cd (commit)
   via  f7612a66680f0a6ab4bb16ff3f545463bf900ad6 (commit)
   via  02ed66c04bf24d4c13fb6f82d040b835c966bf0c (commit)
   via  e1df51b19f1f9707a946068f5bf563c582e08d4f (commit)
   via  15feb5d3f899b1d7f8fb9b92f41cb0f307fa5640 (commit)
   via  0746a3398f4e22f80c19b6253c4df652f9c41214 (commit)
   via  5531e0447257f7a7c2df8a8434f0ba2e207a9938 (commit)
   via  c2b3d0872e41b172ebded93b2c98e0ffb3b54e6b (commit)
   via  03e4fe65b0c4666ed46d0f2a7e2cfe00e30f7406 (commit)
   via  7ddf46230431cd3375f911d4b406af663595861d (commit)
   via  9a7b4f47aa3cf4ce03aad117d2e1de893c34acb0 (commit)
   via  f0c00bec1d7ce8f1209c4024e6000f907f11f1e9 (commit)
   via  53227a4ff27c6eda7cb5b3b283f96d1f2d2d56ca (commit)
  from  e5b0b8560dc40d8d7556a34b7b69409c7c2502fe (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=74569996e8fe798386cca2d4241acea0644f6275
commit 74569996e8fe798386cca2d4241acea0644f6275
Merge: d4611b05a8 53227a4ff2
Author: Brad King 
AuthorDate: Thu Nov 7 15:26:39 2019 +
Commit: Kitware Robot 
CommitDate: Thu Nov 7 10:27:59 2019 -0500

Merge topic 'refactor-foreach'

53227a4ff2 Refactor: Modernize `foreach` code and fix some bugs

Acked-by: Kitware Robot 
Merge-request: !3986


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d4611b05a87e125406588921a7cedc4efae8c8cd
commit d4611b05a87e125406588921a7cedc4efae8c8cd
Merge: f7612a6668 02ed66c04b
Author: Brad King 
AuthorDate: Thu Nov 7 15:26:25 2019 +
Commit: Kitware Robot 
CommitDate: Thu Nov 7 10:26:50 2019 -0500

Merge branch 'release-3.16'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f7612a66680f0a6ab4bb16ff3f545463bf900ad6
commit f7612a66680f0a6ab4bb16ff3f545463bf900ad6
Merge: e1df51b19f 7ddf462304
Author: Brad King 
AuthorDate: Thu Nov 7 15:26:25 2019 +
Commit: Kitware Robot 
CommitDate: Thu Nov 7 10:26:50 2019 -0500

Merge topic 'unity-include-generated'

7ddf462304 Unity build: Include GENERATED files into unity build

Acked-by: Kitware Robot 
Acked-by: Julien Schueller 
Merge-request: !4001


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e1df51b19f1f9707a946068f5bf563c582e08d4f
commit e1df51b19f1f9707a946068f5bf563c582e08d4f
Merge: 15feb5d3f8 0746a3398f
Author: Brad King 
AuthorDate: Thu Nov 7 15:24:35 2019 +
Commit: Kitware Robot 
CommitDate: Thu Nov 7 10:25:45 2019 -0500

Merge branch 'release-3.16'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=15feb5d3f899b1d7f8fb9b92f41cb0f307fa5640
commit 15feb5d3f899b1d7f8fb9b92f41cb0f307fa5640
Merge: 5531e04472 f0c00bec1d
Author: Brad King 
AuthorDate: Thu Nov 7 15:24:35 2019 +
Commit: Kitware Robot 
CommitDate: Thu Nov 7 10:25:45 2019 -0500

Merge topic 'llvm-rc-fix'

f0c00bec1d CMakeVersion.rc: Fix build with llvm-rc

Acked-by: Kitware Robot 
Merge-request: !4003


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5531e0447257f7a7c2df8a8434f0ba2e207a9938
commit 5531e0447257f7a7c2df8a8434f0ba2e207a9938
Merge: c2b3d0872e 03e4fe65b0
Author: Brad King 
AuthorDate: Thu Nov 7 15:24:23 2019 +
Commit: Kitware Robot 
CommitDate: Thu Nov 7 10:24:34 2019 -0500

Merge branch 'release-3.16'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c2b3d0872e41b172ebded93b2c98e0ffb3b54e6b
commit c2b3d0872e41b172ebded93b2c98e0ffb3b54e6b
Merge: e5b0b8560d 9a7b4f47aa
Author: Brad King 
AuthorDate: Thu Nov 7 15:24:23 2019 +
Commit: Kitware Robot 
CommitDate: Thu Nov 7 10:24:34 2019 -0500

Merge topic 'objc-x-objc'

9a7b4f47aa ObjC: Mark explicitly the language for compilation

Acked-by: Kitware Robot 
Merge-request: !4002


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53227a4ff27c6eda7cb5b3b283f96d1f2d2d56ca
commit 53227a4ff27c6eda7cb5b3b283f96d1f2d2d56ca
Author: Alex Turbov 
AuthorDate: Mon Nov 4 17:11:07 2019 +0200
Commit: Alex Turbov 
CommitDate: Wed Nov 6 16:14:47 2019 +0200

Refactor: Modernize `foreach` code and fix some bugs

- fix the typo in `foreach` documentation
- fix broken `foreach(... IN ITEMS ... LISTS ...)`
- add tests of `foreach` for existed functionality and fixes

diff --git a/Help/command/foreach.rst b/Help/command/foreach.rst
index ae2afb2905..ecbfed3d9d 100644
--- a/Help/command/foreach.rst
+++ b/Help/command/foreach.rst
@@ -47,7 +47,7 @@ of undocumented 

[Cmake-commits] CMake branch, master, updated. v3.16.0-rc3-284-ge5b0b8560d

2019-11-07 Thread Kitware Robot via Cmake-commits
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  e5b0b8560dc40d8d7556a34b7b69409c7c2502fe (commit)
   via  3dfefc1ad7d1341aab0bce838e7b2b7a15f7e7a1 (commit)
   via  61ce9d17697db65d179b348845e07f7649818d65 (commit)
   via  145b2d571485fd882d76e86a16d554329a5d7bfc (commit)
   via  0faeb6a4282f476eb5873b7a1e6d60760a06c3bd (commit)
   via  f95d5bed52b4200ec025fb2be5012ff833cd8dbc (commit)
   via  4011b1be41e97de3f1c1cee741f0627838913974 (commit)
  from  9493c770d520d335aeceec81399207f4261f4392 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e5b0b8560dc40d8d7556a34b7b69409c7c2502fe
commit e5b0b8560dc40d8d7556a34b7b69409c7c2502fe
Merge: 3dfefc1ad7 61ce9d1769
Author: Brad King 
AuthorDate: Thu Nov 7 09:33:08 2019 -0500
Commit: Brad King 
CommitDate: Thu Nov 7 09:33:08 2019 -0500

Merge branch 'release-3.15'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3dfefc1ad7d1341aab0bce838e7b2b7a15f7e7a1
commit 3dfefc1ad7d1341aab0bce838e7b2b7a15f7e7a1
Merge: 145b2d5714 f95d5bed52
Author: Brad King 
AuthorDate: Thu Nov 7 09:32:27 2019 -0500
Commit: Brad King 
CommitDate: Thu Nov 7 09:32:27 2019 -0500

Merge branch 'release-3.14'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=61ce9d17697db65d179b348845e07f7649818d65
commit 61ce9d17697db65d179b348845e07f7649818d65
Merge: 4011b1be41 0faeb6a428
Author: Brad King 
AuthorDate: Thu Nov 7 09:31:59 2019 -0500
Commit: Brad King 
CommitDate: Thu Nov 7 09:31:59 2019 -0500

Merge branch 'backport-FindBoost-meta-component-ALL' into release-3.15

Merge-request: !4008


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=145b2d571485fd882d76e86a16d554329a5d7bfc
commit 145b2d571485fd882d76e86a16d554329a5d7bfc
Merge: 9493c770d5 0faeb6a428
Author: Brad King 
AuthorDate: Thu Nov 7 14:31:30 2019 +
Commit: Kitware Robot 
CommitDate: Thu Nov 7 09:31:38 2019 -0500

Merge topic 'backport-FindBoost-meta-component-ALL'

0faeb6a428 FindBoost: Prevent warning due to new meta-component "ALL" of 
Boost 1.73

Acked-by: Kitware Robot 
Merge-request: !4008


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0faeb6a4282f476eb5873b7a1e6d60760a06c3bd
commit 0faeb6a4282f476eb5873b7a1e6d60760a06c3bd
Author: Deniz Bahadir 
AuthorDate: Tue Nov 5 17:27:24 2019 +0100
Commit: Brad King 
CommitDate: Thu Nov 7 09:29:54 2019 -0500

FindBoost: Prevent warning due to new meta-component "ALL" of Boost 1.73

diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 078000f228..af4947caee 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -449,6 +449,9 @@ if (NOT Boost_NO_BOOST_CMAKE)
 # Convert component found variables to standard variables if required
 # Necessary for legacy boost-cmake and 1.70 builtin BoostConfig
 if(Boost_FIND_COMPONENTS)
+  # Ignore the meta-component "ALL", introduced by Boost 1.73
+  list(REMOVE_ITEM Boost_FIND_COMPONENTS "ALL")
+
   foreach(_comp IN LISTS Boost_FIND_COMPONENTS)
 if(DEFINED Boost_${_comp}_FOUND)
   continue()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f95d5bed52b4200ec025fb2be5012ff833cd8dbc
commit f95d5bed52b4200ec025fb2be5012ff833cd8dbc
Merge: 6d01a8e004 aeae4182cb
Author: Brad King 
AuthorDate: Thu Nov 7 09:27:03 2019 -0500
Commit: Brad King 
CommitDate: Thu Nov 7 09:29:27 2019 -0500

Merge branch 'backport-findpostgres-10-and-older' into release-3.14

Merge-request: !4007


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4011b1be41e97de3f1c1cee741f0627838913974
commit 4011b1be41e97de3f1c1cee741f0627838913974
Merge: 2a5e5b25ba aeae4182cb
Author: Brad King 
AuthorDate: Thu Nov 7 09:28:36 2019 -0500
Commit: Brad King 
CommitDate: Thu Nov 7 09:29:20 2019 -0500

Merge branch 'backport-findpostgres-10-and-older' into release-3.15

Merge-request: !4007


---

Summary of changes:


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, master, updated. v3.16.0-rc3-277-g9493c770d5

2019-11-07 Thread Kitware Robot via Cmake-commits
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  9493c770d520d335aeceec81399207f4261f4392 (commit)
   via  aeae4182cb90cbf65b1c27cc877f62d2c7690aaf (commit)
  from  8f3cbe3c65e1c723319d8c63ef7f3e3c8ef5b59d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9493c770d520d335aeceec81399207f4261f4392
commit 9493c770d520d335aeceec81399207f4261f4392
Merge: 8f3cbe3c65 aeae4182cb
Author: Brad King 
AuthorDate: Thu Nov 7 14:26:07 2019 +
Commit: Kitware Robot 
CommitDate: Thu Nov 7 09:26:17 2019 -0500

Merge topic 'findpostgres-10-and-older'

aeae4182cb FindPostgreSQL: support version encoding used in pre-10 releases

Acked-by: Kitware Robot 
Merge-request: !4007


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aeae4182cb90cbf65b1c27cc877f62d2c7690aaf
commit aeae4182cb90cbf65b1c27cc877f62d2c7690aaf
Author: Ben Boeckel 
AuthorDate: Mon Nov 4 16:37:06 2019 -0500
Commit: Brad King 
CommitDate: Thu Nov 7 09:24:12 2019 -0500

FindPostgreSQL: support version encoding used in pre-10 releases

With the 10.x release, PostgreSQL upstream started encoding the version
as `MM` where `M` is major and `m` is minor. Prior to that, `MMmmPP`
was used where `P` was the patch number. Detect this difference and
decode it based on the used encoding.

Fixes: #19912

diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index 4b5e60e21a..1631c9c332 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -184,11 +184,22 @@ if (PostgreSQL_INCLUDE_DIR)
 endif()
   endforeach()
   if (_PostgreSQL_VERSION_NUM)
-math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 1")
-math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 1")
-set(PostgreSQL_VERSION_STRING 
"${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}")
-unset(_PostgreSQL_major_version)
-unset(_PostgreSQL_minor_version)
+# 9.x and older encoding
+if (_PostgreSQL_VERSION_NUM LESS 10)
+  math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 1")
+  math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 1 
/ 100")
+  math(EXPR _PostgreSQL_patch_version "${_PostgreSQL_VERSION_NUM} % 100")
+  set(PostgreSQL_VERSION_STRING 
"${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}.${_PostgreSQL_patch_version}")
+  unset(_PostgreSQL_major_version)
+  unset(_PostgreSQL_minor_version)
+  unset(_PostgreSQL_patch_version)
+else ()
+  math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 1")
+  math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 1")
+  set(PostgreSQL_VERSION_STRING 
"${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}")
+  unset(_PostgreSQL_major_version)
+  unset(_PostgreSQL_minor_version)
+endif ()
   else ()
 foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS})
   if(EXISTS "${_PG_CONFIG_HEADER}")
diff --git a/Tests/FindPostgreSQL/Test/main.c b/Tests/FindPostgreSQL/Test/main.c
index 2cfeed0da2..a63377a256 100644
--- a/Tests/FindPostgreSQL/Test/main.c
+++ b/Tests/FindPostgreSQL/Test/main.c
@@ -5,10 +5,19 @@
 int main()
 {
   int version = PQlibVersion();
-  int major = version / 1;
-  int minor = version % 1;
   char version_string[100];
-  snprintf(version_string, sizeof(version_string), "%d.%d", major, minor);
+  // 9.x and older encoding.
+  if (version < 10) {
+int major = version / 1;
+int minor = version % 1 / 100;
+int patch = version % 100;
+snprintf(version_string, sizeof(version_string), "%d.%d.%d", major, minor,
+ patch);
+  } else {
+int major = version / 1;
+int minor = version % 1;
+snprintf(version_string, sizeof(version_string), "%d.%d", major, minor);
+  }
   printf("Found PostgreSQL version %s, expected version %s\n", version_string,
  CMAKE_EXPECTED_POSTGRESQL_VERSION);
   return strcmp(version_string, CMAKE_EXPECTED_POSTGRESQL_VERSION);

---

Summary of changes:


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits


Re: [CMake] Using generator expression with add_library

2019-11-07 Thread David Aldrich
Thank you. So I guess I can make it as simple as:

if(MSVC)
add_library(${_star_lib_name} STATIC "")
else()
add_library(${_star_lib_name} SHARED "")
endif()

I just wondered if there was a more elegant way.

On Thu, Nov 7, 2019 at 11:45 AM Petr Kmoch  wrote:

> Hi.
>
> The argument STATIC or SHARED is processed at CMake configure time (that
> is, when CMake is executing the add_library() command). However, generator
> expressions are only evaluated at generate time, which comes only after all
> CMake code is processed.
>
> Fortunately for you, compiler ID is something that is already known at
> configure time, meaning you don't need to use a genex to read it. You can
> just do this:
>
> if(MSVC)
>   set(LibType STATIC)
> else()
>   set(LibType SHARED)
> endif()
> add_library(
>   ${_star_lib_name}
>   ${LibType}
>   ...
> )
>
> (Feel free to modify the if(), use CMAKE__COMPILER_ID (
> https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html)
> etc. as necessary).
>
> Petr
>
> On Thu, 7 Nov 2019 at 12:28, David Aldrich 
> wrote:
>
>> I want to build a shared library for Linux and a static library for
>> Windows. So I have tried:
>>
>>  set (_star_lib_name "StdStars")
>>
>>  add_library(${_star_lib_name}
>>  $<$:SHARED>
>>  $<$:STATIC>
>>  ""
>>  )
>>
>> but that gives me error:
>>
>> CMake Error at 
>> C:/SVNProj/zodiac/branches/TRY_TML_CMake_3Oct2019/StarLibs/StdStars/CMakeLists.txt:7
>>  (add_library):
>> Cannot find source file:
>>
>> STATIC
>>
>>   Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
>>   .hpp .hxx .in .txx
>>
>> What is the correct way of doing this please?
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> https://cmake.org/mailman/listinfo/cmake
>>
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Using generator expression with add_library

2019-11-07 Thread Petr Kmoch
Hi.

The argument STATIC or SHARED is processed at CMake configure time (that
is, when CMake is executing the add_library() command). However, generator
expressions are only evaluated at generate time, which comes only after all
CMake code is processed.

Fortunately for you, compiler ID is something that is already known at
configure time, meaning you don't need to use a genex to read it. You can
just do this:

if(MSVC)
  set(LibType STATIC)
else()
  set(LibType SHARED)
endif()
add_library(
  ${_star_lib_name}
  ${LibType}
  ...
)

(Feel free to modify the if(), use CMAKE__COMPILER_ID (
https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html)
etc. as necessary).

Petr

On Thu, 7 Nov 2019 at 12:28, David Aldrich 
wrote:

> I want to build a shared library for Linux and a static library for
> Windows. So I have tried:
>
>  set (_star_lib_name "StdStars")
>
>  add_library(${_star_lib_name}
>  $<$:SHARED>
>  $<$:STATIC>
>  ""
>  )
>
> but that gives me error:
>
> CMake Error at 
> C:/SVNProj/zodiac/branches/TRY_TML_CMake_3Oct2019/StarLibs/StdStars/CMakeLists.txt:7
>  (add_library):
> Cannot find source file:
>
> STATIC
>
>   Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
>   .hpp .hxx .in .txx
>
> What is the correct way of doing this please?
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] Using generator expression with add_library

2019-11-07 Thread David Aldrich
I want to build a shared library for Linux and a static library for
Windows. So I have tried:

 set (_star_lib_name "StdStars")

 add_library(${_star_lib_name}
 $<$:SHARED>
 $<$:STATIC>
 ""
 )

but that gives me error:

CMake Error at 
C:/SVNProj/zodiac/branches/TRY_TML_CMake_3Oct2019/StarLibs/StdStars/CMakeLists.txt:7
(add_library):
Cannot find source file:

STATIC

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx

What is the correct way of doing this please?
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake