GMLC-TDC / HELICS

Hierarchical Engine for Large-scale Infrastructure Co-Simulation (HELICS)
https://docs.helics.org/en/latest/
BSD 3-Clause "New" or "Revised" License
127 stars 41 forks source link

Unknown Cmake command "target_add_definitions" #391

Closed kdheepak closed 6 years ago

kdheepak commented 6 years ago

There's an error when trying to compile with ZMQ using static library

$ cmake -DENABLE_PACKAGE_BUILD=ON -DCPACK_BINARY_BUNDLE=ON -DSTATIC_STANDARD_LIB=ON -DZMQ_USE_STATIC_LIBRARY=ON -DUSE_BOOST_STATIC_LIBS=ON -DCMAKE_INSTALL_PREFIX="/Users/$USER/local/helics-develop/" ../
-- setting up for AppleClang
-- setting version build options to "-std=c++14"
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   program_options
--   unit_test_framework
--   filesystem
--   system
--   date_time
--   timer
--   chrono
CMake Error at CMakeLists.txt:253 (target_add_definitions):
  Unknown CMake command "target_add_definitions".

-- Configuring incomplete, errors occurred!

I have the following version of cmake

$ cmake --version
cmake version 3.11.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).

There appears to be an issue with this line.

kdheepak commented 6 years ago

@phlptp I tried the change that you suggested but this still causes an error in the cmake configuration step

-- setting up for AppleClang
-- setting version build options to "-std=c++14"
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   program_options
--   unit_test_framework
--   filesystem
--   system
--   date_time
--   timer
--   chrono
CMake Error at src/helics/shared_api_library/CMakeLists.txt:55 (target_link_libraries):
  The keyword signature for target_link_libraries has already been used with
  the target "helicsSharedLib".  All uses of target_link_libraries with a
  target must be either all-keyword or all-plain.

  The uses of the keyword signature are here:

   * src/helics/shared_api_library/CMakeLists.txt:39 (target_link_libraries)

-- Configuring incomplete, errors occurred!
phlptp commented 6 years ago

thought I removed that part, try it now