File tree Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 11# This file was generated automatically by cmkr.
22
3+ # Regenerate CMakeLists.txt file when necessary
4+ include (cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT)
5+
6+ if (CMKR_INCLUDE_RESULT)
7+ cmkr()
8+ endif ()
9+
310cmake_minimum_required (VERSION 3.15)
411
512set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
Original file line number Diff line number Diff line change @@ -111,9 +111,9 @@ int generate_cmake(const char *path) {
111111 std::stringstream ss;
112112 ss << " # This file was generated automatically by cmkr.\n " ;
113113 ss << " \n " ;
114-
114+
115115 ss << " # Regenerate CMakeLists.txt file when necessary\n " ;
116- ss << " include(cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT)\n " ;
116+ ss << " include(cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT)\n\n " ;
117117 ss << " if(CMKR_INCLUDE_RESULT)\n " ;
118118 ss << " \t cmkr()\n " ;
119119 ss << " endif()\n " ;
@@ -225,14 +225,19 @@ int generate_cmake(const char *path) {
225225 } else {
226226 set_val = std::get<bool >(set.val ) ? " ON" : " OFF" ;
227227 }
228- ss << " set(" << set.name << " " << set_val;;
228+ ss << " set(" << set.name << " " << set_val;
229+ ;
229230 if (set.cache ) {
230231 std::string typ;
231- if (set.val .index () == 1 ) typ = " STRING" ; else typ = " BOOL" ;
232- ss << " CACHE " << typ << " \" " << set.comment << " \" " ;
233- if (set.force ) ss << " FORCE" ;
232+ if (set.val .index () == 1 )
233+ typ = " STRING" ;
234+ else
235+ typ = " BOOL" ;
236+ ss << " CACHE " << typ << " \" " << set.comment << " \" " ;
237+ if (set.force )
238+ ss << " FORCE" ;
234239 }
235- ss << " )\n\n " ;
240+ ss << " )\n\n " ;
236241 }
237242 }
238243
@@ -364,7 +369,11 @@ int generate_cmake(const char *path) {
364369 ss << conf << " " ;
365370 }
366371 }
367- ss << " \n\t DESTINATION " << inst.destination << " \n\t )\n\n " ;
372+ ss << " \n\t DESTINATION " << inst.destination << " \n\t " ;
373+ if (!inst.targets .empty ())
374+ ss << " COMPONENT " << inst.targets [0 ] << " \n\t )\n\n " ;
375+ else
376+ ss << " \n\t )\n\n " ;
368377 }
369378 }
370379
You can’t perform that action at this time.
0 commit comments